From 1e6a180a3aa13e2868d4bcedfca77a446530b1b0 Mon Sep 17 00:00:00 2001 From: Jaume Garriga Maestre Date: Sat, 2 May 2026 00:18:38 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20Moian=C3=A8s=20noMap=20flag,=20fix=20Sel?= =?UTF-8?q?va=20and=20Segri=C3=A0=20name=20mismatches,=20hide=20tooltip=20?= =?UTF-8?q?in=20blind=20map=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 9cbc50f..08ac339 100644 --- a/index.html +++ b/index.html @@ -684,7 +684,7 @@ const ALL_COMARQUES = [ { name:"Alt Urgell", capital:"la Seu d'Urgell", emoji:"⛪", province:"L", mountain:true }, { name:"Solsonès", capital:"Solsona", emoji:"🏰", province:"L", mountain:true }, { name:"Noguera", capital:"Balaguer", emoji:"🌾", province:"L", mountain:false }, - { name:"Segria", capital:"Lleida", emoji:"🏛️", province:"L", mountain:false }, + { name:"Segrià", capital:"Lleida", emoji:"🏛️", province:"L", mountain:false }, { name:"Urgell", capital:"Tàrrega", emoji:"🌻", province:"L", mountain:false }, { name:"Garrigues", capital:"les Borges Blanques", emoji:"🫒", province:"L", mountain:false }, { name:"Pla d'Urgell", capital:"Mollerussa", emoji:"🌽", province:"L", mountain:false }, @@ -697,12 +697,12 @@ const ALL_COMARQUES = [ { name:"Baix Empordà", capital:"la Bisbal d'Empordà", emoji:"🏖️", province:"G", mountain:false }, { name:"Gironès", capital:"Girona", emoji:"🦁", province:"G", mountain:false }, { name:"Pla de l'Estany", capital:"Banyoles", emoji:"🦆", province:"G", mountain:false }, - { name:"La Selva", capital:"Santa Coloma de Farners", emoji:"🌿", province:"G", mountain:false }, + { name:"Selva", capital:"Santa Coloma de Farners", emoji:"🌿", province:"G", mountain:false }, // ── Barcelona ──────────────────────────────────────────────────────────── { name:"Berguedà", capital:"Berga", emoji:"🏕️", province:"B", mountain:true }, { name:"Osona", capital:"Vic", emoji:"🐄", province:"B", mountain:false }, { name:"Bages", capital:"Manresa", emoji:"⛏️", province:"B", mountain:false }, - { name:"Moianès", capital:"Moià", emoji:"🪨", province:"B", mountain:false }, + { name:"Moianès", capital:"Moià", emoji:"🪨", province:"B", mountain:false, noMap:true }, { name:"Anoia", capital:"Igualada", emoji:"🏭", province:"B", mountain:false }, { name:"Vallès Oriental", capital:"Granollers", emoji:"🌳", province:"B", mountain:false }, { name:"Vallès Occidental", capital:"Sabadell", emoji:"🏙️", province:"B", mountain:false }, @@ -1243,7 +1243,9 @@ function goHome(){ showScreen('screen-home'); } function startLevel(n){ currentLevel=n; currentQ=0; score=0; COMARQUES = getActiveComarques(); // refresh from current filter - questions=shuffle(COMARQUES); + // For map levels (5 & 6), exclude comarques without SVG path (noMap:true) + const mapComarques = COMARQUES.filter(c => !c.noMap && COMARCA_PATHS[c.name]); + questions=shuffle(n>=5 ? mapComarques : COMARQUES); sessionStart=Date.now(); if(n===1)initL1();else if(n===2)initL2();else if(n===3)initL3(); else if(n===4)initL4();else if(n===5){mapBlind=false;initMap();} @@ -1379,7 +1381,7 @@ function buildMap(){ path.setAttribute('data-name',name);path.style.setProperty('--mfill',fill); path.setAttribute('id','mp_'+info.id); path.addEventListener('click',()=>handleMapClick(path)); - const title=document.createElementNS('http://www.w3.org/2000/svg','title');title.textContent=name;path.appendChild(title); + if(!mapBlind){const title=document.createElementNS('http://www.w3.org/2000/svg','title');title.textContent=name;path.appendChild(title);} }else{path.setAttribute('class','comarca-bg');} svg.appendChild(path); }