Reconstruit le site statique mono-page (Bulma + htmx + Strapi) en SvelteKit 2 + Svelte 5 (runes) + TypeScript, 100 % statique (adapter-static), auto-hébergé. - Contenu enrichi à partir du dossier documentaire sourcé : 28 pages (histoire, Mé 67, procès 1968, 9 fiches militants, idéologie, héritage, publications, charte, orientation, sources, FAQ, actualités, contact, mentions légales). - Souveraineté : retrait de Bulma/htmx/mustache/ionicons/Plausible/Google Fonts et de l'API Strapi. Polices Archivo/Inter et sprite SVG auto-hébergés (zéro emoji). - Identité GONG (drapeau vert/blanc/rouge), thème sombre par défaut + clair AA, cadences motion gwoka, KineticText, timeline, 404 kréyòl, PWA hors-ligne. - SEO/AI-Overview : HTML sémantique, JSON-LD (Organization, Person, Event, FAQPage, Article...), hreflang, sitemap dynamique, robots/humans.txt. - Sécurité : CSP hachée + en-têtes (.htaccess o2switch + _headers Cloudflare), HSTS. - Actualités éditées via Sveltia CMS (git-based) ; Strapi retiré. npm run build : vert · npm run check : 0 erreur / 0 warning · JS 97 Ko gzip. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
32 lines
967 B
TypeScript
32 lines
967 B
TypeScript
import type { Action } from 'svelte/action';
|
|
import { syncopatedDelay } from './tokens';
|
|
|
|
// use:reveal={index} — révèle l'élément à l'entrée dans le viewport avec cascade gwoka.
|
|
// L'état caché est posé en CSS uniquement sous html.has-js + prefers-reduced-motion: no-preference,
|
|
// donc le contenu reste lisible sans JS et sans animation.
|
|
export const reveal: Action<HTMLElement, number | undefined> = (node, index = 0) => {
|
|
const reduce = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
|
if (reduce) {
|
|
node.classList.add('is-visible');
|
|
return;
|
|
}
|
|
node.style.setProperty('--d', `${syncopatedDelay(index)}ms`);
|
|
const io = new IntersectionObserver(
|
|
(entries) => {
|
|
for (const e of entries) {
|
|
if (e.isIntersecting) {
|
|
node.classList.add('is-visible');
|
|
io.unobserve(node);
|
|
}
|
|
}
|
|
},
|
|
{ threshold: 0.12, rootMargin: '0px 0px -8% 0px' }
|
|
);
|
|
io.observe(node);
|
|
return {
|
|
destroy() {
|
|
io.disconnect();
|
|
}
|
|
};
|
|
};
|