Skip to content

Commit

Permalink
Optimize fonts (preload, remove unused "National" font from preload)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnmora committed Nov 7, 2024
1 parent 6d77d6a commit 75388b6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/viz/LoveSongChangeTinyAnnotation.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
position: fixed;
transform: translateY(-100%) translateX(-50%);
font-family: 'Atlas Grotesk', sans-serif;
font-family: var(--sans);
font-size: 12px;
list-style-type: none;
Expand Down
2 changes: 1 addition & 1 deletion src/components/viz/LoveSongTypeLabel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@

<style>
li {
font-family: 'Atlas Grotesk', sans-serif;
font-family: var(--sans);
position: fixed;
display: flex;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
position: fixed;
transform: translateY(-100%);
font-family: 'Atlas Grotesk', sans-serif;
font-family: var(--sans);
font-weight: bold;
list-style-type: none;
Expand Down
4 changes: 2 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
const preloadFont = [
"https://pudding.cool/assets/fonts/tiempos/TiemposTextWeb-Regular.woff2",
"https://pudding.cool/assets/fonts/tiempos/TiemposTextWeb-Bold.woff2",
"https://pudding.cool/assets/fonts/national/National2Web-Regular.woff2",
"https://pudding.cool/assets/fonts/national/National2Web-Bold.woff2"
"https://pudding.cool/assets/fonts/atlas/AtlasGrotesk-Regular-Web.woff2",
"https://pudding.cool/assets/fonts/atlas/AtlasGrotesk-Bold-Web.woff2"
];
const { title, description, url, keywords } = copy;
Expand Down
12 changes: 7 additions & 5 deletions src/styles/font.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
/* National */
/* Atlas Grotesk */
@font-face {
font-family: "National 2 Web";
src: url("https://pudding.cool/assets/fonts/national/National2Web-Regular.woff2") format("woff2");
font-family: "Atlas Grotesk";
src: url("https://pudding.cool/assets/fonts/atlas/AtlasGrotesk-Regular-Web.woff2")
format("woff2");
font-weight: 400;
font-style: normal;
font-stretch: normal;
font-display: swap;
}

@font-face {
font-family: "National 2 Web";
src: url("https://pudding.cool/assets/fonts/national/National2Web-Bold.woff2") format("woff2");
font-family: "Atlas Grotesk";
src: url("https://pudding.cool/assets/fonts/atlas/AtlasGrotesk-Bold-Web.woff2")
format("woff2");
font-weight: 700;
font-style: normal;
font-stretch: normal;
Expand Down

0 comments on commit 75388b6

Please sign in to comment.