diff --git a/assets/css/src/events-grid.css b/assets/css/src/events-grid.css index 8b13789..e7edb5c 100644 --- a/assets/css/src/events-grid.css +++ b/assets/css/src/events-grid.css @@ -1 +1,7 @@ +.events-grid { + padding: var(--space-m); +} +.events-grid h4 { + margin-bottom: 1rem; +} diff --git a/assets/css/src/generic.css b/assets/css/src/generic.css index af70f25..6410ceb 100644 --- a/assets/css/src/generic.css +++ b/assets/css/src/generic.css @@ -4,5 +4,11 @@ body.progress * { .grid { display: grid; - grid-template-columns: repeat(2, 1fr); + grid-template-columns: repeat(12, 1fr); + column-gap: var(--space-m); + row-gap: calc(var(--space-m) / 2); +} + +.grid__item { + grid-column: span var(--span); } diff --git a/assets/css/src/text.css b/assets/css/src/text.css index f75306d..6bfee38 100644 --- a/assets/css/src/text.css +++ b/assets/css/src/text.css @@ -9,7 +9,7 @@ font-weight: bold; } body { - font-family: "Joker"; + font-family: "Joker", sans-serif; font-size: var(--font-size-body); } @@ -30,3 +30,9 @@ h3, font-size: var(--font-size-h3); font-weight: normal; } + +h4, +.h4 { + font-size: var(--font-size-h4); + font-weight: bold; +} diff --git a/assets/css/src/vanilla.css b/assets/css/src/vanilla.css new file mode 100644 index 0000000..edf3f5e --- /dev/null +++ b/assets/css/src/vanilla.css @@ -0,0 +1,17 @@ +picture { + background-color: #ddd; + display: flex !important; + justify-content: center !important; + align-items: center !important; +} + +picture img { + z-index: 1; +} + +picture svg { + position: absolute; + opacity: 1; + transition: var(--transition-image-opacity); + z-index: 0; +} diff --git a/assets/css/src/variables.css b/assets/css/src/variables.css index 4c744b5..daeaad7 100644 --- a/assets/css/src/variables.css +++ b/assets/css/src/variables.css @@ -2,6 +2,7 @@ --border: 1px solid #000; --font-size-body: 1.25rem; + --font-size-h4: 1.5625rem; --font-size-h3: 1.5625rem; --font-size-h2: 1.875rem; --font-size-h1: 2.8125rem; diff --git a/assets/css/style.css b/assets/css/style.css index 81b028d..26ca1a6 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -2,6 +2,7 @@ @import url("src/variables.css"); @import url("src/text.css"); @import url("src/generic.css"); +@import url("src/vanilla.css"); @import url("src/nav.css"); @import url("src/hero.css"); @import url("src/calendar-strip.css"); diff --git a/site/blueprints/files/default.yml b/site/blueprints/files/default.yml new file mode 100644 index 0000000..240399d --- /dev/null +++ b/site/blueprints/files/default.yml @@ -0,0 +1,12 @@ +title: Image +fields: + alt: + label: Texte alternatif + type: text + maxlength: 120 + help: | + **Décrivez l'image avec précision et concision.** + - affiché à la place de l'image lorsqu'elle ne peut pas être chargée + - lu par les lecteurs d'écran des personnes malvoyantes + - lu par les robots des moteurs de recherche + [Plus d'infos](https://duckduckgo.com/?q=balise+alt&t=ffab&ia=web) diff --git a/site/config/config.php b/site/config/config.php index 7155a98..66dfed1 100644 --- a/site/config/config.php +++ b/site/config/config.php @@ -38,5 +38,9 @@ return [ ], 'hooks' => [ 'page.update:after' => require_once(__DIR__ . '/hooks/update-mapado-event.php') - ] + ], + 'date' => [ + 'handler' => 'intl' + ], + 'locale' => 'fr_FR.UTF-8' ]; \ No newline at end of file diff --git a/site/models/event.php b/site/models/event.php new file mode 100644 index 0000000..867a42a --- /dev/null +++ b/site/models/event.php @@ -0,0 +1,25 @@ +isMapadoEvent() != 'true' ? $this->sessions()->toStructure() : $this->remoteSessions()->toStructure(); + + try { + $firstSession = $sessions->first()->date(); + $lastSession = $sessions->last()->date(); + } catch (\Throwable $th) { + throw new Exception('Can\'t define sessions for event "' . $this->title()->value() . '".', 1); + } + + $startDay = intval($firstSession->toDate('d')); + $startMonth = $firstSession->toDate('MMMM'); + $endDay = intval($lastSession->toDate('d')); + $endMonth = $lastSession->toDate('MMMM'); + + if ($firstSession->toDate('y-M') === $lastSession->toDate('y-M')) { + return $startDay . ' - ' . $endDay . ' ' . $endMonth; + } else { + return $startDay . ' ' . $startMonth . ' - ' . $endDay . ' ' . $endMonth; + } + } +} \ No newline at end of file diff --git a/site/snippets/event-card.php b/site/snippets/event-card.php index 6739a0f..10a2007 100644 --- a/site/snippets/event-card.php +++ b/site/snippets/event-card.php @@ -1,3 +1,13 @@ -
- $event->files()->first()]) ?> +
+ $event->gallery()->toFiles()->first()]) ?> +
+
+
title() ?>
+ +
+
+

authors() ?>

+

schedule() ?>

+
+
\ No newline at end of file diff --git a/site/snippets/events-grid.php b/site/snippets/events-grid.php index 575eafd..66bb0f1 100644 --- a/site/snippets/events-grid.php +++ b/site/snippets/events-grid.php @@ -1,5 +1,8 @@ -
- - $event]) ?> - -
\ No newline at end of file +
+

À venir

+
+ + $event, "span" => 12 / $events->count()]) ?> + +
+
\ No newline at end of file diff --git a/site/snippets/picture.php b/site/snippets/picture.php index a64c023..1a69c1a 100644 --- a/site/snippets/picture.php +++ b/site/snippets/picture.php @@ -1,7 +1,7 @@ alt() : 'Fragment de carte de la France'; +$alt = $file->alt(); $crop = $crop ?? false; $webPSrcset = $crop === 'banner' ? $file->crop(1600, 800)->srcset('webp') : $file->srcset('webp');