Fix bird button naming scheme
This commit is contained in:
+8
-4
@@ -35,6 +35,10 @@
|
|||||||
<span>-</span>
|
<span>-</span>
|
||||||
<a href="/photography" data-link>Photography</a>
|
<a href="/photography" data-link>Photography</a>
|
||||||
</nav>
|
</nav>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<!-- Nav Bar -->
|
||||||
|
|
||||||
|
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
||||||
@@ -131,8 +135,8 @@
|
|||||||
|
|
||||||
|
|
||||||
// Bird Button
|
// Bird Button
|
||||||
const DISTANCE = 40
|
const DISTANCE = 20
|
||||||
const birdIcon = document.getElementById("birdButton");
|
const birdButton = document.getElementById("birdButton");
|
||||||
const birdSound = new Audio("SnowBuntingSound.ogg");
|
const birdSound = new Audio("SnowBuntingSound.ogg");
|
||||||
const template = document.getElementById("barTemplate");
|
const template = document.getElementById("barTemplate");
|
||||||
const wrap = document.querySelector(".bird-wrap");
|
const wrap = document.querySelector(".bird-wrap");
|
||||||
@@ -144,7 +148,7 @@
|
|||||||
clone.style.setProperty("--angle", `${angle}deg`);
|
clone.style.setProperty("--angle", `${angle}deg`);
|
||||||
clone.style.setProperty("--distance", `${-distance}px`);
|
clone.style.setProperty("--distance", `${-distance}px`);
|
||||||
clone.style.setProperty("--delay", `${delay}s`);
|
clone.style.setProperty("--delay", `${delay}s`);
|
||||||
wrap.appendChild(clone);
|
birdButton.appendChild(clone);
|
||||||
|
|
||||||
clone.addEventListener("animationend", () => clone.remove());
|
clone.addEventListener("animationend", () => clone.remove());
|
||||||
}
|
}
|
||||||
@@ -158,7 +162,7 @@
|
|||||||
spawnBar(DISTANCE, -rightRandom, 0.8)
|
spawnBar(DISTANCE, -rightRandom, 0.8)
|
||||||
}
|
}
|
||||||
|
|
||||||
birdIcon.addEventListener("click", (e) => {
|
birdButton.addEventListener("click", (e) => {
|
||||||
if (!birdSound.paused) return;
|
if (!birdSound.paused) return;
|
||||||
birdSound.play();
|
birdSound.play();
|
||||||
birdSoundAnim()
|
birdSoundAnim()
|
||||||
|
|||||||
Reference in New Issue
Block a user