Improve font loading and fix scripts

This commit is contained in:
Bad Manners 2024-03-20 21:47:52 -03:00
parent aba96f95a2
commit 2990644f87
15 changed files with 85 additions and 19 deletions

12
package-lock.json generated
View file

@ -12,8 +12,6 @@
"@astrojs/rss": "^4.0.5",
"@astrojs/tailwind": "^5.1.0",
"@astropub/md": "^0.4.0",
"@fontsource-variable/noto-sans": "^5.0.4",
"@fontsource-variable/noto-serif": "^5.0.5",
"@tailwindcss/typography": "^0.5.10",
"astro": "^4.5.4",
"date-fns": "^3.5.0",
@ -914,16 +912,6 @@
"node": ">=12"
}
},
"node_modules/@fontsource-variable/noto-sans": {
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/@fontsource-variable/noto-sans/-/noto-sans-5.0.4.tgz",
"integrity": "sha512-UCBloRRF3VDWrzUHo1hRr4DOi30Yxqcyogy+oxRLEzlUe59+VWu1uVLAzl5hEszK7HEwvuavyaceNuRTQAbRZg=="
},
"node_modules/@fontsource-variable/noto-serif": {
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/@fontsource-variable/noto-serif/-/noto-serif-5.0.5.tgz",
"integrity": "sha512-9GmULpDZMdLeLiXoO8qlPBlMRkcEyZiDI2dTRiyhNnF7p0MBY+jK1/UY9LD+P0k8Q5CSx0Ls3i9M92cwXZbOqA=="
},
"node_modules/@isaacs/cliui": {
"version": "8.0.2",
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",

View file

@ -15,8 +15,6 @@
"@astrojs/rss": "^4.0.5",
"@astrojs/tailwind": "^5.1.0",
"@astropub/md": "^0.4.0",
"@fontsource-variable/noto-sans": "^5.0.4",
"@fontsource-variable/noto-serif": "^5.0.5",
"@tailwindcss/typography": "^0.5.10",
"astro": "^4.5.4",
"date-fns": "^3.5.0",

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -2,7 +2,7 @@
---
<script is:inline>
<script is:inline data-astro-rerun>
/* Color scheme toggle */
(() => {
var colorScheme = localStorage.getItem("colorScheme");

View file

@ -15,4 +15,4 @@ const { pageTitle } = Astro.props;
}
})();
</script>
</BaseLayout>
</BaseLayout>

View file

@ -1,7 +1,6 @@
---
import "@fontsource-variable/noto-sans";
import "@fontsource-variable/noto-serif";
import "../styles/base.css";
import "../styles/fonts.css";
import DarkModeScript from "../components/DarkModeScript.astro";
const { pageTitle } = Astro.props;
---

View file

@ -11,7 +11,7 @@ const games = (await getCollection("games"))
---
<GalleryLayout pageTitle="Games">
<h1 class="m-2 text-2xl font-semibold text-stone-800 dark:text-stone-100">Stories</h1>
<h1 class="m-2 text-2xl font-semibold text-stone-800 dark:text-stone-100">Games</h1>
<p class="my-4">A game that I've gone and done.</p>
<ul class="my-6 flex flex-wrap justify-center gap-4 text-center md:justify-normal">
{

81
src/styles/fonts.css Normal file
View file

@ -0,0 +1,81 @@
/* noto-sans-latin-ext-wght-normal */
@font-face {
font-family: "Noto Sans Variable";
font-style: normal;
font-display: block;
font-weight: 100 900;
src: url(/fonts/noto-sans-latin-ext-wght-normal.woff2) format("woff2-variations");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
U+2C60-2C7F, U+A720-A7FF;
}
/* noto-sans-latin-wght-normal */
@font-face {
font-family: "Noto Sans Variable";
font-style: normal;
font-display: block;
font-weight: 100 900;
src: url(/fonts/noto-sans-latin-wght-normal.woff2) format("woff2-variations");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* noto-sans-latin-ext-wght-italic */
@font-face {
font-family: "Noto Sans Variable";
font-style: italic;
font-display: block;
font-weight: 100 900;
src: url(/fonts/noto-sans-latin-ext-wght-italic.woff2) format("woff2-variations");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
U+2C60-2C7F, U+A720-A7FF;
}
/* noto-sans-latin-wght-italic */
@font-face {
font-family: "Noto Sans Variable";
font-style: italic;
font-display: block;
font-weight: 100 900;
src: url(/fonts/noto-sans-latin-wght-italic.woff2) format("woff2-variations");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* noto-serif-latin-ext-wght-normal */
@font-face {
font-family: "Noto Serif Variable";
font-style: normal;
font-display: block;
font-weight: 100 900;
src: url(/fonts/noto-serif-latin-ext-wght-normal.woff2) format("woff2-variations");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
U+2C60-2C7F, U+A720-A7FF;
}
/* noto-serif-latin-wght-normal */
@font-face {
font-family: "Noto Serif Variable";
font-style: normal;
font-display: block;
font-weight: 100 900;
src: url(/fonts/noto-serif-latin-wght-normal.woff2) format("woff2-variations");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* noto-serif-latin-ext-wght-italic */
@font-face {
font-family: "Noto Serif Variable";
font-style: italic;
font-display: block;
font-weight: 100 900;
src: url(/fonts/noto-serif-latin-ext-wght-italic.woff2) format("woff2-variations");
unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
U+2C60-2C7F, U+A720-A7FF;
}
/* noto-serif-latin-wght-italic */
@font-face {
font-family: "Noto Serif Variable";
font-style: italic;
font-display: block;
font-weight: 100 900;
src: url(/fonts/noto-serif-latin-wght-italic.woff2) format("woff2-variations");
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}