diff --git a/src/components/ImageCarousel.astro b/src/components/ImageCarousel.astro new file mode 100644 index 0000000..2c1a3c4 --- /dev/null +++ b/src/components/ImageCarousel.astro @@ -0,0 +1,114 @@ +--- +// src/components/ImageCarousel.astro +import "../../styles/components/ImageCarousel.css"; + +interface Image { + src: string; + alt: string; +} + +const { images = [] } = Astro.props as { images: Image[] }; +--- + + + Galerie + + + ❮ + + + + + {images.map((image, index) => ( + + + + ))} + + + + + ❯ + + + + + {images.map((_, index) => ( + + ))} + + + + \ No newline at end of file diff --git a/src/pages/index.astro b/src/pages/index.astro index cbc0ab3..5c39eb2 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -5,6 +5,7 @@ import Hero from "../components/Hero.astro"; import Welcome from "../components/Welcome.astro"; import EventsGrid from '../components/EventsGrid.astro'; import Drinks from "../components/Drinks.astro"; +import ImageCarousel from "../components/ImageCarousel.astro"; const events = [ {image: '/images/Logo.png', title: 'Karaoke Night', date: 'Mi, 23. Juli 2025', description: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua' }, @@ -12,6 +13,20 @@ const events = [ {image: '/images/Logo.png', title: 'Live-Musik', date: 'Sa, 26. Juli 2025', description: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod' }, {image: '/images/Logo.png', title: 'Cocktail-Abend', date: 'So, 27. Juli 2025', description: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua' } ]; + +const images = [ + { src: '/images/Logo.png', alt: 'Erstes Bild' }, + { src: '/images/Logo.png', alt: 'Zweites Bild' }, + { src: '/images/Logo.png', alt: 'Drittes Bild' }, + { src: '/images/Logo.png', alt: 'Viertes Bild' }, + { src: '/images/Logo.png', alt: 'Fünftes Bild' }, + { src: '/images/Logo.png', alt: 'Sechstes Bild' }, + { src: '/images/Logo.png', alt: 'Siebtes Bild' }, + { src: '/images/Logo.png', alt: 'Achtes Bild' }, + { src: '/images/Logo.png', alt: 'Neuntes Bild' }, + { src: '/images/Logo.png', alt: 'Zehntes Bild' } +]; + --- @@ -19,5 +34,6 @@ const events = [ + diff --git a/styles/components/ImageCarousel.css b/styles/components/ImageCarousel.css new file mode 100644 index 0000000..172aac7 --- /dev/null +++ b/styles/components/ImageCarousel.css @@ -0,0 +1,176 @@ +/* styles/components/ImageCarousel.css */ + +.image-carousel-container { + width: 100%; + max-width: 1200px; + margin: 2rem auto; + padding: 0 1rem; +} + +.section-title { + text-align: center; + margin-bottom: 1.5rem; + font-size: 2rem; + font-weight: bold; + color: #333; +} + +.image-carousel { + position: relative; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; + height: 400px; +} + +.carousel-images { + position: relative; + width: 100%; + height: 100%; + overflow: hidden; +} + +.carousel-track { + display: flex; + height: 100%; + position: relative; +} + +.carousel-slide { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + opacity: 0; + transition: all 0.5s ease; + display: flex; + align-items: center; + justify-content: center; + transform: scale(0.8); + z-index: 1; +} + +/* Current slide - center and fully visible */ +.carousel-slide.current { + opacity: 1; + transform: scale(1); + z-index: 3; +} + +/* Previous slide - left side, partially visible */ +.carousel-slide.prev { + opacity: 0.7; + transform: translateX(-30%) scale(0.85); + z-index: 2; +} + +/* Next slide - right side, partially visible */ +.carousel-slide.next { + opacity: 0.7; + transform: translateX(30%) scale(0.85); + z-index: 2; +} + +.carousel-image { + max-width: 100%; + max-height: 100%; + object-fit: contain; + border-radius: 8px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); +} + +/* Navigation buttons */ +.nav-button { + position: absolute; + top: 50%; + transform: translateY(-50%); + background-color: rgba(255, 255, 255, 0.7); + border: none; + border-radius: 50%; + width: 40px; + height: 40px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + z-index: 10; + transition: background-color 0.3s ease; +} + +.nav-button:hover { + background-color: rgba(255, 255, 255, 0.9); +} + +.prev-button { + left: 10px; +} + +.next-button { + right: 10px; +} + +.arrow { + font-size: 18px; + font-weight: bold; +} + +/* Indicators */ +.carousel-indicators { + display: flex; + justify-content: center; + margin-top: 1rem; + gap: 8px; +} + +.indicator-dot { + width: 12px; + height: 12px; + border-radius: 50%; + background-color: #ccc; + border: none; + cursor: pointer; + transition: background-color 0.3s ease; +} + +.indicator-dot.active { + background-color: #333; +} + +/* Responsive adjustments */ +@media (max-width: 768px) { + .image-carousel { + height: 300px; + } + + .carousel-slide.prev, + .carousel-slide.next { + opacity: 0.5; + transform: scale(0.7); + } + + .carousel-slide.prev { + transform: translateX(-20%) scale(0.7); + } + + .carousel-slide.next { + transform: translateX(20%) scale(0.7); + } +} + +@media (max-width: 480px) { + .image-carousel { + height: 250px; + } + + .carousel-slide.prev, + .carousel-slide.next { + display: none; + } + + .nav-button { + width: 30px; + height: 30px; + } +} \ No newline at end of file