world-game/site/snippets/header.php
isUnknown 7ba18dcd9d
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 25s
perf : replace loading flash with background preloader, parallel sub-page fetch
- Add #preloader div with scrollable-page-background.png as CSS background,
  matching the Svelte bg-fixed image so the transition is imperceptible
  (image is cached by the time Svelte requests it)
- Revert #ssr-content to visually-hidden (clip) for Google Wave 1 crawl
- Prevent scrollbar flash by adding overflow:hidden to html,body inline
  before main.css loads
- Parallel-fetch sub-page data (/blog/slug.json) alongside parent in initRouter
  so Blog/WhitePapers components receive prefetched data on mount — eliminates
  the list→article flash on direct navigation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 18:05:06 +02:00

67 lines
2.3 KiB
PHP

<!DOCTYPE html>
<html lang="<?= $kirby->language()?->code() ?? 'fr' ?>">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php snippet('seo/head') ?>
<style>
html, body { overflow: hidden; }
#app { min-height: 100vh; }
/* Hidden SSR content — in DOM for Google Wave 1 crawl, invisible to users */
#ssr-content {
position: absolute;
width: 1px; height: 1px;
padding: 0; margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);
white-space: nowrap;
border: 0;
}
/* Preloader — covers the blank #app while JS loads.
Uses the same background image as the Svelte app so the transition
is seamless (image is already cached when Svelte requests it). */
#preloader {
position: fixed;
inset: 0;
z-index: 9999;
background: #000 url('/assets/img/scrollable-page-background.png') center / cover no-repeat;
transition: opacity 0.4s ease;
pointer-events: none;
}
#preloader.preloader-hiding {
opacity: 0;
}
</style>
<!-- Favicon -->
<link rel="icon" type="image/png" href="<?= url('assets/favicon.png') ?>">
<?php if (file_exists('assets/dist')): ?>
<!-- Production: Load compiled assets -->
<script type="module" src="<?= url('assets/dist/index.js') ?>" defer></script>
<link rel="stylesheet" href="<?= url('assets/dist/main.css') ?>">
<?php else: ?>
<!-- Development: Load from Vite dev server -->
<script type="module" src="http://localhost:5173/@vite/client" defer></script>
<script type="module" src="http://localhost:5173/src/main.js" defer></script>
<?php endif ?>
<?php if ($site->faviconPNG()->isNotEmpty()): ?>
<link rel="icon" type="image/png" href="<?= $site->faviconPNG()->toFile()->url() ?>" sizes="96x96" />
<?php endif ?>
<?php if ($site->faviconSVG()->isNotEmpty()): ?>
<link rel="icon" type="image/svg+xml" href="<?= $site->faviconSVG()->toFile()->url() ?>" />
<?php endif ?>
<?php if ($site->faviconICO()->isNotEmpty()): ?>
<link rel="shortcut icon" href="<?= $site->faviconICO()->toFile()->url() ?>" />
<?php endif ?>
<?php snippet('gtag') ?>
</head>
<body data-template="<?= $page->intendedTemplate() ?>">
<div id="app"></div>
<div id="preloader" aria-hidden="true"></div>