diff --git a/src/components/Affiche.astro b/src/components/Affiche.astro new file mode 100644 index 0000000..b4eb5c2 --- /dev/null +++ b/src/components/Affiche.astro @@ -0,0 +1,88 @@ +--- +const { evenement, showOverlay = true } = Astro.props; +--- + + + {`Affiche + {showOverlay && ( +
+ {evenement.nom} + {new Date(evenement.date).toLocaleDateString("fr-FR")} +
+ )} +
+ + \ No newline at end of file diff --git a/src/components/GrilleSpectaclesPassés.astro b/src/components/GrilleSpectaclesPassés.astro index 2ea1586..d7efefb 100644 --- a/src/components/GrilleSpectaclesPassés.astro +++ b/src/components/GrilleSpectaclesPassés.astro @@ -1,4 +1,6 @@ --- +import Affiche from "./Affiche.astro"; + const { evenements, limite = 6, afficherLienVoirTout = true } = Astro.props; const evenementsAffiches = evenements.slice(0, limite); --- @@ -8,17 +10,7 @@ const evenementsAffiches = evenements.slice(0, limite);
{evenementsAffiches.map(evenement => ( evenement.affiche && ( - - {`Affiche -
- {evenement.nom} - {new Date(evenement.date).toLocaleDateString("fr-FR")} -
-
+ ) ))}
@@ -40,53 +32,6 @@ const evenementsAffiches = evenements.slice(0, limite); margin-bottom: 2rem; } - .affiche-link { - position: relative; - display: block; - overflow: hidden; - border-radius: 0.5rem; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - transition: transform 0.3s ease, box-shadow 0.3s ease; - background: white; - } - - .affiche-link:hover { - transform: translateY(-5px); - box-shadow: 0 8px 12px rgba(0, 0, 0, 0.2); - } - - .affiche-thumb { - width: 100%; - height: auto; - display: block; - aspect-ratio: 3/4; - object-fit: cover; - } - - .affiche-overlay { - position: absolute; - bottom: 0; - left: 0; - right: 0; - background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); - color: white; - padding: 1rem; - display: flex; - flex-direction: column; - gap: 0.25rem; - } - - .affiche-nom { - font-weight: bold; - font-size: 0.9rem; - line-height: 1.2; - } - - .affiche-date { - font-size: 0.8rem; - opacity: 0.9; - } - .voir-tout { display: inline-block; margin-top: 1rem; @@ -112,18 +57,6 @@ const evenementsAffiches = evenements.slice(0, limite); grid-template-columns: repeat(3, 1fr); gap: 1rem; } - - .affiche-overlay { - padding: 0.5rem; - } - - .affiche-nom { - font-size: 0.8rem; - } - - .affiche-date { - font-size: 0.7rem; - } } @media (max-width: 480px) { @@ -131,17 +64,5 @@ const evenementsAffiches = evenements.slice(0, limite); grid-template-columns: repeat(2, 1fr); gap: 0.75rem; } - - .affiche-overlay { - padding: 0.4rem; - } - - .affiche-nom { - font-size: 0.75rem; - } - - .affiche-date { - font-size: 0.65rem; - } } \ No newline at end of file