6 Commits

Author SHA1 Message Date
Jules Neny
aa410ce7aa feat(v13-bg): layout 1 ecran fixe + hamburger desktop hide + categorie Pro 2026-05-11 20:00:16 +02:00
Jules Neny
e43ec60ecf merge(v13-p0): iframe AEP skeleton timeout fallback fix loading stuck 2026-05-11 19:53:54 +02:00
Jules Neny
1033099663 fix(v13-p0): iframe AEP skeleton timeout fallback (resolves loading stuck)
Le @load event ne fire pas (ou tardivement) sur l'iframe AEP enfermee
dans un wrapper avec transform scale(0.42) + viewport simulee 1440px.
Resultat : skeleton 'Chargement de la carte AEP...' reste affiche
indefiniment, masquant l'iframe meme si elle se charge.

Fix :
- setTimeout 2.5s dans onMounted qui force revealIframe() inconditionnellement
- onIframeLoad clear le timer si l'event fire dans les temps (cas nominal)
- retrait du z-10 sur le skeleton (defense en profondeur : si bug residuel,
  l'iframe sera quand meme visible derriere)
- factorisation revealIframe() partagee entre @load et fallback
- cleanup du timer dans onUnmounted

Build SSR : 5 pages, 0 warning, ~4s.
Tests browser manuels a faire par Jules pour confirmer disparition skeleton.
2026-05-11 19:52:57 +02:00
Jules Neny
9bb55bc311 merge(v12-p): preview article 3 zones + colonnes scrollables indep 2026-05-11 18:52:59 +02:00
Jules Neny
7ec0efdeb5 merge(v12-o): Carte O logos Brandfetch overlay (zoom>1.5x) 2026-05-11 18:52:58 +02:00
Jules Neny
12a2d40371 feat(v12-p): preview article 3 zones + colonnes scrollables indep
- PreviewArticle.vue : nouveau composant qui ecoute journal-item-click et s'insere entre Carte O et iframe AEP
- EmbedDynamique.vue : retire le swap article (iframe AEP toujours visible en bas)
- ColCentre.astro : passe en flex-col, preview ouverte = Carte O 33vh + Preview auto + iframe 67vh, overflow-y-auto sur le container
- Bouton 'Retour a la carte' emet preview-close -> grid revient 1/3 + 2/3
- Scroll independant : Journal (gauche), Centre (preview), Insta (droite)
- Drag-resize desactive quand preview ouverte (anti-collision)
2026-05-11 18:52:11 +02:00
11 changed files with 343 additions and 224 deletions

View File

@@ -1,13 +1,30 @@
--- ---
// Centre - HAUT : tabs (Carte O mindmap | Chatbot RAG branche PC7). // Centre - HAUT : tabs (Carte O mindmap | Chatbot RAG branche PC7).
// BAS : iframe carte AEP + scroll articles Substack (PC4). // MILIEU : preview article (V1.2-P) - inseree au clic journal-item-click.
// BAS : iframe carte AEP (toujours visible).
import CarteOWrapper from '../vue/CarteOWrapper.vue'; import CarteOWrapper from '../vue/CarteOWrapper.vue';
import ChatbotV2 from '../vue/ChatbotV2.vue'; import ChatbotV2 from '../vue/ChatbotV2.vue';
import EmbedDynamique from '../vue/EmbedDynamique.vue'; import EmbedDynamique from '../vue/EmbedDynamique.vue';
import PreviewArticle from '../vue/PreviewArticle.vue';
--- ---
<div id="col-centre-grid" class="h-full grid gap-2 p-2" style="grid-template-rows: 1fr 2fr;"> <!--
<!-- HAUT 50% : tabs Carte O / Chatbot --> V1.2-P : Col centre = flex column container.
<section id="col-centre-haut" class="border border-neutral-200 rounded flex flex-col overflow-hidden bg-white" style="min-height: 0;"> - Default : Carte O (1/3) + iframe AEP (2/3), pas de scroll vertical (h-full).
- Preview ouverte : Carte O (33vh fixe) + Preview (auto) + iframe AEP (67vh fixe), overflow-y-auto.
Flex-basis dynamique pilote via JS.
-->
<div
id="col-centre-grid"
class="flex flex-col gap-2 p-2"
data-preview-open="false"
style="height: 100%; overflow-y: hidden;"
>
<!-- HAUT (default flex-1 base 33%) : tabs Carte O / Chatbot -->
<section
id="col-centre-haut"
class="border border-neutral-200 rounded flex flex-col overflow-hidden bg-white"
style="min-height: 0; flex: 1 1 33%;"
>
<nav role="tablist" aria-label="Vues centrales" class="flex border-b border-neutral-200 px-1 pt-1"> <nav role="tablist" aria-label="Vues centrales" class="flex border-b border-neutral-200 px-1 pt-1">
<button <button
type="button" type="button"
@@ -58,7 +75,7 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
<!-- Drag handle desktop - redimensionnement vertical md+ --> <!-- Drag handle desktop - redimensionnement vertical md+ -->
<div <div
id="col-centre-drag-handle" id="col-centre-drag-handle"
class="hidden md:flex items-center justify-center h-2 cursor-row-resize hover:bg-neutral-200 transition-colors w-full -mt-1 -mb-1" class="hidden md:flex items-center justify-center h-2 cursor-row-resize hover:bg-neutral-200 transition-colors w-full -mt-1 -mb-1 shrink-0"
aria-hidden="true" aria-hidden="true"
> >
<span class="block w-10 h-0.5 bg-neutral-300 rounded-full"></span> <span class="block w-10 h-0.5 bg-neutral-300 rounded-full"></span>
@@ -69,13 +86,24 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
id="col-centre-poignee" id="col-centre-poignee"
type="button" type="button"
aria-label="Replier ou deployer la Carte O" aria-label="Replier ou deployer la Carte O"
class="md:hidden flex items-center justify-center h-6 bg-neutral-100 border-y border-neutral-200 cursor-pointer w-full -mt-2 -mb-2 hover:bg-neutral-200 transition-colors" class="md:hidden flex items-center justify-center h-6 bg-neutral-100 border-y border-neutral-200 cursor-pointer w-full -mt-2 -mb-2 hover:bg-neutral-200 transition-colors shrink-0"
> >
<span class="block w-8 h-0.5 bg-neutral-400 rounded-full"></span> <span class="block w-8 h-0.5 bg-neutral-400 rounded-full"></span>
</button> </button>
<!-- BAS 50% : embed dynamique (carte AEP default, article journal au click) --> <!-- MILIEU (V1.2-P) : preview article inseree entre Carte O et iframe AEP.
<section class="border border-neutral-200 rounded overflow-hidden bg-white" style="min-height: 0;"> Pas de border ici - PreviewArticle.vue gere son propre conteneur.
shrink-0 pour preserver sa taille auto, sinon flex pourrait l'ecraser. -->
<div id="col-centre-preview-slot" class="shrink-0" style="display: contents;">
<PreviewArticle client:visible />
</div>
<!-- BAS (default flex-1 base 67%) : iframe carte AEP toujours visible -->
<section
id="col-centre-bas"
class="border border-neutral-200 rounded overflow-hidden bg-white"
style="min-height: 0; flex: 1 1 67%;"
>
<div class="h-full min-h-[60vh] md:min-h-[400px]"> <div class="h-full min-h-[60vh] md:min-h-[400px]">
<EmbedDynamique client:visible /> <EmbedDynamique client:visible />
</div> </div>
@@ -83,29 +111,32 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
</div> </div>
<script> <script>
// Poignee repli zone HAUT (mobile only, D.3) // Poignee repli zone HAUT (mobile only)
const grid = document.getElementById('col-centre-grid'); const grid = document.getElementById('col-centre-grid');
const haut = document.getElementById('col-centre-haut'); const haut = document.getElementById('col-centre-haut');
const bas = document.getElementById('col-centre-bas');
const poignee = document.getElementById('col-centre-poignee'); const poignee = document.getElementById('col-centre-poignee');
// Sauvegarde flex-basis defaults pour restaure apres fermeture preview
let defaultHautFlex = '1 1 33%';
let defaultBasFlex = '1 1 67%';
const applyRepliState = (replie: boolean) => { const applyRepliState = (replie: boolean) => {
if (!grid || !haut) return; if (!grid || !haut) return;
if (grid.dataset.previewOpen === 'true') return; // skip si preview ouverte
if (replie) { if (replie) {
grid.classList.remove('grid-rows-2'); haut.style.flex = '0 0 0%';
grid.style.gridTemplateRows = '0fr 1fr';
haut.style.overflow = 'hidden'; haut.style.overflow = 'hidden';
haut.style.minHeight = '0'; haut.style.minHeight = '0';
poignee?.setAttribute('aria-label', 'Deployer la Carte O'); poignee?.setAttribute('aria-label', 'Deployer la Carte O');
} else { } else {
grid.classList.remove('grid-rows-2'); haut.style.flex = defaultHautFlex;
grid.style.gridTemplateRows = '1fr 2fr';
haut.style.overflow = ''; haut.style.overflow = '';
haut.style.minHeight = ''; haut.style.minHeight = '0';
poignee?.setAttribute('aria-label', 'Replier la Carte O'); poignee?.setAttribute('aria-label', 'Replier la Carte O');
} }
}; };
// Etat initial depuis sessionStorage
const savedRepli = sessionStorage.getItem('tf-haut-replie'); const savedRepli = sessionStorage.getItem('tf-haut-replie');
applyRepliState(savedRepli === 'true'); applyRepliState(savedRepli === 'true');
@@ -116,53 +147,78 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
applyRepliState(next); applyRepliState(next);
}); });
// Drag-resize desktop (>=768px) // V1.2-P : preview ouverte = container scrollable, Carte O et iframe AEP figes en vh.
const dragHandle = document.getElementById('col-centre-drag-handle'); const applyPreviewState = (open: boolean) => {
const gridEl = document.getElementById('col-centre-grid'); if (!grid || !haut || !bas) return;
grid.dataset.previewOpen = String(open);
if (open) {
// Memorise les flex actuels avant override (au cas ou l'user a drag-resize)
const curHautFlex = haut.style.flex;
const curBasFlex = bas.style.flex;
if (curHautFlex && !curHautFlex.startsWith('0 0')) defaultHautFlex = curHautFlex;
if (curBasFlex) defaultBasFlex = curBasFlex;
if (dragHandle && gridEl) { // Figer hauteurs : Carte O 33vh, iframe AEP 67vh - on perd le flex
let isDragging = false; haut.style.flex = '0 0 33vh';
let startY = 0; bas.style.flex = '0 0 67vh';
let startTop = 0; // Le container reste a 100% du parent (overflow-hidden de <main>),
// mais on active le scroll interne pour passer Carte O -> Preview -> iframe AEP.
const getGridHeight = () => gridEl.getBoundingClientRect().height; grid.style.height = '100%';
grid.style.minHeight = '';
const getHautPercent = (): number => { grid.style.overflowY = 'auto';
const rows = gridEl.style.gridTemplateRows; } else {
if (rows && rows.includes('fr')) { haut.style.flex = defaultHautFlex;
const parts = rows.split(' '); bas.style.flex = defaultBasFlex;
if (parts.length >= 2) { grid.style.height = '100%';
const top = parseFloat(parts[0]) || 1; grid.style.minHeight = '';
const bot = parseFloat(parts[parts.length - 1]) || 1; grid.style.overflowY = 'hidden';
return (top / (top + bot)) * 100;
} }
}
if (rows && rows.includes('%')) {
const parts = rows.split(' ');
return parseFloat(parts[0]) || 50;
}
return 33.33;
}; };
window.addEventListener('journal-item-click', () => {
applyPreviewState(true);
// Scroll vers la preview apres mount
requestAnimationFrame(() => {
const preview = document.querySelector('.preview-article');
if (preview && grid) {
const previewTop = (preview as HTMLElement).offsetTop;
grid.scrollTo({ top: Math.max(0, previewTop - 8), behavior: 'smooth' });
}
});
});
window.addEventListener('preview-close', () => {
applyPreviewState(false);
});
// Drag-resize desktop (>=768px) - desactive quand preview ouverte
const dragHandle = document.getElementById('col-centre-drag-handle');
if (dragHandle && grid && haut && bas) {
let isDragging = false;
let startY = 0;
let startHautH = 0;
let containerH = 0;
dragHandle.addEventListener('mousedown', (e: MouseEvent) => { dragHandle.addEventListener('mousedown', (e: MouseEvent) => {
if (grid.dataset.previewOpen === 'true') return;
if (sessionStorage.getItem('tf-haut-replie') === 'true') return; if (sessionStorage.getItem('tf-haut-replie') === 'true') return;
isDragging = true; isDragging = true;
startY = e.clientY; startY = e.clientY;
startTop = (getHautPercent() / 100) * getGridHeight(); startHautH = haut.getBoundingClientRect().height;
containerH = grid.getBoundingClientRect().height;
document.body.style.cursor = 'row-resize'; document.body.style.cursor = 'row-resize';
document.body.style.userSelect = 'none'; document.body.style.userSelect = 'none';
e.preventDefault(); e.preventDefault();
}); });
document.addEventListener('mousemove', (e: MouseEvent) => { document.addEventListener('mousemove', (e: MouseEvent) => {
if (!isDragging || !gridEl) return; if (!isDragging) return;
const delta = e.clientY - startY; const delta = e.clientY - startY;
const totalH = getGridHeight(); const newHautH = Math.min(Math.max(startHautH + delta, containerH * 0.2), containerH * 0.8);
const newTop = Math.min(Math.max(startTop + delta, totalH * 0.2), totalH * 0.8); const hautPct = (newHautH / containerH) * 100;
const topPct = (newTop / totalH) * 100; const basPct = 100 - hautPct;
const botPct = 100 - topPct; haut.style.flex = `1 1 ${hautPct.toFixed(1)}%`;
gridEl.style.gridTemplateRows = `${topPct.toFixed(1)}% ${botPct.toFixed(1)}%`; bas.style.flex = `1 1 ${basPct.toFixed(1)}%`;
gridEl.classList.remove('grid-rows-2');
}); });
document.addEventListener('mouseup', () => { document.addEventListener('mouseup', () => {
@@ -170,23 +226,37 @@ import EmbedDynamique from '../vue/EmbedDynamique.vue';
isDragging = false; isDragging = false;
document.body.style.cursor = ''; document.body.style.cursor = '';
document.body.style.userSelect = ''; document.body.style.userSelect = '';
const rows = gridEl.style.gridTemplateRows; const hf = haut.style.flex;
if (rows) sessionStorage.setItem('tf-centre-rows', rows); const bf = bas.style.flex;
if (hf) {
sessionStorage.setItem('tf-centre-haut-flex', hf);
defaultHautFlex = hf;
}
if (bf) {
sessionStorage.setItem('tf-centre-bas-flex', bf);
defaultBasFlex = bf;
}
} }
}); });
// Restaurer position depuis sessionStorage // Restaurer position depuis sessionStorage
const savedRows = sessionStorage.getItem('tf-centre-rows'); const savedHF = sessionStorage.getItem('tf-centre-haut-flex');
if (savedRows && sessionStorage.getItem('tf-haut-replie') !== 'true') { const savedBF = sessionStorage.getItem('tf-centre-bas-flex');
gridEl.style.gridTemplateRows = savedRows; if (savedHF && savedBF && sessionStorage.getItem('tf-haut-replie') !== 'true') {
gridEl.classList.remove('grid-rows-2'); haut.style.flex = savedHF;
bas.style.flex = savedBF;
defaultHautFlex = savedHF;
defaultBasFlex = savedBF;
} }
// Double-click sur drag handle = reset default 1/3 + 2/3 // Double-click sur drag handle = reset default 1/3 + 2/3
dragHandle.addEventListener('dblclick', () => { dragHandle.addEventListener('dblclick', () => {
gridEl.style.gridTemplateRows = '1fr 2fr'; haut.style.flex = '1 1 33%';
gridEl.classList.remove('grid-rows-2'); bas.style.flex = '1 1 67%';
sessionStorage.removeItem('tf-centre-rows'); sessionStorage.removeItem('tf-centre-haut-flex');
sessionStorage.removeItem('tf-centre-bas-flex');
defaultHautFlex = '1 1 33%';
defaultBasFlex = '1 1 67%';
}); });
} }

View File

@@ -34,6 +34,16 @@ const categories = [
], ],
hasSelector: false, hasSelector: false,
}, },
{
id: 'pro',
label: 'Pro',
color: '#0F172A',
hashtags: ['#building-public', '#pro'],
plateformes: [
{ id: 'linkedin', label: 'LinkedIn', url: 'https://www.linkedin.com/in/jules-neny/' },
],
hasSelector: false,
},
]; ];
--- ---
<div class="h-full flex flex-col p-4 pt-20 md:pt-6 gap-5"> <div class="h-full flex flex-col p-4 pt-20 md:pt-6 gap-5">
@@ -42,7 +52,7 @@ const categories = [
<details id="hashtags-accordion" class="border-t border-neutral-200 pt-4"> <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"> <summary class="font-semibold cursor-pointer select-none flex items-center justify-between">
<span>Hashtags</span> <span>Hashtags</span>
<span class="text-xs text-neutral-400 font-normal">3 categories</span> <span class="text-xs text-neutral-400 font-normal">4 categories</span>
</summary> </summary>
<div class="mt-3 flex flex-wrap gap-2" id="category-badges"> <div class="mt-3 flex flex-wrap gap-2" id="category-badges">
@@ -126,7 +136,7 @@ const categories = [
const PLATFORM_KEY = 'tf-platform-filter'; const PLATFORM_KEY = 'tf-platform-filter';
// Active state : map categoryId -> boolean // Active state : map categoryId -> boolean
const activeCategories: Record<string, boolean> = { politique: true, art: true, outils: true }; const activeCategories: Record<string, boolean> = { politique: true, art: true, outils: true, pro: true };
// Platform filter : map categoryId -> platformId | null // Platform filter : map categoryId -> platformId | null
const platformFilters: Record<string, string | null> = { politique: null }; const platformFilters: Record<string, string | null> = { politique: null };
@@ -138,15 +148,18 @@ const categories = [
const politiqueHashtags = ['#politique', '#aep-politique']; const politiqueHashtags = ['#politique', '#aep-politique'];
const artHashtags = ['#peinture', '#art']; const artHashtags = ['#peinture', '#art'];
const outilsHashtags = ['#stack', '#building-public']; const outilsHashtags = ['#stack', '#building-public'];
const proHashtags = ['#building-public', '#pro'];
const allPolitique = politiqueHashtags.every(h => storedHashtags[h] !== false); const allPolitique = politiqueHashtags.every(h => storedHashtags[h] !== false);
const allArt = artHashtags.every(h => storedHashtags[h] !== false); const allArt = artHashtags.every(h => storedHashtags[h] !== false);
const allOutils = outilsHashtags.every(h => storedHashtags[h] !== false); const allOutils = outilsHashtags.every(h => storedHashtags[h] !== false);
const allPro = proHashtags.every(h => storedHashtags[h] !== false);
if (Object.keys(storedHashtags).length > 0) { if (Object.keys(storedHashtags).length > 0) {
activeCategories['politique'] = allPolitique; activeCategories['politique'] = allPolitique;
activeCategories['art'] = allArt; activeCategories['art'] = allArt;
activeCategories['outils'] = allOutils; activeCategories['outils'] = allOutils;
activeCategories['pro'] = allPro;
} }
} catch { /* mode prive */ } } catch { /* mode prive */ }
@@ -163,6 +176,7 @@ const categories = [
politique: ['#politique', '#aep-politique'], politique: ['#politique', '#aep-politique'],
art: ['#peinture', '#art'], art: ['#peinture', '#art'],
outils: ['#stack', '#building-public'], outils: ['#stack', '#building-public'],
pro: ['#building-public', '#pro'],
}; };
for (const [catId, tags] of Object.entries(catHashtags)) { for (const [catId, tags] of Object.entries(catHashtags)) {
const active = activeCategories[catId] ?? true; const active = activeCategories[catId] ?? true;

View File

@@ -5,7 +5,7 @@
<button <button
id="hamburger-trigger" id="hamburger-trigger"
type="button" type="button"
class="fixed top-4 right-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:right-6" class="fixed top-4 right-4 z-50 p-3 bg-white/95 border border-neutral-200 rounded-lg shadow-md hover:bg-white transition-colors md:hidden"
aria-label="Ouvrir le menu" aria-label="Ouvrir le menu"
aria-expanded="false" aria-expanded="false"
aria-controls="hamburger-drawer" aria-controls="hamburger-drawer"

View File

@@ -1,23 +1,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted, onUnmounted } from 'vue' import { ref, computed, onMounted, onUnmounted } from 'vue'
interface JournalItem {
id: string
platform: 'substack' | 'gitea' | 'github' | 'instagram' | 'castopod' | 'blog' | 'linkedin'
hashtag: string
date: string
titre: string
extrait: string
url: string
thumbnail: string | null
}
const selectedItem = ref<JournalItem | null>(null)
const iframeRef = ref<HTMLIFrameElement | null>(null) const iframeRef = ref<HTMLIFrameElement | null>(null)
const wrapperRef = ref<HTMLDivElement | null>(null) const wrapperRef = ref<HTMLDivElement | null>(null)
const skeletonHidden = ref(false) const skeletonHidden = ref(false)
// Force rendu desktop de l'iframe AEP : viewport simulée 1440px + scale dynamique // Force rendu desktop de l'iframe AEP : viewport simulee 1440px + scale dynamique
const VIEWPORT_W = 1440 const VIEWPORT_W = 1440
const iframeScale = ref(0.42) const iframeScale = ref(0.42)
let resizeObs: ResizeObserver | null = null let resizeObs: ResizeObserver | null = null
@@ -35,31 +23,9 @@ const iframeStyle = computed(() => ({
transformOrigin: '0 0', transformOrigin: '0 0',
})) }))
const onJournalItemClick = (e: Event) => { let fallbackTimer: ReturnType<typeof setTimeout> | null = null
const ce = e as CustomEvent
if (ce.detail?.item) selectedItem.value = ce.detail.item
}
onMounted(() => { const revealIframe = () => {
window.addEventListener('journal-item-click', onJournalItemClick as EventListener)
if (wrapperRef.value && typeof ResizeObserver !== 'undefined') {
updateScale()
resizeObs = new ResizeObserver(updateScale)
resizeObs.observe(wrapperRef.value)
}
})
onUnmounted(() => {
window.removeEventListener('journal-item-click', onJournalItemClick as EventListener)
resizeObs?.disconnect()
resizeObs = null
})
const reset = () => {
selectedItem.value = null
skeletonHidden.value = false
}
const onIframeLoad = () => {
if (iframeRef.value) { if (iframeRef.value) {
iframeRef.value.classList.remove('opacity-0') iframeRef.value.classList.remove('opacity-0')
iframeRef.value.classList.add('opacity-100') iframeRef.value.classList.add('opacity-100')
@@ -67,59 +33,44 @@ const onIframeLoad = () => {
skeletonHidden.value = true skeletonHidden.value = true
} }
const extractInstaShortcode = (url: string): string | null => { onMounted(() => {
const m = url.match(/\/(p|reel)\/([^\/\?#]+)/) if (wrapperRef.value && typeof ResizeObserver !== 'undefined') {
return m ? m[2] : null updateScale()
} resizeObs = new ResizeObserver(updateScale)
resizeObs.observe(wrapperRef.value)
const embedUrl = computed(() => {
if (!selectedItem.value) return null
const item = selectedItem.value
if (item.platform === 'substack') {
return item.url.includes('?') ? item.url + '&embed=1' : item.url + '?embed=1'
} }
if (item.platform === 'instagram') { // Fallback : si @load ne fire pas dans 2.5s (transform/scale peut bloquer l'event),
const sc = extractInstaShortcode(item.url) // on revele quand meme l'iframe pour ne pas laisser le skeleton infini.
return sc ? `https://www.instagram.com/p/${sc}/embed/` : null fallbackTimer = setTimeout(() => {
revealIframe()
}, 2500)
})
onUnmounted(() => {
resizeObs?.disconnect()
resizeObs = null
if (fallbackTimer) {
clearTimeout(fallbackTimer)
fallbackTimer = null
} }
return null
}) })
const platformLabel = (p: string) => { const onIframeLoad = () => {
const labels: Record<string, string> = { if (fallbackTimer) {
substack: 'Substack', clearTimeout(fallbackTimer)
instagram: 'Instagram', fallbackTimer = null
gitea: 'Gitea',
github: 'GitHub',
castopod: 'Podcast',
blog: 'Blog',
linkedin: 'LinkedIn',
}
return labels[p] || p
}
const formatDate = (iso: string) => {
try {
const d = new Date(iso)
return isNaN(d.getTime())
? ''
: `${String(d.getDate()).padStart(2, '0')}/${String(d.getMonth() + 1).padStart(2, '0')}`
} catch {
return ''
} }
revealIframe()
} }
</script> </script>
<template> <template>
<div class="embed-dynamique h-full flex flex-col relative"> <div class="embed-dynamique h-full flex flex-col relative">
<div class="h-full">
<!-- DEFAULT : iframe AEP (aucun item selectionne) -->
<div v-if="!selectedItem" class="h-full">
<div ref="wrapperRef" class="relative h-full bg-neutral-100 overflow-hidden"> <div ref="wrapperRef" class="relative h-full bg-neutral-100 overflow-hidden">
<div <div
v-if="!skeletonHidden" v-if="!skeletonHidden"
id="embed-skeleton" id="embed-skeleton"
class="absolute inset-0 flex items-center justify-center bg-neutral-50 animate-pulse z-10" class="absolute inset-0 flex items-center justify-center bg-neutral-50 animate-pulse"
> >
<span class="text-neutral-400 text-sm">Chargement de la carte AEP...</span> <span class="text-neutral-400 text-sm">Chargement de la carte AEP...</span>
</div> </div>
@@ -134,75 +85,5 @@ const formatDate = (iso: string) => {
></iframe> ></iframe>
</div> </div>
</div> </div>
<!-- EMBED MODE : teaser + embed live ou carte incitative -->
<div v-else class="h-full flex flex-col overflow-y-auto">
<!-- Header : reset + hashtag -->
<div class="flex items-center justify-between px-4 py-2 border-b border-neutral-200 bg-white sticky top-0 z-10">
<button
class="text-xs text-neutral-500 hover:text-neutral-900 flex items-center gap-1"
@click="reset"
type="button"
>
- Retour a la carte
</button>
<span class="text-xs text-neutral-400" style="font-family: 'Courier New', Courier, monospace;">
{{ selectedItem.hashtag }}
</span>
</div>
<!-- Teaser -->
<div class="px-4 py-3 border-b border-neutral-100 bg-neutral-50">
<p class="text-[11px] text-neutral-500 mb-1">{{ formatDate(selectedItem.date) }} - {{ selectedItem.platform }}</p>
<h3 class="text-sm font-semibold text-neutral-900 leading-snug mb-1">{{ selectedItem.titre }}</h3>
<p v-if="selectedItem.extrait" class="text-xs text-neutral-600 leading-relaxed line-clamp-3">
{{ selectedItem.extrait }}
</p>
<img
v-if="selectedItem.thumbnail"
:src="selectedItem.thumbnail"
:alt="selectedItem.titre"
class="mt-2 w-full max-h-28 object-cover rounded"
loading="lazy"
/>
</div>
<!-- Embed live (Substack ou Instagram) -->
<div v-if="embedUrl" class="flex-1 min-h-[200px] bg-white">
<iframe
:src="embedUrl"
class="w-full h-full border-0 min-h-[300px]"
:title="selectedItem.titre"
loading="lazy"
sandbox="allow-scripts allow-same-origin allow-popups allow-forms allow-top-navigation"
></iframe>
</div>
<!-- Carte incitative (autres plateformes) -->
<div v-else class="flex-1 flex flex-col items-start justify-center px-4 py-6">
<p class="text-xs text-neutral-500 mb-3 italic">Embed non disponible pour cette plateforme.</p>
<a
:href="selectedItem.url"
target="_blank"
rel="noopener noreferrer"
class="inline-block px-4 py-2 bg-neutral-900 text-white text-sm rounded-lg hover:bg-neutral-700 transition-colors"
>
Voir sur {{ platformLabel(selectedItem.platform) }} ->
</a>
</div>
<!-- CTA propagation universel -->
<div class="px-4 py-3 border-t border-neutral-100">
<a
:href="selectedItem.url"
target="_blank"
rel="noopener noreferrer"
class="text-xs text-neutral-500 hover:text-neutral-900 underline"
>
Continuer sur {{ platformLabel(selectedItem.platform) }} - commenter, partager
</a>
</div>
</div>
</div> </div>
</template> </template>

View File

@@ -0,0 +1,152 @@
<script setup lang="ts">
import { ref, computed, onMounted, onUnmounted } from 'vue'
interface JournalItem {
id: string
platform: 'substack' | 'gitea' | 'github' | 'instagram' | 'castopod' | 'blog' | 'linkedin'
hashtag: string
date: string
titre: string
extrait: string
url: string
thumbnail: string | null
}
const selectedItem = ref<JournalItem | null>(null)
const onJournalItemClick = (e: Event) => {
const ce = e as CustomEvent
if (ce.detail?.item) selectedItem.value = ce.detail.item
}
const onPreviewCloseExternal = () => {
selectedItem.value = null
}
onMounted(() => {
window.addEventListener('journal-item-click', onJournalItemClick as EventListener)
window.addEventListener('preview-close-request', onPreviewCloseExternal as EventListener)
})
onUnmounted(() => {
window.removeEventListener('journal-item-click', onJournalItemClick as EventListener)
window.removeEventListener('preview-close-request', onPreviewCloseExternal as EventListener)
})
const close = () => {
selectedItem.value = null
window.dispatchEvent(new CustomEvent('preview-close'))
}
const extractInstaShortcode = (url: string): string | null => {
const m = url.match(/\/(p|reel)\/([^\/\?#]+)/)
return m ? m[2] : null
}
const embedUrl = computed(() => {
if (!selectedItem.value) return null
const item = selectedItem.value
if (item.platform === 'substack') {
return item.url.includes('?') ? item.url + '&embed=1' : item.url + '?embed=1'
}
if (item.platform === 'instagram') {
const sc = extractInstaShortcode(item.url)
return sc ? `https://www.instagram.com/p/${sc}/embed/` : null
}
return null
})
const platformLabel = (p: string) => {
const labels: Record<string, string> = {
substack: 'Substack',
instagram: 'Instagram',
gitea: 'Gitea',
github: 'GitHub',
castopod: 'Podcast',
blog: 'Blog',
linkedin: 'LinkedIn',
}
return labels[p] || p
}
const formatDate = (iso: string) => {
try {
const d = new Date(iso)
return isNaN(d.getTime())
? ''
: `${String(d.getDate()).padStart(2, '0')}/${String(d.getMonth() + 1).padStart(2, '0')}`
} catch {
return ''
}
}
</script>
<template>
<div v-if="selectedItem" class="preview-article border border-neutral-200 rounded overflow-hidden bg-white flex flex-col">
<!-- Header : reset + hashtag -->
<div class="flex items-center justify-between px-4 py-2 border-b border-neutral-200 bg-white">
<button
class="text-xs text-neutral-500 hover:text-neutral-900 flex items-center gap-1"
@click="close"
type="button"
>
- Retour a la carte
</button>
<span class="text-xs text-neutral-400" style="font-family: 'Courier New', Courier, monospace;">
{{ selectedItem.hashtag }}
</span>
</div>
<!-- Teaser -->
<div class="px-4 py-3 border-b border-neutral-100 bg-neutral-50">
<p class="text-[11px] text-neutral-500 mb-1">{{ formatDate(selectedItem.date) }} - {{ selectedItem.platform }}</p>
<h3 class="text-sm font-semibold text-neutral-900 leading-snug mb-1">{{ selectedItem.titre }}</h3>
<p v-if="selectedItem.extrait" class="text-xs text-neutral-600 leading-relaxed line-clamp-3">
{{ selectedItem.extrait }}
</p>
<img
v-if="selectedItem.thumbnail"
:src="selectedItem.thumbnail"
:alt="selectedItem.titre"
class="mt-2 w-full max-h-28 object-cover rounded"
loading="lazy"
/>
</div>
<!-- Embed live (Substack ou Instagram) -->
<div v-if="embedUrl" class="bg-white" style="height: 60vh; min-height: 400px;">
<iframe
:src="embedUrl"
class="w-full h-full border-0"
:title="selectedItem.titre"
loading="lazy"
sandbox="allow-scripts allow-same-origin allow-popups allow-forms allow-top-navigation"
></iframe>
</div>
<!-- Carte incitative (autres plateformes) -->
<div v-else class="flex flex-col items-start justify-center px-4 py-6">
<p class="text-xs text-neutral-500 mb-3 italic">Embed non disponible pour cette plateforme.</p>
<a
:href="selectedItem.url"
target="_blank"
rel="noopener noreferrer"
class="inline-block px-4 py-2 bg-neutral-900 text-white text-sm rounded-lg hover:bg-neutral-700 transition-colors"
>
Voir sur {{ platformLabel(selectedItem.platform) }} ->
</a>
</div>
<!-- CTA propagation universel -->
<div class="px-4 py-3 border-t border-neutral-100">
<a
:href="selectedItem.url"
target="_blank"
rel="noopener noreferrer"
class="text-xs text-neutral-500 hover:text-neutral-900 underline"
>
Continuer sur {{ platformLabel(selectedItem.platform) }} - commenter, partager
</a>
</div>
</div>
</template>

View File

@@ -14,7 +14,7 @@ const {
} = Astro.props; } = Astro.props;
--- ---
<!doctype html> <!doctype html>
<html lang="fr"> <html lang="fr" class="h-screen">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /> <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
@@ -29,11 +29,15 @@ const {
<meta name="twitter:title" content={title} /> <meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} /> <meta name="twitter:description" content={description} />
</head> </head>
<body class="m-0 bg-white text-neutral-900 antialiased min-h-screen flex flex-col"> <body class="m-0 bg-white text-neutral-900 antialiased h-screen flex flex-col overflow-hidden">
<div class="flex-shrink-0">
<SiteHeader /> <SiteHeader />
<div class="flex-1 flex flex-col min-h-0"> </div>
<div class="flex-1 flex flex-col min-h-0 overflow-hidden">
<slot /> <slot />
</div> </div>
<div class="flex-shrink-0">
<Footer /> <Footer />
</div>
</body> </body>
</html> </html>

View File

@@ -10,7 +10,7 @@ import HamburgerMenu from '../components/astro/HamburgerMenu.astro';
> >
<HamburgerMenu /> <HamburgerMenu />
<main class="min-h-screen bg-white"> <main class="h-full overflow-y-auto bg-white">
<article class="max-w-2xl mx-auto px-6 py-16 md:py-24"> <article class="max-w-2xl mx-auto px-6 py-16 md:py-24">
<header class="mb-10"> <header class="mb-10">

View File

@@ -15,18 +15,16 @@ import PopupOnboarding from '../components/astro/PopupOnboarding.astro';
<MobileTabBar /> <MobileTabBar />
<PopupOnboarding /> <PopupOnboarding />
<!-- Desktop : grid 3 colonnes (header 64px deja consommes par SiteHeader, on prend le reste) --> <!-- Desktop : grid 3 colonnes V1.3-BG : prend toute la place du wrapper flex-1 du BaseLayout.
<div Header et footer sont fixes (flex-shrink-0), pas besoin de calc(100vh - X). -->
class="hidden md:grid md:grid-cols-[320px_1fr_320px] overflow-hidden" <div class="hidden md:grid md:grid-cols-[320px_1fr_320px] h-full overflow-hidden">
style="height: calc(100vh - 64px);" <aside class="border-r border-neutral-200 overflow-y-auto h-full"><ColJournal /></aside>
> <main class="overflow-hidden h-full"><ColCentre /></main>
<aside class="border-r border-neutral-200 overflow-y-auto"><ColJournal /></aside> <aside class="border-l border-neutral-200 overflow-y-auto h-full"><ColInsta /></aside>
<main class="overflow-hidden"><ColCentre /></main>
<aside class="border-l border-neutral-200 overflow-y-auto"><ColInsta /></aside>
</div> </div>
<!-- Mobile : SwipeContainer Vue island - header 48px + tabbar 44px = 92px reserves --> <!-- Mobile : SwipeContainer Vue island - tabbar 44px reserve dans la zone flex-1 -->
<div class="md:hidden overflow-hidden" style="height: calc(100dvh - 48px - 44px); margin-top: 44px;"> <div class="md:hidden h-full overflow-hidden" style="padding-top: 44px;">
<SwipeContainer client:load> <SwipeContainer client:load>
<ColJournal slot="left" /> <ColJournal slot="left" />
<ColCentre slot="center" /> <ColCentre slot="center" />

View File

@@ -10,7 +10,7 @@ import HamburgerMenu from '../components/astro/HamburgerMenu.astro';
> >
<HamburgerMenu /> <HamburgerMenu />
<main class="min-h-screen bg-white"> <main class="h-full overflow-y-auto bg-white">
<article class="max-w-2xl mx-auto px-6 py-16 md:py-24"> <article class="max-w-2xl mx-auto px-6 py-16 md:py-24">
<!-- En-tete --> <!-- En-tete -->

View File

@@ -10,7 +10,7 @@ import HamburgerMenu from '../../components/astro/HamburgerMenu.astro';
> >
<HamburgerMenu /> <HamburgerMenu />
<main class="min-h-screen bg-white"> <main class="h-full overflow-y-auto bg-white">
<article class="max-w-xl mx-auto px-6 py-16 md:py-24"> <article class="max-w-xl mx-auto px-6 py-16 md:py-24">
<header class="mb-10"> <header class="mb-10">

View File

@@ -10,7 +10,7 @@ import HamburgerMenu from '../components/astro/HamburgerMenu.astro';
> >
<HamburgerMenu /> <HamburgerMenu />
<main class="min-h-screen bg-white"> <main class="h-full overflow-y-auto bg-white">
<article class="max-w-2xl mx-auto px-6 py-16 md:py-24"> <article class="max-w-2xl mx-auto px-6 py-16 md:py-24">
<header class="mb-10"> <header class="mb-10">