save before move tabs outside from header

This commit is contained in:
isUnknown 2024-03-10 12:03:31 +01:00
parent f9397935bd
commit 94d404288f
13 changed files with 116 additions and 64 deletions

16
site/snippets/cover.php Normal file
View file

@ -0,0 +1,16 @@
<?php
$isOpen = isset($isOpen) ? $isOpen : false;
?>
<header
x-data="{
isOpen: <?= $isOpen ?>
}"
class="page-cover"
:class="isOpen ? 'open' : 'close'"
>
<div class="title-wrapper">
<?= $slots->title() ?>
</div>
<?= $slots->tabs() ?>
</header>

View file

@ -1,10 +1,11 @@
<?php
$left['slug'] = Str::slug($left['label']);
$authorFilter = isset($authorFilter) ? $authorFilter : false;
$activeTab = isset($activeTab) ? Str::slug($activeTab) : '';
?>
<div id="tabs" x-data="{
activeTab: ''
activeTab: '<?= $activeTab ?>'
}">
<div class="toggle-btns | flex space-between" style="
--content:space-between;
@ -20,7 +21,7 @@ $authorFilter = isset($authorFilter) ? $authorFilter : false;
@click="toggleTab($data, 'texts')"
>textes</button>
</div>
<div class="active-tab">
<div class="active-tab" x-show="activeTab.length > 0">
<section
x-show="activeTab === '<?=$left['slug'] ?>'">
<?= $left['content'] ?>

View file

@ -1,5 +1,5 @@
<?php snippet('header') ?>
<header id="header">
<header id="main-header">
<div id="logo">
<a href="/" class="no-line">
<h1 id="actuel">actuel</h1>
@ -9,15 +9,22 @@
</header>
<main id="<?= $page->template() ?>">
<h3 class="title-center">
critique des arts<br />
et des techniques<br>
</h3>
<?php snippet('tabs', [
'left' => [
'label' => 'édito',
'content' => $site->edito()
]
]) ?>
<?php snippet('cover', slots: true) ?>
<?php slot('title') ?>
<h3 class="title-center">
revue critique<br>
des arts et des techniques<br>
</h3>
<?php endslot() ?>
<?php slot('tabs') ?>
<?php snippet('tabs', [
'left' => [
'label' => 'édito',
'content' => $site->edito()
]
]) ?>
<?php endslot() ?>
<?php endsnippet() ?>
</main>
<?php snippet('footer') ?>

View file

@ -1,5 +1,5 @@
<?php snippet('header') ?>
<header id="header" class="minimized">
<header id="main-header" class="minimized">
<div id="logo" >
<a href="/" class="no-line">
<h2 id="actuel">actuel</h2>
@ -9,16 +9,22 @@
</header>
<main id="<?= $page->template() ?>">
<article>
<div class="article-header">
<?php snippet('cover', ['isOpen' => true], slots: true) ?>
<?php slot('title') ?>
<h1 class="main-title title-center <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h1>
<p><span class="opacity" style="--opacity:.5">par</span> <a class="author no-line" href="/auteurs/<?= Str::slug($page->author()->toUser()->name()) ?>" title="Voir les articles d'<?= $page->author()->toUser()->name() ?>"><?= $page->author()->toUser()->name() ?></a></p>
</div>
<?php snippet('tabs', [
'left' => [
'label' => 'Édito ' . $page->parent()->title(),
'content' => $page->parent()->edito()
]
]) ?>
<p><span class="opacity" style="--opacity:.5">par</span> <a class="author no-line" href="/auteurs/<?= Str::slug($page->author()->toUser()->name()) ?>" title="Voir les articles d'<?= $page->author()->toUser()->name() ?>"><?= $page->author()->toUser()->name() ?></a></p>
<?php endslot() ?>
<?php slot('tabs') ?>
<?php snippet('tabs', [
'left' => [
'label' => 'édito ' . $page->parent()->title(),
'content' => $page->parent()->edito()
],
'activeTab' => 'édito ' . $page->parent()->title()
]) ?>
<?php endslot() ?>
<?php endsnippet() ?>
<?= $page->body() ?>
</article>
</main>