feat(pc2): hamburger nav + manifeste V1 + popup onboarding

- HamburgerMenu drawer slide-in left avec liens A propos, Manifeste, Mentions legales (ESC + clic overlay pour fermer)
- ColJournal enrichi : CTA Manifeste, accordeon Hashtags (7 plateformes, ferme mobile / ouvert desktop, persistence localStorage), skeleton Journal pour PC6
- Page /manifeste : V1 redige integre (em-dashes remplaces par tirets/points-virgules), pivot stylise blockquote, diagramme mouvements en 3 sections boites
- Page /manifeste/commander : stub form pre-inscription (V1 localStorage, V1.1 cable Listmonk)
- Page /a-propos : extrait de Contexte Global, 3-4 paragraphes Jules
- Page /mentions-legales : placeholder court (editeur, hebergeur Hetzner, pas de cookies)
- PopupOnboarding : micro-resume 3 lignes proposees, dismiss X / CTA / scroll 200px / ESC, flag tf-onboarded
This commit is contained in:
Jules Neny
2026-05-09 00:58:19 +02:00
parent aeaec6fc06
commit 712ed0eefa
7 changed files with 792 additions and 27 deletions

View File

@@ -1,14 +1,104 @@
---
// Placeholder Journal — PC6 remplit avec entries chrono
// ColJournal - colonne gauche : CTA Manifeste + Hashtags accordeon + Journal skeleton
// 7 hashtags = 7 plateformes (cf delta 15 du PILOTE-PC.md)
const hashtags = [
{ tag: '#manifeste', plateforme: 'Blog trans-former.fr', canal: 'ecriture longue' },
{ tag: '#building-public', plateforme: 'LinkedIn', canal: 'journal pro' },
{ tag: '#politique', plateforme: 'Substack', canal: 'pensee AEP' },
{ tag: '#aep-politique', plateforme: 'Insta @aep.politique', canal: 'carrousels manifeste' },
{ tag: '#peinture', plateforme: 'Insta @julesneny', canal: 'art / poesie / Corse' },
{ tag: '#podcast', plateforme: 'Castopod', canal: 'podcast.trans-former.fr' },
{ tag: '#stack', plateforme: 'GitHub', canal: 'open source' },
];
---
<section class="h-full p-4 flex flex-col gap-3">
<h2 class="text-lg font-semibold text-neutral-700">Journal</h2>
<ul class="flex flex-col gap-2 text-sm text-neutral-500">
<li class="border border-dashed border-neutral-300 rounded p-2">Entry placeholder 1</li>
<li class="border border-dashed border-neutral-300 rounded p-2">Entry placeholder 2</li>
<li class="border border-dashed border-neutral-300 rounded p-2">Entry placeholder 3</li>
<li class="border border-dashed border-neutral-300 rounded p-2">Entry placeholder 4</li>
<li class="border border-dashed border-neutral-300 rounded p-2">Entry placeholder 5</li>
</ul>
<p class="text-xs text-neutral-400 mt-auto">Nav latérale + manifeste CTA — PC2</p>
</section>
<div class="h-full flex flex-col p-4 pt-20 md:pt-6 gap-5">
<!-- CTA Manifeste -->
<a
href="/manifeste"
class="block px-4 py-3 bg-neutral-900 text-white rounded-lg font-medium text-center hover:bg-neutral-700 transition-colors shadow-sm"
>
Lire le manifeste &rarr;
</a>
<!-- Hashtags accordeon -->
<details id="hashtags-accordion" class="border-t border-neutral-200 pt-4">
<summary class="font-semibold cursor-pointer select-none flex items-center justify-between">
<span>Hashtags</span>
<span class="text-xs text-neutral-400 font-normal">7 plateformes</span>
</summary>
<ul class="mt-3 space-y-2 text-sm">
{hashtags.map(({ tag, plateforme, canal }) => (
<li>
<label class="flex items-start gap-2 cursor-pointer hover:bg-neutral-50 rounded p-1 -m-1 transition-colors">
<input
type="checkbox"
data-hashtag={tag}
class="mt-1 accent-neutral-900"
checked
/>
<span class="flex-1">
<span class="font-mono text-neutral-700 text-[13px]">{tag}</span>
<span class="block text-xs text-neutral-500 leading-snug">
{plateforme} ; {canal}
</span>
</span>
</label>
</li>
))}
</ul>
</details>
<!-- Journal chrono (skeleton, slot rempli par PC6) -->
<section class="border-t border-neutral-200 pt-4 flex-1 overflow-y-auto">
<h2 class="font-semibold mb-3 flex items-center justify-between">
<span>Journal</span>
<span class="text-xs text-neutral-400 font-normal">chrono</span>
</h2>
<div id="journal-list" class="space-y-3 text-sm">
<!-- PC6 remplit ce slot via <JournalList client:visible /> -->
<p class="text-neutral-400 italic text-xs">
Chargement du journal...
</p>
</div>
</section>
</div>
<script>
// Hashtags accordeon : ferme par defaut mobile, ouvert desktop (>= 768px)
const accordion = document.getElementById('hashtags-accordion') as HTMLDetailsElement | null;
if (accordion) {
const mql = window.matchMedia('(min-width: 768px)');
const apply = () => {
accordion.open = mql.matches;
};
apply();
mql.addEventListener('change', apply);
}
// Persistence filtres hashtags (localStorage)
const checkboxes = document.querySelectorAll<HTMLInputElement>('[data-hashtag]');
const STORAGE_KEY = 'tf-hashtag-filters';
let stored: Record<string, boolean> = {};
try {
stored = JSON.parse(localStorage.getItem(STORAGE_KEY) || '{}');
} catch {
stored = {};
}
checkboxes.forEach((cb) => {
const tag = cb.dataset.hashtag;
if (!tag) return;
if (tag in stored) cb.checked = stored[tag];
cb.addEventListener('change', () => {
stored[tag] = cb.checked;
try {
localStorage.setItem(STORAGE_KEY, JSON.stringify(stored));
} catch {
// mode prive : on continue silencieusement
}
window.dispatchEvent(
new CustomEvent('hashtag-filter-change', { detail: { ...stored } })
);
});
});
</script>

View File

@@ -1,12 +1,103 @@
---
// Placeholder hamburger menu — PC2 ajoute liens nav
// HamburgerMenu - drawer slide-in left avec liens nav (PC2)
// Astro vanilla + script inline, pas besoin d'island Vue
---
<button
id="hamburger-trigger"
type="button"
class="fixed top-3 right-3 z-30 p-2 rounded bg-white/80 border border-neutral-200 shadow-sm"
aria-label="Menu"
class="fixed top-4 left-4 z-50 p-3 bg-white/95 border border-neutral-200 rounded-lg shadow-md hover:bg-white transition-colors md:top-6 md:left-6"
aria-label="Ouvrir le menu"
aria-expanded="false"
aria-controls="hamburger-drawer"
>
<span class="block w-5 h-0.5 bg-neutral-700 mb-1"></span>
<span class="block w-5 h-0.5 bg-neutral-700 mb-1"></span>
<span class="block w-5 h-0.5 bg-neutral-700"></span>
<span class="block w-5 h-0.5 bg-neutral-800 mb-1"></span>
<span class="block w-5 h-0.5 bg-neutral-800 mb-1"></span>
<span class="block w-5 h-0.5 bg-neutral-800"></span>
</button>
<div
id="hamburger-drawer"
class="fixed inset-0 z-40 hidden"
role="dialog"
aria-modal="true"
aria-label="Menu de navigation"
>
<div
class="absolute inset-0 bg-black/30 transition-opacity"
data-drawer-close
aria-hidden="true"
></div>
<nav
id="hamburger-nav"
class="absolute left-0 top-0 h-full w-72 max-w-[80vw] bg-white shadow-xl p-6 transform -translate-x-full transition-transform duration-200 ease-out"
>
<button
type="button"
data-drawer-close
class="absolute top-4 right-4 w-9 h-9 flex items-center justify-center text-neutral-500 hover:text-neutral-900 text-2xl leading-none rounded-md hover:bg-neutral-100"
aria-label="Fermer le menu"
>
&times;
</button>
<ul class="mt-12 space-y-1 text-base">
<li>
<a
href="/a-propos"
class="block px-3 py-2 rounded-md text-neutral-800 hover:bg-neutral-100 hover:text-neutral-900 transition-colors"
>
A propos
</a>
</li>
<li>
<a
href="/manifeste"
class="block px-3 py-2 rounded-md text-neutral-800 hover:bg-neutral-100 hover:text-neutral-900 transition-colors"
>
Manifeste
</a>
</li>
<li>
<a
href="/mentions-legales"
class="block px-3 py-2 rounded-md text-neutral-800 hover:bg-neutral-100 hover:text-neutral-900 transition-colors"
>
Mentions legales
</a>
</li>
<!-- TODO V2 : ajouter liens ici (newsletter, soutien Liberapay, contact) -->
</ul>
</nav>
</div>
<script>
const trigger = document.getElementById('hamburger-trigger');
const drawer = document.getElementById('hamburger-drawer');
const nav = document.getElementById('hamburger-nav');
const open = () => {
if (!drawer || !nav) return;
drawer.classList.remove('hidden');
trigger?.setAttribute('aria-expanded', 'true');
requestAnimationFrame(() => nav.classList.remove('-translate-x-full'));
};
const close = () => {
if (!drawer || !nav) return;
nav.classList.add('-translate-x-full');
trigger?.setAttribute('aria-expanded', 'false');
setTimeout(() => drawer.classList.add('hidden'), 200);
};
trigger?.addEventListener('click', open);
drawer?.querySelectorAll('[data-drawer-close]').forEach((el) =>
el.addEventListener('click', close)
);
// ESC pour fermer
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && drawer && !drawer.classList.contains('hidden')) {
close();
}
});
</script>

View File

@@ -1,11 +1,101 @@
---
// Placeholder popup onboarding — PC2 fait l'animation et le contenu
// PopupOnboarding - micro-resume premier visit, localStorage flag tf-onboarded
// Le micro-resume est une PROPOSITION Opus a iterer avec Jules.
// Stocke en constante en tete pour iteration facile.
const microResume = `Architecture, ecologie, politique : un commun a construire ensemble.
Reapproprions-nous nos infrastructures vitales en repartant de l'existant.
Ce site, c'est le journal vivant de cette bifurcation.`;
---
<div
id="pc-onboarding"
class="hidden fixed inset-0 z-40 bg-black/30 items-center justify-center"
id="onboarding-popup"
class="fixed inset-0 z-[60] hidden bg-black/50 backdrop-blur-sm items-center justify-center p-4"
role="dialog"
aria-modal="true"
aria-labelledby="onboarding-text"
>
<div class="bg-white p-6 rounded shadow-lg max-w-sm">
<p class="text-sm text-neutral-600">Pop-up onboarding — PC2</p>
<div class="bg-white rounded-xl max-w-md w-full p-6 md:p-7 shadow-2xl relative animate-fade-in">
<button
id="onboarding-close"
type="button"
class="absolute top-3 right-3 w-8 h-8 flex items-center justify-center text-neutral-400 hover:text-neutral-800 text-2xl leading-none rounded-md hover:bg-neutral-100 transition-colors"
aria-label="Fermer"
>
&times;
</button>
<p
id="onboarding-text"
class="text-base md:text-lg leading-relaxed text-neutral-800 whitespace-pre-line pr-6"
>{microResume}</p>
<button
id="onboarding-cta"
type="button"
class="mt-5 px-4 py-2.5 bg-neutral-900 text-white rounded-lg w-full font-medium hover:bg-neutral-700 transition-colors"
>
Entrer
</button>
</div>
</div>
<style>
@keyframes fadeIn {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
animation: fadeIn 0.25s ease-out;
}
</style>
<script>
const STORAGE_KEY = 'tf-onboarded';
const popup = document.getElementById('onboarding-popup');
const closeBtn = document.getElementById('onboarding-close');
const ctaBtn = document.getElementById('onboarding-cta');
let alreadyOnboarded = false;
try {
alreadyOnboarded = !!localStorage.getItem(STORAGE_KEY);
} catch {
// mode prive : on affiche quand meme, sans persistence
alreadyOnboarded = false;
}
if (!alreadyOnboarded && popup) {
requestAnimationFrame(() => {
popup.classList.remove('hidden');
popup.classList.add('flex');
});
}
const dismiss = () => {
if (!popup) return;
popup.classList.remove('flex');
popup.classList.add('hidden');
try {
localStorage.setItem(STORAGE_KEY, '1');
} catch {
// mode prive : pas de persistence
}
window.removeEventListener('scroll', onScroll);
};
closeBtn?.addEventListener('click', dismiss);
ctaBtn?.addEventListener('click', dismiss);
// Dismiss implicite au scroll 200px (engagement implicite)
const onScroll = () => {
if (window.scrollY > 200) {
dismiss();
}
};
if (!alreadyOnboarded) {
window.addEventListener('scroll', onScroll, { passive: true });
}
// ESC pour fermer
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && popup && !popup.classList.contains('hidden')) {
dismiss();
}
});
</script>