Merge version_42 into main #63
@@ -2,59 +2,15 @@
|
||||
|
||||
import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider";
|
||||
import HeroSplitDoubleCarousel from "@/components/sections/hero/HeroSplitDoubleCarousel";
|
||||
import FeatureCardSixteen from "@/components/sections/feature/FeatureCardSixteen";
|
||||
import TestimonialCardSixteen from "@/components/sections/testimonial/TestimonialCardSixteen";
|
||||
import ProductCardFour from "@/components/sections/product/ProductCardFour";
|
||||
import ContactCTA from "@/components/sections/contact/ContactCTA";
|
||||
import FooterSimple from "@/components/sections/footer/FooterSimple";
|
||||
import TestimonialAboutCard from "@/components/sections/about/TestimonialAboutCard";
|
||||
import BlogCardThree from "@/components/sections/blog/BlogCardThree";
|
||||
import { Star, Heart, Users, Camera, Sparkles, Crown, Phone, X, ChevronRight, Play, Instagram, MapPin, User } from "lucide-react";
|
||||
import { Phone, Instagram, MapPin, X } from "lucide-react";
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
|
||||
export default function LandingPage() {
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
const [showBackToTop, setShowBackToTop] = useState(false);
|
||||
const [showGalleryViewMore, setShowGalleryViewMore] = useState(false);
|
||||
const [showShoesViewMore, setShowShoesViewMore] = useState(false);
|
||||
const [showVeilsViewMore, setShowVeilsViewMore] = useState(false);
|
||||
const [modalType, setModalType] = useState<'gallery' | 'shoes' | 'veils' | null>(null);
|
||||
const [lastScrollY, setLastScrollY] = useState(0);
|
||||
const [modalType, setModalType] = useState<'gallery' | null>(null);
|
||||
const galleryRef = useRef<HTMLDivElement>(null);
|
||||
const shoesRef = useRef<HTMLDivElement>(null);
|
||||
const veilsRef = useRef<HTMLDivElement>(null);
|
||||
const galleryButtonContainerRef = useRef<HTMLDivElement>(null);
|
||||
const shoesButtonContainerRef = useRef<HTMLDivElement>(null);
|
||||
const veilsButtonContainerRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
let ticking = false;
|
||||
const handleScroll = () => {
|
||||
if (!ticking && !showModal) {
|
||||
window.requestAnimationFrame(() => {
|
||||
const currentScrollY = window.scrollY;
|
||||
setShowBackToTop(currentScrollY > 300);
|
||||
if (galleryButtonContainerRef.current) {
|
||||
const rect = galleryButtonContainerRef.current.getBoundingClientRect();
|
||||
setShowGalleryViewMore(rect.top < window.innerHeight && rect.bottom > 0);
|
||||
}
|
||||
if (shoesButtonContainerRef.current) {
|
||||
const rect = shoesButtonContainerRef.current.getBoundingClientRect();
|
||||
setShowShoesViewMore(rect.top < window.innerHeight && rect.bottom > 0);
|
||||
}
|
||||
if (veilsButtonContainerRef.current) {
|
||||
const rect = veilsButtonContainerRef.current.getBoundingClientRect();
|
||||
setShowVeilsViewMore(rect.top < window.innerHeight && rect.bottom > 0);
|
||||
}
|
||||
setLastScrollY(currentScrollY);
|
||||
ticking = false;
|
||||
});
|
||||
ticking = true;
|
||||
}
|
||||
};
|
||||
window.addEventListener('scroll', handleScroll);
|
||||
return () => window.removeEventListener('scroll', handleScroll);
|
||||
}, [lastScrollY, showModal]);
|
||||
|
||||
const allDresses = [
|
||||
{ id: "dress-1", name: "Classic Elegance", price: "Starting at $1,200", variant: "White", imageSrc: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3B5MJh3BJx339lVFA4KYjFzlzMX/uploaded-1773897612811-03t85tl3.jpg?_wi=1", imageAlt: "Elegant white wedding dress" },
|
||||
@@ -65,14 +21,13 @@ export default function LandingPage() {
|
||||
|
||||
const renderModal = () => {
|
||||
if (!showModal || !modalType) return null;
|
||||
let items = modalType === 'gallery' ? allDresses : [];
|
||||
return (
|
||||
<div className="fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm p-4">
|
||||
<div className="relative w-full max-w-4xl max-h-[80vh] bg-[var(--background)] rounded-2xl p-6 shadow-2xl flex flex-col">
|
||||
<button onClick={() => setShowModal(false)} className="absolute top-4 right-4 p-2 bg-[var(--card)] rounded-full"><X /></button>
|
||||
<h2 className="text-2xl font-bold mb-6">Dress Details</h2>
|
||||
<div className="grid grid-cols-2 gap-4 overflow-y-auto">
|
||||
{items.map((item) => (
|
||||
{allDresses.map((item) => (
|
||||
<img key={item.id} src={item.imageSrc} alt={item.imageAlt} className="rounded-lg shadow-sm w-full h-auto" />
|
||||
))}
|
||||
</div>
|
||||
@@ -126,14 +81,17 @@ export default function LandingPage() {
|
||||
}
|
||||
}))}
|
||||
/>
|
||||
<div ref={galleryButtonContainerRef} />
|
||||
</div>
|
||||
|
||||
<div id="footer" data-section="footer">
|
||||
<FooterSimple columns={[]} />
|
||||
<FooterSimple
|
||||
columns={[{ title: "Company", items: [{ label: "About Us", href: "#" }] }]}
|
||||
bottomLeftText="© 2025 Maral Bridal"
|
||||
bottomRightText="All rights reserved."
|
||||
/>
|
||||
</div>
|
||||
|
||||
{renderModal()}
|
||||
</ThemeProvider>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user