diff --git a/src/app/page.tsx b/src/app/page.tsx index 5f01fd5..98a5d35 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -7,9 +7,9 @@ import Section from "@/components/Section"; import Button from "@/components/Button"; import BannerSlider from "@/components/BannerSlider"; import Image from "next/image"; -import { useState, useEffect, useRef, useCallback, useMemo } from "react"; -import { AnimatePresence } from "framer-motion"; -import { useInstagram } from "@/hooks/useInstagram"; +import { useState, useEffect, useRef, useCallback } from "react"; +import ProductCategory from "@/components/ProductCategory"; +import SocialMedia from "@/components/SocialMedia"; // Premium animation variants const fadeInUp = { @@ -46,14 +46,6 @@ const categories = [ "Dragees", "Gelatos", ]; -const categoryImages = [ - "/categories/c1.svg", - "/categories/c2.svg", - "/categories/c3.svg", - "/categories/c4.svg", - "/categories/c5.svg", - "/categories/c6.svg", -]; const partnerImages = [ "/partners/p1.svg", @@ -127,14 +119,18 @@ export default function Home() { return () => clearInterval(timer); }, []); - const { posts, loading, error, isTokenExpired } = useInstagram(); - // Memoize expensive components - const BrandStorySection = useMemo( - () => ( + + return ( +
+
+ + + {/* Brand Story */} +
-
- {/* Left Column - Text */} +
+ {/* Brand Story - Left Text */} - - {/* Right Column - Image */} + {/* Brand Story - Right Image */} - {/* Premium overlay for depth */}
-
-
- ), - [] - ); - return ( -
-
- - - {BrandStorySection} - - {/* Chocolate Tempering Section */} -
-
- {/* Left Column - Image */} + {/* Chocolate Tempering - Left Video */}
- {/* Product Categories Section */} -
-
- {/* Left Column - Categories List */} - -
    - {categories.map((category, idx) => ( - - - - ))} -
-
- - {/* Right Column - Large Category Image (desktop only) */} - - - - - -
-
- + {/* Social Media Call to Action */} -
- -

- Follow us on Instagram -

-
- -
- {loading ? ( - <> - {[1, 2, 3].map((i) => ( - - ))} - - ) : error ? ( - isTokenExpired ? ( -
- -
- 🔗 -
-

- Instagram Connection Expired -

-

- Our Instagram connection needs to be refreshed. We're - working on getting it back up! -

-
- In the meantime, follow us @mozimo_chocolate -
-
-
- ) : ( - <> - {/* Left Block - Chocolate Spread Jar */} - -
- -
- 🍫 -
-
-
- MOZIMO -
-
- SINGLE ORIGIN HAZELNUT SPREAD 45% -
-
-
-
-
- - {/* Middle Block - Magazine Article */} - -
-
- 🍫 -
-
-
- 🍰 -
-
- 👨‍🍳 -
-
-
-

- By RUPALI DEAN -

-

- - MOZIMO'S CHOCOLATE PIE BY PRIYANKA GUPTA - -

-

- isolat[ing] beans to not only single ori- but also to - single farms so as to express unique complexity. -

-
-
-
- - {/* Right Block - World Chocolate Day */} - -
-
-

- World Chocolate Day -

-

- Celebrating the art of chocolate making -

-
-
-
🍫
-

- Join us in celebrating the world's favorite treat -

-
-
-
- - ) - ) : ( - posts?.slice(0, 3).map((post, index) => ( - - - -
+ {/* In the Spotlight Section */}
@@ -785,7 +447,6 @@ export default function Home() { animate={{ x: `-${spotlightIndex * 152}px` }} transition={{ type: "spring", stiffness: 80, damping: 18 }} > - {/* Create 12 tiles (3 sets of 4 logos) */} {Array(12) .fill(0) .map((_, i) => { @@ -795,7 +456,10 @@ export default function Home() { (null); - + // Auto-advance slider useEffect(() => { const timer = setInterval(() => { @@ -37,7 +37,7 @@ export default function BannerSlider() { const goToPrevious = () => { setDirection(-1); - setCurrentIndex((prevIndex) => + setCurrentIndex((prevIndex) => prevIndex === 0 ? banners.length - 1 : prevIndex - 1 ); }; @@ -49,7 +49,7 @@ export default function BannerSlider() { const slideVariants = { enter: (direction: number) => ({ - x: direction > 0 ? '100%' : '-100%', + x: direction > 0 ? "100%" : "-100%", opacity: 1, }), center: { @@ -57,9 +57,9 @@ export default function BannerSlider() { opacity: 1, }, exit: (direction: number) => ({ - x: direction < 0 ? '100%' : '-100%', + x: direction < 0 ? "100%" : "-100%", opacity: 1, - }) + }), }; const swipeConfidenceThreshold = 10000; @@ -76,7 +76,7 @@ export default function BannerSlider() { }; return ( -
{ @@ -105,7 +105,7 @@ export default function BannerSlider() { exit="exit" transition={{ x: { type: "spring", stiffness: 300, damping: 30 }, - duration: 0.4 + duration: 0.4, }} drag="x" dragConstraints={{ left: 0, right: 0 }} @@ -128,41 +128,43 @@ export default function BannerSlider() { className="object-cover img-premium" draggable={false} priority={currentIndex === 0} - loading={currentIndex === 0 ? 'eager' : 'lazy'} + loading={currentIndex === 0 ? "eager" : "lazy"} sizes="100vw" quality={85} /> - + {/* Premium overlay with gradient */}
{/* Premium Shop Now Button */} -
- - Shop Now -
- -
+ {currentIndex === 0 && ( +
+ + Shop Now +
+ +
+ )} {/* Premium Navigation Arrows - Hidden on mobile */} @@ -179,8 +181,18 @@ export default function BannerSlider() { whileTap={{ scale: 0.95 }} aria-label="Previous banner" > - - + +
@@ -195,8 +207,18 @@ export default function BannerSlider() { whileTap={{ scale: 0.95 }} aria-label="Next banner" > - - + + @@ -212,8 +234,18 @@ export default function BannerSlider() { whileTap={{ scale: 0.95 }} aria-label="Previous banner" > - - + + @@ -224,22 +256,32 @@ export default function BannerSlider() { whileTap={{ scale: 0.95 }} aria-label="Next banner" > - - + +
{/* Premium Dots Indicator */} -
+
{banners.map((_, index) => ( goToSlide(index)} className={`w-2 h-2 md:w-3 md:h-3 rounded-full transition-all duration-300 ${ index === currentIndex - ? 'bg-white scale-110 shadow-glow' - : 'bg-white/50 hover:bg-white/70 hover:scale-110' + ? "bg-white scale-110 shadow-glow" + : "bg-white/50 hover:bg-white/70 hover:scale-110" }`} whileHover={{ scale: 1.2 }} whileTap={{ scale: 0.9 }} @@ -260,4 +302,4 @@ export default function BannerSlider() {
); -} \ No newline at end of file +} diff --git a/src/components/Header.tsx b/src/components/Header.tsx index cf3ac80..8702853 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -60,7 +60,7 @@ export default function Header() { <> {/* Mobile Header - Only visible on mobile */} -