diff --git a/src/pages/galeries.tsx b/src/pages/galeries.tsx index b1a45f3..b6510ec 100644 --- a/src/pages/galeries.tsx +++ b/src/pages/galeries.tsx @@ -1,34 +1,50 @@ import { Layout } from "./index"; import Image from "next/image"; +import styles from "../styles/Galerie.module.css"; + export default function Galeries({ pictures }: { pictures: string[] }) { - return ( - - - - Galeries - - - Voici les photos des galeries du club. - - - - {pictures?.map((picture) => ( - - - - ))} - - - - - ); + return ( + + + + + Retrouvez toutes nos photos + + + + {pictures?.map((picture) => ( + + + + ))} + + + + + ); } export function getServerSideProps() { - return { - props: { - pictures: ["https://picsum.photos/seed/1/500","https://picsum.photos/seed/2/500","https://picsum.photos/seed/3/500"], - }, - }; + let pictures = []; + const classes = ["wide", "tall", "big", ""]; + for (let i = 0; i < 10; i++) { + pictures.push({ + src: `https://picsum.photos/500/500?random=${i}`, + alt: "random image", + className: classes[Math.floor(Math.random() * classes.length)], + }); + } + return { + props: { + pictures, + }, + }; } diff --git a/src/styles/Galerie.module.css b/src/styles/Galerie.module.css new file mode 100644 index 0000000..b836962 --- /dev/null +++ b/src/styles/Galerie.module.css @@ -0,0 +1,37 @@ +img.img { + max-width: 100%; + height: auto; + vertical-align: middle; + display: inline-block; +} + +.grid-wrapper > div { + display: flex; + justify-content: center; + align-items: center; +} +.grid-wrapper > div > img { + width: 100%; + height: 100%; + object-fit: cover; + border-radius: 5px; +} + +.grid-wrapper { + display: grid; + grid-gap: 10px; + grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); + grid-auto-rows: 200px; + grid-auto-flow: dense; +} +.grid-wrapper .wide { + grid-column: span 2; +} +.grid-wrapper .tall { + grid-row: span 2; +} +.grid-wrapper .big { + grid-column: span 2; + grid-row: span 2; +} +
- Voici les photos des galeries du club. -