|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import { Button } from "@/components/ui/button"; |
| 4 | +import { motion, Variants } from "framer-motion"; |
| 5 | +import { ArrowRight, Trophy } from "lucide-react"; |
| 6 | +import Link from "next/link"; |
| 7 | + |
| 8 | +const container: Variants = { |
| 9 | + hidden: { opacity: 0 }, |
| 10 | + show: { |
| 11 | + opacity: 1, |
| 12 | + transition: { |
| 13 | + staggerChildren: 0.1, |
| 14 | + delayChildren: 0.3, |
| 15 | + }, |
| 16 | + }, |
| 17 | +}; |
| 18 | + |
| 19 | +const item: Variants = { |
| 20 | + hidden: { opacity: 0, y: 20 }, |
| 21 | + show: { |
| 22 | + opacity: 1, |
| 23 | + y: 0, |
| 24 | + transition: { |
| 25 | + type: "spring", |
| 26 | + stiffness: 100, |
| 27 | + damping: 15, |
| 28 | + }, |
| 29 | + }, |
| 30 | +}; |
| 31 | + |
| 32 | +const HeroSection = () => { |
| 33 | + return ( |
| 34 | + <section className="relative overflow-hidden bg-zinc-50 dark:bg-neutral-900/80"> |
| 35 | + {/* Accent Corner Lines */} |
| 36 | + <div className="hidden sm:block absolute top-10 left-10 h-16 w-16 border-t-2 border-l-2 border-emerald-400 dark:border-violet-500 opacity-60 rounded-tl-lg" /> |
| 37 | + <div className="hidden sm:block absolute bottom-10 right-10 h-20 w-20 border-b-2 border-r-2 border-emerald-400 dark:border-violet-500 opacity-60 rounded-br-lg" /> |
| 38 | + |
| 39 | + {/* Geometric Shape Decorations */} |
| 40 | + <div className="absolute top-1/3 -left-6 w-24 h-24 border border-emerald-300 dark:border-violet-400/40 rounded-full opacity-30" /> |
| 41 | + <div className="absolute bottom-1/4 -right-8 w-20 h-20 border border-emerald-300 dark:border-violet-400/40 rotate-12 opacity-30" /> |
| 42 | + |
| 43 | + {/* Hero Content */} |
| 44 | + <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-20 md:py-32 relative"> |
| 45 | + <motion.div |
| 46 | + className="text-center" |
| 47 | + initial="hidden" |
| 48 | + animate="show" |
| 49 | + variants={container} |
| 50 | + > |
| 51 | + {/* Badge */} |
| 52 | + <motion.div |
| 53 | + variants={item} |
| 54 | + className="inline-flex items-center gap-2 bg-emerald-100 text-emerald-700 dark:bg-violet-700/30 dark:text-violet-300 text-sm font-medium px-4 py-2 rounded-full mb-6" |
| 55 | + > |
| 56 | + <Trophy className="h-4 w-4" /> |
| 57 | + <span>Fast & Secure Converter</span> |
| 58 | + </motion.div> |
| 59 | + |
| 60 | + {/* Heading */} |
| 61 | + <motion.h1 |
| 62 | + className="text-4xl sm:text-6xl font-bold tracking-tight max-w-4xl mx-auto leading-tight mb-6 text-slate-900 dark:text-neutral-100" |
| 63 | + variants={item} |
| 64 | + > |
| 65 | + Your Ultimate |
| 66 | + <span className="text-emerald-600 dark:text-violet-500"> SVG </span> |
| 67 | + Companion |
| 68 | + </motion.h1> |
| 69 | + |
| 70 | + {/* Subtext */} |
| 71 | + <motion.p |
| 72 | + className="text-lg text-slate-600 dark:text-neutral-400 max-w-3xl mx-auto lg:text-xl mb-10" |
| 73 | + variants={item} |
| 74 | + > |
| 75 | + Effortlessly transform your PNG, JPG, and other raster images into |
| 76 | + high-quality, editable SVG vectors with a single click. Perfect for |
| 77 | + any creator. |
| 78 | + </motion.p> |
| 79 | + |
| 80 | + <motion.div |
| 81 | + className="flex flex-col sm:flex-row gap-4 justify-center" |
| 82 | + variants={{ |
| 83 | + hidden: { opacity: 0, y: 20 }, |
| 84 | + show: { |
| 85 | + opacity: 1, |
| 86 | + y: 0, |
| 87 | + transition: { |
| 88 | + staggerChildren: 0.1, |
| 89 | + delayChildren: 0.4, |
| 90 | + }, |
| 91 | + }, |
| 92 | + }} |
| 93 | + > |
| 94 | + <motion.div |
| 95 | + whileHover={{ scale: 1.05 }} |
| 96 | + whileTap={{ scale: 0.98 }} |
| 97 | + variants={item} |
| 98 | + > |
| 99 | + <Link href="/generate"> |
| 100 | + <Button |
| 101 | + size="lg" |
| 102 | + className="gap-2 bg-emerald-600 text-white hover:bg-emerald-700 dark:bg-violet-600 dark:hover:bg-violet-700 transition-transform cursor-pointer" |
| 103 | + > |
| 104 | + Upload Image & Convert |
| 105 | + <ArrowRight className="h-5 w-5" /> |
| 106 | + </Button> |
| 107 | + </Link> |
| 108 | + </motion.div> |
| 109 | + </motion.div> |
| 110 | + </motion.div> |
| 111 | + </div> |
| 112 | + </section> |
| 113 | + ); |
| 114 | +}; |
| 115 | + |
| 116 | +export default HeroSection; |
0 commit comments