Skip to content

Instantly share code, notes, and snippets.

@bpiroman
Created April 28, 2024 12:39
Show Gist options
  • Save bpiroman/2d3029601811997b712d45111d54bf1f to your computer and use it in GitHub Desktop.
Save bpiroman/2d3029601811997b712d45111d54bf1f to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<meta charset="UTF-8">
<head>
<title>Ah Ah Ah, you didn't say the magic word!</title>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
</head>
<html>
<body>
<div class="container" id="nedry">
<div class="nedry">
<!-- <img class="nedry-body" src="resources/body.png">
<img class="nedry-head" src="resources/head.png">
<img class="nedry-hand" src="resources/hand.png"> -->
<img class="nedry-body" src="resources/body.png">
<img class="nedry-head" src="resources/head.png">
<img class="nedry-hand" src="resources/hand.png">
</div>
<audio id="player" autoplay loop>
<source src="resources/ahahah.mp3" type="audio/mp3">
<source src="resources/ahahah.mp3" type="audio/mp3">
</audio>
<input id="unmuteButton" type="button" onclick="playSound()" value="🔈 Unmute" />
<input id="goBack" type="button" onclick="playSound()" value="Back to Map" />
</div>
</body>
<link rel="stylesheet" href="resources/style.css">
<script>
const sound = document.getElementById('player');
sound.addEventListener('play', (event) => {
document.getElementById("unmuteButton").hidden = true;
});
sound.addEventListener('pause', (event) => {
document.getElementById("unmuteButton").hidden = false;
});
function playSound() {
document.getElementById("player").play();
}
$('#nedry').on('click', playSound);
$('#goBack').on('click', function() {
console.log('go back to map button');
localStorage.setItem("qmaps-wapl", JSON.stringify(Object.assign({}, { random: "Does not update", page: "map" })));
render(getState());
});
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment