diff --git a/src/components/playground/GalarySection.jsx b/src/components/playground/GalarySection.jsx new file mode 100644 index 0000000..5cc1fac --- /dev/null +++ b/src/components/playground/GalarySection.jsx @@ -0,0 +1,41 @@ +import TButton from "../shared/TertiaryButton"; +import images from "../../config/galary"; + +export default function GalarySection() { + const getRandomImages = () => { + const shuffled = [...images].sort(() => 0.5 - Math.random()); + return shuffled.slice(0, 5); + }; + + const randomImages = getRandomImages(); + + return ( +
+ {/* Header Section */} +
+

Image Gallery

+

+ Explore our vibrant moments captured in stunning visuals. +

+ Go to Gallery > +
+ + {/* Gallery Grid */} +
+ {randomImages.map((image) => ( +
+ {image.alt} +
+ ))} +
+
+ ); +} diff --git a/src/components/shared/TertiaryButton.jsx b/src/components/shared/TertiaryButton.jsx new file mode 100644 index 0000000..645b9aa --- /dev/null +++ b/src/components/shared/TertiaryButton.jsx @@ -0,0 +1,9 @@ +const TButton = ({ children }) => { + return ( +
+ {children} +
+ ); +}; + +export default TButton; diff --git a/src/config/galary.js b/src/config/galary.js new file mode 100644 index 0000000..11e7e98 --- /dev/null +++ b/src/config/galary.js @@ -0,0 +1,40 @@ +const images = [ + { + id: 1, + src: "https://res.cloudinary.com/dsjxx976j/image/upload/v1752424604/image-2_yjyxwo.png", + alt: "Gallery Image 1", + year: 2025, + }, + { + id: 2, + src: "https://res.cloudinary.com/dsjxx976j/image/upload/v1752424605/image_r6mlez.png", + alt: "Gallery Image 2", + year: 2025, + }, + { + id: 3, + src: "https://res.cloudinary.com/dsjxx976j/image/upload/v1752424604/image-3_yezplq.png", + alt: "Gallery Image 3", + year: 2025, + }, + { + id: 4, + src: "https://res.cloudinary.com/dsjxx976j/image/upload/v1752424604/image-4_lwzmbl.png", + alt: "Gallery Image 4", + year: 2024, + }, + { + id: 5, + src: "https://res.cloudinary.com/dsjxx976j/image/upload/v1752424604/image-1_ruw6yy.png", + alt: "Gallery Image 5", + year: 2024, + }, + { + id: 6, + src: "https://res.cloudinary.com/dsjxx976j/image/upload/v1752425766/e8d1afdb4d097b5c14935394e296d28109b650e4_fominv.png", + alt: "Gallery Image 6", + year: 2024, + }, +]; + +export default images; diff --git a/src/config/galaryPage.js b/src/config/galaryPage.js new file mode 100644 index 0000000..d436111 --- /dev/null +++ b/src/config/galaryPage.js @@ -0,0 +1,16 @@ +const heroImages = [ + { + id: 1, + src: "https://res.cloudinary.com/dsjxx976j/image/upload/v1752424604/image-2_yjyxwo.png", + alt: "Gallery Image 1", + year: 2025, + }, + { + id: 2, + src: "https://res.cloudinary.com/dsjxx976j/image/upload/v1752425766/e8d1afdb4d097b5c14935394e296d28109b650e4_fominv.png", + alt: "Gallery Image 1", + year: 2025, + }, +]; + +export default heroImages; diff --git a/src/main.jsx b/src/main.jsx index d7f5742..fd993c6 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -7,6 +7,8 @@ import Footer from "./components/playground/Footer.jsx"; import Playground from "./Playground.jsx"; import Test from "./components/playground/Test.jsx"; import Home from "./pages/playground/landing-page/Home.jsx"; +import GalarySection from "./components/playground/GalarySection.jsx"; +import GallaryPage from "./pages/gallary/Gallary.jsx"; import Achievements from "./pages/playground/Achievements.jsx"; import AchievementPage from "./pages/playground/AchievementPage.jsx"; import Events from "./pages/playground/landing-page/Events.jsx"; @@ -19,6 +21,8 @@ createRoot(document.getElementById("root")).render( }> } /> } /> + } /> + } /> } /> } /> } /> diff --git a/src/pages/gallary/Gallary.jsx b/src/pages/gallary/Gallary.jsx new file mode 100644 index 0000000..370e1cf --- /dev/null +++ b/src/pages/gallary/Gallary.jsx @@ -0,0 +1,178 @@ +import { useState, useEffect } from "react"; +import images from "../../config/galary"; +import heroImages from "../../config/galaryPage"; + +const NavButton = ({ direction, onClick }) => { + const isNext = direction === "next"; + return ( + + ); +}; + +const YearButton = ({ year, isSelected, onClick }) => ( + +); + +const GalleryItem = ({ image }) => ( +
+ {image.alt} +
+); + +export default function GallaryPage() { + const [selectedYear, setSelectedYear] = useState("all"); + const [currentSlide, setCurrentSlide] = useState(0); + + useEffect(() => { + const interval = setInterval(() => { + setCurrentSlide((prev) => (prev + 1) % heroImages.length); + }, 5000); + return () => clearInterval(interval); + }, []); + + const years = ["all", ...new Set(images.map((image) => image.year))].sort(); + + const galleryImages = + selectedYear === "all" + ? images + : images.filter((image) => image.year === Number(selectedYear)); + + return ( +
+ {/* Hero Banner Carousel */} +
+ {/* Carousel Slides */} +
+ {heroImages.map((image, index) => ( +
+ {image.alt} +
+ ))} + + {/* Carousel Controls */} +
+ {heroImages.map((_, index) => ( +
+ + {/* Next/Prev Buttons */} + {heroImages.length > 1 && ( + <> + + setCurrentSlide((prev) => + prev === 0 ? heroImages.length - 1 : prev - 1, + ) + } + /> + + setCurrentSlide((prev) => (prev + 1) % heroImages.length) + } + /> + + )} +
+
+ + {/* Gallery Content */} +
+ {/* Year Filters and Description Section */} +
+
+
+

+ Gallery +

+
+ {years.map((year) => ( + setSelectedYear(year)} + /> + ))} +
+
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. + Suspendisse varius enim in eros elementum tristique. Duis cursus, + mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam + libero vitae erat. +

+
+
+ + {/* Gallery Grid */} +
+ {galleryImages.map((image) => ( + + ))} +
+ + {/* No Images Message */} + {galleryImages.length === 0 && ( +
+

+ No images found for selected year. +

+
+ )} +
+
+ ); +}