"use client" import { useState, useRef, useEffect } from "react" import Image from "next/image" import { motion, useScroll, useTransform } from "framer-motion" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Textarea } from "@/components/ui/textarea" import { Card } from "@/components/ui/card" import { Camera, Upload, MessageSquare, ChevronRight, ChevronLeft, Send, ArrowRight } from "lucide-react" // Sparkle component const Sparkle = ({ size = "sm", color = "white", delay = 0, duration = 2, className = "" }) => { const sizeMap = { xs: "w-1 h-1", sm: "w-1.5 h-1.5", md: "w-2 h-2", lg: "w-3 h-3", } const colorMap = { white: "bg-white", purple: "bg-purple-400", pink: "bg-pink-400", blue: "bg-blue-400", } return ( ) } // Animation variants const fadeIn = { hidden: { opacity: 0, y: 40 }, visible: { opacity: 1, y: 0, transition: { duration: 0.8, ease: "easeOut" }, }, } const fadeInLeft = { hidden: { opacity: 0, x: -60 }, visible: { opacity: 1, x: 0, transition: { duration: 0.8, ease: "easeOut" }, }, } const fadeInRight = { hidden: { opacity: 0, x: 60 }, visible: { opacity: 1, x: 0, transition: { duration: 0.8, ease: "easeOut" }, }, } const staggerContainer = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.3, }, }, } export default function Home() { const [activeSlide, setActiveSlide] = useState(0) const [messages, setMessages] = useState([ { text: "Hi there! I'm your smart stylist. What's your style preference today?", sender: "bot" }, ]) const [messageInput, setMessageInput] = useState("") const featuresRef = useRef(null) const tryOnRef = useRef(null) const stylistRef = useRef(null) const shopRef = useRef(null) const contactRef = useRef(null) const carouselRef = useRef(null) const { scrollYProgress: featuresScrollProgress } = useScroll({ target: featuresRef, offset: ["start end", "end start"], }) const { scrollYProgress: tryOnScrollProgress } = useScroll({ target: tryOnRef, offset: ["start end", "end start"], }) const { scrollYProgress: stylistScrollProgress } = useScroll({ target: stylistRef, offset: ["start end", "end start"], }) const { scrollYProgress: shopScrollProgress } = useScroll({ target: shopRef, offset: ["start end", "end start"], }) const { scrollYProgress: contactScrollProgress } = useScroll({ target: contactRef, offset: ["start end", "end start"], }) const featuresOpacity = useTransform(featuresScrollProgress, [0, 0.3, 0.7, 1], [0, 1, 1, 0]) const featuresY = useTransform(featuresScrollProgress, [0, 0.3, 0.7, 1], [100, 0, 0, 100]) const tryOnOpacity = useTransform(tryOnScrollProgress, [0, 0.3, 0.7, 1], [0, 1, 1, 0]) const tryOnY = useTransform(tryOnScrollProgress, [0, 0.3, 0.7, 1], [100, 0, 0, 100]) const stylistOpacity = useTransform(stylistScrollProgress, [0, 0.3, 0.7, 1], [0, 1, 1, 0]) const stylistY = useTransform(stylistScrollProgress, [0, 0.3, 0.7, 1], [100, 0, 0, 100]) const shopOpacity = useTransform(shopScrollProgress, [0, 0.3, 0.7, 1], [0, 1, 1, 0]) const shopY = useTransform(shopScrollProgress, [0, 0.3, 0.7, 1], [100, 0, 0, 100]) const contactOpacity = useTransform(contactScrollProgress, [0, 0.3, 0.7, 1], [0, 1, 1, 0]) const contactY = useTransform(contactScrollProgress, [0, 0.3, 0.7, 1], [100, 0, 0, 100]) const products = [ { id: 1, name: "Summer Dress", price: "$49.99", image: "/placeholder.svg?height=300&width=300" }, { id: 2, name: "Casual Jeans", price: "$39.99", image: "/placeholder.svg?height=300&width=300" }, { id: 3, name: "Elegant Blouse", price: "$29.99", image: "/placeholder.svg?height=300&width=300" }, { id: 4, name: "Formal Suit", price: "$99.99", image: "/placeholder.svg?height=300&width=300" }, { id: 5, name: "Winter Coat", price: "$79.99", image: "/placeholder.svg?height=300&width=300" }, ] const recommendedItems = [ { id: 1, name: "Striped T-Shirt", price: "$24.99", image: "/placeholder.svg?height=150&width=150" }, { id: 2, name: "Denim Jacket", price: "$59.99", image: "/placeholder.svg?height=150&width=150" }, { id: 3, name: "Black Pants", price: "$34.99", image: "/placeholder.svg?height=150&width=150" }, ] // Auto-scroll carousel useEffect(() => { const interval = setInterval(() => { setActiveSlide((prev) => (prev === products.length - 1 ? 0 : prev + 1)) }, 3000) return () => clearInterval(interval) }, [products.length]) const nextSlide = () => { setActiveSlide((prev) => (prev === products.length - 1 ? 0 : prev + 1)) } const prevSlide = () => { setActiveSlide((prev) => (prev === 0 ? products.length - 1 : prev - 1)) } const sendMessage = () => { if (messageInput.trim()) { setMessages([...messages, { text: messageInput, sender: "user" }]) // Simulate bot response setTimeout(() => { setMessages((prev) => [ ...prev, { text: "Based on your style, I recommend checking out our new collection of casual wear. Here are some items that might interest you.", sender: "bot", }, ]) }, 1000) setMessageInput("") } } const scrollToSection = (ref) => { ref.current.scrollIntoView({ behavior: "smooth" }) } return (
{/* Hero Section */}
{/* Sparkle effects */}
{/* Large sparkles */} {[...Array(20)].map((_, i) => ( 0.7 ? "lg" : Math.random() > 0.5 ? "md" : "sm"} color={Math.random() > 0.7 ? "white" : Math.random() > 0.5 ? "purple" : "pink"} delay={Math.random() * 5} duration={Math.random() * 2 + 1.5} /> ))} {/* Floating light particles */} {[...Array(30)].map((_, i) => ( ))} {/* Glowing orbs */} {[...Array(5)].map((_, i) => ( ))}
MiRRA {/* Logo sparkles */} {[...Array(8)].map((_, i) => ( ))} style in sight
{/* Overview Section */}
Welcome to MiRRA
MiRRA Overview

Redefining Fashion Experience

MiRRA combines cutting-edge technology with fashion expertise to create a personalized shopping experience. Our platform offers virtual try-on capabilities and AI-powered styling recommendations to help you discover your perfect look without leaving your home.

Virtual Try-On

See how clothes look on you before buying

Smart Stylist

AI-powered fashion advice tailored to you

{/* Virtual Try-On Section */}
Virtual Try-On

Upload Your Photo

See how our clothes look on you by uploading your photo or using your camera. Our AI will fit the garments to your body shape and size.

Drag and drop your photo here or use the buttons above

Try-On Results

Virtual Try-On Result
{[1, 2, 3, 4].map((item) => (
{`Outfit
))}
{/* Smart Stylist Section */}
Smart Stylist

Chat with Your Personal Stylist

{messages.map((message, index) => (
{message.text}
))}
setMessageInput(e.target.value)} onKeyPress={(e) => e.key === "Enter" && sendMessage()} className="flex-grow bg-gray-800 border-purple-700 text-white" />

Recommended for You

{recommendedItems.map((item) => (
{item.name}

{item.name}

{item.price}

))}
{/* Shop Section */}
Our Shop
{products.map((product) => (
{product.name}

{product.name}

{product.price}

))}
{products.map((_, index) => (
{/* Contact Section */}
Contact Us

Get in Touch

Have questions about our products or services? We'd love to hear from you. Fill out the form and our team will get back to you as soon as possible.

contact@mirra.com
+1 (555) 123-4567
123 Fashion Street, New York, NY 10001