mirror of
https://github.com/pvrzz/atmosphere.git
synced 2026-11-29 05:22:26 +00:00
Fix artist photo search, artist placeholders and mini player controls
- Artist photo search: thumbnails are fetched by the app and embedded, so they always show (lazy-loaded web images never started loading) - Artists without a photo show the person placeholder instead of an album cover - Mini player: lyrics centre inside their own box instead of scrolling the whole window, and only the cover shrinks when space is tight, so the controls always show
This commit is contained in:
+13
-1
@@ -155,6 +155,18 @@ function renderLyricsAll() {
|
||||
if (typeof Mini !== "undefined" && Mini.on) renderMiniPanel();
|
||||
}
|
||||
|
||||
function centerLine(el) {
|
||||
let box = el.parentElement;
|
||||
while (box && box !== document.body) {
|
||||
const style = getComputedStyle(box);
|
||||
if (/(auto|scroll)/.test(style.overflowY) && box.scrollHeight > box.clientHeight) break;
|
||||
box = box.parentElement;
|
||||
}
|
||||
if (!box || box === document.body) return;
|
||||
const target = el.getBoundingClientRect().top - box.getBoundingClientRect().top + box.scrollTop - (box.clientHeight - el.offsetHeight) / 2;
|
||||
box.scrollTo({ top: Math.max(0, target), behavior: reduced.matches ? "auto" : "smooth" });
|
||||
}
|
||||
|
||||
function tick() {
|
||||
Lyr.raf = 0;
|
||||
const visible = !$("#lyricsPanel").hidden || Lyr.tv || (typeof Mini !== "undefined" && Mini.on && Mini.panelShown && Mini.prefs.panel === "lyrics");
|
||||
@@ -177,7 +189,7 @@ function tick() {
|
||||
});
|
||||
if (box.classList.contains("depth")) setDepth(box, idx);
|
||||
const cur = box.querySelector(".lyr-line.on");
|
||||
if (cur) cur.scrollIntoView({ block: "center", behavior: reduced.matches ? "auto" : "smooth" });
|
||||
if (cur) centerLine(cur);
|
||||
}
|
||||
}
|
||||
const line = l.lines[idx];
|
||||
|
||||
Reference in New Issue
Block a user