fix info-banner

This commit is contained in:
isUnknown 2024-09-04 13:43:27 +02:00
parent 1c8e47d810
commit 646c5ab65f
4 changed files with 39 additions and 49 deletions

View file

@ -11,12 +11,12 @@
overflow: hidden;
white-space: nowrap;
border-bottom: var(--border);
background-color: var(--color-mint);
}
.info-banner ul {
box-sizing: border-box;
padding: 1rem var(--space-m);
background-color: var(--color-mint);
display: inline-block;
animation: scroll-left 12s linear infinite;
}

View file

@ -51,7 +51,6 @@ return function($page) {
$nextEvents = new Pages();
$currentSeasonSessions = [];
$previousSeasons = $page->children()->without($currentSeason);
foreach ($currentSeason->children() as $event) {
$sessions = $event->isMapadoEvent() == 'true' ? $event->remoteSessions() : $event->sessions();
@ -78,7 +77,6 @@ return function($page) {
return [
'previousEvents' => $previousEvents,
'nextEvents' => $nextEvents,
'currentSeasonSessions' => sortByMonth($currentSeasonSessions),
'previousSeasons' => $previousSeasons,
'currentSeasonSessions' => sortByMonth($currentSeasonSessions)
];
};

View file

@ -1,43 +1,41 @@
<div class="info-banner">
<ul>
<?php foreach($site->infoBanner()->toStructure() as $info): ?>
<li>
<?php if ($info->link()->isNotEmpty()): ?>
<a href="<?= $info->link()->toUrl() ?>">
<?= $info->message() ?>
</a>
<?php else: ?>
<p>
<?= $info->message() ?>
</p>
<?php endif ?>
</li>
<?php endforeach ?>
<?php foreach($site->infoBanner()->toStructure() as $info): ?>
<li>
<?php if ($info->link()->isNotEmpty()): ?>
<a href="<?= $info->link()->toUrl() ?>">
<?= $info->message() ?>
</a>
<?php else: ?>
<p>
<?= $info->message() ?>
</p>
<?php endif ?>
</li>
<?php endforeach ?>
<?php foreach($site->infoBanner()->toStructure() as $info): ?>
<li>
<?php if ($info->link()->isNotEmpty()): ?>
<a href="<?= $info->link()->toUrl() ?>">
<?= $info->message() ?>
</a>
<?php else: ?>
<p>
<?= $info->message() ?>
</p>
<?php endif ?>
</li>
<?php endforeach ?>
<?php
$repeat = 3;
$infosCount = (int) $site->infoBanner()->toStructure()->count();
switch ($infosCount) {
case 1:
$repeat = 6;
break;
case 2:
$repeat = 4;
break;
case 3:
$repeat = 3;
break;
case 4:
$repeat = 2;
break;
}
for ($i=0; $i < $repeat; $i++):
?>
<?php foreach($site->infoBanner()->toStructure() as $info): ?>
<li>
<?php if ($info->link()->isNotEmpty()): ?>
<a href="<?= $info->link()->toUrl() ?>">
<?= $info->message() ?>
</a>
<?php else: ?>
<p>
<?= $info->message() ?>
</p>
<?php endif ?>
</li>
<?php endforeach ?>
<?php endfor ?>
</ul>
</div>

View file

@ -62,12 +62,6 @@
:class="tab === filterTitle ? 'strong' : ''"
@click="if (tab === filterTitle) { tab = 'Programme' } else { tab = filterTitle; filter = title }"
></button>
<button
x-data="{title: 'Saisons précédentes'}"
x-text="title"
:class="tab === title ? 'strong' : ''"
@click="if (tab === title) { tab = 'Programme' } else { tab = title }"
></button>
</section>
<section class="page-title">
<h1 x-text="tab"></h1>