From e838b066de0ec2184c4e2517b246c4f464b8474b Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Tue, 22 Nov 2022 19:22:00 +0100 Subject: [PATCH] minimizar espacio vertical y mostrar-ocultar acordes --- res/static/song.js | 12 +++++------- res/templates/song.html | 17 +++++++++-------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/res/static/song.js b/res/static/song.js index 34c6975..40e6529 100644 --- a/res/static/song.js +++ b/res/static/song.js @@ -73,20 +73,18 @@ function getTranspose() { // Init window.onload = function () { - var show = localStorage.getItem("show_chords") == "true"; + var show = localStorage.getItem("show_chords") != "false"; showChords(show); document.getElementById("showChords").checked = show; }; function showChords(show) { if (show || show == "true") { - document.getElementById("songLyrics").style.display = "none"; - document.getElementById("songChords").style.display = "block"; - document.getElementById("transposeControls").style.display = "block"; + for (let e of document.getElementsByClassName("showChords")) { e.style.display = "block"; } + for (let e of document.getElementsByClassName("showLyrics")) { e.style.display = "none"; } } else { - document.getElementById("songLyrics").style.display = "block"; - document.getElementById("songChords").style.display = "none"; - document.getElementById("transposeControls").style.display = "none"; + for (let e of document.getElementsByClassName("showChords")) { e.style.display = "none"; } + for (let e of document.getElementsByClassName("showLyrics")) { e.style.display = "block"; } } localStorage.setItem("show_chords", show); } diff --git a/res/templates/song.html b/res/templates/song.html index f16acf7..cbf0b00 100644 --- a/res/templates/song.html +++ b/res/templates/song.html @@ -9,15 +9,15 @@ {% include "header.html" with path=".." %}
-

{{song.number}}. {{ song.name}}

- Categoría: {{ song.category|title }} +

{{song.number}}. {{ song.name}}

{% if song.author %} por {{ song.author }} {% endif %} {% if song.origin %} basada en: {{ song.origin }} {% endif %} -

Ajustes

+
+

Ajustes

@@ -28,7 +28,7 @@
-
+
@@ -51,16 +51,17 @@
- {% endif %} {% if song.capo != 0 %} -
+
Tono original: Cejilla {{ song.capo }}
{% endif %} + {% endif %} +

Canción

-