Fix meteor animation: animate transform instead of static translate

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ltadeu6 2026-06-07 10:17:35 -03:00
parent 1e9b63e577
commit 238c56eba4
No known key found for this signature in database
GPG key ID: FB9FDAB6B6F3418D

View file

@ -122,10 +122,10 @@ html, body {
animation: meteorFall linear forwards;
}
@keyframes meteorFall {
0% { opacity: 0; }
0% { opacity: 0; transform: rotate(var(--rot)) translateY(0); }
5% { opacity: 1; }
85% { opacity: 1; }
100% { opacity: 0; }
100% { opacity: 0; transform: rotate(var(--rot)) translateY(var(--dist)); }
}
/* ============================================================
@ -911,13 +911,13 @@ function spawnMeteor() {
const dur = 1.2 + Math.random() * 1.8; // seconds
const color = `rgba(${180+Math.random()*75|0},${180+Math.random()*75|0},255,0.9)`;
el.style.cssText = `
--rot:${angle}deg;
--dist:${(window.innerHeight + len * 2)}px;
left:${x}%; top:${-len}px;
height:${len}px;
background:linear-gradient(to bottom, transparent, ${color});
transform:rotate(${angle}deg);
animation-duration:${dur}s;
animation-name:meteorFall;
translate:0 ${(window.innerHeight + len) * 1.3}px;
`;
document.querySelector('.scene').appendChild(el);
setTimeout(() => el.remove(), dur * 1000);