|
| 1 | +"use client" |
| 2 | + |
| 3 | +import { useEffect, useState } from "react" |
| 4 | +import { Heart } from "lucide-react" |
| 5 | + |
| 6 | +interface FloatingHeart { |
| 7 | + id: number |
| 8 | + left: number |
| 9 | + delay: number |
| 10 | + duration: number |
| 11 | + size: number |
| 12 | +} |
| 13 | + |
| 14 | +export function ValentinesBanner() { |
| 15 | + const [hearts, setHearts] = useState<FloatingHeart[]>([]) |
| 16 | + |
| 17 | + useEffect(() => { |
| 18 | + // Create floating hearts on mount |
| 19 | + const newHearts: FloatingHeart[] = Array.from({ length: 15 }, (_, i) => ({ |
| 20 | + id: i, |
| 21 | + left: Math.random() * 100, |
| 22 | + delay: Math.random() * 5, |
| 23 | + duration: 3 + Math.random() * 4, |
| 24 | + size: 12 + Math.random() * 16, |
| 25 | + })) |
| 26 | + setHearts(newHearts) |
| 27 | + }, []) |
| 28 | + |
| 29 | + return ( |
| 30 | + <div className="relative overflow-hidden bg-gradient-to-r from-pink-500/90 via-rose-500/90 to-red-500/90 py-3"> |
| 31 | + {/* Floating hearts background */} |
| 32 | + <div className="absolute inset-0 pointer-events-none"> |
| 33 | + {hearts.map((heart) => ( |
| 34 | + <div |
| 35 | + key={heart.id} |
| 36 | + className="absolute animate-float-up opacity-60" |
| 37 | + style={{ |
| 38 | + left: `${heart.left}%`, |
| 39 | + animationDelay: `${heart.delay}s`, |
| 40 | + animationDuration: `${heart.duration}s`, |
| 41 | + }}> |
| 42 | + <Heart |
| 43 | + className="text-white/40 fill-white/20" |
| 44 | + style={{ width: heart.size, height: heart.size }} |
| 45 | + /> |
| 46 | + </div> |
| 47 | + ))} |
| 48 | + </div> |
| 49 | + |
| 50 | + {/* Banner content */} |
| 51 | + <div className="container mx-auto px-4 relative z-10"> |
| 52 | + <div className="flex items-center justify-center gap-2 text-white font-medium"> |
| 53 | + <Heart className="h-4 w-4 fill-white animate-pulse" /> |
| 54 | + <span className="text-sm md:text-base"> |
| 55 | + Happy Valentine's Day! Fall in love with AI-powered coding |
| 56 | + </span> |
| 57 | + <Heart className="h-4 w-4 fill-white animate-pulse" /> |
| 58 | + </div> |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + ) |
| 62 | +} |
0 commit comments