This commit is contained in:
sundae 2026-03-06 11:03:17 +02:00
commit 4972cbe693
Signed by: sundae
SSH key fingerprint: SHA256:MsJkKuo4PUdjQDpLeaURy81drKkW14exlTHp+8QFu6M
40 changed files with 499 additions and 286 deletions

View file

@ -1,2 +1,2 @@
/* this is for neocities. if you self-host, there's no need to use this hack */
export const audioPath = "https://bunsin.space/forgejo/sundae/website/raw/branch/main/_src/assets/audio/";
export const audioPath = "/assets/audio/";

32
_src/assets/js/what.js Normal file
View file

@ -0,0 +1,32 @@
import { audioPath } from "./path.js";
let what = document.querySelector('[commandfor="signal"]');
let guardian = document.createElement("audio");
let dialog = document.getElementById("signal");
let funny = document.getElementById("funny");
let invis;
guardian.src = `${audioPath}sanctuary_guardian.ogg`;
guardian.preload = "";
what.appendChild(guardian);
function codzombies(mutations) {
if (dialog.open) {
guardian.play();
if (funny) {
funny.style.opacity = 0;
invis = setTimeout(() => {
funny.style.opacity = 1;
}, 2200);
}
} else {
guardian.pause();
guardian.currentTime = 0;
clearTimeout(invis);
}
}
const observer = new MutationObserver(codzombies);
observer.observe(dialog, {
attributes: true,
});