مزّونةولاية سيدي بوزيد · وسط-غرب تونس. المعهد المنكوب في 14 أبريل 2025.
');
L.circle(MEZZOUNA, {
radius: 12000, color:'#A63D3D', weight:1.4,
fillColor:'#A63D3D', fillOpacity:.08, dashArray:'4 5'
}).addTo(map);
document.getElementById('mezzZoom').addEventListener('click', ()=>{
map.flyTo(MEZZOUNA, 13, {duration:1.6});
setTimeout(()=>marker.openPopup(), 1700);
});
document.getElementById('mezzWide').addEventListener('click', ()=>{
map.closePopup();
map.flyTo(TUNISIA_CENTER, 7, {duration:1.4});
});
setTimeout(()=>{
map.flyTo(MEZZOUNA, 11, {duration:2.2});
setTimeout(()=>{ map.invalidateSize(); marker.openPopup(); }, 2300);
}, 600);
}
const mObs = new IntersectionObserver((es)=>{
es.forEach(e=>{ if(e.isIntersecting){ initMap(); setTimeout(()=>map && map.invalidateSize(), 200); mObs.disconnect(); }});
},{threshold:.2});
mObs.observe(el);
})();
/* ============================================================
VIZ 01 — تناوب رؤساء الحكومات (desktop SVG)
============================================================ */
const MANDATES = [
{label:'قبل 2021', months:34, color:C.sky, note:'حكومات ائتلافية منبثقة عن الانتقال'},
{label:'الولاية أ', months:11, color:C.wheatDeep, note:'منفّذ إداري'},
{label:'الولاية ب', months:9, color:C.wheat, note:'تعديل حكومي'},
{label:'الولاية ج', months:14, color:C.olive, note:'توجيهات تُحدَّد في القمّة'},
{label:'الولاية د', months:8, color:C.rust, note:'تناوب سريع'},
{label:'الولاية هـ', months:6, color:C.earth, note:'تعبئة دائمة'},
{label:'الولاية و', months:5, color:C.skySoft, note:'تحكيم ظرفي'}
];
(function(){
const svg = d3.select('#ssqRota');
if(svg.empty()) return;
const W=1400, H=420, m={t:40,r:50,b:64,l:60};
const x = d3.scaleBand().domain(MANDATES.map(d=>d.label)).range([m.l, W-m.r]).padding(0.32);
const y = d3.scaleLinear().domain([0, 36]).range([H-m.b, m.t]);
svg.append('g').attr('transform',`translate(${m.l},0)`)
.call(d3.axisLeft(y).ticks(4).tickFormat(d=>d+' m'))
.selectAll('text').attr('font-family','JetBrains Mono, monospace').attr('font-size',12).attr('fill',C.mute);
svg.selectAll('.tick line, .domain').attr('stroke',C.ink).attr('stroke-opacity',.15);
y.ticks(4).forEach(t=>{
svg.append('line').attr('x1',m.l).attr('x2',W-m.r).attr('y1',y(t)).attr('y2',y(t)).attr('stroke',C.ink).attr('stroke-opacity',.06);
});
svg.append('line').attr('x1',m.l).attr('x2',W-m.r).attr('y1',y(24)).attr('y2',y(24))
.attr('stroke',C.rust).attr('stroke-dasharray','6 5').attr('stroke-width',1.4).attr('opacity',.6);
svg.append('text').attr('x',W-m.r).attr('y',y(24)-8).attr('text-anchor','end')
.attr('font-family','IBM Plex Sans Arabic, sans-serif').attr('font-size',12).attr('fill',C.rust)
.text('عتبة الاستمرارية الاستراتيجية');
const bars = svg.append('g').selectAll('rect').data(MANDATES).enter().append('rect')
.attr('x',d=>x(d.label)).attr('width',x.bandwidth())
.attr('y',y(0)).attr('height',0)
.attr('fill',d=>d.color).attr('fill-opacity',.85)
.attr('stroke',C.paper).attr('stroke-width',2).attr('rx',2);
svg.append('g').selectAll('text.lbl').data(MANDATES).enter().append('text')
.attr('x',d=>x(d.label)+x.bandwidth()/2).attr('y',H-m.b+24).attr('text-anchor','middle')
.attr('font-family','IBM Plex Sans Arabic, sans-serif')
.attr('font-size',13).attr('fill',C.ink).text(d=>d.label);
const vals = svg.append('g').selectAll('text.val').data(MANDATES).enter().append('text')
.attr('x',d=>x(d.label)+x.bandwidth()/2).attr('y',y(0)).attr('text-anchor','middle')
.attr('font-family','JetBrains Mono, monospace').attr('font-size',14).attr('font-weight',700)
.attr('fill',C.ink).attr('opacity',0).text(d=>d.months+' m');
bars.append('title').text(d=>d.note);
ScrollTrigger.create({
trigger:'#ssqRota', start:'top 80%',
onEnter:()=>{
bars.transition().duration(900).delay((d,i)=>i*120)
.attr('y',d=>y(d.months)).attr('height',d=>y(0)-y(d.months));
vals.transition().duration(500).delay((d,i)=>i*120+700)
.attr('y',d=>y(d.months)-10).attr('opacity',1);
}
});
})();
/* VIZ 01 — MOBILE */
(function(){
const wrap = document.getElementById('ssqRotaMobile');
if(!wrap) return;
const max = 36;
let html = '';
MANDATES.forEach(d=>{
html += `${d.label}
${d.months} m
— — عتبة الاستمرارية الاستراتيجية: 24 شهرًا — —
`;
wrap.innerHTML = html;
const obs = new IntersectionObserver((es)=>{
es.forEach(e=>{ if(e.isIntersecting){
wrap.querySelectorAll('.vizm-rota-fill').forEach((f,i)=>{
setTimeout(()=>{ f.style.width = f.dataset.w+'%'; }, i*90);
});
obs.disconnect();
}});
},{threshold:.3});
obs.observe(wrap);
})();
/* ============================================================
VIZ 02 — تونس المزدوجة
============================================================ */
const DIMS = [
{key:'حصّة الناتج المحلّي', littoral:85, interieur:15, unitL:'≈ 85 %', unitI:'≈ 15 %',
descL:'يحتكر الساحل (تونس الكبرى، صفاقس، سوسة) نحو 85% من الناتج المحلّي الإجمالي.',
descI:'لا تُمثّل المناطق الداخلية سوى جزء يسير من الناتج الوطني.',
src:'البنك الدولي، Tunisia Urbanization Review'},
{key:'المؤسسات الصناعية', littoral:92, interieur:8, unitL:'≈ 92 %', unitI:'≈ 8 %',
descL:'نحو 92% من المؤسسات الصناعية تقع على بعد ساعة من تونس أو صفاقس أو سوسة.',
descI:'كثافة صناعية ضعيفة جدًّا في الداخل.',
src:'البنك الدولي، الثورة غير المكتملة (الفصل 10)'},
{key:'معدّل البطالة', littoral:35, interieur:80, unitL:'7-11 %', unitI:'20-23 %',
descL:'بطالة بنسبة 7 إلى 11% في الولايات الساحلية.',
descI:'بطالة بنسبة 20 إلى 23% في ولايات الداخل (الكاف، جندوبة، القصرين، قفصة).',
src:'INS / البنك الدولي'},
{key:'النفاذ إلى شبكة المياه', littoral:97, interieur:62, unitL:'97 %', unitI:'61-66 %',
descL:'97% من أسر تونس الكبرى لديها ماء جارٍ.',
descI:'61 إلى 66% فقط في الشمال الغربي والوسط الغربي.',
src:'البنك الدولي / INS'}
];
(function(){
const svg = d3.select('#ssqSplit');
if(svg.empty()) return;
const W=760, H=540, mid=W/2, padTop=46, rowH=98, barMax=230;
const x = d3.scaleLinear().domain([0,100]).range([0, barMax]);
svg.append('text')
.attr('x', mid - barMax/2 - 7) // Position centrée sur la colonne de gauche
.attr('y', 26)
.attr('text-anchor', 'middle') // Alignement central
.attr('font-family', 'IBM Plex Sans Arabic, sans-serif')
.attr('font-weight', 700)
.attr('font-size', 18)
.attr('fill', C.sky)
.text('الساحل');
svg.append('text')
.attr('x', mid + barMax/2 + 7) // Position centrée sur la colonne de droite
.attr('y', 26)
.attr('text-anchor', 'middle') // Alignement central
.attr('font-family', 'IBM Plex Sans Arabic, sans-serif')
.attr('font-weight', 700)
.attr('font-size', 18)
.attr('fill', C.rust)
.text('المناطق الداخلية');
const info = document.getElementById('splitInfo');
DIMS.forEach((d,i)=>{
const yy = padTop + i*rowH + 28;
svg.append('text').attr('x',mid).attr('y',yy-14).attr('text-anchor','middle')
.attr('font-family','IBM Plex Sans Arabic, sans-serif').attr('font-size',12).attr('fill',C.mute)
.text(d.key);
const bl = svg.append('rect').attr('class','vs-bar')
.attr('x',mid-7).attr('y',yy).attr('height',24).attr('width',0)
.attr('fill',C.sky).attr('fill-opacity',.85).attr('rx',3).datum({side:'littoral', d});
const bi = svg.append('rect').attr('class','vs-bar')
.attr('x',mid+7).attr('y',yy).attr('height',24).attr('width',0)
.attr('fill',C.rust).attr('fill-opacity',.85).attr('rx',3).datum({side:'interieur', d});
bl.targetW = x(d.littoral); bi.targetW = x(d.interieur);
d._bl = bl; d._bi = bi;
function hov(side){
info.innerHTML = `
${d.key}
${side==='littoral'?'الساحل':'المناطق الداخلية'}
${side==='littoral'?d.unitL:d.unitI}
${side==='littoral'?d.descL:d.descI}
المصدر: ${d.src}
`;
}
bl.on('mouseenter',()=>hov('littoral')).on('click',()=>hov('littoral'));
bi.on('mouseenter',()=>hov('interieur')).on('click',()=>hov('interieur'));
});
ScrollTrigger.create({
trigger:'#ssqSplit', start:'top 78%',
onEnter:()=>{
DIMS.forEach((d,i)=>{
d._bl.transition().duration(1000).delay(i*100)
.attr('x',()=>mid-7-d._bl.targetW).attr('width',d._bl.targetW);
d._bi.transition().duration(1000).delay(i*100).attr('width',d._bi.targetW);
});
}
});
})();
/* VIZ 02 — MOBILE */
(function(){
const wrap = document.getElementById('ssqSplitMobile');
if(!wrap) return;
let html='';
DIMS.forEach(d=>{
html += `
${d.key}
`;
});
wrap.innerHTML = html;
const obs = new IntersectionObserver((es)=>{
es.forEach(e=>{ if(e.isIntersecting){
wrap.querySelectorAll('.vizm-fill').forEach((f,i)=>{
setTimeout(()=>{ f.style.width = f.dataset.w+'%'; }, i*120);
});
obs.disconnect();
}});
},{threshold:.25});
obs.observe(wrap);
})();
/* ============================================================
VIZ 03 — الركائز الثلاث
============================================================ */
const PILLARS = [
{name:'السياحة', val:34, color:C.sky, icon:'tourism', note:'عائدات سياحية معرَّضة للصدمات الخارجية.'},
{name:'المناولة الصناعية', val:38, color:C.olive, icon:'factory', note:'موجَّهة للسوق الأوروبية، قائمة على تدنّي كلفة العمل.'},
{name:'تحويلات المهجر', val:28, color:C.earth, icon:'diaspora', note:'نحو 6,5% من الناتج المحلّي في 2024؛ صمّام أمان اقتصادي.'}
];
(function(){
const svg = d3.select('#ssqPillars');
if(svg.empty()) return;
const W=1000, H=460;
const defs = svg.append('defs');
function grad(id,c1,c2){
const g=defs.append('linearGradient').attr('id',id).attr('x1','0').attr('y1','0').attr('x2','0').attr('y2','1');
g.append('stop').attr('offset','0%').attr('stop-color',c2);
g.append('stop').attr('offset','100%').attr('stop-color',c1);
}
grad('pg0', C.sky, C.skySoft); grad('pg1', C.olive, C.oliveSoft); grad('pg2', C.earth, C.earthSoft);
const f=defs.append('filter').attr('id','pSoft').attr('x','-30%').attr('y','-30%').attr('width','160%').attr('height','160%');
f.append('feDropShadow').attr('dx',0).attr('dy',6).attr('stdDeviation',8).attr('flood-color','rgba(21,25,31,.18)');
const fills=['url(#pg0)','url(#pg1)','url(#pg2)'];
const cx = [W*0.2, W*0.5, W*0.8];
const baseY = 360, colW = 150, maxH = 250;
const xScale = d3.scaleLinear().domain([0,40]).range([0,maxH]);
svg.append('rect').attr('x',60).attr('y',baseY).attr('width',W-120).attr('height',12).attr('fill',C.paper2).attr('stroke',C.line);
svg.append('rect').attr('x',40).attr('y',baseY+12).attr('width',W-80).attr('height',12).attr('fill',C.sand).attr('stroke',C.line);
svg.append('text').attr('x',W/2).attr('y',baseY+48).attr('text-anchor','middle')
.attr('font-family','IBM Plex Sans Arabic, sans-serif')
.attr('font-size',14).attr('fill',C.mute)
.text('ركيزة استقرار ماكرو-اقتصادي من دون تحوّل إنتاجي');
PILLARS.forEach((p,i)=>{
const colX = cx[i]-colW/2;
const col = svg.append('rect').attr('filter','url(#pSoft)')
.attr('x',colX).attr('width',colW).attr('y',baseY).attr('height',0)
.attr('fill',fills[i]).attr('stroke',C.paper).attr('stroke-width',2).attr('rx',3);
col.append('title').text(p.note);
const cap = svg.append('rect').attr('x',colX-10).attr('width',colW+20).attr('height',12)
.attr('y',baseY).attr('fill',p.color).attr('opacity',0).attr('rx',2);
svg.append('text').attr('x',cx[i]).attr('y',baseY+72).attr('text-anchor','middle')
.attr('font-family','IBM Plex Sans Arabic, sans-serif').attr('font-weight',600)
.attr('font-size',15).attr('fill',C.ink).text(p.name);
p._col=col; p._cap=cap;
});
ScrollTrigger.create({
trigger:'#ssqPillars', start:'top 80%',
onEnter:()=>{
PILLARS.forEach((p,i)=>{
const h=xScale(p.val);
p._col.transition().duration(1000).delay(i*150+100).attr('y',baseY-h).attr('height',h);
p._cap.transition().duration(600).delay(i*150+900).attr('y',baseY-h-12).attr('opacity',.95);
});
}
});
})();
/* VIZ 03 — MOBILE */
(function(){
const wrap = document.getElementById('ssqPillarsMobile');
if(!wrap) return;
const max=40;
let html='';
PILLARS.forEach(p=>{
html += `الساحل
${d.unitL}
الداخل
${d.unitI}
ركيزة
${v.label}
${v.desc}
← يُغذّي: ${feeds}
${i+1}
${s.name}
${s.leaves.map(l=>`${l}`).join('')}