'use client'; import { useEffect, useRef } from 'react'; import Navigation from '../../../components/Navigation'; import FloatingLanguageSwitcher from '../../../components/FloatingLanguageSwitcher'; import Footer from '../../../components/Footer'; import { Locale } from '../../../lib/i18n'; import { getTranslations } from '../../../lib/translations'; import { updateDocumentMeta } from '../../../lib/seo-utils'; // Enhanced Particle Background Component for Products function ProductParticleBackground() { const canvasRef = useRef(null); useEffect(() => { const canvas = canvasRef.current; if (!canvas) return; const ctx = canvas.getContext('2d'); if (!ctx) return; // Set canvas size const resizeCanvas = () => { canvas.width = window.innerWidth; canvas.height = window.innerHeight; }; resizeCanvas(); window.addEventListener('resize', resizeCanvas); // Enhanced particle system with different types const particles: Array<{ x: number; y: number; vx: number; vy: number; size: number; opacity: number; type: 'circle' | 'square' | 'triangle'; color: string; rotation: number; rotationSpeed: number; }> = []; const colors = ['#22c55e', '#3b82f6', '#f59e0b', '#ef4444', '#8b5cf6']; // Create particles for (let i = 0; i < 80; i++) { particles.push({ x: Math.random() * canvas.width, y: Math.random() * canvas.height, vx: (Math.random() - 0.5) * 0.8, vy: (Math.random() - 0.5) * 0.8, size: Math.random() * 4 + 2, opacity: Math.random() * 0.6 + 0.2, type: ['circle', 'square', 'triangle'][Math.floor(Math.random() * 3)] as | 'circle' | 'square' | 'triangle', color: colors[Math.floor(Math.random() * colors.length)], rotation: Math.random() * Math.PI * 2, rotationSpeed: (Math.random() - 0.5) * 0.02, }); } // Animation loop const animate = () => { ctx.clearRect(0, 0, canvas.width, canvas.height); particles.forEach((particle) => { // Update position particle.x += particle.vx; particle.y += particle.vy; particle.rotation += particle.rotationSpeed; // Wrap around edges if (particle.x < -particle.size) particle.x = canvas.width + particle.size; if (particle.x > canvas.width + particle.size) particle.x = -particle.size; if (particle.y < -particle.size) particle.y = canvas.height + particle.size; if (particle.y > canvas.height + particle.size) particle.y = -particle.size; // Set style ctx.fillStyle = particle.color; ctx.globalAlpha = particle.opacity; ctx.save(); ctx.translate(particle.x, particle.y); ctx.rotate(particle.rotation); // Draw different shapes ctx.beginPath(); switch (particle.type) { case 'circle': ctx.arc(0, 0, particle.size, 0, Math.PI * 2); break; case 'square': ctx.rect( -particle.size, -particle.size, particle.size * 2, particle.size * 2, ); break; case 'triangle': ctx.moveTo(0, -particle.size); ctx.lineTo(-particle.size, particle.size); ctx.lineTo(particle.size, particle.size); ctx.closePath(); break; } ctx.fill(); ctx.restore(); }); // Draw connections with different colors particles.forEach((particle, i) => { particles.slice(i + 1).forEach((otherParticle) => { const dx = particle.x - otherParticle.x; const dy = particle.y - otherParticle.y; const distance = Math.sqrt(dx * dx + dy * dy); if (distance < 120) { ctx.beginPath(); ctx.moveTo(particle.x, particle.y); ctx.lineTo(otherParticle.x, otherParticle.y); const gradient = ctx.createLinearGradient( particle.x, particle.y, otherParticle.x, otherParticle.y, ); gradient.addColorStop(0, particle.color); gradient.addColorStop(1, otherParticle.color); ctx.strokeStyle = gradient; ctx.globalAlpha = 0.1 * (1 - distance / 120); ctx.lineWidth = 1; ctx.stroke(); } }); }); ctx.globalAlpha = 1; requestAnimationFrame(animate); }; animate(); return () => { window.removeEventListener('resize', resizeCanvas); }; }, []); return ( ); } export default function ProductsPage({ params }: { params: { locale: Locale } }) { const t = getTranslations(params.locale); // Update meta tags when locale changes useEffect(() => { updateDocumentMeta(params.locale); }, [params.locale]); return (
{/* Enhanced Particle Background */} {/* Navigation */} {/* Floating Language Switcher */} {/* Hero Section */}

{t.products?.title || 'Our Products'}

{t.products?.subtitle || 'Discover innovative solutions for a sustainable future'}

{/* Featured Product */}
Featured Product

{t.products?.featured?.title || 'Eco-Life Simulator'}

{t.products?.featured?.description || 'Experience the ultimate environmental simulation game'}

{(t.products?.featured?.features || []).map( (feature, index) => (
{feature}
), )}
{t.products?.featured?.price || '$29.99'}
{/* Product mockup with particles */}

Interactive Demo

Experience the simulation

{/* Product Categories */}

{t.products.categories.games.title}

{t.products.categories.games.description}

{t.products.categories.tools.title}

{t.products.categories.tools.description}

{t.products.categories.education.title}

{t.products.categories.education.description}

{/* Product Grid */}
{/* Product 1 */}

{t.products.productList.ecoSimulator.title}

{t.products.productList.ecoSimulator.description}

{t.products.productList.ecoSimulator.price}
{/* Product 2 */}

{t.products.productList.carbonTracker.title}

{t.products.productList.carbonTracker.description}

{t.products.productList.carbonTracker.price}
{/* Product 3 */}

{t.products.productList.greenGuide.title}

{t.products.productList.greenGuide.description}

{t.products.productList.greenGuide.price}
{/* Product 4 */}

{t.products.productList.ecoChallenge.title}

{t.products.productList.ecoChallenge.description}

{t.products.productList.ecoChallenge.price}
{/* CTA Section */}

Ready to Make a Difference?

Join thousands of users already making sustainable choices with our products.

{/* Footer */}
); }