index-main/site/snippets/header.php
isUnknown da2abad099 feat: replace menu opacity hack with proper overlay
- Add #menu-overlay div (fixed, full screen, z-index below menu)
- Overlay fades in/out via opacity+visibility transition (cursor: pointer)
- Click on overlay closes the menu
- Remove opacity: 0.1 hack on main/footer/etc. when menu-open

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 11:50:11 +01:00

92 lines
3.4 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="fr ">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="<?= url('assets/css/style.css') ?>?version-cache-prevent<?= rand(0, 1000) ?>">
<link rel="stylesheet" type="text/css" href="<?= url('assets/fonts/stylesheet.css') ?>">
<script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
<meta name="robots" content="noindex,nofollow">
<title>
<?php if ($page->isHomePage() == false): ?>
<?= $page->title() ?>&nbsp;|&nbsp;
<?php endif ?>
<?= $site->title() ?>
</title>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/swiper@12/swiper-bundle.min.css"
/>
<script src="<?= url('assets/js/script.js') ?>" type="module"></script>
<!-- À SUPPRIMER EN PRODUCTION -->
<meta name="robots" content="noindex, nofollow, noarchive">
<?php snippet('seo/head'); ?>
</head>
<body data-template="<?= $page->template() ?>">
<header id="site-header">
<div class="site-header__inner">
<h1 id="site-title">
<a
href="<?= $site->url() ?>"
aria-label="Retour à laccueil"
title="aller au site d'Index"
>
<?= svg('assets/images/index-logo.svg') ?>
</a>
</h1>
<nav id="nav-highlight">
<ul>
<li><a href="<?= page('enquetes')->url() ?>"><?= t('investigations.title') ?></a></li>
<li><a href="<?= page('impacts')->url() ?>"><?= t('impacts.title') ?></a></li>
<li><a href="<?= page('ressources')->url() ?>"><?= t('resources.title') ?></a></li>
<li class="support highlight"><a href="https://soutenir.index.ngo/" target="_blank" rel="noopener"><?= kirby()->language() && kirby()->language()->code() === 'en' ? 'Support us' : 'Soutenez-nous' ?></a></li>
</ul>
</nav>
<?php if ($page->template() == 'investigation'): ?>
<nav id="nav-investigation">
<!-- <p class="title"><?= $page->title()->esc() ?></p> -->
<ul>
<li class="is-selected"><a href="#investigation__hero">Vidéo</a></li>
<li><a href="#investigation__content">Enquête</a></li>
<li><a href="#methodologies">Méthodologies</a></li>
<li><a href="#impacts">Impact</a></li>
<li><a href="#related-investigations">En lien</a></li>
</ul>
</nav>
<?php endif ?>
<button id="theme-toggle">
<svg style="fill: var(--color-txt)" class="switch" width="24" height="24" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M22 41C32.4934 41 41 32.4934 41 22C41 11.5066 32.4934 3 22
3C11.5066 3 3 11.5066 3 22C3 32.4934 11.5066 41 22 41ZM7 22C7
13.7157 13.7157 7 22 7V37C13.7157 37 7 30.2843 7 22Z"></path>
</svg>
</button>
<div id="lang-toggle">
<?php foreach($kirby->languages() as $language): ?>
<a
href="<?= $language->url() ?>"
<?php e($language->code() === $kirby->language()->code(), 'aria-current="page"') ?>
>
<?= strtoupper($language->code()) ?>
</a>
<?php endforeach ?>
</div>
<button id="menu-toggle">
<span class="open"><?= svg('assets/icons/menu.svg') ?></span>
<span class="close"><?= svg('assets/icons/close.svg') ?></span>
</button>
</div>
</header>
<?php snippet('nav') ?>
<div id="menu-overlay"></div>