import { useEffect, useRef } from 'react' import { ArrowDown, Terminal, Zap, Globe, ChevronRight } from 'lucide-react' export default function HeroSection() { const canvasRef = useRef(null) useEffect(() => { const canvas = canvasRef.current if (!canvas) return const ctx = canvas.getContext('2d') let animationId const resize = () => { canvas.width = window.innerWidth canvas.height = window.innerHeight } resize() window.addEventListener('resize', resize) const particles = [] const particleCount = 80 const connectionDistance = 120 for (let i = 0; i < particleCount; i++) { particles.push({ x: Math.random() * canvas.width, y: Math.random() * canvas.height, vx: (Math.random() - 0.5) * 0.5, vy: (Math.random() - 0.5) * 0.5, radius: Math.random() * 2 + 1, }) } const animate = () => { ctx.clearRect(0, 0, canvas.width, canvas.height) for (let i = 0; i < particles.length; i++) { const p = particles[i] p.x += p.vx p.y += p.vy if (p.x < 0 || p.x > canvas.width) p.vx *= -1 if (p.y < 0 || p.y > canvas.height) p.vy *= -1 ctx.beginPath() ctx.arc(p.x, p.y, p.radius, 0, Math.PI * 2) ctx.fillStyle = 'rgba(56, 189, 248, 0.6)' ctx.fill() } for (let i = 0; i < particles.length; i++) { for (let j = i + 1; j < particles.length; j++) { const dx = particles[i].x - particles[j].x const dy = particles[i].y - particles[j].y const dist = Math.sqrt(dx * dx + dy * dy) if (dist < connectionDistance) { ctx.beginPath() ctx.moveTo(particles[i].x, particles[i].y) ctx.lineTo(particles[j].x, particles[j].y) ctx.strokeStyle = `rgba(56, 189, 248, ${0.15 * (1 - dist / connectionDistance)})` ctx.lineWidth = 0.5 ctx.stroke() } } } animationId = requestAnimationFrame(animate) } animate() return () => { cancelAnimationFrame(animationId) window.removeEventListener('resize', resize) } }, []) return (
v2.4.1-stable Open Source

daKI tech .dev

Next-gen developer tools, AI-powered frameworks, and open source utilities. Built for the developers who push boundaries.

TypeScript | Rust | Python
Explore Projects Try Terminal
Scroll
) }