Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arreglo css #14

Open
wants to merge 71 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
be4003c
datos ingresados
CamilaCarrenoV Jun 17, 2024
2e32cff
Merge pull request #1 from CamilaCarrenoV/RamaCami
CamilaCarrenoV Jun 17, 2024
a099982
todos los datos listos
CamilaCarrenoV Jun 18, 2024
461c88d
Merge pull request #2 from CamilaCarrenoV/RamaCami
CamilaCarrenoV Jun 18, 2024
55e28e2
datos arreglados
CamilaCarrenoV Jun 18, 2024
bb45360
Merge pull request #3 from CamilaCarrenoV/RamaCami
CamilaCarrenoV Jun 18, 2024
6529ee0
cambios test
CamilaCarrenoV Jun 18, 2024
22e4e3f
Merge pull request #4 from CamilaCarrenoV/RamaCami
CamilaCarrenoV Jun 18, 2024
10da88e
cambio test corregido
Danimar-g Jun 18, 2024
96f1332
cambio html primero
Danimar-g Jun 19, 2024
4a01246
Merge pull request #5 from Danimar-g/RamaDani
Danimar-g Jun 19, 2024
8e562d4
html con botones
CamilaCarrenoV Jun 19, 2024
22cddd6
Merge pull request #6 from CamilaCarrenoV/visualizacionData
CamilaCarrenoV Jun 19, 2024
04c381a
visualizacion
CamilaCarrenoV Jun 20, 2024
be68899
html con option
CamilaCarrenoV Jun 24, 2024
2fa45ed
Merge pull request #7 from CamilaCarrenoV/visualizacionData
CamilaCarrenoV Jun 24, 2024
65b82a8
todos los li listos
Danimar-g Jun 24, 2024
c329c51
Merge pull request #8 from CamilaCarrenoV/RamaDani
Danimar-g Jun 24, 2024
05f22b7
css infernal
Danimar-g Jun 26, 2024
7f2b73b
Merge pull request #9 from Danimar-g/RamaDani
Danimar-g Jun 26, 2024
f9deb80
arreglos css infernal
Danimar-g Jun 26, 2024
3968f78
cambios actualizados css
Danimar-g Jun 27, 2024
f8af483
Merge pull request #10 from Danimar-g/RamaDani
Danimar-g Jun 27, 2024
574eb2b
aqsdf
CamilaCarrenoV Jun 27, 2024
ff18b0a
Merge branch 'main' of https://github.com/CamilaCarrenoV/DEV015-datav…
CamilaCarrenoV Jun 27, 2024
45dd4ba
cambios proyecto
CamilaCarrenoV Jun 27, 2024
eccf71b
Empezando hito3
CamilaCarrenoV Jun 28, 2024
75cada4
empezando funciones hito 3
CamilaCarrenoV Jun 28, 2024
65c20de
empezando hito 3
CamilaCarrenoV Jun 28, 2024
8dd5c2a
hito 3
CamilaCarrenoV Jun 28, 2024
3439237
organizando las ramas
CamilaCarrenoV Jul 2, 2024
9314b6c
Merge pull request #12 from CamilaCarrenoV/visualizacionData
CamilaCarrenoV Jul 2, 2024
bcd5e96
funcion filtrado listo
CamilaCarrenoV Jul 2, 2024
4a30267
Merge pull request #13 from CamilaCarrenoV/hito3
CamilaCarrenoV Jul 2, 2024
211ed28
cambio main
Danimar-g Jul 3, 2024
15b324f
cambios funcion ordenar
Danimar-g Jul 3, 2024
ab254a8
Merge pull request #14 from Danimar-g/RamaPanii
CamilaCarrenoV Jul 3, 2024
fc0c787
ultimos cambios del hito 3
CamilaCarrenoV Jul 4, 2024
0d1ce83
ultimos cambios hito 3
CamilaCarrenoV Jul 4, 2024
054afb6
Merge pull request #15 from CamilaCarrenoV/hito3
CamilaCarrenoV Jul 4, 2024
8b5c912
cambios selectores css
Danimar-g Jul 5, 2024
af1c6c7
boton filtrado
CamilaCarrenoV Jul 6, 2024
c9387e4
Merge pull request #16 from CamilaCarrenoV/hito3
CamilaCarrenoV Jul 8, 2024
568fe29
actualizacion css
Danimar-g Jul 8, 2024
6c605c9
Merge pull request #17 from Danimar-g/RamaPanii
Danimar-g Jul 8, 2024
e496948
hito 3 listo
CamilaCarrenoV Jul 8, 2024
9984fe2
Merge pull request #18 from CamilaCarrenoV/hito3
CamilaCarrenoV Jul 8, 2024
c7b2d24
hito 4 empezado
CamilaCarrenoV Jul 9, 2024
cdc7518
Merge pull request #19 from CamilaCarrenoV/hito3
CamilaCarrenoV Jul 9, 2024
75ba07b
datos estadisticos casi listos
CamilaCarrenoV Jul 10, 2024
e12cc66
Merge pull request #20 from CamilaCarrenoV/hito3
CamilaCarrenoV Jul 10, 2024
f0ca448
css datos curiosos incompleto
Danimar-g Jul 11, 2024
a03f164
Merge pull request #21 from Danimar-g/RamaPanii
Danimar-g Jul 11, 2024
c594254
arreglos de data y css
CamilaCarrenoV Jul 12, 2024
078aa2b
proyecto casi listo
CamilaCarrenoV Jul 12, 2024
b46d462
Merge pull request #22 from CamilaCarrenoV/hito3
CamilaCarrenoV Jul 12, 2024
029a86d
código ordenado
CamilaCarrenoV Jul 17, 2024
55e5670
Merge pull request #23 from CamilaCarrenoV/codigoOrdenado
CamilaCarrenoV Jul 17, 2024
0c4d2aa
cambios finales css
Danimar-g Jul 18, 2024
44db849
filtro y orden listo
CamilaCarrenoV Jul 18, 2024
41cec57
Merge pull request #24 from Danimar-g/RamaMejorada
Danimar-g Jul 18, 2024
1dba5c1
Merge pull request #25 from CamilaCarrenoV/codigoOrdenado
CamilaCarrenoV Jul 18, 2024
f686ed1
listas para testing
Danimar-g Jul 23, 2024
7049cab
Merge pull request #26 from Danimar-g/RamaMejorada
Danimar-g Jul 24, 2024
8747c24
cambios css
CamilaCarrenoV Jul 24, 2024
c42f1c8
css
CamilaCarrenoV Jul 24, 2024
693f0c6
Merge pull request #27 from CamilaCarrenoV/codigoOrdenado
CamilaCarrenoV Jul 24, 2024
5ab9625
proyecto listo
CamilaCarrenoV Jul 24, 2024
f7b034c
Merge pull request #28 from CamilaCarrenoV/codigoOrdenado
CamilaCarrenoV Jul 24, 2024
c172365
proyecto con readme listo
CamilaCarrenoV Jul 24, 2024
0f599fd
Merge pull request #29 from CamilaCarrenoV/codigoOrdenado
CamilaCarrenoV Jul 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,075 changes: 41 additions & 1,034 deletions README.md

Large diffs are not rendered by default.

7,975 changes: 7,975 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"eslint": "^8.3.0",
"gh-pages": "^3.1.0",
"htmlhint": "^1.0.0",
"jest": "^27.0.1",
"jest": "^27.5.1",
"jsdom": "^22.1.0",
"opener": "^1.5.1",
"serve": "^14.2.1"
Expand All @@ -49,4 +49,4 @@
"jest": {
"testEnvironment": "jsdom"
}
}
}
Binary file added src/assets/DisneyFont.ttf
Binary file not shown.
500 changes: 266 additions & 234 deletions src/data/dataset.js

Large diffs are not rendered by default.

37 changes: 32 additions & 5 deletions src/dataFunctions.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
// Estas funciones son ejemplos, aquí puedes desarrollar tus propias funciones.
/* eslint-disable indent */
/* eslint-disable no-unused-vars */

export const example = () => {
return 'example';
export const computeStats = (data) => {
const sumaTotalDuracion = data.reduce((acumulador, pelicula) => acumulador + Number(pelicula.facts.tiempoDuracion.split(" ")[0]), 0);

return sumaTotalDuracion/data.length;
};

export const computeStatsNota = (data) => {
const sumaTotalNota = data.reduce((acumulador, pelicula) => acumulador + Number(pelicula.facts.clasificPublico.split("/")[0]), 0);
const promedioNota= sumaTotalNota/data.length;

return promedioNota.toFixed(1);
};


export const filterData = (data, filterBy, value) => {
const resultFilter = data.filter(
(data) => data.facts[filterBy] >= Number(value) && data.facts[filterBy] <= Number(value) + 9
);
return resultFilter;
};

export const anotherExample = () => {
return [];
export const sortData = (data,sortBy, sortOrder) => {
const nombresOrdenados = data.sort((a, b) => {
if (sortOrder === 'Asc') {
return a[sortBy].localeCompare(b[sortBy]);
} else {
return b[sortBy].localeCompare(a[sortBy]);
}
});
return nombresOrdenados;
};


80 changes: 71 additions & 9 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,73 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dataverse</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<script src="main.js" type="module"></script>
</body>
</html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dataverse</title>
<link rel="stylesheet" href="style.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap"
rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Montserrat+Alternates:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Aclonica&display=swap" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Henny+Penny&display=swap" rel="stylesheet">
</head>
<header>
<h1>Dreamland</h1>
</header>
<body>
<main>
<h2>¡Bienvenidos fans de Disney y Pixar! Explora nuestro mágico contenido y descubre las novedades de este fantástico mundo</h2>

<div class="selectores">
<label for="epoca"><span class="tituloSelectores"><b> Selecciona por épocas</b></span></label>
<select id="epoca" data-testid="select-filter" name="epocas">
<option value="0">Seleccionar</option>
<option value="1990">1990</option>
<option value="2000">2000</option>
<option value="2010">2010</option>
<option value="2020">2020</option>
</select>

<label for="nombre"><span class="tituloSelectores"><b>Ordena por nombre</b></span></label>
<select id="nombre" data-testid="select-sort" name="name">
<option value="orden">Ordenar</option>
<option value="Asc">A - Z</option>
<option value="Desc">Z - A</option>
</select>

<button id="borrar" data-testid="button-clear">Limpiar Filtros</button>
</div>
<div id="datosestadisticos">
<button id="datosestadisticosDisney" class="botonDatos">¿Sabías qué?</button>
<div class="contenido-oculto">
<ul class="datosdisney">
<li id="duracion">El promedio de duración es:</li>
<li id="nota">El promedio de clasificación es:</li>
</ul>
</div>
</div>
<div id="root"></div>


</main>
<footer>
<p><b>Creado por Camila Carreño y Daniela Martínez</b></p>
<b><p>Proyecto Dataverse para Laboratoria. <em>La información de esta página está proporcionado por Disney y Pixar, quienes tiene derechos exclusivos del contenido.</em></p></b>
</footer>
<script src="main.js" type="module"></script>
</body>


</html>
87 changes: 83 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,85 @@
import { example } from './dataFunctions.js';
import { renderItems } from './view.js';
import { renderItems } from "./view.js";

import data from './data/dataset.js';
import data from "./data/dataset.js";

import { filterData, sortData } from "./dataFunctions.js";
import { computeStats, computeStatsNota } from "./dataFunctions.js";

const elementos = document.getElementById("root");
const listaDePeliculas = renderItems(data);
elementos.appendChild(listaDePeliculas);

const selectoresEpoca = document.querySelector("#epoca");
const selectoresOrden = document.querySelector("#nombre");
const botonborrar = document.getElementById("borrar");
const botonData = document.getElementById("datosestadisticosDisney");


selectoresEpoca.addEventListener("change", (event) => {
const valor = event.target.value;
let dataFiltrada;
if (valor === "0") {
dataFiltrada = data;
} else {
dataFiltrada = filterData(data, "estreno", valor)
}

const valorOrden = document.getElementById("nombre").value;
if (valorOrden !== "orden") {
dataFiltrada = sortData(dataFiltrada, "name", valorOrden);
}


const listaFiltrada = renderItems(dataFiltrada);
elementos.innerHTML = "";
elementos.appendChild(listaFiltrada);

});

selectoresOrden.addEventListener("change", (e) => {
const value = e.target.value;
let dataOrdenada;
if (value === "orden") {
dataOrdenada = data;
} else {
dataOrdenada = sortData(data, "name", value);
}

const valorFiltro = document.getElementById("epoca").value;
if (valorFiltro !== "0") {
dataOrdenada = filterData(dataOrdenada, "estreno", valorFiltro);
}

const listaOrdenada = renderItems(dataOrdenada);
elementos.innerHTML = "";
elementos.appendChild(listaOrdenada);
});


function borrarFiltrosYOrden() {
const listaOriginal = renderItems(data);
elementos.innerHTML = "";
elementos.appendChild(listaOriginal);
selectoresEpoca.selectedIndex=0;
selectoresOrden.selectedIndex=0;
}

function datosEstadisticos() {
const copyData = [...data];

const datoDuracion = document.querySelector("#duracion");
const datoNota = document.querySelector("#nota");

datoDuracion.innerHTML = "Las peliculas, en promedio, duran: " + computeStats(copyData) + " minutos.";
datoNota.innerHTML = "En promedio, la calificación es de: " + computeStatsNota(copyData) + " según IMDb.";
}

const contenido = document.querySelector('.contenido-oculto');
botonData.addEventListener("click", ()=> {
datosEstadisticos();
contenido.style.display = 'block';
});


botonborrar.addEventListener("click", borrarFiltrosYOrden);

console.log(example, renderItems(data), data);
Loading