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

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;
}