bruit de pas quand on s'avance dans le couloir
This commit is contained in:
parent
268f89b053
commit
0d0602b49e
5 changed files with 30 additions and 3 deletions
|
@ -64,6 +64,7 @@ body {
|
|||
padding: 1vw 1.2vw 1vw 1.2vw;
|
||||
color: black;
|
||||
font-family: 'Special Elite', cursive;
|
||||
text-align: center;
|
||||
font-size: 0.8vw;
|
||||
background-image: linear-gradient(to top, black -50%, #BF0909 80%);
|
||||
cursor : pointer;
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
<link rel="stylesheet" href="../CSS/couloir.css">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Special+Elite&display=swap" rel="stylesheet">
|
||||
<script defer type="text/javascript" src="../JAVASCRIPT/couloir.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<body id="body">
|
||||
<header>
|
||||
<h1>Sur les traces</h1>
|
||||
<nav><a href='./menu.html'>Retourner au menu</a></nav>
|
||||
|
@ -24,8 +25,8 @@
|
|||
</p>
|
||||
</article>
|
||||
<div id="buttons">
|
||||
<button id="safeButton" class="button" onclick="window.location.href = './aide_ami.html';">Prendre une photo, vous en parlerez à quelqu'un plus tard</button>
|
||||
<button id="riskyButton" class="button" onclick="window.location.href = './crypto_seul.html';">Attendre qu'ils rentrent, prendre son courage à deux mains, et s'aventurer jusqu'à cette salle</button>
|
||||
<button id="button1" class="button" onclick="window.location.href = './aide_ami.html';">Prendre une photo, vous en parlerez à quelqu'un plus tard</button>
|
||||
<a id="button2" class="button">Attendre qu'ils rentrent, prendre son courage à deux mains, et s'aventurer jusqu'à cette salle</a>
|
||||
</div>
|
||||
</section>
|
||||
</main>
|
||||
|
|
|
@ -54,8 +54,11 @@ function handleButtonClicked(event) {
|
|||
button.setAttribute('href', './couloir_ami.html');
|
||||
button.click();
|
||||
} else {
|
||||
//desactive le lien
|
||||
button.removeAttribute('href');
|
||||
//on enleve l'event listener pour pas pouvoir spam le bouton
|
||||
button.removeEventListener("click", handleButtonClicked);
|
||||
//faire clignoter le message d'erreur
|
||||
let repeater = setInterval(() => {
|
||||
friendInput.setAttribute("placeholder", "");
|
||||
setTimeout(() => {
|
||||
|
@ -71,6 +74,7 @@ function handleButtonClicked(event) {
|
|||
}
|
||||
|
||||
//------------------ Gestion events ------------------//
|
||||
//Pour pas faire apparaitre le texte avant que la premiere phrase soit apparue
|
||||
setTimeout(() => {
|
||||
document.addEventListener("keypress", makeNextTextAppear);
|
||||
}, 2000);
|
||||
|
|
21
JAVASCRIPT/couloir.js
Normal file
21
JAVASCRIPT/couloir.js
Normal file
|
@ -0,0 +1,21 @@
|
|||
// -------------- 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);
|
BIN
Sounds/pas_insaide.mp3
Normal file
BIN
Sounds/pas_insaide.mp3
Normal file
Binary file not shown.
Loading…
Reference in a new issue