fix: Moianès noMap flag, fix Selva and Segrià name mismatches, hide tooltip in blind map mode
This commit is contained in:
12
index.html
12
index.html
@@ -684,7 +684,7 @@ const ALL_COMARQUES = [
|
|||||||
{ name:"Alt Urgell", capital:"la Seu d'Urgell", emoji:"⛪", province:"L", mountain:true },
|
{ name:"Alt Urgell", capital:"la Seu d'Urgell", emoji:"⛪", province:"L", mountain:true },
|
||||||
{ name:"Solsonès", capital:"Solsona", 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:"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:"Urgell", capital:"Tàrrega", emoji:"🌻", province:"L", mountain:false },
|
||||||
{ name:"Garrigues", capital:"les Borges Blanques", 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 },
|
{ 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:"Baix Empordà", capital:"la Bisbal d'Empordà", emoji:"🏖️", province:"G", mountain:false },
|
||||||
{ name:"Gironès", capital:"Girona", 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:"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 ────────────────────────────────────────────────────────────
|
// ── Barcelona ────────────────────────────────────────────────────────────
|
||||||
{ name:"Berguedà", capital:"Berga", emoji:"🏕️", province:"B", mountain:true },
|
{ name:"Berguedà", capital:"Berga", emoji:"🏕️", province:"B", mountain:true },
|
||||||
{ name:"Osona", capital:"Vic", emoji:"🐄", province:"B", mountain:false },
|
{ name:"Osona", capital:"Vic", emoji:"🐄", province:"B", mountain:false },
|
||||||
{ name:"Bages", capital:"Manresa", 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:"Anoia", capital:"Igualada", emoji:"🏭", province:"B", mountain:false },
|
||||||
{ name:"Vallès Oriental", capital:"Granollers", 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 },
|
{ name:"Vallès Occidental", capital:"Sabadell", emoji:"🏙️", province:"B", mountain:false },
|
||||||
@@ -1243,7 +1243,9 @@ function goHome(){ showScreen('screen-home'); }
|
|||||||
function startLevel(n){
|
function startLevel(n){
|
||||||
currentLevel=n; currentQ=0; score=0;
|
currentLevel=n; currentQ=0; score=0;
|
||||||
COMARQUES = getActiveComarques(); // refresh from current filter
|
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();
|
sessionStart=Date.now();
|
||||||
if(n===1)initL1();else if(n===2)initL2();else if(n===3)initL3();
|
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();}
|
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('data-name',name);path.style.setProperty('--mfill',fill);
|
||||||
path.setAttribute('id','mp_'+info.id);
|
path.setAttribute('id','mp_'+info.id);
|
||||||
path.addEventListener('click',()=>handleMapClick(path));
|
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');}
|
}else{path.setAttribute('class','comarca-bg');}
|
||||||
svg.appendChild(path);
|
svg.appendChild(path);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user