mirror of
https://github.com/asgeirtj/system_prompts_leaks.git
synced 2026-07-31 09:17:25 +02:00
Surface stars today/7d in the GitHub Stars stat card too
The live readout was only on the chart title; mirror today + 7d into the top stat card where the headline numbers are, sourced from the same live windows (falls back to series 7d).
This commit is contained in:
@@ -336,7 +336,13 @@ const statCards = [
|
||||
{ l:'Peak Day', v:fmt(peakView.count), s:peakView.timestamp.slice(0,10) },
|
||||
{ l:'7-Day Trend', v:`<span class="${trendCls}">${trend>=0?'+':''}${trend}%</span>`, s:fmt(last7)+' vs '+fmt(prev7) },
|
||||
];
|
||||
if (curStars != null) statCards.splice(2, 0, { l:'GitHub Stars', v:'★ '+fmt(curStars), s: starGain!=null ? `<span class="${starGain>=0?'trend-up':'trend-down'}">${starGain>=0?'+':''}${fmt(starGain)}</span> last ${starGainDays}d` : ' ' });
|
||||
if (curStars != null) {
|
||||
const tdy = sw ? sw.d1 : null;
|
||||
const sub = sw
|
||||
? `<span class="trend-up">+${fmt(sw.d1)}</span> today · <span class="trend-up">+${fmt(sw.d7)}</span> 7d`
|
||||
: (starGain!=null ? `<span class="${starGain>=0?'trend-up':'trend-down'}">${starGain>=0?'+':''}${fmt(starGain)}</span> last ${starGainDays}d` : ' ');
|
||||
statCards.splice(2, 0, { l:'GitHub Stars', v:'★ '+fmt(curStars), s: sub });
|
||||
}
|
||||
|
||||
document.getElementById('stats').innerHTML = statCards.map(s=>`<div class="stat"><div class="stat-label">${s.l}</div><div class="stat-val">${s.v}</div><div class="stat-sub">${s.s}</div>${s.t?`<div class="stat-since">${s.t}</div>`:''}</div>`).join('');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user