tabs minimized

This commit is contained in:
isUnknown 2024-04-07 09:57:55 +02:00
parent 3c0de1603c
commit 7e21e1ffb7
7 changed files with 128 additions and 49 deletions

View file

@ -3,10 +3,6 @@ $isOpen = isset($isOpen) ? $isOpen : false;
?>
<header
x-data="{
activeTab: ''
}"
:class="activeTab.length > 0 ? 'open' : 'close'"
class="page-cover"
>
<div class="title-wrapper">

View file

@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?= $site->title() ?><?= e($page->url() !== $site->url(), '-' . $page->title()) ?></title>
<link rel="stylesheet" href="<?= url('assets/css/style.css') . '?version-cache-prevent' . rand(0, 1000) ?>" />
<script src="<?= url('assets') ?>/js/script.js?version-cache-prevent<?= rand(0, 1000)?>" defer></script>
<script src="<?= url('assets') ?>/js/script.js?version-cache-prevent<?= rand(0, 1000)?>" type="module" defer></script>
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<meta name="robots" content="noindex, nofollow, noarchive">
</head>

View file

@ -8,7 +8,12 @@ $authorFilter = isset($authorFilter) ? $authorFilter : false;
$activeTab = isset($activeTab) ? Str::slug($activeTab) : '';
?>
<nav id="tabs" :class="activeTab.length > 0 ? 'open' : 'close'">
<nav id="tabs"
x-data="{
activeTab: ''
}"
:class="activeTab.length > 0 ? 'open' : 'close'"
>
<div class="toggle-btns | flex space-between" style="
--content:space-between;
">
@ -65,8 +70,8 @@ $activeTab = isset($activeTab) ? Str::slug($activeTab) : '';
<?php snippet(
'text-item',
[
'article' => $article
]
'article' => $article
]
) ?>
<?php endif ?>
<?php endforeach ?>

View file

@ -1,31 +1,29 @@
<?php snippet('header') ?>
<main id="<?= $page->template() ?>">
<article>
<?php snippet('cover', ['isOpen' => true], slots: true) ?>
<?php slot('title') ?>
<h2 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h2>
<p>
<span class="opacity" style="--opacity:.6">par </span>
<a
class="author"
href="/auteurs/<?= Str::slug($page->author()->toUser()->name()) ?>"
title="Voir les articles d'<?= $page->author()->toUser()->name() ?>"
>
<?= $page->author()->toUser()->name() ?>
</a><br>
<span class="opacity" style="--opacity:.6">publié le </span><?= $page->published()->toDate('d/m/Y') ?>
<span class="opacity" style="--opacity: .6">dans</span> <a href="/categories/<?= $page->category() ?>"><?= $page->category() ?></a>
</p>
<?php endslot() ?>
<?php slot('tabs') ?>
<article>
<?php snippet('cover', ['isOpen' => true], slots: true) ?>
<?php slot('title') ?>
<h2 class="main-title <?= setTitleFontSizeClass($page->title()) ?>"><?= $page->title() ?></h2>
<p>
<span class="opacity" style="--opacity:.6">par </span>
<a
class="author"
href="/auteurs/<?= Str::slug($page->author()->toUser()->name()) ?>"
title="Voir les articles d'<?= $page->author()->toUser()->name() ?>"
>
<?= $page->author()->toUser()->name() ?>
</a><br>
<span class="opacity" style="--opacity:.6">publié le </span><?= $page->published()->toDate('d/m/Y') ?>
<span class="opacity" style="--opacity: .6">dans</span> <a href="/categories/<?= $page->category() ?>"><?= $page->category() ?></a>
</p>
<?php endslot() ?>
<?php endsnippet() ?>
<?php snippet('tabs', [
'left' => [
'label' => 'édito ' . $page->parent()->title(),
'content' => $page->parent()->edito()
],
]) ?>
<?php endslot() ?>
<?php endsnippet() ?>
<?= $page->body() ?>
</article>
]) ?>
<?= $page->body() ?>
</article>
</main>