diff options
author | metamuffin <metamuffin@disroot.org> | 2025-02-02 00:39:39 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-02-02 00:39:39 +0100 |
commit | 5970c8da7e2569429b2ef45c63157d0b6416259a (patch) | |
tree | 22de1d664a581b79ec39db0eb1094c058e1ba8a8 | |
parent | 11e8361f1efabda3a80c5977461fbf24945774ad (diff) | |
download | jellything-5970c8da7e2569429b2ef45c63157d0b6416259a.tar jellything-5970c8da7e2569429b2ef45c63157d0b6416259a.tar.bz2 jellything-5970c8da7e2569429b2ef45c63157d0b6416259a.tar.zst |
globalThis
-rw-r--r-- | web/script/transition.ts | 12 | ||||
-rw-r--r-- | web/style/js-transition.css | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/web/script/transition.ts b/web/script/transition.ts index e1d2cab..35b4ebe 100644 --- a/web/script/transition.ts +++ b/web/script/transition.ts @@ -17,7 +17,7 @@ globalThis.addEventListener("DOMContentLoaded", () => { }) globalThis.addEventListener("popstate", async e => { - await transition_to(window.location.href, e.state) + await transition_to(globalThis.location.href, e.state) }) let disable_transition = false @@ -37,7 +37,7 @@ function patch_page() { async function transition_to(href: string, state?: HistoryState) { stop() // nice! - if (disable_transition) return window.location.href = href + if (disable_transition) return globalThis.location.href = href const trigger_load = prepare_load(href, state) await fade(false) trigger_load() @@ -58,9 +58,9 @@ function prepare_load(href: string, state?: HistoryState) { try { const r = await r_promise if (r.type == "opaqueredirect") { - window.location.href = href + globalThis.location.href = href show_message("Native Player Started.", "success") - setTimeout(() => window.location.reload(), 500) + setTimeout(() => globalThis.location.reload(), 500) return } if (!r.ok) return show_message("Error response. Try again.") @@ -70,8 +70,8 @@ function prepare_load(href: string, state?: HistoryState) { return show_message("unknown error when fetching page") } const [head, body] = rt.split("<head>")[1].split("</head>") - window.history.replaceState({ top: globalThis.scrollY, index: i++ } as HistoryState, "") - if (!state) window.history.pushState({}, "", href) + globalThis.history.replaceState({ top: globalThis.scrollY, index: i++ } as HistoryState, "") + if (!state) globalThis.history.pushState({}, "", href) clear_spinner() document.head.innerHTML = head document.body.outerHTML = body diff --git a/web/style/js-transition.css b/web/style/js-transition.css index 75e1f41..8375a22 100644 --- a/web/style/js-transition.css +++ b/web/style/js-transition.css @@ -23,7 +23,7 @@ from { transform: rotate(0turn); } - from { + to { transform: rotate(-1turn); } } |