pupdated
This commit is contained in:
parent
c8223447a0
commit
4972cbe693
40 changed files with 499 additions and 286 deletions
|
|
@ -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
32
_src/assets/js/what.js
Normal 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,
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue