Bob AI: Added rotating image carousel with progress bar to about sec
This commit is contained in:
@@ -9,9 +9,29 @@ import ScrollReveal from "@/components/ui/ScrollReveal";
|
|||||||
import { CheckCircle2 } from "lucide-react";
|
import { CheckCircle2 } from "lucide-react";
|
||||||
|
|
||||||
export default function AboutSection(): React.JSX.Element {
|
export default function AboutSection(): React.JSX.Element {
|
||||||
|
const [currentIndex, setCurrentIndex] = React.useState(0);
|
||||||
|
const IMAGES = [
|
||||||
|
"https://images.unsplash.com/photo-1566073771259-6a8506099945?auto=format&fit=crop&q=80",
|
||||||
|
"https://images.unsplash.com/photo-1582719478250-c894e4dc24a5?auto=format&fit=crop&q=80",
|
||||||
|
"https://images.unsplash.com/photo-1542314831-c6a4d14d8c85?auto=format&fit=crop&q=80"
|
||||||
|
];
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
setCurrentIndex((prev) => (prev + 1) % IMAGES.length);
|
||||||
|
}, 5000);
|
||||||
|
return () => clearInterval(timer);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="about" data-section="about" className="py-24 bg-background">
|
<div id="about" data-section="about" className="py-24 bg-background">
|
||||||
<SectionErrorBoundary name="about">
|
<SectionErrorBoundary name="about">
|
||||||
|
<style>{`
|
||||||
|
@keyframes progress-bar {
|
||||||
|
0% { width: 0%; }
|
||||||
|
100% { width: 100%; }
|
||||||
|
}
|
||||||
|
`}</style>
|
||||||
<div className="container mx-auto px-4">
|
<div className="container mx-auto px-4">
|
||||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
|
<div className="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
|
||||||
<ScrollReveal variant="slide-up">
|
<ScrollReveal variant="slide-up">
|
||||||
@@ -40,10 +60,27 @@ export default function AboutSection(): React.JSX.Element {
|
|||||||
</ScrollReveal>
|
</ScrollReveal>
|
||||||
<ScrollReveal variant="fade-blur">
|
<ScrollReveal variant="fade-blur">
|
||||||
<div className="relative h-[500px] rounded-2xl overflow-hidden">
|
<div className="relative h-[500px] rounded-2xl overflow-hidden">
|
||||||
<ImageOrVideo
|
{IMAGES.map((src, index) => (
|
||||||
imageSrc="https://images.unsplash.com/photo-1566073771259-6a8506099945?auto=format&fit=crop&q=80"
|
<div
|
||||||
className="w-full h-full object-cover"
|
key={src}
|
||||||
/>
|
className={`absolute inset-0 transition-opacity duration-1000 ${
|
||||||
|
index === currentIndex ? "opacity-100 z-10" : "opacity-0 z-0"
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<ImageOrVideo
|
||||||
|
imageSrc={src}
|
||||||
|
className="w-full h-full object-cover"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
|
||||||
|
<div className="absolute bottom-0 left-0 right-0 h-1.5 bg-black/40 z-20">
|
||||||
|
<div
|
||||||
|
key={currentIndex}
|
||||||
|
className="h-full bg-primary"
|
||||||
|
style={{ animation: 'progress-bar 5s linear' }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ScrollReveal>
|
</ScrollReveal>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user