builder avec section > suppression du bandeau qui contient le titre de la page - donc le titre du site passe en h1 sur les pages sectionnées aussi, anchors-strip sticky
This commit is contained in:
parent
f0158eea5b
commit
3900966800
5 changed files with 25 additions and 5 deletions
|
|
@ -1,5 +1,10 @@
|
||||||
.anchors-strip {
|
.anchors-strip {
|
||||||
padding: calc(var(--padding-vertical) / 1.6) var(--space-m) !important;
|
padding: calc(var(--padding-vertical) / 1.6) var(--space-m) !important;
|
||||||
|
position: sticky;
|
||||||
|
top: var(--header-height, 0px);
|
||||||
|
z-index: 9;
|
||||||
|
background-color: #fff !important;
|
||||||
|
box-shadow: 0px -10px #fff; /*pour éviter un petit bug du à la latence de anchors-strip_stiky.js*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.anchors-strip ul {
|
.anchors-strip ul {
|
||||||
|
|
|
||||||
15
assets/js/anchors-strip_stiky.js
Normal file
15
assets/js/anchors-strip_stiky.js
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
const header = document.querySelector('.main-header');
|
||||||
|
|
||||||
|
console.log("test");
|
||||||
|
|
||||||
|
const setHeaderHeight = () => {
|
||||||
|
document.documentElement.style.setProperty(
|
||||||
|
'--header-height',
|
||||||
|
`${header.offsetHeight}px`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
setHeaderHeight();
|
||||||
|
|
||||||
|
const resizeObserver = new ResizeObserver(setHeaderHeight);
|
||||||
|
resizeObserver.observe(header);
|
||||||
|
|
@ -35,6 +35,10 @@
|
||||||
|
|
||||||
<!-- script.js -->
|
<!-- script.js -->
|
||||||
<script defer src="<?= url('assets/dist/script.min.js') ?>" type="module"></script>
|
<script defer src="<?= url('assets/dist/script.min.js') ?>" type="module"></script>
|
||||||
|
|
||||||
|
<?php if ($page->template() == 'sectioned'): ?>
|
||||||
|
<script defer src="<?= url('/assets/js/anchors-strip_stiky.js') ?>"></script>
|
||||||
|
<?php endif ?>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<header class="main-header">
|
<header class="main-header">
|
||||||
<nav class="main-nav" aria-label="main-menu">
|
<nav class="main-nav" aria-label="main-menu">
|
||||||
<a href="/" title="Aller à l'accueil">
|
<a href="/" title="Aller à l'accueil">
|
||||||
<?php if ($page->isHomePage()): ?>
|
<?php if ($page->isHomePage() || $page->template() == "sectioned"): ?>
|
||||||
<h1 class="logo">
|
<h1 class="logo">
|
||||||
<span>
|
<span>
|
||||||
Nouveau
|
Nouveau
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,6 @@
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section>
|
|
||||||
<h1><?= $page->title() ?></h1>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<?php foreach($page->children() as $sectionPage): ?>
|
<?php foreach($page->children() as $sectionPage): ?>
|
||||||
<section id="<?= $sectionPage->slug() ?>" <?= e($sectionPage->backgroundColor()->isNotEmpty() == 'true', ' style="--color: ' . $sectionPage->backgroundColor() . ';"') ?>>
|
<section id="<?= $sectionPage->slug() ?>" <?= e($sectionPage->backgroundColor()->isNotEmpty() == 'true', ' style="--color: ' . $sectionPage->backgroundColor() . ';"') ?>>
|
||||||
<?php if ($sectionPage->isTitled() != 'false'): ?>
|
<?php if ($sectionPage->isTitled() != 'false'): ?>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue