diff --git a/package-lock.json b/package-lock.json index e7f2c52..a7df6b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gallery.badmanners.xyz", - "version": "1.7.8", + "version": "1.7.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gallery.badmanners.xyz", - "version": "1.7.8", + "version": "1.7.9", "hasInstallScript": true, "dependencies": { "@astrojs/check": "^0.9.2", @@ -20,6 +20,7 @@ "github-slugger": "^2.0.0", "marked": "^14.0.0", "pagefind": "^1.1.0", + "polywasm": "^0.1.4", "reading-time": "^1.5.0", "sanitize-html": "^2.13.0", "tailwindcss": "^3.4.9", @@ -5500,6 +5501,12 @@ "node": ">=8" } }, + "node_modules/polywasm": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/polywasm/-/polywasm-0.1.4.tgz", + "integrity": "sha512-s+ugIqz8Wy5GGex0JiO6VXzAr+1SybzNSVxopKwDvtETGlNg5Wysa4njLo8f9Qczv7yBj9WZAmk4IM0vJXBusA==", + "license": "MIT" + }, "node_modules/postcss": { "version": "8.4.39", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.39.tgz", diff --git a/package.json b/package.json index e1f2954..2749032 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gallery.badmanners.xyz", "type": "module", - "version": "1.7.8", + "version": "1.7.9", "scripts": { "postinstall": "astro sync", "dev": "astro dev", @@ -27,6 +27,7 @@ "github-slugger": "^2.0.0", "marked": "^14.0.0", "pagefind": "^1.1.0", + "polywasm": "^0.1.4", "reading-time": "^1.5.0", "sanitize-html": "^2.13.0", "tailwindcss": "^3.4.9", diff --git a/public/licenses.toml b/public/licenses.toml index 0b04dfb..a093f87 100644 --- a/public/licenses.toml +++ b/public/licenses.toml @@ -51,7 +51,7 @@ description = "Generic icons." type = "icons" source = "https://fontawesome.com" license = { name = "CC-BY-4.0", url = "https://creativecommons.org/licenses/by/4.0/" } -icons = [ +items = [ "arrow-back", "arrow-up", "book", diff --git a/src/components/AgeRestrictedScriptInline.astro b/src/components/AgeRestrictedScriptInline.astro index 31f37f2..d8f6de7 100644 --- a/src/components/AgeRestrictedScriptInline.astro +++ b/src/components/AgeRestrictedScriptInline.astro @@ -1,4 +1,4 @@ --- --- -<script is:inline>(function (){let b=document,c="#modal-age-restricted",d="true",e=b.querySelector("body > "+c),f="ageVerified",g="searchParams",h=localStorage,i=new URL(b.location),j=history;i[g].get(f)===d&&(h[f]=d,j&&(i[g].delete(f),j.replaceState({},"",i)));e&&(h[f]===d?b.querySelectorAll("a[href][data-age-restricted]").forEach(x=>{let y=new URL(x.href);y[g].set(f,d);x.href=y.href}):((b.body.style.overflow="hidden"),b.querySelectorAll("body > :not("+c+")").forEach(x=>x.setAttribute("inert",d)),(e.style.display="block")))})()</script> +<script is:inline>(a=>{let b="body > ",c="#modal-age-restricted",d="true",e="ageVerified",f="searchParams",g=localStorage,h=new URL(a.location),i=x=>a.querySelectorAll(x),j=i(b+c)[0];h[f].get(e)==d&&(g[e]=d,h[f].delete(e),history.replaceState({},"",h));j&&(g[e]==d?i("a[href][data-age-restricted]").forEach(x=>{let y=new URL(x.href);y[f].set(e,d);x.href=y}):((a.body.style.overflow="hidden"),i(b+":not("+c+")").forEach(x=>x.setAttribute("inert",d)),(j.style.display="block")))})(document)</script> diff --git a/src/components/DarkModeScriptInline.astro b/src/components/DarkModeScriptInline.astro index 4f017bb..621acf1 100644 --- a/src/components/DarkModeScriptInline.astro +++ b/src/components/DarkModeScriptInline.astro @@ -1,4 +1,4 @@ --- --- -<script is:inline>(function (){var b="dark",c="auto",d="colorScheme",e=document.body.classList,f=localStorage,g=f&&f[d];g&&g!==c?g===b&&e.add(b):(f&&(f[d]=c),matchMedia("(prefers-color-scheme: dark)").matches&&e.add(b))})()</script> +<script is:inline>(a=>{var b="dark",c="auto",d="colorScheme",e=a.body.classList,f=localStorage,g=f[d];g==c?(f[d]=c,matchMedia("(prefers-color-scheme: dark)").matches&&e.add(b)):g==b&&e.add(b)})(document)</script> diff --git a/src/env.d.ts b/src/env.d.ts index 338ba9e..a342ebe 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1,3 +1,7 @@ /// <reference path="../.astro/env.d.ts" /> /// <reference path="../.astro/types.d.ts" /> /// <reference types="astro/client" /> + +declare module "polywasm" { + export const WebAssembly: typeof globalThis.WebAssembly; +} \ No newline at end of file diff --git a/src/pages/search.astro b/src/pages/search.astro index fb80d41..3f9a451 100644 --- a/src/pages/search.astro +++ b/src/pages/search.astro @@ -3,6 +3,13 @@ import SearchComponent from "astro-pagefind/components/Search"; import GalleryLayout from "../layouts/GalleryLayout.astro"; --- +<script> + import { WebAssembly } from "polywasm"; + if (!("WebAssembly" in globalThis)) { + globalThis.WebAssembly = WebAssembly; + } +</script> + <GalleryLayout pageTitle="Search"> <meta slot="head" property="og:description" content="Bad Manners || Search" /> <h1 class="m-2 text-2xl font-semibold text-stone-800 dark:text-stone-100">Search</h1>