ui stuff, proxy?, and whatever else
This commit is contained in:
22
js/main.js
22
js/main.js
@ -98,16 +98,18 @@ document.addEventListener("DOMContentLoaded", async ()=>{
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
let scrollRaf = null;
|
||||
document.addEventListener("scroll", () => {
|
||||
if (scrollRaf) return;
|
||||
scrollRaf = requestAnimationFrame(() => {
|
||||
const pjs = document.getElementById("pjs");
|
||||
if (pjs) pjs.style.top = window.scrollY + "px";
|
||||
scrollRaf = null;
|
||||
});
|
||||
});
|
||||
function handlePanicKeydown(e) {
|
||||
let panic;
|
||||
try {
|
||||
panic = JSON.parse(localStorage.getItem("selenite.panic-mode") || "{}");
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
if (panic.key && panic.url && e.key.toLowerCase() === panic.key.toLowerCase()) {
|
||||
location.href = panic.url;
|
||||
}
|
||||
}
|
||||
document.addEventListener("keydown", handlePanicKeydown);
|
||||
|
||||
if ("serviceWorker" in navigator) {
|
||||
navigator.serviceWorker.addEventListener('message', (event) => {
|
||||
|
||||
Reference in New Issue
Block a user