From c1d421cc74ed185b3434259454a44778ff783995 Mon Sep 17 00:00:00 2001 From: kudindmitriy Date: Wed, 15 Apr 2026 15:45:26 +0300 Subject: [PATCH] Bob AI: In the hero section, replace the static image with an image --- src/App.tsx | 51 ++++++++++++++------ src/components/sections/hero/ImageSlider.tsx | 37 ++++++++++++++ src/index.css | 4 ++ src/styles/animations.css | 34 +++++++++++++ 4 files changed, 111 insertions(+), 15 deletions(-) create mode 100644 src/components/sections/hero/ImageSlider.tsx diff --git a/src/App.tsx b/src/App.tsx index 14a1210..fe62d6e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,7 +2,7 @@ import AboutFeaturesSplit from '@/components/sections/about/AboutFeaturesSplit'; import ContactFormMap from '@/components/sections/contact/ContactFormMap'; import FeaturesDetailedCards from '@/components/sections/features/FeaturesDetailedCards'; import FooterBasic from '@/components/sections/footer/FooterBasic'; -import HeroSplit from '@/components/sections/hero/HeroSplit'; +import ImageSlider from '@/components/sections/hero/ImageSlider'; import NavbarCentered from '@/components/ui/NavbarCentered'; import TestimonialMarqueeCards from '@/components/sections/testimonial/TestimonialMarqueeCards'; import { Clock, Flame, Wheat } from "lucide-react"; @@ -27,20 +27,41 @@ export default function App() {
- +
+
+
+ Freshly Baked Every Morning +

Artisanal Breads & Pastries

+

+ Experience the warmth of traditional baking. We use only organic, locally-sourced ingredients to craft our daily fresh sourdough, croissants, and gourmet desserts. +

+ +
+
+
+
+ +
+
+

Artisan Bakery

+
+
+
+
+
diff --git a/src/components/sections/hero/ImageSlider.tsx b/src/components/sections/hero/ImageSlider.tsx new file mode 100644 index 0000000..20133e4 --- /dev/null +++ b/src/components/sections/hero/ImageSlider.tsx @@ -0,0 +1,37 @@ +"use client"; + +import { useState, useEffect } from "react"; + +type ImageSliderProps = { + imageSrcs: string[]; + interval?: number; +}; + +const ImageSlider = ({ imageSrcs, interval = 3000 }: ImageSliderProps) => { + const [currentIndex, setCurrentIndex] = useState(0); + + useEffect(() => { + const timer = setInterval(() => { + setCurrentIndex((prevIndex) => (prevIndex + 1) % imageSrcs.length); + }, interval); + + return () => clearInterval(timer); + }, [imageSrcs.length, interval]); + + return ( +
+ {imageSrcs.map((src, index) => ( + {`Slide + ))} +
+ ); +}; + +export default ImageSlider; \ No newline at end of file diff --git a/src/index.css b/src/index.css index 5c8aff0..9b3eefb 100644 --- a/src/index.css +++ b/src/index.css @@ -142,6 +142,10 @@ body { overscroll-behavior-y: none; } +.hero-image-container { + perspective: 1000px; +} + h1, h2, h3, diff --git a/src/styles/animations.css b/src/styles/animations.css index 4a3a4d4..d970d2e 100644 --- a/src/styles/animations.css +++ b/src/styles/animations.css @@ -169,3 +169,37 @@ .animate-slide { animation: slide 30s linear infinite; } + +/* Flip card effect */ +.flip-card { + position: relative; + width: 100%; + height: 100%; + transition: transform 0.8s; + transform-style: preserve-3d; +} + +.hero-image-container:hover .flip-card { + transform: rotateY(180deg); +} + +.flip-card-front, +.flip-card-back { + position: absolute; + width: 100%; + height: 100%; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + border-radius: var(--radius); + overflow: hidden; +} + +.flip-card-back { + transform: rotateY(180deg); + background-color: var(--card); + color: var(--foreground); + display: flex; + justify-content: center; + align-items: center; + font-size: var(--text-2xl); +} -- 2.49.1