From 1a88adeabcaa2fecda8bfbe5b99b7dd58286e046 Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Mon, 27 Jul 2026 09:44:22 -0500 Subject: [PATCH] Move lyrics location into artwork --- assets/css/radio.css | 28 +++++++++++++++++++++------- assets/js/player.js | 4 ++-- index.php | 17 ++++++++--------- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/assets/css/radio.css b/assets/css/radio.css index 53ec9b3..d8a0afa 100644 --- a/assets/css/radio.css +++ b/assets/css/radio.css @@ -50,6 +50,8 @@ a:hover, a:focus { color: var(--text); text-decoration: underline; } } /* ----------------------------------------------------------- album art */ +.art-wrap { position: relative; width: 100%; } + .album-art { width: 100%; max-width: 600px; @@ -160,18 +162,30 @@ audio[controls] { width: 100%; outline: 0; } } /* --------------------------------------------------------------- lyrics */ +.lyrics-toggle { + position: absolute; top: 10px; right: 10px; z-index: 2; + padding: 6px 14px; + background: rgba(0, 0, 0, 0.55); color: #fff; + font-variant: small-caps; font-size: 0.85rem; + border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 999px; + cursor: pointer; backdrop-filter: blur(4px); + transition: background .15s ease; +} +.lyrics-toggle:hover, .lyrics-toggle:focus { background: rgba(0, 0, 0, 0.8); outline: 0; } +.lyrics-toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); } + .lyrics { - width: 100%; max-width: 460px; - max-height: 42vh; + position: absolute; inset: 0; z-index: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; /* momentum scroll on iOS */ overscroll-behavior: contain; - text-align: left; white-space: pre-line; line-height: 1.5; - padding: 12px 14px; - background: rgba(0, 0, 0, 0.25); + text-align: left; white-space: pre-line; line-height: 1.6; + padding: 52px 20px 20px; + background: rgba(0, 0, 0, 0.8); border-radius: var(--radius); - color: var(--text); + color: #fff; } +.lyrics[hidden] { display: none; } /* [hidden] must beat position:absolute rule specificity */ /* Hide the scrollbar but keep wheel / touch / drag scrolling. */ .no-scrollbar, .lyrics, .history { @@ -222,7 +236,7 @@ audio[controls] { width: 100%; outline: 0; } @media (max-width: 575px) { body { background: var(--bg-mobile); } .player-card { padding: 16px; } - .album-art { width: 88%; } + .art-wrap, .album-art { width: 88%; } .history { width: min(96vw, 420px); } } diff --git a/assets/js/player.js b/assets/js/player.js index bfc4083..6ead57c 100644 --- a/assets/js/player.js +++ b/assets/js/player.js @@ -384,7 +384,7 @@ function loadLyrics(track) { if (!CFG.lyricsEnabled || !el.lyricsToggle) return; el.lyricsToggle.hidden = true; - el.lyricsToggle.textContent = 'Show lyrics'; + el.lyricsToggle.setAttribute('aria-pressed', 'false'); if (el.lyrics) { el.lyrics.hidden = true; el.lyrics.textContent = ''; } var body = new URLSearchParams(); @@ -405,7 +405,7 @@ if (!el.lyrics) return; var show = el.lyrics.hidden; el.lyrics.hidden = !show; - el.lyricsToggle.textContent = show ? 'Hide lyrics' : 'Show lyrics'; + el.lyricsToggle.setAttribute('aria-pressed', show ? 'true' : 'false'); }); } diff --git a/index.php b/index.php index 96653f1..8ee4dd4 100644 --- a/index.php +++ b/index.php @@ -23,8 +23,14 @@ $waveActive = radio_waveform_active();
- Album art +
+ Album art + + + + +
@@ -59,14 +65,7 @@ $waveActive = radio_waveform_active();
- - -
- - - -