diff --git a/components/home/HeroSection2.tsx b/components/home/HeroSection2.tsx index 9905d332..d8cf3455 100644 --- a/components/home/HeroSection2.tsx +++ b/components/home/HeroSection2.tsx @@ -13,22 +13,22 @@ const useLocalPerformanceMonitor = () => { const [fps, setFps] = useState(60) const [quality, setQuality] = useState<'high' | 'medium' | 'low'>('high') const { track3DPerformance } = usePerformanceMonitor() - + useEffect(() => { let frameCount = 0 let lastTime = performance.now() - + const measureFPS = () => { frameCount++ const currentTime = performance.now() - + if (currentTime - lastTime >= 1000) { const currentFPS = Math.round((frameCount * 1000) / (currentTime - lastTime)) setFps(currentFPS) - + // Track performance metrics track3DPerformance(currentFPS, quality) - + // Auto-adjust quality based on FPS if (currentFPS < 30 && quality === 'high') { setQuality('medium') @@ -39,23 +39,23 @@ const useLocalPerformanceMonitor = () => { } else if (currentFPS > 55 && quality === 'medium') { setQuality('high') } - + frameCount = 0 lastTime = currentTime } - + requestAnimationFrame(measureFPS) } - + const rafId = requestAnimationFrame(measureFPS) return () => cancelAnimationFrame(rafId) }, [quality, track3DPerformance]) - + return { fps, quality } } // Optimized World component with performance monitoring -const World = dynamic(() => import("@/components/ui/globe").then(mod => mod.World), { +const World = dynamic(() => import("@/components/ui/globe").then(mod => mod.World), { ssr: false, loading: () => (
@@ -65,7 +65,7 @@ const World = dynamic(() => import("@/components/ui/globe").then(mod => mod.Worl }) // Optimized Particles with conditional rendering -const Particles = dynamic(() => import("@/components/ui/particles").then(mod => mod.Particles), { +const Particles = dynamic(() => import("@/components/ui/particles").then(mod => mod.Particles), { ssr: false, loading: () => null }) @@ -73,7 +73,7 @@ const Particles = dynamic(() => import("@/components/ui/particles").then(mod => export function HeroSection2() { const { quality } = useLocalPerformanceMonitor() const [isVisible, setIsVisible] = useState(false) - + // Intersection observer for lazy loading 3D content useEffect(() => { const observer = new IntersectionObserver( @@ -85,15 +85,15 @@ export function HeroSection2() { }, { threshold: 0.1 } ) - + const element = document.getElementById('hero-globe') if (element) { observer.observe(element) } - + return () => observer.disconnect() }, []) - + // Memoized globe configuration with performance-based adjustments const globeConfig = useMemo(() => { const baseConfig = { @@ -118,7 +118,7 @@ export function HeroSection2() { autoRotate: true, autoRotateSpeed: 0.3, // Reduced from 0.5 } - + // Adjust quality based on performance switch (quality) { case 'low': @@ -145,372 +145,372 @@ export function HeroSection2() { // Memoized colors and optimized arc data const colors = useMemo(() => ["#06b6d4", "#3b82f6", "#6366f1"], []) - + // Optimized arc data with performance-based reduction const sampleArcs = useMemo(() => { const allArcs = [ - { - order: 1, - startLat: -19.885592, - startLng: -43.951191, - endLat: -22.9068, - endLng: -43.1729, - arcAlt: 0.1, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 1, - startLat: 28.6139, - startLng: 77.209, - endLat: 3.139, - endLng: 101.6869, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 1, - startLat: -19.885592, - startLng: -43.951191, - endLat: -1.303396, - endLng: 36.852443, - arcAlt: 0.5, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 2, - startLat: 1.3521, - startLng: 103.8198, - endLat: 35.6762, - endLng: 139.6503, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 2, - startLat: 51.5072, - startLng: -0.1276, - endLat: 3.139, - endLng: 101.6869, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 2, - startLat: -15.785493, - startLng: -47.909029, - endLat: 36.162809, - endLng: -115.119411, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 3, - startLat: -33.8688, - startLng: 151.2093, - endLat: 22.3193, - endLng: 114.1694, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 3, - startLat: 21.3099, - startLng: -157.8581, - endLat: 40.7128, - endLng: -74.006, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 3, - startLat: -6.2088, - startLng: 106.8456, - endLat: 51.5072, - endLng: -0.1276, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 4, - startLat: 11.986597, - startLng: 8.571831, - endLat: -15.595412, - endLng: -56.05918, - arcAlt: 0.5, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 4, - startLat: -34.6037, - startLng: -58.3816, - endLat: 22.3193, - endLng: 114.1694, - arcAlt: 0.7, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 4, - startLat: 51.5072, - startLng: -0.1276, - endLat: 48.8566, - endLng: -2.3522, - arcAlt: 0.1, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 5, - startLat: 14.5995, - startLng: 120.9842, - endLat: 51.5072, - endLng: -0.1276, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 5, - startLat: 1.3521, - startLng: 103.8198, - endLat: -33.8688, - endLng: 151.2093, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 5, - startLat: 34.0522, - startLng: -118.2437, - endLat: 48.8566, - endLng: -2.3522, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 6, - startLat: -15.432563, - startLng: 28.315853, - endLat: 1.094136, - endLng: -63.34546, - arcAlt: 0.7, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 6, - startLat: 37.5665, - startLng: 126.978, - endLat: 35.6762, - endLng: 139.6503, - arcAlt: 0.1, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 6, - startLat: 22.3193, - startLng: 114.1694, - endLat: 51.5072, - endLng: -0.1276, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 7, - startLat: -19.885592, - startLng: -43.951191, - endLat: -15.595412, - endLng: -56.05918, - arcAlt: 0.1, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 7, - startLat: 48.8566, - startLng: -2.3522, - endLat: 52.52, - endLng: 13.405, - arcAlt: 0.1, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 7, - startLat: 52.52, - startLng: 13.405, - endLat: 34.0522, - endLng: -118.2437, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 8, - startLat: -8.833221, - startLng: 13.264837, - endLat: -33.936138, - endLng: 18.436529, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 8, - startLat: 49.2827, - startLng: -123.1207, - endLat: 52.3676, - endLng: 4.9041, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 8, - startLat: 1.3521, - startLng: 103.8198, - endLat: 40.7128, - endLng: -74.006, - arcAlt: 0.5, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 9, - startLat: 51.5072, - startLng: -0.1276, - endLat: 34.0522, - endLng: -118.2437, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 9, - startLat: 22.3193, - startLng: 114.1694, - endLat: -22.9068, - endLng: -43.1729, - arcAlt: 0.7, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 9, - startLat: 1.3521, - startLng: 103.8198, - endLat: -34.6037, - endLng: -58.3816, - arcAlt: 0.5, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 10, - startLat: -22.9068, - startLng: -43.1729, - endLat: 28.6139, - endLng: 77.209, - arcAlt: 0.7, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 10, - startLat: 34.0522, - startLng: -118.2437, - endLat: 31.2304, - endLng: 121.4737, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 10, - startLat: -6.2088, - startLng: 106.8456, - endLat: 52.3676, - endLng: 4.9041, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 11, - startLat: 41.9028, - startLng: 12.4964, - endLat: 34.0522, - endLng: -118.2437, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 11, - startLat: -6.2088, - startLng: 106.8456, - endLat: 31.2304, - endLng: 121.4737, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 11, - startLat: 22.3193, - startLng: 114.1694, - endLat: 1.3521, - endLng: 103.8198, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 12, - startLat: 34.0522, - startLng: -118.2437, - endLat: 37.7749, - endLng: -122.4194, - arcAlt: 0.1, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 12, - startLat: 35.6762, - startLng: 139.6503, - endLat: 22.3193, - endLng: 114.1694, - arcAlt: 0.2, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 12, - startLat: 22.3193, - startLng: 114.1694, - endLat: 34.0522, - endLng: -118.2437, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 13, - startLat: 52.52, - startLng: 13.405, - endLat: 22.3193, - endLng: 114.1694, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 13, - startLat: 11.986597, - startLng: 8.571831, - endLat: 35.6762, - endLng: 139.6503, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 13, - startLat: -22.9068, - startLng: -43.1729, - endLat: -34.6037, - endLng: -58.3816, - arcAlt: 0.1, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - { - order: 14, - startLat: -33.936138, - startLng: 18.436529, - endLat: 21.395643, - endLng: 39.883798, - arcAlt: 0.3, - color: colors[Math.floor(Math.random() * (colors.length - 1))], - }, - ] - + { + order: 1, + startLat: -19.885592, + startLng: -43.951191, + endLat: -22.9068, + endLng: -43.1729, + arcAlt: 0.1, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 1, + startLat: 28.6139, + startLng: 77.209, + endLat: 3.139, + endLng: 101.6869, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 1, + startLat: -19.885592, + startLng: -43.951191, + endLat: -1.303396, + endLng: 36.852443, + arcAlt: 0.5, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 2, + startLat: 1.3521, + startLng: 103.8198, + endLat: 35.6762, + endLng: 139.6503, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 2, + startLat: 51.5072, + startLng: -0.1276, + endLat: 3.139, + endLng: 101.6869, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 2, + startLat: -15.785493, + startLng: -47.909029, + endLat: 36.162809, + endLng: -115.119411, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 3, + startLat: -33.8688, + startLng: 151.2093, + endLat: 22.3193, + endLng: 114.1694, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 3, + startLat: 21.3099, + startLng: -157.8581, + endLat: 40.7128, + endLng: -74.006, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 3, + startLat: -6.2088, + startLng: 106.8456, + endLat: 51.5072, + endLng: -0.1276, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 4, + startLat: 11.986597, + startLng: 8.571831, + endLat: -15.595412, + endLng: -56.05918, + arcAlt: 0.5, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 4, + startLat: -34.6037, + startLng: -58.3816, + endLat: 22.3193, + endLng: 114.1694, + arcAlt: 0.7, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 4, + startLat: 51.5072, + startLng: -0.1276, + endLat: 48.8566, + endLng: -2.3522, + arcAlt: 0.1, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 5, + startLat: 14.5995, + startLng: 120.9842, + endLat: 51.5072, + endLng: -0.1276, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 5, + startLat: 1.3521, + startLng: 103.8198, + endLat: -33.8688, + endLng: 151.2093, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 5, + startLat: 34.0522, + startLng: -118.2437, + endLat: 48.8566, + endLng: -2.3522, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 6, + startLat: -15.432563, + startLng: 28.315853, + endLat: 1.094136, + endLng: -63.34546, + arcAlt: 0.7, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 6, + startLat: 37.5665, + startLng: 126.978, + endLat: 35.6762, + endLng: 139.6503, + arcAlt: 0.1, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 6, + startLat: 22.3193, + startLng: 114.1694, + endLat: 51.5072, + endLng: -0.1276, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 7, + startLat: -19.885592, + startLng: -43.951191, + endLat: -15.595412, + endLng: -56.05918, + arcAlt: 0.1, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 7, + startLat: 48.8566, + startLng: -2.3522, + endLat: 52.52, + endLng: 13.405, + arcAlt: 0.1, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 7, + startLat: 52.52, + startLng: 13.405, + endLat: 34.0522, + endLng: -118.2437, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 8, + startLat: -8.833221, + startLng: 13.264837, + endLat: -33.936138, + endLng: 18.436529, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 8, + startLat: 49.2827, + startLng: -123.1207, + endLat: 52.3676, + endLng: 4.9041, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 8, + startLat: 1.3521, + startLng: 103.8198, + endLat: 40.7128, + endLng: -74.006, + arcAlt: 0.5, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 9, + startLat: 51.5072, + startLng: -0.1276, + endLat: 34.0522, + endLng: -118.2437, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 9, + startLat: 22.3193, + startLng: 114.1694, + endLat: -22.9068, + endLng: -43.1729, + arcAlt: 0.7, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 9, + startLat: 1.3521, + startLng: 103.8198, + endLat: -34.6037, + endLng: -58.3816, + arcAlt: 0.5, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 10, + startLat: -22.9068, + startLng: -43.1729, + endLat: 28.6139, + endLng: 77.209, + arcAlt: 0.7, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 10, + startLat: 34.0522, + startLng: -118.2437, + endLat: 31.2304, + endLng: 121.4737, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 10, + startLat: -6.2088, + startLng: 106.8456, + endLat: 52.3676, + endLng: 4.9041, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 11, + startLat: 41.9028, + startLng: 12.4964, + endLat: 34.0522, + endLng: -118.2437, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 11, + startLat: -6.2088, + startLng: 106.8456, + endLat: 31.2304, + endLng: 121.4737, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 11, + startLat: 22.3193, + startLng: 114.1694, + endLat: 1.3521, + endLng: 103.8198, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 12, + startLat: 34.0522, + startLng: -118.2437, + endLat: 37.7749, + endLng: -122.4194, + arcAlt: 0.1, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 12, + startLat: 35.6762, + startLng: 139.6503, + endLat: 22.3193, + endLng: 114.1694, + arcAlt: 0.2, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 12, + startLat: 22.3193, + startLng: 114.1694, + endLat: 34.0522, + endLng: -118.2437, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 13, + startLat: 52.52, + startLng: 13.405, + endLat: 22.3193, + endLng: 114.1694, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 13, + startLat: 11.986597, + startLng: 8.571831, + endLat: 35.6762, + endLng: 139.6503, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 13, + startLat: -22.9068, + startLng: -43.1729, + endLat: -34.6037, + endLng: -58.3816, + arcAlt: 0.1, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + { + order: 14, + startLat: -33.936138, + startLng: 18.436529, + endLat: 21.395643, + endLng: 39.883798, + arcAlt: 0.3, + color: colors[Math.floor(Math.random() * (colors.length - 1))], + }, + ] + // Reduce arcs based on quality for better performance switch (quality) { case 'low': @@ -524,10 +524,10 @@ export function HeroSection2() { return (
- +
- - + +
@@ -535,7 +535,7 @@ export function HeroSection2() {
- + {/* Conditionally render particles based on performance */} {quality !== 'low' && ( @@ -543,62 +543,62 @@ export function HeroSection2() { )} - +
- - + +
- +
-
🚀 - Fueling Devs. Driving Ideas. + Fueling Devs. Driving Ideas.
- +

Empowering the Next Generation of{" "} - Coders + Developers

- +

- Real-world projects, curated challenges, a vibrant dev community. Join thousands of developers building - the future together across the globe. + Connect with verified companies. Participate in hackathons, workshops, and real-world projects. + Advance your career through industry-led opportunities.

- +
@@ -609,11 +609,11 @@ export function HeroSection2() { asChild > -
- - - Join Community - +
+ + + Get Started +
@@ -626,35 +626,35 @@ export function HeroSection2() { { value: "10+", label: "Events Hosted", icon: Sparkles, gradient: "from-purple-500 to-pink-500" }, { value: "95%", label: "Success Rate", icon: Globe, gradient: "from-orange-500 to-red-500" } ].map((stat, index) => ( -
- +
- +
{stat.value}
- +
{stat.label}
- +
))}
- +
@@ -674,8 +674,8 @@ export function HeroSection2() { )}
- - {/* Commented out floating icons for now */} + + {/* Commented out floating icons for now */} {/*
@@ -695,28 +695,28 @@ export function HeroSection2() { { value: "200+", label: "Events Hosted", icon: Sparkles, gradient: "from-purple-500 to-pink-500" }, { value: "95%", label: "Success Rate", icon: Globe, gradient: "from-orange-500 to-red-500" } ].map((stat, index) => ( -
- +
- +
{stat.value}
- +
{stat.label}
- +
))}