Skip to content

Commit

Permalink
v1.2.1
Browse files Browse the repository at this point in the history
Mejoras y arreglos
  • Loading branch information
matefernandezcc committed Feb 7, 2025
1 parent ffbd6ad commit 8aec146
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions caba.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<main class="game-wrapper">
<!-- Barra superior -->
<div class="game-header">
<span class="objective game-header-divisor">0/135</span>
<span class="objective game-header-divisor">0/49</span>
<span>0<!-- -->%</span>
<span class="timer game-header-divisor">00:00</span>
<span class="area game-header-divisor">Haz clic en <strong>Area</strong> </span>
Expand All @@ -36,7 +36,7 @@
</div>

<div class="svg-wrapper">
<svg id="Mapa" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 2097.96 2423.91" width="1000" height="auto">
<svg id="Mapa" areas="49" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 2097.96 2423.91" width="1000" height="auto">
<path id="Villa Riachuelo" d="m540,2157 232,221 186,-262 -62,-61 -145,159 -144,-132 z"
style="fill:currentColor;fill-opacity:1"/>

Expand Down Expand Up @@ -88,7 +88,7 @@
<path id="Agronomía" d="M26,1095 m579,157 m-192,-108 m-125,-168 m30,-109 60,26 161,18 49,23 34,-112 45,-47 -16,-58 -88,70 -86,-39 z"
style="fill:currentColor;fill-opacity:1"/>

<path id="Villa PueyrcurrentColorón" d="M187,685 311,854 467,736 246,531 z"
<path id="Villa Pueyrredon" d="M187,685 311,854 467,736 246,531 z"
style="fill:currentColor;fill-opacity:1"/>

<path id="Parque Chas" d="M187,685 m302,54 71,32 86,-64 -37,-53 z"
Expand Down
4 changes: 2 additions & 2 deletions provincia.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div class="game-wrapper">
<!-- Barra superior -->
<div class="game-header">
<span class="objective game-header-divisor">0/135</span>
<span class="objective game-header-divisor">0/136</span>
<span>0<!-- -->%</span>
<span class="timer game-header-divisor">00:00</span>
<span class="area game-header-divisor">Haz clic en <strong>Area</strong> </span>
Expand All @@ -36,7 +36,7 @@
</div>

<div class="svg-wrapper">
<svg id="Mapa" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 2097.96 2423.91" width="400" height="auto" baseProfile="tiny" version="1.0">
<svg id="Mapa" areas="136" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 2097.96 2423.91" width="400" height="auto" baseProfile="tiny" version="1.0">
<!-- Conurbano AMBA -->
<path id="Lomas de Zamora" d="m187.27 38.86.03.03.01.02.02.03.03.04.04.04.02.03.01.02.01.01.01.01v.01l.02.02h0l.02.02v.01l.02.01h0v.02l.02.02h0l.02.02h0l.02.02h0l.02.03h0l.02.03.02.03.02.02h0l.02.03h0l.01.01.01.02h.01l.01.02.02.03h0l.02.02h0l.02.03h0l.02.03.02.02h0l.01.02h.01v.01l.02.02h0v.01h.01l.03.04.01.02h0l.01.01h0l.02.02h0l.02.02v.01l.01.02h.01v.02h.02v.02h.01l.02.03h0l.02.02v.01l.02.02h0l.01.02.01.01v.01l.02.02.02.02.01.02.03.03h0v.01h.08v.01h.04l.04.01h.03l.04.01h.04l.03.01h0l.05.01h.03l.04.01h.03l.04.01h0l.04.01h.04l.04.01h.04l.03.01h.03l.04.02h.02l.02.01.03.01h0l.04.01h.02l.02.03h0l.02.01h0l.02.02h.01l.02.03h0l.03.02h.02l.02-.01h.01l.01-.01.02-.01h.03v.01l.02.01.01.01h.01l.01.02h.01l.01.01.02.02h0l.02.01h.03l.03-.02h.02l.01-.01.02-.01h0l.02-.01.02-.01h0l.03-.02.02-.01h0l.03-.01h.01l.02-.02h0l.03-.01h.22l.01-.01h.02v.01l.02.02v.02l.02.02.01.01.02.03.02-.01.02.04.02.04.02.03h0l.01.02.01.02h0l.02.02v.02l.02.01v.02h.01l.02.03.02.03-.02.01-.02.01-.02.01h0l-.02.01h0l-.02.02h0-.02 0l-.02.01v.01h-.02l-.01.01h0l-.03.02-.02.01-.03.02h0l-.05.02-.03.02-.04.02h-.02l-.02.02h0-.03l-.03.02-.03.02-.02.01h0l-.03.02-.03.01-.02.01-.03.02h-.01l-.03.02v.01h.02l.01.03.02.02h0l.02.02h0l.02.02-.04.02-.03.02-.03.01-.02.01h0l-.03.02h0l-.03.02h0-.03v.01h0l-.03.01h0l-.03.02h0l-.03.01h0l-.03.02h-.02l-.01.01-.02.01h-.01 0l-.03.02h0l-.02.01-.01.01-.02.01h0l-.02.01-.03.02-.04.02h0-.01l-.02.02H189l-.02.01h0l-.01.01h-.01l-.01.01h-.01l-.01.01-.02.01h0l-.03.02h0-.02v.01l-.03.01h0l-.02.01-.02.01-.02.02h0l-.03.01-.01.01h-.01 0l-.01.01-.02.01h0l-.04.03h-.01 0-.01l-.03.02h0l-.03.01-.03.02h0l-.03.01-.01.01h-.02v.01h-.01l-.01.01h-.01v.01h-.02 0l-.02.02h-.01l-.02.01h0l-.02.02h-.03l-.01.02h0l-.04.01-.02.01-.02.02.01.02h0l.01.02h.01l.01.02h.02v.01h.01v.01h0v.01h.01v.01h.01v.01h.01v.01h0v.01h.01v.01h.01v.01h.01v.01h0l-.02.01h0l-.03.02h-.02l-.01.01h-.01l-.02.02h0l-.03.01h0l-.02.01h0l-.02.01h0l-.03.02h0-.02l-.01.01-.02.01h0l-.02.01h0l-.02.01h-.01l-.02.02h0l-.03.01h0l-.02.01h0l-.02.01-.01.01h-.01l-.02.01-.03.02h0-.01l-.02.01-.02.01-.03.02h0l-.04.02h0-.02l-.02.02h-.02l-.01.01-.02-.01-.01-.02-.01-.02-.01-.01-.01-.02-.02-.02-.01-.01-.01-.02-.01-.01-.03-.03-.02-.03v-.02l-.02-.02-.02-.02-.02-.02-.02-.02h0v-.01h0v-.01h0l-.03-.03v-.02l-.02-.01-.01-.02-.02-.02v-.02l-.04-.04-.02-.03-.02-.02-.02-.03v-.01l-.02-.02-.02-.03-.04-.04-.03-.03-.02-.03-.02-.02-.04-.06-.03-.04-.02-.03-.03-.04-.06-.09-.02-.03-.04-.04-.1-.14-.05-.06-.05-.06-.02-.04-.08-.1-.05-.08-.02-.02-.02-.02-.02-.04h-.01l-.02-.03v-.01l-.03-.03-.02-.02-.01-.03h-.01l-.01-.02-.06-.07-.01-.02-.04-.05-.01-.01-.02-.03-.02-.03-.01-.02-.03-.03v-.02l-.03-.02v-.01l-.02-.02-.04-.06-.03-.03-.02-.03-.01-.02-.02-.02-.01-.02-.03-.03-.03-.04-.04-.07-.06-.08h0l.03.02h.05l.02.01.02.01.01.02h.01l.01.01h.05v.02l.01.02.01.01.01.02.03.02h.03l.03.01.02.01.02.01.01.01.02.02.02.02V40h.02l.01.01h.01l.01-.01h0v-.02h0v-.02h0v-.04h0l-.02-.02v-.01l.02-.02.02-.02.21-.2.1-.09.1-.1.17-.16h0v-.01l.34-.4.03-.03"
style="fill-rule:evenodd;fill:currentColor;fill-opacity:1" transform="translate(-669.25 -12.28) scale(11.8081)"
Expand Down
2 changes: 2 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ footer {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
position: relative;
overflow: hidden;
user-select: none;
border-radius: 30px;
}

/* Barra superior */
Expand Down
23 changes: 14 additions & 9 deletions utils/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,28 @@ document.addEventListener("DOMContentLoaded", function() {


//////////////////////////////////////////////// Objetivos ////////////////////////////////////////////////
// Variables globales para llevar la cuenta de los intentos del objetivo actual
let incorrectCount = 0; // Contador de intentos fallidos para el objetivo actual
const totalObjectives = 135;
let solvedCorrect = 0;
const svgElement = document.getElementById("Mapa");
const totalObjectives = parseInt(svgElement.getAttribute("areas"), 10);

// Función para recalcular cuántos paths ya han sido solucionados (marcados con blanco, amarillo o rojo)
function recalcSolvedCount() {
solvedCorrect = 0;
let solvedIncorrect = 0;
const paths = document.querySelectorAll('#Mapa path');
let solved = 0;

paths.forEach(path => {
const fill = window.getComputedStyle(path).fill.toLowerCase();
if (fill === "rgb(243, 243, 243)" || fill === "white" ||
fill === "rgb(226, 178, 45)" || fill === "yellow" ||
fill === "rgb(191, 65, 64)" || fill === "red") {
solved++;
if (fill === "rgb(243, 243, 243)" || fill === "rgb(226, 178, 45)") {
solvedCorrect++;
}
if (fill === "rgb(191, 65, 64)") {
solvedIncorrect++;
}
});
return solved;

return solvedCorrect + solvedIncorrect;
}

// Función para actualizar el contador y el porcentaje en la interfaz
Expand All @@ -61,7 +66,7 @@ function updateObjectiveDisplay() {
objectiveSpan.textContent = `${solvedCount}/${totalObjectives}`;
}
if (percentageSpan) {
const percent = Math.floor((solvedCount / totalObjectives) * 100);
const percent = Math.floor((solvedCorrect / totalObjectives) * 100);
percentageSpan.textContent = `${percent}%`;
}
}
Expand Down

0 comments on commit 8aec146

Please sign in to comment.