From 22d4ab2cda9f11995f2b0efe2ce8366a06590dab Mon Sep 17 00:00:00 2001 From: rramiachraf <51409801+rramiachraf@users.noreply.github.com> Date: Tue, 16 Apr 2024 01:26:28 +0100 Subject: [PATCH] feat: add option to easily redirect to Genius website --- static/script.js | 2 ++ style/navbar.css | 8 +++++++- views/navbar.templ | 46 ++++++++++++++++++++++++++++++---------------- 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/static/script.js b/static/script.js index a9018a7..2109349 100644 --- a/static/script.js +++ b/static/script.js @@ -9,6 +9,8 @@ function showAbout() { fullAbout && [fullAbout, summary].forEach(item => item.onclick = showAbout) window.addEventListener("load", () => { + const geniusURL = "https://genius.com" + document.location.pathname + document.location.search + document.getElementById("goto-genius").setAttribute("href", geniusURL) document.querySelectorAll("#lyrics a").forEach(item => { item.addEventListener("click", getAnnotation) }) diff --git a/style/navbar.css b/style/navbar.css index 6beca6c..8efece6 100644 --- a/style/navbar.css +++ b/style/navbar.css @@ -24,7 +24,13 @@ nav img { width: 50px; } -#choose-theme { +#nav-icons { + display: flex; + align-items: center; + gap: 1rem; +} + +.nav-icon { background: none; border: none; cursor: pointer; diff --git a/views/navbar.templ b/views/navbar.templ index 90295ce..502ba8b 100644 --- a/views/navbar.templ +++ b/views/navbar.templ @@ -4,24 +4,38 @@ templ navbar() { }