diff --git a/app.py b/app.py index 903c3bb..f7f1923 100644 --- a/app.py +++ b/app.py @@ -137,7 +137,7 @@ def suche_finden(): json.dump(songs,f,indent=2,ensure_ascii=False) return redirect("/suche?liste="+liste,303) -@app.route("/rm") +@app.route("/remove") def admin(): liste = request.args.get("liste") if liste is None: @@ -151,7 +151,7 @@ def admin(): gesamtLaenge += song["laenge"] return render_template('index.html', karten=songs,gesamtLaenge=gesamtLaenge,liste=liste,admin=True) -@app.route("/rm",methods=["POST"]) +@app.route("/remove",methods=["POST"]) def loeschen(): liste = request.args.get("liste") song = int(request.form.get("index")) diff --git a/static/script.js b/static/script.js index 0b01684..f75471c 100644 --- a/static/script.js +++ b/static/script.js @@ -1,11 +1,49 @@ -const audios = document.querySelectorAll("audio") - +const audios = document.querySelectorAll("audio") +const articles = document.querySelectorAll("article") +const signs = document.querySelectorAll(".sing") +outindex = 0 +playing = false +playcolor = "#00ff3c" +function abspielen(){ + if(playing){ + audios[outindex].pause() + signs[outindex].innerHTML = "" + playing = false + articles[outindex].style.margin = "0px" + articles[outindex].style.boxShadow = "0 0 0px 0px "+playcolor + document.querySelector("button").innerHTML = "Abspielen" + } + else{ + audios[outindex].play() + playing = true + signs[outindex].innerHTML = "Spielt" + articles[outindex].style.margin = "8px" + articles[outindex].style.boxShadow = "0 0 6px 3px "+playcolor + document.querySelector("button").innerHTML = "Pausieren" + } +} for (const [index,audio] of audios.entries()){ audio.addEventListener("ended", (event) => { - if (index+1!= audios.length){ - audios[index + 1].play() + signs[index].innerHTML = "" + if (index != audios.length -1){ + outindex = index +1 + audios[outindex].play() + // Visueles + signs[index].innerHTML = "" + articles[index].style.filter = "grayscale("+(index+1)*50+"%)" + articles[index].style.boxShadow = "0 0 0px 0px "+playcolor + articles[outindex].style.margin = "8px" + signs[outindex].innerHTML = "Spielt" + articles[outindex].style.boxShadow = "0 0 6px 1px "+playcolor + } + else{ + signs[index].innerHTML = "" + articles[index].style.filter = "grayscale(80%)" + articles[index].style.boxShadow = "0 0 0px 0px "+playcolor + articles[index].style.margin = "8px" + signs[index].innerHTML = "Spielt" + articles[index].style.boxShadow = "0 0 6px 1px "+playcolor } - }) -} +} console.log(audios) \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index da1045d..a612f7f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -44,11 +44,18 @@ text-align: center; color: rgb(181, 181, 181); } + button{ + padding: 10px; + margin: 5px; + border: black; + border-radius: 20px; + }

ESC Playlist

2026

Du willst ein weiteres Lied in der Playlist? -

Die Playlist {{liste}} ist insgesamt lang {{ gesamtLaenge | zeit }} und enthält {{ karten|length }} Lieder

+

Die Playlist {{liste}} ist insgesamt {{ gesamtLaenge | zeit }} lang und enthält {{ karten|length }} Lieder

+
{% for karte in karten %} {% set karte_loop = loop %} diff --git a/templates/karte.html b/templates/karte.html index 7a8654e..698372f 100644 --- a/templates/karte.html +++ b/templates/karte.html @@ -1,7 +1,8 @@
+

{% if karte.ytid %} - + {% endif %}

{{ karte.titel}}

Übersetzter Titel:{{ karte.uetitel}}

diff --git a/templates/suche.html b/templates/suche.html index 7673f1a..abab342 100644 --- a/templates/suche.html +++ b/templates/suche.html @@ -1,5 +1,5 @@