Merge branch 'feat/v11-dg' into feat/page-cerveau-v1
This commit is contained in:
@@ -6,9 +6,9 @@ import ChatbotV2 from '../vue/ChatbotV2.vue';
|
||||
import IframeCarteAEP from './IframeCarteAEP.astro';
|
||||
import ScrollArticles from './ScrollArticles.astro';
|
||||
---
|
||||
<div class="h-full grid grid-rows-2 gap-2 p-2">
|
||||
<div id="col-centre-grid" class="h-full grid grid-rows-2 gap-2 p-2">
|
||||
<!-- HAUT 50% : tabs Carte O / Chatbot -->
|
||||
<section class="border border-neutral-200 rounded flex flex-col overflow-hidden bg-white">
|
||||
<section id="col-centre-haut" class="border border-neutral-200 rounded flex flex-col overflow-hidden bg-white">
|
||||
<nav role="tablist" aria-label="Vues centrales" class="flex border-b border-neutral-200 px-1 pt-1">
|
||||
<button
|
||||
type="button"
|
||||
@@ -56,6 +56,16 @@ import ScrollArticles from './ScrollArticles.astro';
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Poignee repli zone HAUT - mobile only -->
|
||||
<button
|
||||
id="col-centre-poignee"
|
||||
type="button"
|
||||
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"
|
||||
>
|
||||
<span class="block w-8 h-0.5 bg-neutral-400 rounded-full"></span>
|
||||
</button>
|
||||
|
||||
<!-- BAS 50% : iframe carte AEP + scroll articles Substack (PC4) -->
|
||||
<section class="border border-neutral-200 rounded overflow-y-auto bg-white">
|
||||
<div class="h-full min-h-[60vh] md:min-h-[400px]">
|
||||
@@ -66,6 +76,39 @@ import ScrollArticles from './ScrollArticles.astro';
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Poignee repli zone HAUT (mobile only, D.3)
|
||||
const grid = document.getElementById('col-centre-grid');
|
||||
const haut = document.getElementById('col-centre-haut');
|
||||
const poignee = document.getElementById('col-centre-poignee');
|
||||
|
||||
const applyRepliState = (replie: boolean) => {
|
||||
if (!grid || !haut) return;
|
||||
if (replie) {
|
||||
grid.classList.remove('grid-rows-2');
|
||||
grid.style.gridTemplateRows = '0fr 1fr';
|
||||
haut.style.overflow = 'hidden';
|
||||
haut.style.minHeight = '0';
|
||||
poignee?.setAttribute('aria-label', 'Deployer la Carte O');
|
||||
} else {
|
||||
grid.classList.add('grid-rows-2');
|
||||
grid.style.gridTemplateRows = '';
|
||||
haut.style.overflow = '';
|
||||
haut.style.minHeight = '';
|
||||
poignee?.setAttribute('aria-label', 'Replier la Carte O');
|
||||
}
|
||||
};
|
||||
|
||||
// Etat initial depuis sessionStorage
|
||||
const savedRepli = sessionStorage.getItem('tf-haut-replie');
|
||||
applyRepliState(savedRepli === 'true');
|
||||
|
||||
poignee?.addEventListener('click', () => {
|
||||
const current = sessionStorage.getItem('tf-haut-replie') === 'true';
|
||||
const next = !current;
|
||||
sessionStorage.setItem('tf-haut-replie', String(next));
|
||||
applyRepliState(next);
|
||||
});
|
||||
|
||||
// Tabs toggle.
|
||||
const tabs = document.querySelectorAll<HTMLButtonElement>('[data-tab]');
|
||||
const panels = document.querySelectorAll<HTMLElement>('[data-tab-panel]');
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<button
|
||||
id="hamburger-trigger"
|
||||
type="button"
|
||||
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"
|
||||
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"
|
||||
aria-label="Ouvrir le menu"
|
||||
aria-expanded="false"
|
||||
aria-controls="hamburger-drawer"
|
||||
|
||||
71
src/components/astro/MobileTabBar.astro
Normal file
71
src/components/astro/MobileTabBar.astro
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
// MobileTabBar - indicateur de colonne active sur mobile (V1.1-D.1)
|
||||
// Ecoute l'event "swipe-position-change" emis par SwipeContainer.vue
|
||||
// Affiche : Journal | Carte | Insta - colonne active surlignee
|
||||
---
|
||||
<nav
|
||||
id="mobile-tab-bar"
|
||||
aria-label="Navigation colonnes"
|
||||
class="fixed top-0 left-0 right-0 z-30 h-11 bg-white border-b border-neutral-200 flex items-stretch justify-around md:hidden"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
data-tab-index="0"
|
||||
class="mobile-tab flex-1 text-sm px-2 border-b-2 transition-colors"
|
||||
aria-label="Aller au journal"
|
||||
>
|
||||
Journal
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-tab-index="1"
|
||||
class="mobile-tab flex-1 text-sm px-2 border-b-2 transition-colors"
|
||||
aria-label="Aller à la carte"
|
||||
>
|
||||
Carte
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
data-tab-index="2"
|
||||
class="mobile-tab flex-1 text-sm px-2 border-b-2 transition-colors"
|
||||
aria-label="Aller à Instagram"
|
||||
>
|
||||
Insta
|
||||
</button>
|
||||
</nav>
|
||||
|
||||
<script>
|
||||
const tabs = document.querySelectorAll<HTMLButtonElement>('.mobile-tab');
|
||||
|
||||
function setActive(pos: number) {
|
||||
tabs.forEach((tab, i) => {
|
||||
const active = i === pos;
|
||||
tab.classList.toggle('text-neutral-900', active);
|
||||
tab.classList.toggle('font-medium', active);
|
||||
tab.classList.toggle('border-neutral-900', active);
|
||||
tab.classList.toggle('text-neutral-400', !active);
|
||||
tab.classList.toggle('border-transparent', !active);
|
||||
});
|
||||
}
|
||||
|
||||
// Etat initial depuis sessionStorage (cle utilisee par SwipeContainer.vue)
|
||||
const saved = sessionStorage.getItem('pc-position');
|
||||
const initial = saved !== null && !Number.isNaN(Number(saved)) ? Number(saved) : 1;
|
||||
setActive(initial);
|
||||
|
||||
// Ecoute les changements de position emis par SwipeContainer.vue
|
||||
document.addEventListener('swipe-position-change', (e: Event) => {
|
||||
const detail = (e as CustomEvent<{ pos: number }>).detail;
|
||||
if (detail && typeof detail.pos === 'number') {
|
||||
setActive(detail.pos);
|
||||
}
|
||||
});
|
||||
|
||||
// Les boutons de la tab bar declenchent un scroll via un event custom
|
||||
tabs.forEach((tab) => {
|
||||
tab.addEventListener('click', () => {
|
||||
const idx = Number(tab.dataset.tabIndex);
|
||||
document.dispatchEvent(new CustomEvent('mobile-tab-scroll', { detail: { pos: idx } }));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -22,12 +22,17 @@ const resetFade = () => {
|
||||
}, 3000);
|
||||
};
|
||||
|
||||
const emitPositionChange = (pos: number) => {
|
||||
document.dispatchEvent(new CustomEvent('swipe-position-change', { detail: { pos } }));
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
if (!emblaApi.value) return;
|
||||
emblaApi.value.on('select', () => {
|
||||
if (!emblaApi.value) return;
|
||||
selectedIndex.value = emblaApi.value.selectedScrollSnap();
|
||||
sessionStorage.setItem('pc-position', String(selectedIndex.value));
|
||||
emitPositionChange(selectedIndex.value);
|
||||
resetFade();
|
||||
});
|
||||
const saved = sessionStorage.getItem('pc-position');
|
||||
@@ -35,6 +40,13 @@ onMounted(() => {
|
||||
const idx = Number(saved);
|
||||
if (!Number.isNaN(idx)) emblaApi.value.scrollTo(idx, false);
|
||||
}
|
||||
// Ecoute les clics de la MobileTabBar
|
||||
document.addEventListener('mobile-tab-scroll', (e: Event) => {
|
||||
const detail = (e as CustomEvent<{ pos: number }>).detail;
|
||||
if (detail && typeof detail.pos === 'number') {
|
||||
emblaApi.value?.scrollTo(detail.pos);
|
||||
}
|
||||
});
|
||||
resetFade();
|
||||
});
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ interface Props {
|
||||
|
||||
const {
|
||||
title = 'trans-former.fr',
|
||||
description = 'Page-cerveau : journal, mindmap AEP, Insta',
|
||||
description = "Architecture d'ecologie politique - journal, carte conceptuelle, manifeste",
|
||||
} = Astro.props;
|
||||
---
|
||||
<!doctype html>
|
||||
|
||||
@@ -7,10 +7,12 @@ import ColCentre from '../components/astro/ColCentre.astro';
|
||||
import ColInsta from '../components/astro/ColInsta.astro';
|
||||
import SwipeContainer from '../components/vue/SwipeContainer.vue';
|
||||
import HamburgerMenu from '../components/astro/HamburgerMenu.astro';
|
||||
import MobileTabBar from '../components/astro/MobileTabBar.astro';
|
||||
import PopupOnboarding from '../components/astro/PopupOnboarding.astro';
|
||||
---
|
||||
<BaseLayout title="trans-former.fr">
|
||||
<HamburgerMenu />
|
||||
<MobileTabBar />
|
||||
<PopupOnboarding />
|
||||
|
||||
<!-- Desktop : grid 3 colonnes -->
|
||||
@@ -20,8 +22,8 @@ import PopupOnboarding from '../components/astro/PopupOnboarding.astro';
|
||||
<aside class="border-l border-neutral-200 overflow-y-auto"><ColInsta /></aside>
|
||||
</div>
|
||||
|
||||
<!-- Mobile : SwipeContainer Vue island -->
|
||||
<div class="md:hidden h-screen overflow-hidden">
|
||||
<!-- Mobile : SwipeContainer Vue island - decale de 44px pour la tabbar -->
|
||||
<div class="md:hidden overflow-hidden" style="height: calc(100dvh - 44px); margin-top: 44px;">
|
||||
<SwipeContainer client:load>
|
||||
<ColJournal slot="left" />
|
||||
<ColCentre slot="center" />
|
||||
|
||||
@@ -1 +1,23 @@
|
||||
@import "tailwindcss";
|
||||
|
||||
/* Typographie monospace - labels editoriaux (V1.1-G.1) */
|
||||
.font-mono-editorial,
|
||||
.hashtag-label,
|
||||
.nature-badge,
|
||||
.carte-o-label {
|
||||
font-family: 'Courier New', Courier, monospace;
|
||||
}
|
||||
|
||||
/* Corps de texte pages statiques (V1.1-G.2) */
|
||||
.prose-page {
|
||||
font-size: 1.0625rem;
|
||||
line-height: 1.75;
|
||||
color: #374151;
|
||||
max-width: 65ch;
|
||||
}
|
||||
.prose-page h1, .prose-page h2, .prose-page h3 {
|
||||
color: #111827;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user