Visual fixes
This commit is contained in:
parent
5c2d166ff4
commit
8f3a1c00a4
2 changed files with 10 additions and 3 deletions
2
app.py
2
app.py
|
|
@ -163,4 +163,4 @@ def loeschen():
|
||||||
del songs[song]
|
del songs[song]
|
||||||
with open(liste+".json","w") as f:
|
with open(liste+".json","w") as f:
|
||||||
json.dump(songs,f,indent=2,ensure_ascii=False)
|
json.dump(songs,f,indent=2,ensure_ascii=False)
|
||||||
return redirect("/rm?liste="+liste,303)
|
return redirect("/remove?liste="+liste,303)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
const audios = document.querySelectorAll("audio")
|
const audios = document.querySelectorAll("audio")
|
||||||
const articles = document.querySelectorAll("article")
|
const articles = document.querySelectorAll("article")
|
||||||
|
const kartenContainer = document.getElementById("flex-container")
|
||||||
outindex = 0
|
outindex = 0
|
||||||
playing = false
|
playing = false
|
||||||
playcolor = "#00ff3c"
|
playcolor = "#00ff3c"
|
||||||
|
|
@ -8,8 +9,12 @@ loop = true
|
||||||
function onplay(id){
|
function onplay(id){
|
||||||
id = parseInt(id)
|
id = parseInt(id)
|
||||||
if(id>0){
|
if(id>0){
|
||||||
articles[id-1].style.filter = "grayscale("+(id+1)*50+"%)"
|
articles[id-1].style.filter = "grayscale("+(id+1)*20+"%)"
|
||||||
articles[id-1].style.boxShadow = "0 0 0px 0px "+playcolor
|
articles[id-1].style.boxShadow = "0 0 0px 0px "+playcolor
|
||||||
|
}
|
||||||
|
if(articles[id].offsetWidth * id == window.innerWidth/2){
|
||||||
|
console.log(articles[id].offsetWidth)
|
||||||
|
kartenContainer.scrollWidth += articles[id].offsetWidth
|
||||||
}
|
}
|
||||||
articles[id].style.filter = "grayscale(0%)"
|
articles[id].style.filter = "grayscale(0%)"
|
||||||
articles[id].style.margin = "8px"
|
articles[id].style.margin = "8px"
|
||||||
|
|
@ -20,11 +25,13 @@ function nächste(id){
|
||||||
audios[id].pause()
|
audios[id].pause()
|
||||||
id = parseInt(id) + 1
|
id = parseInt(id) + 1
|
||||||
audios[id].play()
|
audios[id].play()
|
||||||
|
onplay(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
function vorherige(id){
|
function vorherige(id){
|
||||||
audios[id].pause()
|
audios[id].pause()
|
||||||
audios[id-1].play()
|
audios[id-1].play()
|
||||||
|
onplay(id-1)
|
||||||
}
|
}
|
||||||
|
|
||||||
function looptrue(){
|
function looptrue(){
|
||||||
|
|
@ -78,7 +85,7 @@ for (const [index,audio] of audios.entries()){
|
||||||
if (index != audios.length -1){
|
if (index != audios.length -1){
|
||||||
outindex = index +1
|
outindex = index +1
|
||||||
audios[outindex].play()
|
audios[outindex].play()
|
||||||
onplay(index)
|
onplay(index+1)
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
//Last song ON END
|
//Last song ON END
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue