world-game/site/snippets/header.php
isUnknown 4d9509dec2
All checks were successful
Deploy Production / Deploy to Production (push) Successful in 23s
feat: add film grain effect and purple base to preloader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-25 18:25:04 +02:00

81 lines
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:
radial-gradient(ellipse 70% 55% at 10% 90%, #82107a 0%, transparent 65%),
radial-gradient(ellipse 50% 45% at 8% 15%, #2e0d8e 0%, transparent 55%),
radial-gradient(ellipse 45% 40% at 48% 35%, #0c2540 0%, transparent 55%),
#1D154C;
transition: opacity 0.4s ease;
pointer-events: none;
}
#preloader::before {
content: '';
position: absolute;
inset: 0;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23n)'/%3E%3C/svg%3E");
background-repeat: repeat;
background-size: 250px;
opacity: 0.09;
mix-blend-mode: overlay;
}
#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>