revert: use single dominant color on VU bars, drop secondary gradient
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7ed455f72b
commit
510e677c30
1 changed files with 5 additions and 12 deletions
|
|
@ -1014,11 +1014,9 @@ requestAnimationFrame(flushBars);
|
||||||
/* ============================================================
|
/* ============================================================
|
||||||
MUSIC-LIGHT THEME (album color)
|
MUSIC-LIGHT THEME (album color)
|
||||||
============================================================ */
|
============================================================ */
|
||||||
function applyTheme(rgb, rgb2) {
|
function applyTheme(rgb) {
|
||||||
const [r, g, b] = rgb;
|
const [r, g, b] = rgb;
|
||||||
const [r2, g2, b2] = rgb2 || [r, g, b];
|
|
||||||
document.documentElement.style.setProperty('--theme-color', `rgba(${r},${g},${b},1)`);
|
document.documentElement.style.setProperty('--theme-color', `rgba(${r},${g},${b},1)`);
|
||||||
// Tint horizon with primary color
|
|
||||||
horizonEl.style.background = `linear-gradient(to right,
|
horizonEl.style.background = `linear-gradient(to right,
|
||||||
transparent 0%,
|
transparent 0%,
|
||||||
rgba(${r},${g},${b},0.7) 20%,
|
rgba(${r},${g},${b},0.7) 20%,
|
||||||
|
|
@ -1027,14 +1025,9 @@ function applyTheme(rgb, rgb2) {
|
||||||
transparent 100%)`;
|
transparent 100%)`;
|
||||||
horizonEl.style.boxShadow =
|
horizonEl.style.boxShadow =
|
||||||
`0 0 30px rgba(${r},${g},${b},0.9), 0 0 90px rgba(${r},${g},${b},0.3)`;
|
`0 0 30px rgba(${r},${g},${b},0.9), 0 0 90px rgba(${r},${g},${b},0.3)`;
|
||||||
// Apply primary→secondary gradient across VU bars
|
vuBars.forEach(bar => {
|
||||||
vuBars.forEach((bar, i) => {
|
bar.style.background = `rgb(${r},${g},${b})`;
|
||||||
const t = i / (vuBars.length - 1);
|
bar.style.boxShadow = `0 0 4px rgba(${r},${g},${b},0.8)`;
|
||||||
const br = Math.round(r + (r2 - r) * t);
|
|
||||||
const bg = Math.round(g + (g2 - g) * t);
|
|
||||||
const bb = Math.round(b + (b2 - b) * t);
|
|
||||||
bar.style.background = `rgb(${br},${bg},${bb})`;
|
|
||||||
bar.style.boxShadow = `0 0 4px rgba(${br},${bg},${bb},0.8)`;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1046,7 +1039,7 @@ function fetchTheme() {
|
||||||
fetch('http://127.0.0.1:8765/current')
|
fetch('http://127.0.0.1:8765/current')
|
||||||
.then(r => r.json())
|
.then(r => r.json())
|
||||||
.then(d => {
|
.then(d => {
|
||||||
if (d.rgb) applyTheme(d.rgb, d.rgb2);
|
if (d.rgb) applyTheme(d.rgb);
|
||||||
if (d.art_url && d.art_url !== lastArtUrl) {
|
if (d.art_url && d.art_url !== lastArtUrl) {
|
||||||
lastArtUrl = d.art_url;
|
lastArtUrl = d.art_url;
|
||||||
document.getElementById('albumArtImg').src =
|
document.getElementById('albumArtImg').src =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue