cooler glows

This commit is contained in:
Joshua Seigler 2025-06-22 01:08:24 -04:00
parent 8aeff65c2a
commit dbb7f59197
2 changed files with 17 additions and 10 deletions

View file

@ -67,6 +67,7 @@ function addEffect({ target }) {
) {
return;
}
const color = window.getComputedStyle(target).getPropertyValue('--glowColor');
const rects = Array.from(target.getClientRects());
Array.from(target.children).forEach((child) => {
rects.push(...Array.from(child.getClientRects()));
@ -81,6 +82,7 @@ function addEffect({ target }) {
newEffect.style.left = `calc(${left + window.scrollX}px - ${padding})`;
newEffect.style.width = `calc(${width}px + 2 * ${padding})`;
newEffect.style.height = `calc(${height}px + 2 * ${padding})`;
newEffect.style.setProperty('--glowColor', color);
effectsLayer.appendChild(newEffect);
});
}