Skip to content

Commit b5e4b6f

Browse files
committed
feat: add animation to starfield circles for enhanced visual effects
1 parent b271128 commit b5e4b6f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/card-renderer.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ export class CardRenderer {
3636
const y = Math.floor(seededRandom() * height);
3737
const r = (seededRandom() * 1 + 0.5).toFixed(1);
3838
const opacity = (seededRandom() * 0.7 + 0.3).toFixed(1);
39-
return `<circle cx="${x}" cy="${y}" r="${r}" fill="${textColor}" opacity="${opacity}"/>`;
39+
const duration = (seededRandom() * 3 + 2).toFixed(1);
40+
const delay = (seededRandom() * 5).toFixed(1);
41+
return `<circle cx="${x}" cy="${y}" r="${r}" fill="${textColor}" opacity="${opacity}">
42+
<animate attributeName="opacity" values="${opacity};${(parseFloat(opacity) * 0.3).toFixed(1)};${opacity}" dur="${duration}s" begin="${delay}s" repeatCount="indefinite" />
43+
</circle>`;
4044
}).join('');
4145

4246
this.STARFIELD_CACHE.set(cacheKey, stars);

0 commit comments

Comments
 (0)