accessibility maxxing
This commit is contained in:
parent
6c9294f0a0
commit
f18a342ae5
64 changed files with 320 additions and 205 deletions
|
@ -1,24 +1,40 @@
|
|||
import { audioPath } from './path.js'
|
||||
import { audioPath } from "./path.js";
|
||||
|
||||
let pipe = document.getElementById("meow");
|
||||
let preload = new Image();
|
||||
preload.src = "/assets/img/button/braixdragon-cat2.gif";
|
||||
|
||||
pipe.addEventListener("mouseover", func, true);
|
||||
let hoverTimeout;
|
||||
let hovered = false;
|
||||
let played = localStorage.getItem("audioPlayed") === "true";
|
||||
let audio = new Audio(`${audioPath}anvil_land_low.ogg`);
|
||||
|
||||
function func() {
|
||||
pipe.src = preload.src;
|
||||
}
|
||||
|
||||
let audio = document.createElement("audio");
|
||||
audio.src = `${audioPath}anvil_land_low.ogg`;
|
||||
pipe.appendChild(audio);
|
||||
window.addEventListener("beforeunload", () => {
|
||||
localStorage.removeItem("catflattened");
|
||||
});
|
||||
|
||||
pipe.addEventListener(
|
||||
"mouseover",
|
||||
function () {
|
||||
setTimeout(() => {
|
||||
audio.play();
|
||||
}, 1700);
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
"mouseover",
|
||||
() => {
|
||||
if (played) return;
|
||||
hovered = true;
|
||||
hoverTimeout = setTimeout(() => {
|
||||
if (hovered && !played) {
|
||||
pipe.src = preload.src;
|
||||
setTimeout(() => {
|
||||
if (!played) {
|
||||
audio.play();
|
||||
played = true;
|
||||
localStorage.setItem("catflattened", "true");
|
||||
}
|
||||
}, 600);
|
||||
}
|
||||
}, 650);
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
pipe.addEventListener("mouseout", () => {
|
||||
hovered = false;
|
||||
clearTimeout(hoverTimeout);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue