From ddca239668167b34157e6dfd2ab88e6b9774db7d Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 5 Apr 2021 15:21:24 -0300 Subject: info card thumbnail & image link/color niceness --- static/client.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'static/client.js') diff --git a/static/client.js b/static/client.js index 60bf62b..a4fb824 100644 --- a/static/client.js +++ b/static/client.js @@ -177,11 +177,16 @@ const HIDE_HOVER_DELAY = 250; let fastHover = false; let endFastHoverTimeout = null; -function link(a, type, {name, directory, color}) { +function colorLink(a, color) { if (color) { - a.style.setProperty('--primary-color', color); + const { primary, dim } = C.getColors(color); + a.style.setProperty('--primary-color', primary); + a.style.setProperty('--dim-color', dim); } +} +function link(a, type, {name, directory, color}) { + colorLink(a, color); a.innerText = name a.href = getLinkHref(type, directory); } @@ -227,7 +232,11 @@ const infoCard = (() => { link(albumLink, 'album', data.links.album); const img = container.querySelector('.info-card-art'); - img.src = rebase(data.cover.path, 'rebaseMedia'); + img.src = rebase(data.cover.paths.small, 'rebaseMedia'); + + const imgLink = container.querySelector('.info-card-art-container a'); + colorLink(imgLink, data.color); + imgLink.href = rebase(data.cover.paths.original, 'rebaseMedia'); }); } -- cgit 1.3.0-6-gf8a5