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 (
{/* Gradient Background */}
{/* Confetti Animation - falling from top */}
{confetti.map((piece) => (
))}
{/* Floating confetti particles (subtle) */}
{Array.from({ length: 12 }).map((_, i) => (
))}
{/* Main Card */}
{/* Costco Logo (red) */}
🛒 COSTCO WHOLESALE
{/* Heading */}

Congratulations!

{/* Subheading */}

Your Exclusive Promo Code

{/* Promo Code Box */}
{promoCode}
{/* Copy Button */} {/* Helper text */}

Apply this code during checkout

{/* Footer terms */}

Offer availability, eligibility, and terms may apply.

{/* Toast Notification */} {showToast && (
✓ Promo code copied!
)} {/* Tailwind animations via style tag */}
); }; export default App;