Skip to content

Commit

Permalink
feat: [Design refresh] new fonts + colors + dynamic favicon + pretty …
Browse files Browse the repository at this point in the history
  • Loading branch information
dgattey authored Aug 16, 2024
1 parent f874a1f commit de6aedf
Show file tree
Hide file tree
Showing 66 changed files with 995 additions and 733 deletions.
Binary file added apps/web/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 0 additions & 8 deletions apps/web/public/browserconfig.xml

This file was deleted.

Binary file modified apps/web/public/favicon.ico
Binary file not shown.
Binary file added apps/web/public/icon-192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/icon-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/web/public/icon-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions apps/web/public/icon-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/web/public/icons/favicon-144.png
Binary file not shown.
Binary file removed apps/web/public/icons/favicon-192.png
Binary file not shown.
Binary file removed apps/web/public/icons/favicon-228.png
Binary file not shown.
Binary file removed apps/web/public/icons/favicon-32.png
Binary file not shown.
Binary file removed apps/web/public/icons/prerounded-128.png
Binary file not shown.
Binary file removed apps/web/public/icons/prerounded-144.png
Binary file not shown.
Binary file removed apps/web/public/icons/prerounded-192.png
Binary file not shown.
Binary file removed apps/web/public/icons/prerounded-196.png
Binary file not shown.
Binary file removed apps/web/public/icons/prerounded-512.png
Binary file not shown.
Binary file removed apps/web/public/icons/prerounded-96.png
Binary file not shown.
1 change: 0 additions & 1 deletion apps/web/public/icons/safari-pinned-tab.svg

This file was deleted.

Binary file removed apps/web/public/icons/touch-icon-1024.png
Binary file not shown.
Binary file removed apps/web/public/icons/touch-icon-120.png
Binary file not shown.
Binary file removed apps/web/public/icons/touch-icon-152.png
Binary file not shown.
Binary file removed apps/web/public/icons/touch-icon-167.png
Binary file not shown.
Binary file removed apps/web/public/icons/touch-icon-180.png
Binary file not shown.
Binary file removed apps/web/public/icons/touch-icon-512.png
Binary file not shown.
Binary file removed apps/web/public/icons/touch-icon-57.png
Binary file not shown.
Binary file removed apps/web/public/icons/touch-icon-76.png
Binary file not shown.
Binary file added apps/web/public/images/error-small.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/web/public/images/error.jpg
41 changes: 0 additions & 41 deletions apps/web/public/manifest.json

This file was deleted.

12 changes: 12 additions & 0 deletions apps/web/public/manifest.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Dylan Gattey",
"short_name": "DG",
"lang": "en",
"background_color": "#022F31",
"theme_color": "#F6A56F",
"display": "standalone",
"icons": [
{ "src": "/icon-192.png", "type": "image/png", "sizes": "192x192" },
{ "src": "/icon-512.png", "type": "image/png", "sizes": "512x512" }
]
}
4 changes: 0 additions & 4 deletions apps/web/src/api/endpoints.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { fetchFooterLinks } from 'api/contentful/fetchFooterLinks';
import { fetchIntroContent } from 'api/contentful/fetchIntroContent';
import { fetchCurrentLocation } from 'api/contentful/fetchCurrentLocation';
import { fetchPrivacyContent } from 'api/contentful/fetchPrivacyContent';
import { fetchProjects } from 'api/contentful/fetchProjects';
import { fetchRepoVersion } from 'api/github/fetchRepoVersion';
import { fetchRecentlyPlayed } from 'api/spotify/fetchRecentlyPlayed';
Expand Down Expand Up @@ -32,9 +31,6 @@ export const endpoints = {
// Intro block of content via Contentful
intro: fetchIntroContent,

// Privacy block of content via Contentful
privacy: fetchPrivacyContent,

// My current location via Contentful
location: fetchCurrentLocation,

Expand Down
8 changes: 6 additions & 2 deletions apps/web/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ export function Footer() {
return (
<Container component={Section} sx={{ padding: 0, marginTop: 12 }}>
<footer>
<Divider sx={{ marginBottom: 3 }} />
<Divider
sx={{
marginBottom: 3,
}}
/>
<Nav
sx={(theme) => ({
flexDirection: 'row',
Expand All @@ -64,7 +68,7 @@ export function Footer() {
<NavItem sx={{ padding: 0 }}></NavItem>
<NavItem>{version}</NavItem>
</NavGroup>
<NavGroup component="div" sx={{ columnGap: 4 }}>
<NavGroup component="div" sx={{ columnGap: 2 }}>
<HorizontalStack component="ul" sx={{ padding: 0, margin: 0 }}>
{nonIconFooterLinks?.map((link) => <FooterLink key={link.url} link={link} />)}
</HorizontalStack>
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function Header({ headerRef }: HeaderProps) {
sx={(theme) => ({
backdropFilter: 'blur(16px) saturate(160%) contrast(110%)',
backgroundColor: isScrolled
? alpha(theme.palette.card.background, 0.85)
? alpha(theme.palette.background.paper, 0.85)
: theme.vars.palette.background.default,
boxShadow: isScrolled ? theme.vars.extraShadows.card.hovered : 'none',
willChange: 'box-shadow, background-color',
Expand Down
84 changes: 18 additions & 66 deletions apps/web/src/components/Meta.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Theme } from '@mui/material';
import { useTheme } from '@mui/material';
import Head from 'next/head';
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';
import { useColorScheme } from 'ui/theme/useColorScheme';

type MetaProps = {
/**
Expand All @@ -28,63 +28,6 @@ export const HOMEPAGE_TITLE = 'Engineer. Problem Solver.';
const OG_IMAGE_API_ROUTE = 'api/og';
const GRAPH_PREFIXES = ['og', 'twitter'] as const;

/**
* Helps reduce duplication for creation of link elements
*/
const linkFromSize = (size: string, fileType: string, rel = 'icon') => (
<link
href={`/icons/${fileType}-${size}.png`}
key={`${size}${fileType}link`}
rel={rel}
sizes={`${size}x${size}`}
/>
);

/**
* Helps reduce duplication for creation of meta elements
*/
const metaFromSize = (size: string, fileType: string, name: string) => (
<meta content={`/icons/${fileType}-${size}.png`} key={`${size}${fileType}meta`} name={name} />
);

/**
* Organizes and maps icon file sizes/names to their created elements - keep this
* up to date with everything in public/icons/*.png
*/
const ICONS = {
generic: {
variants: [32, 144, 192, 228],
element: (size: string) => linkFromSize(size, 'favicon'),
},
android: {
variants: [96, 128, 144, 192, 196, 512],
element: (size: string) => linkFromSize(size, 'prerounded'),
},
ios: {
variants: [57, 76, 120, 152, 167, 180, 512, 1024],
element: (size: string) => linkFromSize(size, 'touch-icon', 'apple-touch-icon'),
},
windows: {
variants: [144],
element: (size: string) => metaFromSize(size, 'favicon', 'msapplication-TileImage'),
},
thumbnail: {
variants: [152],
element: (size: string) => metaFromSize(size, 'touch-icon', 'thumbnail'),
},
mask: {
variants: ['safari-pinned-tab.svg'],
element: (name: string, theme: Theme) => (
<link
color={theme.vars.palette.primary.main}
href={`/icons/${name}`}
key={`${name}mask`}
rel="mask-icon"
/>
),
},
} as const;

/**
* Small helper to create og: and twitter: elements for keys + content
*/
Expand All @@ -104,6 +47,7 @@ export function Meta({ title, description }: MetaProps) {
const router = useRouter();
const [pageUrl, setPageUrl] = useState('');
const [baseUrl, setBaseUrl] = useState('');
const { colorScheme } = useColorScheme();

useEffect(() => {
const { host } = window.location;
Expand Down Expand Up @@ -139,16 +83,24 @@ export function Meta({ title, description }: MetaProps) {
url: pageUrl,
image: `${baseUrl}/${OG_IMAGE_API_ROUTE}/${imageTitle}?subtitle=${imageSubtitle}`,
})}
<link href="/favicon.ico" key="favicon" rel="icon" />
<meta content={theme.vars.palette.background.default} key="theme-color" name="theme-color" />
<meta
content={theme.vars.palette.background.default}
key="msapplication-TileColor"
name="msapplication-TileColor"
<link key="favicon" rel="icon" href="/favicon.ico" sizes="32x32" />
<link
key="svg-icon"
rel="icon"
href={`/icon${colorScheme.mode === 'dark' ? '-dark' : '-light'}.svg`}
type="image/svg+xml"
/>
<link key="apple-touch" rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link key="manifest" rel="manifest" href="/manifest.webmanifest" />
{/* Preload the error image */}
<link
as="image"
href="/images/error-small.jpg"
key="preload-error-image"
rel="preload"
type="image/jpeg"
/>
{Object.values(ICONS).flatMap(({ variants, element }) =>
variants.map((variant) => element(String(variant), theme)),
)}
</Head>
);
}
56 changes: 0 additions & 56 deletions apps/web/src/components/errors/ErrorPageContents.tsx

This file was deleted.

9 changes: 4 additions & 5 deletions apps/web/src/components/homepage/IntroCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useLinkWithName } from 'hooks/useLinkWithName';
/**
* Width of the intro image on small screens
*/
const SMALL_IMAGE_SIZE = '14em';
const SMALL_IMAGE_SIZE = '16em';

/**
* Creates an intro information card for use on the homepage. Technically
Expand Down Expand Up @@ -46,10 +46,9 @@ export function IntroCard() {
})}
sx={(theme) => ({
[theme.breakpoints.down('md')]: {
justifySelf: 'center',
width: SMALL_IMAGE_SIZE,
height: SMALL_IMAGE_SIZE,
borderRadius: `calc(${SMALL_IMAGE_SIZE} / 2)`,
minWidth: SMALL_IMAGE_SIZE,
maxWidth: SMALL_IMAGE_SIZE,
maxHeight: SMALL_IMAGE_SIZE,
},
})}
>
Expand Down
7 changes: 5 additions & 2 deletions apps/web/src/components/homepage/SpotifyCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ export function SpotifyCard() {

return (
<ContentCard
sx={{
sx={(theme) => ({
padding: 2.5,
display: 'flex',
}}
[theme.breakpoints.down('md')]: {
minWidth: 'min(max-content, inherit)',
},
})}
>
<TrackListing hasLogo track={track} />
</ContentCard>
Expand Down
Loading

0 comments on commit de6aedf

Please sign in to comment.