Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
Changed styles, colors and minor fixes
  • Loading branch information
matefernandezcc committed Feb 6, 2025
1 parent 59d7404 commit c301a41
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 84 deletions.
Binary file added Partidos/Flag_of_Argentina.svg.webp
Binary file not shown.
20 changes: 16 additions & 4 deletions index.html → seterra.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@
</head>

<body>
<header>
<nav>
<img src="./Partidos/Flag_of_Argentina.svg.webp" width="auto" height="30px" style="padding-left: 15px; padding-bottom: 1px;">
<ul style="list-style: none;">
<li>Mapa de Buenos Aires</li>
<li>Mapa de CABA</li>
</ul>
</nav>
</header>

<footer>

</footer>

<div class="game-wrapper">
<!-- Barra superior -->
<div class="game-header">
Expand All @@ -23,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="450" height="auto" baseProfile="tiny" version="1.0">
<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">
<!-- 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 Expand Up @@ -91,7 +104,7 @@
<path id="Almirante Brown" d="M185.55 42.01 m-45.73.44 m51.08-.84-.05.02h0l-.03.02h-.01l-.02.01-.02.02-.04.01h0l-.03.02-.05.03-.04.01-.03.02-.04.02-.02.01-.03.01-.02.02h-.02l-.03.02-.03.02h0-.01 0l-.01.01-.03.02-.03.02h-.02l-.01.02.02.02.01.02.02.02.01.02h0l.02.02.01.02.02.02h0v.02h.02l.01.03.02.02h0l.02.01.01.03.02.02.01.02.02.02.02.03h0l-.01.02.02.03-.04.01.02.02.01.02.02.02.01.02.02.02.02.02.01.02.05-.03.04-.02.21.25h-.02l.17.2.03.03.01.02.02.03.02.02.02.03.02.02.02.02.02.03.01.02.02.02.02.02.01.02.02.02.02.03.02.02h-.02l-.02.02h-.01l-.03.02-.02.01-.01.01-.03.01-.06.04-.06.03-.06.03-.07.03-.03.02-.03.02-.04.02-.03.01-.04.02-.03.02-.04.02-.03.02.1.13.01.03.02.02-.04.02-.04.02-.04.02-.04.02-.05.03-.04.02-.04.02-.04.03-.05.02-.05.03-.03.01-.03.02-.04.02-.02.01-.03.02-.03.01-.03.02h-.02l-.02.02-.02.01-.03.02-.02.01-.03.01-.02-.02-.02-.03-.01-.02-.02-.02-.02-.03-.02-.03-.04.02-.03.02-.05.02-.04.02-.04.02-.04.02h-.01l-.02.01-.02.02h-.02l-.02.02h-.02l-.03.02-.02.01-.02.01-.02.01-.02.01-.02.01-.02.01h0l-.05.03-.03.01h0l-.03.01-.03.02-.03.01-.03.02-.03.01-.04.02-.02.01-.03.02-.03.01-.03.02-.03.01-.03.02h-.02 0l-.02.02h-.01 0l-.02.01-.03.02-.07.03-.03.02-.04.01-.02.02-.03.01-.03.02-.03.01-.04.02v-.02h-.01l-.02-.03-.02-.02-.02-.03-.02-.03-.01-.02-.02-.02-.02-.03-.01-.02-.02-.02-.01-.02-.02-.02-.02-.03-.01-.02-.02-.02v-.02l-.02-.02-.01-.01-.01-.02-.02-.02-.02-.02-.01-.02-.02-.03-.02-.03-.02-.03-.02-.02-.02-.02v-.02l-.02-.02-.02-.02-.01-.02-.01-.02.03-.02h.02l.02-.01.02-.02.04-.01.05-.03-.01-.01-.01-.02-.01-.01-.02-.02v-.02l-.02-.01-.01-.02-.01-.01-.01-.01-.02-.02-.01-.02-.02-.03-.02-.02-.01-.02-.02-.03-.02-.02h0l-.02-.03-.01-.02-.02-.02-.01-.02-.02-.02-.02-.03-.02-.02-.01-.03-.02-.02h0l-.02-.03-.01-.02-.02-.02v-.01l-.02-.02v-.01l-.02-.01-.01-.02-.02-.03-.02-.02-.01-.02-.02-.02-.01-.02v-.01l-.06-.06-.12-.17-.02-.03h0l-.02-.02-.01-.02-.01-.02h-.01l-.02-.03-.02-.03-.01-.02h0l-.02-.02h0l-.01-.02h0l-.02-.01h0l-.01-.02h0l-.02-.02h0l-.01-.02-.01-.02-.02-.02-.01-.02-.01-.01-.01-.02-.01-.01-.02-.03.02-.02h.02l.01-.01h.01l.03-.02.02-.01h0l.02-.01h.01l.02-.02h.02v-.01l.03-.01h0l.02-.01.02-.01h0l.03-.02h0l.03-.01h0l.03-.02h.01l.02-.01.01-.01.04-.02h.01l.03-.02h.01l.02-.01.02-.01.02-.01h0l.03-.02h.01l.03-.02h.02l.02-.02h.01l.03-.02h.02v-.01h.02l.02-.01h0l.02-.02h0l.03-.01h0l.02-.01h.01l.01-.01h.01l.01-.02h.03v-.01l.03-.01h0l.02-.01h0l.03-.02h.02l.03-.02h0l.02-.01h0l.02-.01.02-.01.02-.01h0l.03-.02h0v-.01h0-.01 0v-.01h0l-.01-.01h0v-.01h0-.01 0v-.01h0-.01 0v-.01h0-.01 0v-.01h0v-.01h-.01 0v-.01h0l-.03-.01v-.02h-.02v-.02h0l-.02-.02.02-.02h.02l.04-.02h0l.01-.01h.01l.02-.01.01-.01h.01l.02-.01v-.01l.03-.01h0l.01-.01h.02v-.01h.02v-.01h.02l.01-.02h.03v-.01l.03-.02.03-.01h0l.03-.01h0l.02-.01.03-.02h.01l.02-.02h.02l.02-.02h.01v-.01l.03-.02h.02l.02-.02h.02v-.01l.03-.01h0l.03-.02h0l.02-.01h0l.02-.01h.02v-.02h.03v-.01l.03-.01h0l.01-.01.04-.02.03-.02h.02v-.01h.02v-.02h.03l.03-.02h0l.03-.02h.01l.02-.01.02-.01h0l.04-.02h0l.03-.01h0l.03-.02h0l.03-.01h0l.03-.02h0l.03-.01h0l.02-.02.03-.01.03-.02.04-.02-.02-.02h0l-.02-.01v-.01l-.02-.02-.01-.02h-.01l-.01-.02.03-.02h.02l.02-.02.02-.01.03-.01.02-.01h0l.03-.02.03-.02.03-.01.03-.01h0l.02-.02h.02l.04-.02.03-.02.04-.02h.01l.03-.02.02-.01.02-.01h0l.02-.01h.01l.01-.02h.02l.01-.01h.01l.02-.01h0l.02-.01h0l.02-.02h.02l.02-.02v.02h.01l.02.02v.02l.02.02h.01v.02l.02.01h0v.01l.01.01h0l.01.02h0l.02.02h0l.01.01h0l.01.02h0l.02.02h0v.01h.01l.01.02h0l.01.01.01.01v.01l.02.01v.01h0l.01.01h0l.01.02h0l.02.02h0l.02.03v.01h0l.02.03h.01v.02l.02.02.01.01v.02h.02v.01l.01.02.01.02h0l.01.01.01.02.01.02.01.01.01.02.02.02v.01l.01.02.01.01v.02l.02.01v.02h0l.01.01h0v.01h.01v.01h0l.01.02h.01v.02h.02v.02h.01v.01l.01.01.01.02h0l.02.01h0v.02h0l.02.01h0v.02h.01v.01h.01v.02h.01l.01.01h0l.01.02h0l.01.01h0l.01.02h0l.02.02"
style="fill-rule:evenodd;fill:currentColor;fill-opacity:1" transform="translate(-669.25 -12.28) scale(11.8081)"
data-escudo="./Partidos/Escudos/AlmiranteBrown.png"
data-flag="./Partidos/Banderas/AlmiranteBrown.png"/>
data-flag="./Partidos/Banderas/AlmiranteBrown.jpg"/>

<path id="Florencio Varela" d="m192 41.09.02.01v.02l.05.05h0v.01l.03.02.01.02h0l.02.03h0l.02.02h0v.01h0l.01.01.02.02h0v.01h.01l.01.02h.01v.01h.01l.02.02v.01l.01.01.01.01.02.02h0l.02.02h0l.01.01.01.02h0l.02.01h0l.01.02h0l.02.02h0l.02.02h0l.02.02h0l.05.04.03.01h.01l.02.02h0l.02.01h0l.02.02.08.05h.02v.01l.02.01.02.02h.01l.02.02h0l.01.01.01.02h.02l.04.02.02.01h.02l.02.02h.02l.02.01h.01l.01.01h.02l.01.01h.01l.02.02.08.03.05.02h.03l.03.01h.03l.03.02h.03l.04.01h.03l.03.02h.04l.02.01.02.01.04.02.05.02.06.01h.02l.05.01h0l.03.01.04.02.05.04.02.03.03.04h0l.03.06.03.04h0l.01.04.01.03.01.04.01.04.02.04v.04l.02.03v.02l.08.24h.01v.01h0v.01h0v.01h0l.1.28.06.15.04.11v.01l.03.06.01.03h0l-.05.05-.02.02-.04.03-.02.02-.02.02-.03.03-.03.02-.03.03-.03.03-.03.02-.03.03-.03.02-.03.03-.03.03-.03.02-.06.05-.06.05h0l-.05.05-.06.05h0l-.06.05-.06.05-.06.06-.15.12-.14.13-.16.14-.33.28-.13.1.29.23h0l.67.53-.97.83.05.1h-.02l-.6.28-.03.01-.05.01-.23.19-.11-.24-.2-.34h0l-.15-.22-.08-.1.16-.09.2-.1-.07-.09h0l-.18-.23-.04-.05-.08-.11-.01-.02-.08-.1-.1-.14-.08-.12-.13-.17.25-.14h0l.35-.2h0l.1.03h.07l.09.03.09.02h.13l-.02-.02-.03-.04-.04-.06v-.02l-.02-.02-.05-.08-.14-.1-.03-.02-.06-.05-.11-.08-.09-.06-.06-.09-.06-.09-.11-.15-.06-.1-.02-.02-.04-.07-.02-.02-.02-.02-.01-.03-.1-.13.03-.02.04-.02.03-.02.04-.02.03-.01.04-.02.03-.02.03-.02.07-.03.06-.03.06-.03.06-.04h.03l.01-.02.02-.01.03-.01.01-.01.02-.01.02-.01-.02-.02-.02-.03-.02-.02-.01-.02-.02-.02-.02-.02-.01-.02-.02-.03-.02-.02-.02-.02-.02-.03-.02-.02-.02-.03-.01-.02-.03-.03-.17-.2h.02l-.2-.25-.05.02-.05.03-.01-.02-.02-.02-.02-.02-.01-.02-.02-.02-.01-.02-.02-.02.04-.01-.02-.03.02-.01v-.01l-.03-.03-.02-.02-.01-.02-.02-.02-.01-.03-.02-.02h0l-.02-.01-.01-.03h-.01v-.01h-.01l-.02-.03-.01-.02-.01-.01v-.01l-.02-.02-.02-.02-.01-.02-.02-.02.01-.02h.02l.03-.02.03-.02h.02v-.01l.03-.02.03-.01.02-.01.03-.02h.02l.02-.02.04-.02.03-.02.04-.01.05-.03.03-.01h0l.04-.03h.02l.02-.02h.01l.02-.01h.01l.04-.03.01.02h0l.02.02h0l.01.02h0l.02.01h0v.02h.01l.01.02h0l.02.02.01.02.02.02.01.02h0l.01.01h0v.01h.01l.01-.01h0v-.01h.01v-.01h.01l.01-.02h.01l.01-.01h0v-.01l.01-.01h0v-.05h0v-.04h0v-.01h0v-.02l.01-.01v-.02h0v-.02h0v-.01h0v-.01h0v-.01h0v-.01h0v-.01h.01l.01-.01h.01v-.02h0v-.02h.01l.01-.01h0v-.02h.01v-.07h0v-.02h.02l.01-.02.03-.01.02-.01h0l.02-.01.02-.01.01-.01h.01l.01-.02h.01l.02-.01.02-.01h.01l.01-.01.02-.01h0l.02-.01h0l.02-.01h0l.02-.02h0l.04-.02h.02l.02-.02h0l.04-.02h.02v-.01l.02-.01.02-.01h0l.03-.01h0l.02-.02h0l.03-.01h.01l.02-.02.03-.01.02-.02h.02l.01-.01h.01l.03-.02v.01h.01V41h.01l.01.01v.01h.01v.01l.02.01v.01l.01.01.01.01.01.01.01.02"
style="fill-rule:evenodd;fill:currentColor;fill-opacity:1" transform="translate(-669.25 -12.28) scale(11.8081)"
Expand Down Expand Up @@ -606,8 +619,7 @@
<!-- Cuadro popup para mostrar el id -->
<div id="popup" class="popup"></div>

<script src="./utils/zoom_drag.js"></script>
<script src="./utils/game.js"></script>
<script src="./utils/area_selector.js"></script>
<script src="./utils/zoom_drag.js"></script>
</body>
</html>
55 changes: 46 additions & 9 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,56 @@ body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
height: 200vh;
background-color: #f5f5f5;
}

/* //////////////////////////////////////////////// Header & Footer //////////////////////////////////////////////// */
header {
display: grid;
position: absolute;
align-self: flex-start;

background-color: rgb(74, 74, 218, .6);
height: 50px;
width: 100%;
}

header > nav {
display: flex;
align-self: center;
justify-self: flex-start;
}

header > nav > ul {
display: flex;
flex-direction: row;
gap: 25px;
padding-left: 4rem;
padding-top: 4px;
}

footer {
display: flex;
position: absolute;
align-self: flex-end;

background-color: rgb(74, 74, 218, .8);
height: 100vh;
width: 100%;
}

/* //////////////////////////////////////////////// SVG //////////////////////////////////////////////// */
.game-wrapper {
width: 75vmin;
height: 75vmin;
width: 60vmin;
height: 60vmin;
background-color: #a4d1dc;
border: 2px solid #ccc;
display: flex;
flex-direction: column;
align-items: center;
flex-direction: row;
align-self: flex-start;
top: 22vh;
right: 40vh;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
position: relative;
overflow: hidden;
Expand All @@ -36,7 +72,7 @@ body {
align-items: center;
background: hsla(0, 3%, 50%, 0.5);
display: flex;
font-size: clamp(.8rem, 2vw, 1.2rem);
font-size: clamp(.5rem, 1vw, 1rem);
gap: 1em;
left: 0;
padding: .5rem 8rem .5rem 1rem;
Expand Down Expand Up @@ -85,8 +121,8 @@ body {
align-self: center;
justify-self: center;
position: absolute;
right: 100px;
width: 30px;
right: 85px;
width: 35px;
height: auto;
opacity: 100%;
z-index: 2;
Expand Down Expand Up @@ -139,8 +175,9 @@ svg path:hover {
color: white;
padding: 5px 10px;
border-radius: 4px;
font-size: 14px;
font-size: 12px;
pointer-events: none;
user-select: none;
display: none;
transform: translate(-50%, -50%);
z-index: 1000;
Expand Down
63 changes: 0 additions & 63 deletions utils/area_selector.js

This file was deleted.

26 changes: 18 additions & 8 deletions utils/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,29 @@ function getCurrentObjective() {

// Función para seleccionar un path aleatorio y actualizar el span "area", la bandera y el escudo
function selectRandomArea() {
const paths = document.querySelectorAll('#Mapa path');
const allPaths = document.querySelectorAll('#Mapa path');
const areaSpan = document.querySelector('.area');
const flagImage = document.querySelector('.flag');
const escudoImage = document.querySelector('.escudo');

if (paths.length > 0 && areaSpan) {
// Reinicia los intentos fallidos para el nuevo objetivo
if (allPaths.length > 0 && areaSpan) {
incorrectCount = 0;

// Selecciona un path al azar
const randomIndex = Math.floor(Math.random() * paths.length);
const randomPath = paths[randomIndex];
// Filtrar solo los paths que tienen el fill por defecto (en este caso, "rgb(30, 131, 70)" o "#3b965f")
const candidatePaths = Array.from(allPaths).filter(path => {
const fill = window.getComputedStyle(path).fill.toLowerCase();
return fill === "rgb(30, 131, 70)" || fill === "#3b965f";
});

// Si no hay candidatos, todas las áreas han sido solucionadas.
if (candidatePaths.length === 0) {
//alert("¡Todos los objetivos han sido resueltos!");
return;
}

// Selecciona un path al azar de la lista filtrada
const randomIndex = Math.floor(Math.random() * candidatePaths.length);
const randomPath = candidatePaths[randomIndex];
const randomPathId = randomPath.id;

// Actualiza el contenido del <strong> dentro del span "area"
Expand Down Expand Up @@ -158,10 +169,9 @@ document.addEventListener("DOMContentLoaded", function() {
path.addEventListener('click', function(event) {
event.stopPropagation();

// Obtener el color actual del path
const computedFill = window.getComputedStyle(this).fill.toLowerCase();
if (computedFill === "rgb(243, 243, 243)" || computedFill === "rgb(226, 178, 45)" || computedFill === "rgb(191, 65, 64)") {
return; // Si ya está marcado, ignoramos el clic
return;
}

checkObjective(this.id);
Expand Down

0 comments on commit c301a41

Please sign in to comment.