- new commit
This commit is contained in:
35
app/assets/js/index.js
Normal file
35
app/assets/js/index.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const navBar = document.querySelector("nav")
|
||||
const uiButton = document.querySelector("footer>section.left")
|
||||
const audio = new Audio()
|
||||
|
||||
function startAudio() {
|
||||
audio.src = "/app/assets/audio/Golden Hill (Radio Edit).mp3"
|
||||
audio.loop = true
|
||||
audio.onended = () => {
|
||||
if (!audio.paused) {
|
||||
audio.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function muteAudio() {
|
||||
audio.muted = true
|
||||
}
|
||||
|
||||
function unmuteAudio() {
|
||||
audio.muted = false
|
||||
}
|
||||
|
||||
function showNavBar() {
|
||||
navBar.removeAttribute("hidden")
|
||||
for (const button of uiButton.children) {
|
||||
button.setAttribute("hidden", "")
|
||||
}
|
||||
}
|
||||
|
||||
function hideNavBar() {
|
||||
navBar.setAttribute("hidden", "")
|
||||
for (const button of uiButton.children) {
|
||||
button.removeAttribute("hidden")
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
const audio = new Audio()
|
||||
|
||||
function startAudio() {
|
||||
audio.src = "/app/assets/audio/Golden Hill (Radio Edit).mp3"
|
||||
audio.loop = true
|
||||
audio.onended = () => {
|
||||
if (!audio.paused) {
|
||||
audio.play()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function muteAudio() {
|
||||
audio.muted = true
|
||||
}
|
||||
|
||||
function unmuteAudio() {
|
||||
audio.muted = false
|
||||
}
|
||||
Reference in New Issue
Block a user