From e6ccb2ec2cd64a77e2a5286dfa13300de1e76acc Mon Sep 17 00:00:00 2001 From: Aevann Date: Mon, 28 Oct 2024 23:07:08 +0300 Subject: [PATCH] play the jumpscare audio with the img --- files/assets/events/homoween/js/jumpscare.js | 6 +++--- files/templates/root.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/files/assets/events/homoween/js/jumpscare.js b/files/assets/events/homoween/js/jumpscare.js index dbb70d6bb..3bfca6020 100644 --- a/files/assets/events/homoween/js/jumpscare.js +++ b/files/assets/events/homoween/js/jumpscare.js @@ -1,11 +1,11 @@ // Jump scare function function scare() { - const image = document.getElementById("jumpscare-img"); - image.style.display = "block"; - const jumpscare_audio = document.getElementById('jumpscare-audio') jumpscare_audio.play(); + const image = document.getElementById("jumpscare-img"); + image.style.display = "block"; + // Hide image and reset sound setTimeout(function() { image.style.display = "none"; diff --git a/files/templates/root.html b/files/templates/root.html index e2869ea10..6db386a91 100644 --- a/files/templates/root.html +++ b/files/templates/root.html @@ -39,7 +39,7 @@ {% set image_src = SITE_FULL_IMAGES ~ "/assets/events/homoween/images/jumpscares/" ~ listdir("files/assets/events/homoween/images/jumpscares")|random ~ "?x=45" %} {% set audio_src = "/assets/events/homoween/audio/jumpscares/" ~ listdir("files/assets/events/homoween/audio/jumpscares")|random ~ "?x=45" %} - + {% endif %}