Projet_Prog_Web/JAVASCRIPT/couloir.js

21 lines
No EOL
760 B
JavaScript

// -------------- VARIABLES -------------//
let lienCrypto = document.getElementById("button2");
let body = document.getElementById("body");
// -------------- FUNCTIONS -------------//
function handleLienCryptoClicked() {
let audioPas = document.createElement("audio");
audioPas.setAttribute("preload", "auto");
audioPas.setAttribute("autoplay", true);
audioPas.setAttribute("src", "../Sounds/pas_insaide.mp3");
audioPas.style.cssText = "z-index: -1; opacity: 0;";
body.appendChild(audioPas);
setTimeout(() => {
lienCrypto.setAttribute("href", "./crypto_seul.html");
lienCrypto.click();
}, 5000);
}
// --------------- EVENTS ---------------//
lienCrypto.addEventListener("click", handleLienCryptoClicked);