Skip to content

Commit e655096

Browse files
devsart95claude
andcommitted
feat(particles): repulse hover + stars + wobble + constellation links
- Hover: partículas huyen del cursor con repulse (factor 4, radio 120px) - Click/tap: genera 5 partículas en el punto tocado - Formas: 75% círculos + 25% estrellas de 4 puntas (inset 0.45) - Wobble: oscilación orgánica en todas las partículas - Links: red de constelaciones tenue (indigo, opacity 0.12) - Colores: cyan, indigo, blanco, lavanda, cian claro, amarillo pálido - Opacity + size animation para twinkle y pulso Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 915f562 commit e655096

1 file changed

Lines changed: 39 additions & 23 deletions

File tree

src/components/StarfieldCanvas.tsx

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,59 +6,80 @@ import type { ISourceOptions } from '@tsparticles/engine'
66
const OPTIONS: ISourceOptions = {
77
fpsLimit: 60,
88
background: { color: { value: 'transparent' } },
9+
detectRetina: true,
10+
911
particles: {
10-
number: { value: 160 },
12+
number: { value: 130 },
13+
1114
color: {
12-
value: ['#ffffff', '#bfdbfe', '#a5f3fc', '#e9d5ff', '#fef9c3', '#c7d2fe'],
15+
value: ['#ffffff', '#38bdf8', '#818cf8', '#c4b5fd', '#67e8f9', '#fef9c3'],
16+
},
17+
18+
shape: {
19+
type: ['circle', 'circle', 'circle', 'star'], // 75% circles, 25% stars
20+
options: {
21+
star: { sides: 4, inset: 0.45 },
22+
},
1323
},
14-
shape: { type: 'circle' },
24+
1525
opacity: {
16-
value: { min: 0.04, max: 0.9 },
26+
value: { min: 0.06, max: 0.95 },
1727
animation: {
1828
enable: true,
19-
speed: { min: 0.3, max: 1.8 },
29+
speed: { min: 0.4, max: 2 },
2030
sync: false,
2131
},
2232
},
33+
2334
size: {
24-
value: { min: 0.2, max: 2.2 },
35+
value: { min: 0.4, max: 2.8 },
2536
animation: {
2637
enable: true,
27-
speed: 1.2,
38+
speed: { min: 0.8, max: 2.5 },
2839
sync: false,
2940
},
3041
},
42+
3143
links: {
3244
enable: true,
33-
distance: 150,
45+
distance: 140,
3446
color: '#818cf8',
35-
opacity: 0.1,
47+
opacity: 0.12,
3648
width: 0.7,
3749
},
50+
51+
wobble: {
52+
enable: true,
53+
distance: 8,
54+
speed: { angle: 8, move: 10 },
55+
},
56+
3857
move: {
3958
enable: true,
40-
speed: { min: 0.05, max: 0.45 },
59+
speed: { min: 0.08, max: 0.5 },
4160
direction: 'none',
4261
random: true,
4362
straight: false,
4463
outModes: { default: 'out' },
4564
},
4665
},
66+
4767
interactivity: {
4868
detectsOn: 'window',
4969
events: {
50-
onHover: { enable: true, mode: 'grab' },
51-
onClick: { enable: true, mode: 'push' },
70+
onHover: { enable: true, mode: 'repulse' },
71+
onClick: { enable: true, mode: 'push' },
5272
},
5373
modes: {
54-
grab: {
55-
distance: 200,
56-
links: { opacity: 0.55, color: '#38bdf8' },
74+
repulse: {
75+
distance: 120,
76+
duration: 0.5,
77+
factor: 4,
78+
speed: 1,
5779
},
58-
push: { quantity: 3 },
80+
push: { quantity: 5 },
5981
},
6082
},
61-
detectRetina: true,
6283
}
6384

6485
export function StarfieldCanvas() {
@@ -76,12 +97,7 @@ export function StarfieldCanvas() {
7697
<Particles
7798
id="tsparticles"
7899
options={OPTIONS}
79-
style={{
80-
position: 'fixed',
81-
inset: 0,
82-
zIndex: 0,
83-
pointerEvents: 'none',
84-
}}
100+
style={{ position: 'fixed', inset: 0, zIndex: 0, pointerEvents: 'none' }}
85101
/>
86102
)
87103
}

0 commit comments

Comments
 (0)