From 3b42abf59252ce74e98fbb7d883103c22b7e51f2 Mon Sep 17 00:00:00 2001 From: JaimeGuilherme Date: Thu, 5 Sep 2024 13:01:26 -0300 Subject: [PATCH] keeping button pressed while changing slidades and update setup name --- js/main.js | 29 ++++++++++++----------------- js/setup.js | 8 ++++---- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/js/main.js b/js/main.js index a62f3f3..d4e7c7f 100644 --- a/js/main.js +++ b/js/main.js @@ -57,7 +57,6 @@ filterGeo = (year, updateGeoJson = false) => { ...feature.properties, edicoes_topo: [], situacao_topo: "Não mapeado", - situacao: "Não mapeado" } })) }; @@ -71,7 +70,6 @@ filterGeo = (year, updateGeoJson = false) => { ...feature.properties, edicoes_orto: [], situacao_orto: "Não mapeado", - situacao: "Não mapeado" } })) }; @@ -108,9 +106,9 @@ loadLegend = ( let legendEl = document.getElementById(legendElId); - let initialVisibility1 = hideTopo ? 'hidden' : 'visible'; - let initialVisibility2 = hideOrto ? 'hidden' : 'visible'; - let initialDisplay = (hideOrto && hideOrto) ? 'none' : 'flex'; + let initialVisibility1 = (slideIndex > 2 && slideIndex < 7) ? (hideTopo ? 'hidden' : 'visible') : 'visible'; + let initialVisibility2 = (slideIndex > 2 && slideIndex < 7) ? (hideOrto ? 'hidden' : 'visible') : 'visible'; + let initialDisplay = (slideIndex > 2 && slideIndex < 7) ? ((hideOrto && hideOrto) ? 'none' : 'flex') : 'flex'; let topoButtonColor = hideTopo ? 'rgba(70, 130, 180, 0.2)' : 'rgba(70, 130, 180, 0.6)'; let ortoButtonColor = hideOrto ? 'rgba(70, 130, 180, 0.2)' : 'rgba(70, 130, 180, 0.6)'; @@ -127,7 +125,7 @@ loadLegend = ( ${legendTitle2} ` : ''; - + let subtitleCount = activeSubtitleCount; let legendContent1 = layers.map((layer, i) => { let color = colors[i]; @@ -164,7 +162,6 @@ loadLegend = (
${legendContent2}
`; - let year = (yearFilter >= yearInterval.min && yearFilter <= yearInterval.max) ? yearFilter : yearFilter < yearInterval.min ? yearInterval.min : yearInterval.max; let sliderContent = (slideIndex > 2 && slideIndex < 7) ? `

Escolha a partir de qual ano exibir as cartas

@@ -221,18 +218,18 @@ loadLegend = ( let legendContentEl = document.getElementById("legendContent"); topoButton?.addEventListener('click', function() { - let isActive = legendContent1El.style.visibility !== 'hidden'; - legendContent1El.style.visibility = isActive ? 'hidden' : 'visible'; - topoButton.style.backgroundColor = isActive ? 'rgba(70, 130, 180, 0.2)' : 'rgba(70, 130, 180, 0.6)'; - hideTopo = isActive ? true : false; + let isHidden = legendContent1El.style.visibility !== 'hidden'; + legendContent1El.style.visibility = isHidden ? 'hidden' : 'visible'; + topoButton.style.backgroundColor = isHidden ? 'rgba(70, 130, 180, 0.2)' : 'rgba(70, 130, 180, 0.6)'; + hideTopo = isHidden ? true : false; updateLegendDisplay(); }); ortoButton?.addEventListener('click', function() { - let isActive = legendContent2El.style.visibility !== 'hidden'; - legendContent2El.style.visibility = isActive ? 'hidden' : 'visible'; - ortoButton.style.backgroundColor = isActive ? 'rgba(70, 130, 180, 0.2)' : 'rgba(70, 130, 180, 0.6)'; - hideOrto = isActive ? true : false; + let isHidden = legendContent2El.style.visibility !== 'hidden'; + legendContent2El.style.visibility = isHidden ? 'hidden' : 'visible'; + ortoButton.style.backgroundColor = isHidden ? 'rgba(70, 130, 180, 0.2)' : 'rgba(70, 130, 180, 0.6)'; + hideOrto = isHidden ? true : false; updateLegendDisplay(); }); @@ -384,8 +381,6 @@ function plugin({ swiper, extendParams, on }) { return } if (mobileScreen()) document.getElementById("legend-icon").style.display = 'block' - hideTopo = false - hideOrto = false await setCurrentChapter(currentSlideId, false) }); diff --git a/js/setup.js b/js/setup.js index 668245b..f2c1889 100644 --- a/js/setup.js +++ b/js/setup.js @@ -54,7 +54,7 @@ var PROJECTS = { lotes: [ { name: 'situacao-geral-ct-25k', - subtitle: 'Carta Topográfica 1:25.000', + subtitle: 'Cartas 1:25.000', description: ``, zoom: [ [-58.00, -34.00], // southwestern corner of the bounds @@ -120,7 +120,7 @@ var PROJECTS = { lotes: [ { name: 'situacao-geral-ct-50k', - subtitle: 'Carta Topográfica 1:50.000', + subtitle: 'Cartas 1:50.000', description: ``, zoom: [ [-58.125, -34.125], // southwestern corner of the bounds @@ -186,7 +186,7 @@ var PROJECTS = { lotes: [ { name: 'situacao-geral-ct-100k', - subtitle: 'Carta Topográfica 1:100.000', + subtitle: 'Cartas 1:100.000', description: ``, zoom: [ [-58.250, -34.125], // southwestern corner of the bounds @@ -252,7 +252,7 @@ var PROJECTS = { lotes: [ { name: 'situacao-geral-ct-250k', - subtitle: 'Carta Topográfica 1:250.000', + subtitle: 'Cartas 1:250.000', description: ``, zoom: [ [-58.625, -34.125], // southwestern corner of the bounds