Fix non-WASM search with polyfill and optimize minified scripts
This commit is contained in:
parent
fb30f1b416
commit
5521291e5b
7 changed files with 25 additions and 6 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
4
src/env.d.ts
vendored
4
src/env.d.ts
vendored
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue