Skip to content

Commit

Permalink
fix menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeatgu committed Jan 14, 2020
1 parent 60bdd88 commit 7687353
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 27 deletions.
14 changes: 2 additions & 12 deletions comparador.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,8 @@
<nav class="navegacion menu--inola">
<a href="https://casacaida.co" class="navegacion-btn menu__item">
<span class="menu__item-name">Portada</span>
</a>
<a href="https://casacaida.co/evolucion.html#zaragoza" class="navegacion-btn menu__item">
<span class="menu__item-name">Evolución Zaragoza</span>
</a>
<a href="https://casacaida.co/evolucion.html#huesca" class="navegacion-btn menu__item">
<span class="menu__item-name">Evolución Huesca</span>
</a>
<a href="https://casacaida.co/evolucion.html#teruel" class="navegacion-btn menu__item">
<span class="menu__item-name">Evolución Teruel</span>
</a>
<a href="#enlaces" class="navegacion-btn menu__item">
<span class="menu__item-name">Enlaces de interés</span>
<a href="https://casacaida.co/evolucion.html" class="navegacion-btn menu__item">
<span class="menu__item-name">Evolución 2011-2019</span>
</a>
<a href="https://github.com/jorgeatgu/la-casa-caida" class="navegacion-btn menu__item">
<span class="menu__item-name">GitHub</span>
Expand Down
5 changes: 5 additions & 0 deletions css/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/styles.css.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions evolucion.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<a href="https://casacaida.co/evolucion.html#teruel" class="navegacion-btn menu__item">
<span class="menu__item-name">Evolución Teruel</span>
</a>
<a href="https://casacaida.co/comparador" class="navegacion-btn menu__item">
<span class="menu__item-name">Comparador</span>
</a>
<a href="#enlaces" class="navegacion-btn menu__item">
<span class="menu__item-name">Enlaces de interés</span>
</a>
Expand Down
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
<a href="https://casacaida.co/evolucion.html" class="navegacion-btn menu__item">
<span class="menu__item-name">Evolución 2011-2019</span>
</a>
<a href="https://casacaida.co/comparador" class="navegacion-btn menu__item">
<span class="menu__item-name">Comparador</span>
</a>
<a href="#enlaces" class="navegacion-btn menu__item">
<span class="menu__item-name">Enlaces de interés</span>
</a>
Expand Down
2 changes: 1 addition & 1 deletion js/comparador.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/index.js

Large diffs are not rendered by default.

23 changes: 18 additions & 5 deletions now.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
{
"name": "La casa caida",
"version": 2,
"alias": [
"casacaida.co"
]
"name": "La casa caida",
"version": 2,
"alias": [
"casacaida.co"
],
"routes": [
{
"src": "^/",
"dest": "/index.html"
},
{
"src": "^/comparador",
"dest": "/comparador.html"
},
{
"src": "^/evolucion",
"dest": "/evolucion.html"
}]
}
4 changes: 4 additions & 0 deletions src/css/_comarcas.css
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
.ss-main .ss-content {
margin-left: 0 !important;
}
header {
position: relative;
z-index: 100;
}
}

.container-comparador {
Expand Down
44 changes: 41 additions & 3 deletions src/js/comparador.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
const widthMobile = window.innerWidth > 0 ? window.innerWidth : screen.width;

function menu() {
var overlay = document.querySelector('.overlay');
var navigation = document.querySelector('.navegacion');
var body = document.querySelector('body');
var elementBtn = document.querySelectorAll('.navegacion-btn');
var burger = document.querySelector('.burger');

function classToggle() {
burger.classList.toggle('clicked');
overlay.classList.toggle('show');
navigation.classList.toggle('show');
body.classList.toggle('overflow');
}

document.querySelector('.burger').addEventListener('click', classToggle);
document.querySelector('.overlay').addEventListener('click', classToggle);

for (i = 0; i < elementBtn.length; i++) {
elementBtn[i].addEventListener('click', function() {
removeClass();
});
}

function removeClass() {
overlay.classList.remove('show');
navigation.classList.remove('show');
burger.classList.remove('clicked');
}
}

menu()

function grid() {
let ciudad;
const chart = d3.select('.grid-chart-element');
Expand Down Expand Up @@ -143,9 +175,15 @@ function grid() {

diferencia = dataz[0].population - 100

d3.select('.grid-chart-diferencia')
.html((d) =>
`<p class="diferencia-habitantes"><span class="numero-diferencia">${dataz[0].name}</span> tiene <span class="numero-diferencia">${diferencia}</span> habitantes más que la manifestación de Vox. `);
if (diferencia > 0) {
d3.select('.grid-chart-diferencia')
.html((d) =>
`<p class="diferencia-habitantes"><span class="numero-diferencia">${dataz[0].name}</span> tiene <span class="numero-diferencia">${diferencia}</span> habitantes más que la manifestación de Vox. `);
} else {
d3.select('.grid-chart-diferencia')
.html((d) =>
`<p class="diferencia-habitantes"><span class="numero-diferencia">${dataz[0].name}</span> tiene menos habitantes más que la manifestación de Vox. `);
}

updateChart(dataz);

Expand Down
4 changes: 0 additions & 4 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function menu() {
for (i = 0; i < elementBtn.length; i++) {
elementBtn[i].addEventListener('click', function() {
removeClass();
console.log('click');
});
}

Expand Down Expand Up @@ -1071,9 +1070,6 @@ const barNegative = (csvFile, cities) => {
const saldoMaxMin = -500;
const saldoMaxMax = 300;

console.log(saldoMax)
console.log(saldoMin)

const countX = d3.scaleBand().domain(dataz.map((d) => d.year));

const countY = d3
Expand Down

0 comments on commit 7687353

Please sign in to comment.