From 8f3a1c00a40b625fc8450e6652ca68d7c2619cae Mon Sep 17 00:00:00 2001 From: mikka Date: Sat, 25 Apr 2026 17:41:29 +0200 Subject: [PATCH] Visual fixes --- app.py | 2 +- static/script.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index f7f1923..40b9757 100644 --- a/app.py +++ b/app.py @@ -163,4 +163,4 @@ def loeschen(): del songs[song] with open(liste+".json","w") as f: json.dump(songs,f,indent=2,ensure_ascii=False) - return redirect("/rm?liste="+liste,303) \ No newline at end of file + return redirect("/remove?liste="+liste,303) diff --git a/static/script.js b/static/script.js index 36f2482..815e345 100644 --- a/static/script.js +++ b/static/script.js @@ -1,5 +1,6 @@ const audios = document.querySelectorAll("audio") const articles = document.querySelectorAll("article") +const kartenContainer = document.getElementById("flex-container") outindex = 0 playing = false playcolor = "#00ff3c" @@ -8,8 +9,12 @@ loop = true function onplay(id){ id = parseInt(id) 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 + } + 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.margin = "8px" @@ -20,11 +25,13 @@ function nächste(id){ audios[id].pause() id = parseInt(id) + 1 audios[id].play() + onplay(id) } function vorherige(id){ audios[id].pause() audios[id-1].play() + onplay(id-1) } function looptrue(){ @@ -78,7 +85,7 @@ for (const [index,audio] of audios.entries()){ if (index != audios.length -1){ outindex = index +1 audios[outindex].play() - onplay(index) + onplay(index+1) } else{ //Last song ON END