import React, { useState, useEffect } from 'react'; import { Clipboard } from 'lucide-react'; const App: React.FC = () => { const [showToast, setShowToast] = useState(false); const [confetti, setConfetti] = useState<{ id: number; x: number; delay: number; size: number; color: string }[]>([]); const promoCode = 'Q7KM-9XTR-4VPL-82CW'; // Generate confetti pieces useEffect(() => { const colors = ['#FF6B6B', '#FECA57', '#48DBFB', '#FF9FF3', '#54A0FF', '#5F27CD']; const pieces = Array.from({ length: 80 }, (_, i) => ({ id: i, x: Math.random() * 100, delay: Math.random() * 3, size: 6 + Math.random() * 8, color: colors[Math.floor(Math.random() * colors.length)], })); setConfetti(pieces); }, []); // Copy to clipboard const handleCopy = async () => { try { await navigator.clipboard.writeText(promoCode); setShowToast(true); setTimeout(() => setShowToast(false), 2500); } catch (err) { console.error('Failed to copy: ', err); } }; return (
Your Exclusive Promo Code
{/* Promo Code Box */}Apply this code during checkout
{/* Footer terms */}Offer availability, eligibility, and terms may apply.