From fe317ee35eb32cc1cf2bd2ef86eec2dcd803eaa5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 26 Apr 2026 12:34:58 +0000 Subject: [PATCH] feat: remove milestone countdown alert banner Agent-Logs-Url: https://github.com/nitrocode/token-deathclock/sessions/df6a25d5-46fc-41b6-92fb-a56d475c07c2 Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com> --- index.html | 7 ---- script.js | 40 +++++++++++----------- src/js/19-milestone-alert.js | 39 ++-------------------- styles.css | 2 +- styles/social.css | 65 ------------------------------------ 5 files changed, 23 insertions(+), 130 deletions(-) diff --git a/index.html b/index.html index ee50424..b330a95 100644 --- a/index.html +++ b/index.html @@ -1594,13 +1594,6 @@

Session Receipt

- - - ",e.innerHTML=d,document.getElementById("lb-info").textContent=`${n.toLocaleString()} days until extinction \xB7 predicted ${c}`}function hn(e,t,n){const o=O(t,n),s=t===0;let i='
';for(let c=0;c<24;c++){const d=o+c*36e5,m=s?ke(d,36e5,n):"future",h=`${String(c).padStart(2,"0")}:00`,E=`${String(c).padStart(2,"0")}`;if(m==="dying"){const g=(n-d)/36e5*100;i+=te(`data-hour="${c}"`,g,h,E)}else i+=ne(m,`data-hour="${c}"`,h,E)}i+="
",e.innerHTML=i;const r=t===0?"Today":`Day +${t}`;document.getElementById("lb-info").textContent=`${r} \u2014 select an hour`}function fn(e,t,n,o){const i=O(t,o)+n*36e5,r=t===0&&o>=i&&o${String(d).padStart(2,"0")}`;if(h==="dying"){const f=(o-m)/6e4*100;c+=te(`data-minute="${d}"`,f,E,g)}else c+=ne(h,`data-minute="${d}"`,E,g)}c+="",e.innerHTML=c,document.getElementById("lb-info").textContent=`${String(n).padStart(2,"0")}:xx \u2014 select a minute`}function yn(e,t,n,o,s){const r=O(t,s)+n*36e5+o*6e4,c=t===0&&s>=r&&s${String(m).padStart(2,"0")}`;if(E==="dying"){const p=(s-h)/1e3*100;d+=te(`data-second="${m}"`,p,g,f)}else d+=ne(E,`data-second="${m}"`,g,f)}d+="",e.innerHTML=d,document.getElementById("lb-info").textContent=`${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}:xx`}function bn(){const e=document.getElementById("lb-breadcrumb");if(!e)return;const t=[{label:"\u{1F480} Days",level:"days"}];l.level!=="days"&&t.push({label:`Day ${l.day===0?"Today":"+"+l.day}`,level:"hours"}),(l.level==="minutes"||l.level==="seconds")&&t.push({label:`Hour ${String(l.hour).padStart(2,"0")}`,level:"minutes"}),l.level==="seconds"&&t.push({label:`Min ${String(l.minute).padStart(2,"0")}`,level:"seconds"}),e.innerHTML=t.map((n,o)=>o===t.length-1?`${u(n.label)}`:`${u(n.label)} - `).join(""),e.querySelectorAll("[data-nav]").forEach(n=>{const o=n.getAttribute("data-nav");n.addEventListener("click",()=>ze(o)),n.addEventListener("keydown",s=>{(s.key==="Enter"||s.key===" ")&&ze(o)})})}function ze(e){l.level=e,e==="days"?(l.day=null,l.hour=null,l.minute=null):e==="hours"?(l.hour=null,l.minute=null):e==="minutes"&&(l.minute=null),K()}function K(){const e=document.getElementById("lb-container");if(!e)return;const t=Date.now(),n=new Date(t);l.lastSec=n.getSeconds(),l.lastMin=n.getMinutes(),l.lastHr=n.getHours(),l.lastDayMs=F(n),l.exploding=!1,l.level==="days"?pn(e,t):l.level==="hours"?hn(e,l.day,t):l.level==="minutes"?fn(e,l.day,l.hour,t):l.level==="seconds"&&yn(e,l.day,l.hour,l.minute,t),En(),bn(e)}function bn(e){e.querySelectorAll(".lb-block:not(.lb-dead)").forEach(t=>{t.addEventListener("click",Qe),t.addEventListener("keydown",n=>{(n.key==="Enter"||n.key===" ")&&Qe.call(t,n)})})}function Qe(e){const t=e.currentTarget||this;if(l.level==="days")l.day=parseInt(t.getAttribute("data-day"),10),l.level="hours";else if(l.level==="hours")l.hour=parseInt(t.getAttribute("data-hour"),10),l.level="minutes";else if(l.level==="minutes")l.minute=parseInt(t.getAttribute("data-minute"),10),l.level="seconds";else return;K()}function vn(e){if(l.exploding){e();return}const t=document.querySelector("#lb-container .lb-dying");if(!t){e();return}l.exploding=!0,t.classList.add("lb-exploding"),setTimeout(e,560)}function Xe(){const e=Date.now(),t=new Date(e);if(!l.exploding){const h=document.querySelector("#lb-container .lb-dying");if(h){let b,g;if(l.level==="days")b=F(t),g=864e5;else if(l.level==="hours"){const p=t.getHours();b=N(l.day,e)+p*36e5,g=36e5}else if(l.level==="minutes"){const p=t.getMinutes();b=N(l.day,e)+l.hour*36e5+p*6e4,g=6e4}else{const p=t.getSeconds();b=N(l.day,e)+l.hour*36e5+l.minute*6e4+p*1e3,g=1e3}const f=Math.min(100,(e-b)/g*100);h.style.setProperty("--progress",f.toFixed(2)+"%")}}const n=t.getSeconds(),o=t.getMinutes(),s=t.getHours(),i=F(t),r=l.level==="seconds"&&n!==l.lastSec,c=l.level==="minutes"&&o!==l.lastMin,d=l.level==="hours"&&s!==l.lastHr,m=l.level==="days"&&i!==l.lastDayMs;(r||c||d||m)&&!l.exploding&&(l.lastSec=n,l.lastMin=o,l.lastHr=s,l.lastDayMs=i,vn(()=>K())),l.rafId=requestAnimationFrame(Xe)}function kn(){K(),l.rafId=requestAnimationFrame(Xe),wn()}const Sn={seconds:"sec",minutes:"min",hours:"hr",days:"day",months:"month",years:"year"},E={rafId:null,active:!1,initialized:!1,lastSec:-1,lastMin:-1,lastHr:-1,lastDay:-1,lastMonth:-1,lastYear:-1,pendingCascade:!1,exploding:{sec:!1,min:!1,hr:!1,day:!1,month:!1,year:!1}};function Ze(e,t,n){const o=new Date(n),s=o.getFullYear(),i=o.getMonth(),r=o.getDate(),c=o.getHours(),d=o.getMinutes(),m=o.getSeconds(),h={years:"YEARS",months:"MONTHS",days:"DAYS",hours:"HOURS",minutes:"MINS",seconds:"SECS"},b=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];let g,f,p,T=null,w;switch(t){case"seconds":g=60,f=m,p=(n-Math.floor(n/1e3)*1e3)/1e3*100,w=y=>yy{const v=String(y).padStart(2,"0")+":00";return y{const C=v+1;return v{const me=b[C];return C30&&(T=`+${C-30}y`),w=Lo=>{const Q=v+Lo;return Q