Loopfunktion
This commit is contained in:
parent
ec5b29dff3
commit
a6b47e15f8
3 changed files with 20 additions and 4 deletions
|
|
@ -4,6 +4,18 @@ const signs = document.querySelectorAll(".sing")
|
|||
outindex = 0
|
||||
playing = false
|
||||
playcolor = "#00ff3c"
|
||||
loop = true
|
||||
function looptrue(){
|
||||
if(loop){
|
||||
loop = false
|
||||
document.querySelector("#loop").innerHTML = "Kein Loop"
|
||||
document.querySelector("#loop").style.beckground
|
||||
}
|
||||
else{
|
||||
loop = true
|
||||
document.querySelector("#loop").innerHTML = "Loop"
|
||||
}
|
||||
}
|
||||
function abspielen(){
|
||||
if(playing){
|
||||
audios[outindex].pause()
|
||||
|
|
@ -11,7 +23,7 @@ function abspielen(){
|
|||
playing = false
|
||||
articles[outindex].style.margin = "0px"
|
||||
articles[outindex].style.boxShadow = "0 0 0px 0px "+playcolor
|
||||
document.querySelector("button").innerHTML = "Abspielen"
|
||||
document.querySelector("#play").innerHTML = "Abspielen"
|
||||
}
|
||||
else{
|
||||
audios[outindex].play()
|
||||
|
|
@ -19,7 +31,7 @@ function abspielen(){
|
|||
signs[outindex].innerHTML = "Spielt"
|
||||
articles[outindex].style.margin = "8px"
|
||||
articles[outindex].style.boxShadow = "0 0 6px 3px "+playcolor
|
||||
document.querySelector("button").innerHTML = "Pausieren"
|
||||
document.querySelector("#play").innerHTML = "Pausieren"
|
||||
}
|
||||
}
|
||||
for (const [index,audio] of audios.entries()){
|
||||
|
|
@ -32,6 +44,7 @@ for (const [index,audio] of audios.entries()){
|
|||
signs[index].innerHTML = ""
|
||||
articles[index].style.filter = "grayscale("+(index+1)*50+"%)"
|
||||
articles[index].style.boxShadow = "0 0 0px 0px "+playcolor
|
||||
articles[outindex].style.filter = "grayscale(0%)"
|
||||
articles[outindex].style.margin = "8px"
|
||||
signs[outindex].innerHTML = "Spielt"
|
||||
articles[outindex].style.boxShadow = "0 0 6px 1px "+playcolor
|
||||
|
|
@ -43,6 +56,9 @@ for (const [index,audio] of audios.entries()){
|
|||
articles[index].style.margin = "8px"
|
||||
signs[index].innerHTML = "Spielt"
|
||||
articles[index].style.boxShadow = "0 0 6px 1px "+playcolor
|
||||
if(loop){
|
||||
audios[0].play()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue