fix: file pathes

This commit is contained in:
Hegyi Áron Ferenc
2024-07-23 14:38:23 +02:00
parent 929431071f
commit f73205b720
2 changed files with 9 additions and 9 deletions

View File

@@ -2,8 +2,8 @@ const playBtn = document.getElementById("play-btn");
const catImg = document.getElementsByClassName("cat")[0];
const volumeSlider = document.getElementById("volume-slider");
const currentVolumeLabel = document.getElementById("current-volume-label");
const clickAudio = new Audio("/audio/click.wav");
const clickReleaseAudio = new Audio("/audio/click-release.wav");
const clickAudio = new Audio("./audio/click.wav");
const clickReleaseAudio = new Audio("./audio/click-release.wav");
const CROSSFADE_DURATION_MS = 5000;
const CROSSFADE_INTERVAL_MS = 20;
@@ -17,7 +17,7 @@ let currentVolume = 0;
function playAudio() {
// add a random query parameter at the end to prevent browser caching
currentAudio = new Audio(`/current.mp3?t=${Date.now()}`);
currentAudio = new Audio(`./current.mp3?t=${Date.now()}`);
currentAudio.onplay = () => {
isPlaying = true;
playBtn.innerText = "pause";
@@ -93,7 +93,7 @@ function animateCat() {
} else {
current += 1;
}
catImg.src = `/images/cat-${current}.png`;
catImg.src = `./images/cat-${current}.png`;
}, 500);
}