import { useState, useCallback } from 'react'; import Scene from '../components/3d/Scene'; import confetti from 'canvas-confetti'; export default function Inauguration() { const [isCelebrating, setIsCelebrating] = useState(false); const [showWelcome, setShowWelcome] = useState(false); const [isHovered, setIsHovered] = useState(false); const triggerConfetti = useCallback(() => { const duration = 5 * 1000; const animationEnd = Date.now() + duration; const defaults = { startVelocity: 30, spread: 360, ticks: 60, zIndex: 0 }; const randomInRange = (min: number, max: number) => Math.random() * (max - min) + min; const interval: any = setInterval(function() { const timeLeft = animationEnd - Date.now(); if (timeLeft <= 0) { return clearInterval(interval); } const particleCount = 50 * (timeLeft / duration); const colors = ['#2E90FA', '#53B1FD', '#84CAFF', '#1570EF', '#175CD3']; confetti({ ...defaults, particleCount, origin: { x: randomInRange(0.1, 0.3), y: Math.random() - 0.2 }, colors: colors, shapes: ['circle', 'square'], scalar: randomInRange(0.8, 1.5) }); confetti({ ...defaults, particleCount, origin: { x: randomInRange(0.7, 0.9), y: Math.random() - 0.2 }, colors: colors, shapes: ['circle', 'square'], scalar: randomInRange(0.8, 1.5) }); }, 250); }, []); const handleKickstart = () => { setIsCelebrating(true); triggerConfetti(); setTimeout(() => { setShowWelcome(true); }, 2000); }; return (
Freshness Delivered
Click to celebrate our launch in Mahabubnagar
Bringing fresh groceries to your doorstep