diff --git a/package-lock.json b/package-lock.json index 875f3d3..c6307de 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "badmanners.xyz", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "badmanners.xyz", - "version": "2.1.0", + "version": "2.1.1", "hasInstallScript": true, "dependencies": { "@astrojs/check": "^0.9.2", diff --git a/package.json b/package.json index d962a26..22f90f1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "badmanners.xyz", "type": "module", - "version": "2.1.0", + "version": "2.1.1", "scripts": { "postinstall": "astro sync", "dev": "astro dev", diff --git a/public/licenses.txt b/public/licenses.txt index 9019f16..fa99be7 100644 --- a/public/licenses.txt +++ b/public/licenses.txt @@ -6,7 +6,7 @@ All attributed artwork is copyrighted by their respective creators and distribut The Jost* typeface is copyrighted by indestructible type* and is distributed under the SIL Open Font License v1.1: https://opensource.org/license/ofl-1-1 -The SVG icons for Bluesky, Codeberg, Discord, Itch.io, Keybase, GitHub, GitLab, Mastodon, Picarto, Signal, Steam, Telegram, Twitch, Weasyl, and X were created for the Simple Icons project and are distributed under the Creative Commons Zero v1.0 Universal license: https://creativecommons.org/publicdomain/zero/1.0/ +The SVG icons for Bluesky, Codeberg, Discord, Itch.io, Keybase, Ko-fi, GitHub, GitLab, Google, Mastodon, Picarto, Reddit, Signal, Steam, Telegram, Twitch, Weasyl, X, and YouTube were created for the Simple Icons project and are distributed under the Creative Commons Zero v1.0 Universal license: https://creativecommons.org/publicdomain/zero/1.0/ The SVG icons for Cohost, Eka's Portal, Fur Affinity, Inkbunny, Itaku, Neocities, SoFurry, and SubscribeStar were edited by me (Bad Manners) from their respective logos, for personal use. diff --git a/src/components/AgeRestrictedModal.astro b/src/components/AgeRestrictedModal.astro index 582f34b..f949e5d 100644 --- a/src/components/AgeRestrictedModal.astro +++ b/src/components/AgeRestrictedModal.astro @@ -56,8 +56,12 @@ import IconTriangleExclamation from "./icons/IconTriangleExclamation.astro"; import { ENABLE_VIEW_TRANSITIONS } from "astro:env/client"; const ageRestrictedModalSetup = () => { - if (localStorage.ageVerified !== "true") { - const modal = document.querySelector("div#modal-age-restricted")!; + const modal = document.querySelector("body > div#modal-age-restricted"); + if (!modal) { + throw new Error("Missing #modal-age-restricted element! Make sure that it's a direct child of body."); + } + let ageVerified: "true" | undefined = localStorage.ageVerified; + if (ageVerified !== "true") { const rejectButton = modal.querySelector("button[data-modal-reject]")!; const onRejectButtonClick = (e: MouseEvent) => { e.preventDefault(); @@ -69,7 +73,8 @@ import IconTriangleExclamation from "./icons/IconTriangleExclamation.astro"; (e: MouseEvent) => { e.preventDefault(); rejectButton.removeEventListener("click", onRejectButtonClick); - localStorage.ageVerified = "true"; + ageVerified = "true"; + localStorage.ageVerified = ageVerified; document.body.style.overflow = "auto"; document.querySelectorAll("body > :not(#modal-age-restricted)").forEach((el) => el.removeAttribute("inert")); modal.style.display = "none"; diff --git a/src/components/AgeRestrictedScriptInline.astro b/src/components/AgeRestrictedScriptInline.astro index 8f3f72f..6bf941b 100644 --- a/src/components/AgeRestrictedScriptInline.astro +++ b/src/components/AgeRestrictedScriptInline.astro @@ -1,4 +1,4 @@ --- --- - + diff --git a/src/components/DarkModeScript.astro b/src/components/DarkModeScript.astro index 822b67a..850ddfa 100644 --- a/src/components/DarkModeScript.astro +++ b/src/components/DarkModeScript.astro @@ -6,27 +6,29 @@ import DarkModeScriptInline from "./DarkModeScriptInline.astro";