Every Signal's tile in the folder's accent tint, not one by a hash of its name (#262)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 19:03:40 +00:00
parent 4f1e7e23f6
commit d0ed953e84

View File

@@ -35,9 +35,11 @@ function feedRow(id: string, cls: string, html: string, open: ()=>void){
/// takes nothing else either). /// takes nothing else either).
const ICON_ID=/^(solid|regular|brands)\/[a-z0-9-]{1,64}$/; const ICON_ID=/^(solid|regular|brands)\/[a-z0-9-]{1,64}$/;
const iconHTML=(icon: string)=>`<span class="ficon" style="--icon:url('/icons/${icon}.svg')"></span>`; const iconHTML=(icon: string)=>`<span class="ficon" style="--icon:url('/icons/${icon}.svg')"></span>`;
/// Every Signal in the accent tint the folder has, icon or initials: tinted by a hash of its name,
/// as a feed without art is, one came out a colour of its own for no reason anyone could see (#262).
function signalTile(sg: {name: string, icon: string|null}){ function signalTile(sg: {name: string, icon: string|null}){
return sg.icon&&ICON_ID.test(sg.icon) const inner=sg.icon&&ICON_ID.test(sg.icon) ? iconHTML(sg.icon) : esc(initials(sg.name));
? `<div class="art ini sig" style="--tint:${tint(sg.name)}">${iconHTML(sg.icon)}</div>` : tileHTML(sg.name); return `<div class="art ini sig" style="--tint:var(--accent)">${inner}</div>`;
} }
const badgeHTML=(n: number)=>`<span class="badge${n?'':' zero'}" title="${n} unread">${n>999?'999+':n}</span>`; const badgeHTML=(n: number)=>`<span class="badge${n?'':' zero'}" title="${n} unread">${n>999?'999+':n}</span>`;
function signalFolder(list: HTMLElement, q: string){ function signalFolder(list: HTMLElement, q: string){