fix: reframe greeting as a heartfelt birthday encore
Validate and publish Pages / pages (push) Failing after 6s

This commit is contained in:
2026-08-17 18:07:20 +00:00
parent eff9689a82
commit ad2b31f666
2 changed files with 30 additions and 30 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ function piece(x,y,i){const a=-Math.PI*.9+(i%50)/49*Math.PI*.8,s=7+Math.random()
function burst(x=innerWidth/2,y=innerHeight*.7){if(reduced.matches)return;for(let i=0;i<220;i++)pieces.push(piece(x,y,i));if(!frame)animate()}
function animate(){ctx.clearRect(0,0,innerWidth,innerHeight);pieces=pieces.filter(p=>p.life>0&&p.y<innerHeight+90);pieces.forEach(p=>{p.vx*=p.d;p.vy=p.vy*p.d+p.g;p.x+=p.vx;p.y+=p.vy;p.r+=p.spin;p.life--;ctx.save();ctx.translate(p.x,p.y);ctx.rotate(p.r);ctx.fillStyle=p.color;ctx.strokeStyle='#080808';ctx.lineWidth=1;if(p.shape===0){ctx.fillRect(-p.size/2,-p.size/4,p.size,p.size/2);ctx.strokeRect(-p.size/2,-p.size/4,p.size,p.size/2)}else if(p.shape===1){ctx.beginPath();ctx.moveTo(0,-p.size/2);ctx.lineTo(p.size/2,p.size/2);ctx.lineTo(-p.size/2,p.size/2);ctx.closePath();ctx.fill();ctx.stroke()}else{ctx.fillRect(-p.size/3,-p.size/2,p.size*.66,p.size)}ctx.restore()});if(pieces.length)frame=requestAnimationFrame(animate);else{frame=null;ctx.clearRect(0,0,innerWidth,innerHeight)}}
function count(){document.querySelectorAll('[data-count]').forEach(el=>{const target=+el.dataset.count;if(+el.textContent===target)return;let v=0,step=Math.max(1,Math.ceil(target/55));function tick(){v=Math.min(target,v+step);el.textContent=v;if(v<target)requestAnimationFrame(tick)}tick()})}
function showToast(text='ŠVENTĖ PALEISTA — PLOJIMAI DONATUI!'){clearTimeout(toastTimer);toast.textContent=text;toast.classList.add('visible');toastTimer=setTimeout(()=>toast.classList.remove('visible'),3200)}
function launch(e){document.body.classList.add('started');liveText.textContent='TIESIOGINIS ETERIS';start.querySelector('span').textContent='ŠVENTĖ PALEISTA!';const r=e?.currentTarget?.getBoundingClientRect();burst(r?r.left+r.width/2:innerWidth/2,r?r.top:innerHeight*.7);count();showToast()}
function showToast(text='SVEIKINIMO BISAS PALEISTAS — PLOJIMAI DONATUI!'){clearTimeout(toastTimer);toast.textContent=text;toast.classList.add('visible');toastTimer=setTimeout(()=>toast.classList.remove('visible'),3200)}
function launch(e){document.body.classList.add('started');liveText.textContent='BISAS PALEISTAS';start.querySelector('span').textContent='SVEIKINIMO BISAS ATIDARYTAS!';const r=e?.currentTarget?.getBoundingClientRect();burst(r?r.left+r.width/2:innerWidth/2,r?r.top:innerHeight*.7);count();showToast()}
function rap(){clearInterval(rapTimer);const lines=[...document.querySelectorAll('#rapText span')];lines.forEach(x=>x.classList.remove('active'));let i=0;const next=()=>{if(i<lines.length)lines[i++].classList.add('active');else clearInterval(rapTimer)};next();rapTimer=setInterval(next,650);showToast('REPAS DONATUI — PUBLIKA PRAŠO BISO!')}
start.addEventListener('click',launch);encore.addEventListener('click',launch);rapButton.addEventListener('click',e=>{rap();const r=e.currentTarget.getBoundingClientRect();burst(r.left+r.width/2,r.top)});addEventListener('resize',resize,{passive:true});resize();const observer=new IntersectionObserver(entries=>{if(entries.some(x=>x.isIntersecting)){count();observer.disconnect()}},{threshold:.3});observer.observe(document.querySelector('.numbers'));})();