"use client" import { useEffect, useRef } from "react" import Image from "next/image" import Link from "next/link" import { Button } from "@/components/ui/button" import { ChevronDown, History } from "lucide-react" export default function HeroSection() { const canvasRef = useRef(null) useEffect(() => { const canvas = canvasRef.current if (!canvas) return const ctx = canvas.getContext("2d") if (!ctx) return canvas.width = window.innerWidth canvas.height = window.innerHeight const particles: { x: number y: number size: number speedX: number speedY: number color: string }[] = [] const createParticles = () => { const particleCount = Math.floor(window.innerWidth / 20) for (let i = 0; i < particleCount; i++) { particles.push({ x: Math.random() * canvas.width, y: Math.random() * canvas.height, size: Math.random() * 1.5 + 0.1, speedX: Math.random() * 0.3 - 0.15, speedY: Math.random() * 0.3 - 0.15, color: `rgba(255, 255, 255, ${Math.random() * 0.2})`, }) } } const connectParticles = () => { for (let i = 0; i < particles.length; i++) { for (let j = i; j < particles.length; j++) { const dx = particles[i].x - particles[j].x const dy = particles[i].y - particles[j].y const distance = Math.sqrt(dx * dx + dy * dy) if (distance < 100) { ctx.beginPath() ctx.strokeStyle = `rgba(255, 255, 255, ${0.05 - distance / 2000})` ctx.lineWidth = 0.2 ctx.moveTo(particles[i].x, particles[i].y) ctx.lineTo(particles[j].x, particles[j].y) ctx.stroke() } } } } const animate = () => { requestAnimationFrame(animate) ctx.clearRect(0, 0, canvas.width, canvas.height) for (let i = 0; i < particles.length; i++) { const p = particles[i] ctx.fillStyle = p.color ctx.beginPath() ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2) ctx.fill() p.x += p.speedX p.y += p.speedY if (p.x > canvas.width) p.x = 0 else if (p.x < 0) p.x = canvas.width if (p.y > canvas.height) p.y = 0 else if (p.y < 0) p.y = canvas.height } connectParticles() } const handleResize = () => { canvas.width = window.innerWidth canvas.height = window.innerHeight particles.length = 0 createParticles() } createParticles() animate() window.addEventListener("resize", handleResize) return () => { window.removeEventListener("resize", handleResize) } }, []) const scrollToAbout = () => { const aboutSection = document.getElementById("about") if (aboutSection) { aboutSection.scrollIntoView({ behavior: "smooth" }) } } return (
Simba Robotics Logo

SIMBA
ROBOTICS

// HLJU ROBOMASTER COMPETITION TEAM 黑龙江大学 RoboMaster 战队

) }