Skip to content

Commit

Permalink
remove particule pulse
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolivierbouch committed Nov 29, 2024
1 parent 2b98679 commit f510ec4
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions websites/customdomainready/components/dynamic-background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ interface Particle {
dx: number
dy: number
size: number
pulse: number
}

export default function DynamicBackground() {
Expand Down Expand Up @@ -39,8 +38,7 @@ export default function DynamicBackground() {
y: Math.random() * canvas.height,
dx: (Math.random() - 0.5) * 0.1, // Slower movement
dy: (Math.random() - 0.5) * 0.1, // Slower movement
size: Math.random() * 2 + 1,
pulse: Math.random() * 100, // Initial pulse state
size: Math.random() * 2 + 1
})
}
}
Expand All @@ -59,24 +57,12 @@ export default function DynamicBackground() {
if (particle.y < 0) particle.y = canvas.height
if (particle.y > canvas.height) particle.y = 0

// Pulse logic
particle.pulse += 1
if (particle.pulse > 100) particle.pulse = 0

// Particle drawing
ctx.beginPath()
ctx.arc(particle.x, particle.y, particle.size, 0, Math.PI * 2)
ctx.fillStyle = theme === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.5)'
ctx.fill()

// Draw pulses
if (particle.pulse > 95) {
ctx.beginPath()
ctx.arc(particle.x, particle.y, particle.size + 2, 0, Math.PI * 2)
ctx.strokeStyle = theme === 'dark' ? 'rgba(255, 255, 255, 0.5)' : 'rgba(0, 0, 0, 0.5)'
ctx.lineWidth = 1
ctx.stroke()
}
})

requestAnimationFrame(animate)
Expand Down

0 comments on commit f510ec4

Please sign in to comment.