dynamize info banner background color + callour background color

This commit is contained in:
isUnknown 2024-09-13 15:29:02 +02:00
parent ea0cb004aa
commit bc2d238a05
18 changed files with 73 additions and 34 deletions

View file

@ -0,0 +1,13 @@
type: group
fields:
calloutHeadline:
type: headline
label: Brève
calloutText:
label: Texte
type: writer
width: 1/2
calloutColor:
label: Couleur de fond
extends: fields/color
width: 1/2

View file

@ -11,6 +11,9 @@ options:
"#ff3300": Rouge
"#2e8799": Colvert
"#009eff": Bleu
"#99EEFF": Bleu clair
"#00b477": Vert
"#45e6ba": Menthe
"#a59478": Brun
"#C4C9CC": Gris
"#fff": Blanc

View file

@ -6,6 +6,12 @@ tabs:
label: Calendrier
icon: calendar
sections:
paramsSection:
type: fields
fields:
color:
label: Dominante de la saison
extends: fields/color
seasons:
label: Événéments
type: pages

View file

@ -7,8 +7,14 @@ tabs:
columns:
- width: 1/1
fields:
infoBannerHeading:
type: headline
label: Bannière d'infos
infoBannerColor:
label: Couleur de fond
extends: fields/color
infoBanner:
label: Bannière d'info
label: Messages
type: structure
help: Affichée en haut de la page d'accueil.
fields:
@ -80,14 +86,11 @@ tabs:
heroMode: custom
- width: 1/1
fields:
separator2:
line:
type: line
calloutHeadline:
type: headline
label: Brève
calloutText:
label: Texte
type: writer
- width: 1/1
fields:
callout: fields/callout
navigationTab:
label: Menu
icon: bars

View file

@ -0,0 +1,5 @@
<?php
return function() {
return page('programme')->children()->first();
};

View file

@ -0,0 +1,4 @@
<section class="callout" style="--color: <?= $color ?>;">
<h4><?= $text ?></h4>
<a class="ticket-link" href="<?= option('ticketingUrl') ?>" target="_blank" title="Aller à la billetterie"><?php snippet('ticket') ?> Billetterie</a>
</section>

View file

@ -29,13 +29,15 @@
<script src="<?= url('assets/js/swiper.js') ?>" defer></script>
<?php endif ?>
<script src="<?= url('assets/js/script.js') ?>" type="module" defer></script>
<?php if ($page->color()->exists()): ?>
<style>
:root {
--color-accent: <?= e($page->color()->isNotEmpty() == 'true', $page->color(), '#000') ?>;
}
</style>
<?php endif ?>
<style>
:root {
<?php if ($page->color()->exists()): ?>
--color-event: <?= e($page->color()->isNotEmpty() == 'true', $page->color(), '#000') ?>;
<?php endif ?>
--color-season: <?= $kirby->collection('current-season')->color() ?>;
}
</style>
</head>
<body data-template="<?= $page->template() ?>">
<?php if ($page->isHomePage()): ?>

View file

@ -1,4 +1,4 @@
<div class="info-banner">
<div class="info-banner" style="--color: <?= $site->infoBannerColor() ?>">
<ul>
<?php

View file

@ -1,5 +1,4 @@
<header class="main-header">
<div class="main-header__infos-banner"></div>
<a href="/" title="Aller à l'accueil">
<nav class="main-nav">
<h1 class="logo">

View file

@ -32,9 +32,6 @@
<?php snippet('events-grid', ['title' => 'Prochainement', 'events' => $orderedEvents->slice(2, 3)]) ?>
<section class="callout">
<h4><?= $site->callout()->inline() ?></h4>
<a class="ticket-link" href="<?= option('ticketingUrl') ?>" target="_blank" title="Aller à la billetterie"><?php snippet('ticket') ?> Billetterie</a>
</section>
<?php snippet('callout', ['text' => $site->calloutText()->inline(), 'color' => $site->calloutColor()]) ?>
<?php snippet('footer') ?>