Base du thème : gabarits, jetons et effets
This commit is contained in:
commit
e06ad42369
6 changed files with 327 additions and 0 deletions
77
header.php
Normal file
77
header.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
$yb_static = isset($_GET['ybstatic']);
|
||||
$yb_nav = array(
|
||||
array('ACCUEIL', home_url('/')),
|
||||
array('QUI SUIS-JE', home_url('/qui-suis-je/')),
|
||||
array('COMPÉTENCES', home_url('/competences/')),
|
||||
array('RÉALISATIONS', home_url('/realisation/')),
|
||||
array('BLOG', home_url('/blog/')),
|
||||
array('CONTACT', home_url('/contact/')),
|
||||
);
|
||||
$yb_path = trim((string) parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH), '/');
|
||||
$yb_email = yb2026_id('email');
|
||||
$yb_tel = yb2026_id('telephone');
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html <?php language_attributes(); ?> class="<?php echo $yb_static ? 'yb-static' : 'is-entering'; ?>"<?php echo yb2026_season_attrs(); ?>>
|
||||
<head>
|
||||
<meta charset="<?php bloginfo('charset'); ?>">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#0a0a0a">
|
||||
<script>/* ybTheme : applique le thème mémorisé avant le premier rendu (pas de flash) */
|
||||
(function(){try{var t=localStorage.getItem('yb-theme');if(t==='light'||t==='dark')document.documentElement.setAttribute('data-theme',t);
|
||||
var h=document.documentElement,s=h.getAttribute('data-season');
|
||||
if(h.hasAttribute('data-no-season')){}else if(localStorage.getItem('yb-sx')){h.setAttribute('data-sx','');var p=localStorage.getItem('yb-sp');if(p==='none'){if(s){h.removeAttribute('data-season');h.setAttribute('data-season-off',s);}}else if(p)h.setAttribute('data-season',p);}
|
||||
else if(s&&localStorage.getItem('yb-season')==='off'){h.removeAttribute('data-season');h.setAttribute('data-season-off',s);}}catch(e){}})();</script>
|
||||
<?php wp_head(); ?>
|
||||
</head>
|
||||
<body <?php body_class(); ?>>
|
||||
<?php wp_body_open(); ?>
|
||||
|
||||
<!-- Wipe (rideau lime) : couvre l'écran dès le premier paint grâce à html.is-entering -->
|
||||
<div class="yb-wipe" aria-hidden="true"><span class="yb-wipe__label"></span></div>
|
||||
<script>
|
||||
/* ybWipe : libellé du rideau repris de la page précédente ; filet de sécurité :
|
||||
si effects.js ne se charge pas, le rideau se lève quand même. */
|
||||
(function(){try{var l=sessionStorage.getItem('ybWipe');if(l)document.querySelector('.yb-wipe__label').textContent=l;}catch(e){}
|
||||
setTimeout(function(){document.documentElement.classList.remove('is-entering');},2500);})();
|
||||
</script>
|
||||
|
||||
<div class="scroll-progress" aria-hidden="true"></div>
|
||||
|
||||
<header class="site-nav">
|
||||
<a class="site-nav__logo" href="<?php echo esc_url(home_url('/')); ?>" data-wipe="ACCUEIL">YB<span class="lime">©</span>2026</a>
|
||||
<nav class="site-nav__links" aria-label="Navigation principale">
|
||||
<?php foreach ($yb_nav as $item) :
|
||||
$active = trim((string) parse_url($item[1], PHP_URL_PATH), '/') === $yb_path; ?>
|
||||
<a href="<?php echo esc_url($item[1]); ?>" data-wipe="<?php echo esc_attr($item[0]); ?>"<?php echo $active ? ' class="is-active" aria-current="page"' : ''; ?>><?php echo esc_html($item[0]); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</nav>
|
||||
<div class="site-nav__right">
|
||||
<?php yb2026_season_toggle(); ?>
|
||||
<button type="button" class="theme-toggle" data-theme-toggle aria-label="Passer en mode clair" title="Mode clair / sombre">
|
||||
<svg class="theme-toggle__sun" viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="12" r="4.2"/><path d="M12 2.5v2.2M12 19.3v2.2M4.6 4.6l1.6 1.6M17.8 17.8l1.6 1.6M2.5 12h2.2M19.3 12h2.2M4.6 19.4l1.6-1.6M17.8 6.2l1.6-1.6"/></svg>
|
||||
<svg class="theme-toggle__moon" viewBox="0 0 24 24" aria-hidden="true"><path d="M20.5 14.6A8.6 8.6 0 0 1 9.4 3.5a8.6 8.6 0 1 0 11.1 11.1z"/></svg>
|
||||
</button>
|
||||
<div class="site-nav__badge">@ <?php echo esc_html(mb_strtoupper(yb2026_id('entreprise'))); ?></div>
|
||||
<button type="button" class="site-nav__burger" data-menu-toggle aria-expanded="false" aria-controls="yb-menu">MENU</button>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<div class="mobile-menu" id="yb-menu" data-menu aria-hidden="true">
|
||||
<nav class="mobile-menu__links" aria-label="Menu mobile">
|
||||
<?php foreach ($yb_nav as $i => $item) :
|
||||
$active = trim((string) parse_url($item[1], PHP_URL_PATH), '/') === $yb_path; ?>
|
||||
<a href="<?php echo esc_url($item[1]); ?>" data-wipe="<?php echo esc_attr($item[0]); ?>" class="mobile-menu__link<?php echo $active ? ' is-active' : ''; ?>" style="--i:<?php echo $i; ?>">
|
||||
<span class="mobile-menu__txt"><?php echo esc_html($item[0]); ?><span class="mobile-menu__arrow">→</span></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</nav>
|
||||
<div class="mobile-menu__contact">
|
||||
<a <?php echo yb2026_pv_href('mailto:' . $yb_email); ?>><?php echo yb2026_pv($yb_email); ?> ↗</a>
|
||||
<a <?php echo yb2026_pv_href(yb2026_tel_href($yb_tel)); ?>><?php echo yb2026_pv($yb_tel); ?> ↗</a>
|
||||
<div class="mobile-menu__loc"><?php echo esc_html(mb_strtoupper(yb2026_location_long())); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main id="yb-root">
|
||||
Loading…
Add table
Add a link
Reference in a new issue