Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
4c9ea32
hice un archivo para las img y agrague más generos
Addis-cx Jan 22, 2024
7a8890d
Agregué toda la data a HTML siguiendo la estructura de tarjetas
MikotoGyaru Jan 23, 2024
e06d717
hice un h1 y h2, dos botones para filtar y ordenar
Addis-cx Jan 24, 2024
be9d31b
descargue las img faltantes y las agregue en html
Addis-cx Jan 24, 2024
40c5012
Agregue la etiqueta de cierre </dl>
Addis-cx Jan 24, 2024
99a350c
Cambiamos algunos valores de recaudación y le agregamos la moneda cor…
MikotoGyaru Jan 24, 2024
7cef4c3
cambie los url de la data
Addis-cx Jan 24, 2024
b2d659b
creamos la función para mostrar los objetos en htlm (no está terminada)
MikotoGyaru Jan 24, 2024
1007f84
Merge branch 'html' of https://github.com/Addis-cx/DEV013-dataverse i…
MikotoGyaru Jan 24, 2024
8ef78b7
agregue algunos comentarios en html
Addis-cx Jan 24, 2024
4618b4a
Cambiamos la url y la moneda a USD en la data.
Addis-cx Jan 24, 2024
cef831f
Merge branch 'main' of https://github.com/Addis-cx
Addis-cx Jan 24, 2024
57cb163
Creamos la funcion para renderizar la data
Addis-cx Jan 25, 2024
fa8949b
Definimos paleta de colores, comencé el body, h1
Addis-cx Jan 25, 2024
4583b31
Merge remote-tracking branch 'upstream/style.css' into html
MikotoGyaru Jan 26, 2024
03b7cd3
arregle errores de de la funcion para renderizar
Addis-cx Jan 27, 2024
d197e84
agregué las fuentes a nuestro html
Addis-cx Jan 29, 2024
53e25b3
ordenamos el HTML
MikotoGyaru Jan 29, 2024
c0d3f0b
Merge remote-tracking branch 'upstream/view.js' into html
MikotoGyaru Jan 29, 2024
1c5d736
Cambios en la estructura HTML, CSS y view.js
MikotoGyaru Jan 29, 2024
d0b95a2
Agregué algunas funciones en main.js para darle funcionalidad a los f…
MikotoGyaru Jan 30, 2024
499f656
hice una funcion para el input
Addis-cx Jan 30, 2024
c57672a
intento de crear la funcion de ordenar data
Addis-cx Jan 31, 2024
3ac418d
se creo la función de orden asc y desc
Addis-cx Feb 1, 2024
20d3647
cambié algunas cosas de la funcion para ordenar asc y desc
Addis-cx Feb 1, 2024
a70c17e
agregue estilo a los botones, el input y las tarjetas
Addis-cx Feb 5, 2024
601148f
cree divs para poder darles estilos mas detallados a los botonos y el…
Addis-cx Feb 5, 2024
016c046
progreso de la funcion de filtrar por genero
Addis-cx Feb 7, 2024
3234d1d
creamos la funcion de filtrado por genero
Addis-cx Feb 8, 2024
11e9ec3
estilizamos el buscador y los botones
Addis-cx Feb 8, 2024
94cae75
agregue hover a los botones
Addis-cx Feb 9, 2024
0b9970a
agregue estilos a las ventanas emergentes
Addis-cx Feb 13, 2024
d9e9b93
cree la funcion de popup
Addis-cx Feb 13, 2024
051fc64
mal commit
Addis-cx Feb 13, 2024
6016194
actualice la rama con los nuevos cambios
Addis-cx Feb 13, 2024
01eeb1f
agregue la actualizacion de los estilos
Addis-cx Feb 13, 2024
3b99873
intente crear la funcion para estadisticas
Addis-cx Feb 14, 2024
128be1a
intento de crear la funcion de estadisticas
Addis-cx Feb 16, 2024
35a6444
Cree la función de estadisticas
Addis-cx Feb 17, 2024
0b1489f
intento de diseño responsive
Addis-cx Feb 18, 2024
1a5245a
intentos de pagina responsive
Addis-cx Feb 20, 2024
0e2c402
intento de responsive 2.0
Addis-cx Feb 20, 2024
74ec483
intento de diseño responsive 600px logrado
Addis-cx Feb 21, 2024
68f7c64
estilizamos el boton de ver menos
Addis-cx Feb 22, 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
6 changes: 6 additions & 0 deletions desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[.ShellClassInfo]
IconResource=C:\Users\catal\OneDrive\Escritorio\Wallpaper\Iconos\Purple folders\Flat _files.ico,0
[ViewState]
Mode=
Vid=
FolderType=Generic
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Cuentos-de-Terramar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Earwig-y-la-bruja.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/El-castillo-ambulante.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/El-castillo-en-el-cielo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/El-chico-y-la-garza.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/El-cuento-de-la-princesa-Kaguya.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/El-recuerdo-de-Marnie.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/El-viaje-de-Chihiro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/El-viento-se-levanta.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Kiki-entregas-a-domicilio.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/La-Colina-de-las-Amapolas.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/La-princesa-Mononoke.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/La-tumba-de-las-luciernagas.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Mi-vecino-totoro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Mis-vecinos-los-Yamada.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Nausicaä-del-valle-del-viento.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Pompoko.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Ponyo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Porco-rosso.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Puedo-escuchar-el-mar.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Recuerdos-del-ayer.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Susurros-del-corazón.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/Totoro-png.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/favicon-256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/Imagenes/haru-en-el-reino-de-los-gatos.jpg
621 changes: 315 additions & 306 deletions src/data/dataset.js

Large diffs are not rendered by default.

48 changes: 43 additions & 5 deletions src/dataFunctions.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,47 @@
// Estas funciones son ejemplos, aquí puedes desarrollar tus propias funciones.
export const filterGenders = (data, filterBy, value) => {
const filter = data.filter((movie) => movie.facts[filterBy].includes(value));
return filter;
};

export const sortFilms = (data, sortBy, sortOrder) => {
data.sort((a, b) => {
const movieA = a[sortBy].toLowerCase();
const movieB = b[sortBy].toLowerCase();

export const example = () => {
return 'example';
if (sortOrder === "asc") {
return movieA.localeCompare(movieB);
} else if (sortOrder === "desc") {
return movieB.localeCompare(movieA);
}
});
return data;
};

export const anotherExample = () => {
return [];
export const computeStats = (data) => {
const movies = data.flatMap((movie) => movie.facts.genders.split(", "));
console.log(movies);
const stats = movies.reduce((acc, genreFil) => {
genreFil = genreFil.trim();
acc[genreFil] += 1;
return acc;
}, {
"Acción": 0,
"Romance": 0,
"Fantasía": 0,
"Ciencia Ficción": 0,
"Terror": 0,
"Bélico": 0,
"Suspenso": 0,
"Infantil": 0,
"Familia": 0,
"Comedia": 0,
"Drama": 0,
"Aventura": 0,
"Misterio": 0,
});

const statsText = Object.entries(stats).map(([genre, count]) => `${genre}: ${count}`).join(', ')
return statsText;
};


93 changes: 89 additions & 4 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,96 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Data Lovers</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<link
href="https://fonts.googleapis.com/css2?family=Average&family=Cabin+Condensed&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=Merriweather:ital,wght@0,300;0,400;0,700;0,900;1,300;1,400;1,700;1,900&display=swap"
rel="stylesheet"
/>
<title>Ghibli Lovers</title>
<link rel="icon" type="image/png" href="imagenes/icono-ramita.png" />
<link rel="stylesheet" href="style.css" />
</head>

<body>
<script src="main.js" type="module"></script>
<header>
<div class="header">
<img
src="https://raw.githubusercontent.com/Addis-cx/DEV013-dataverse/html/src/Imagenes/Totoro-transparente.png"
alt="Dibujo del contorno de totoro, similar al logo de Studio Ghibli"
class="logo"
/>
<div class="title">
<h1>スタジオジブリ</h1>
<h1>STUDIO GHIBLI</h1>
</div>
<label for="input">
<input type="text" class="movie-search" placeholder="Buscar" />
</label>
</div>
</header>

<div class="superButtons">
<label for="filter" class="buttons">
<select data-testid="select-filter" name="genders" id="filter">
<option value="genres">Filtrar por:</option>
<option value="Acción">Acción</option>
<option value="Aventura">Aventura</option>
<option value="Bélico">Bélico</option>
<option value="Ciencia Ficción">Ciencia Ficción</option>
<option value="Comedia">Comedia</option>
<option value="Drama">Drama</option>
<option value="Familia">Familia</option>
<option value="Fantasía">Fantasía</option>
<option value="Romance">Romance</option>
<option value="Terror">Terror</option>
<option value="Suspenso">Suspenso</option>
<option value="Infantil">Infantil</option>
<option value="Misterio">Misterio</option>
</select>
</label>

<label for="order" class="buttons">
<select data-testid="select-filter" name="sortOrder" id="order">
<option value="todos">Ordenar por:</option>
<option value="asc">A-Z</option>
<option value="desc">Z-A</option>
</select>
</label>

<label for="button" class="button2">
<button class="cleanerButton" type="button">Limpiar</button>
</label>

<label for="stats" class="button2">
<button class="statsButton">
<img
src="https://raw.githubusercontent.com/Addis-cx/DEV013-dataverse/html/src/Imagenes/estadisticas-transparente.png"
alt="Icono de estadisticas"
/>
</button>
</label>
</div>

<div class="statsWindow noVisual">
<h3>Estadísticas de Géneros</h3>
<p class="statsMovie"></p>
<label for="button">
<button class="closeStats"><b>Ver menos</b></button>
</label>
</div>
<div class="statsFondo noVisual"></div>

<div id="root"></div>

<footer>Desarrolladoras Cataline Alarcón y Addis Pérez Castro 🌼</footer>
</body>
</html>
<script src="main.js" type="module"></script>
</html>
86 changes: 82 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,84 @@
import { example } from './dataFunctions.js';
import { renderItems } from './view.js';
import { filterGenders, sortFilms, computeStats } from "./dataFunctions.js";
import { renderItems } from "./view.js";

import data from './data/dataset.js';
import data from "./data/dataset.js";
const newData = [...data];

console.log(example, renderItems(data), data);
const movieSearch = document.querySelector(".movie-search");
const gendersFilms = document.querySelector("#filter");
const orderFilms = document.querySelector("#order");
const movieCards = document.querySelector("#root");
const statsButton = document.querySelector(".statsButton");
const statsWindow = document.querySelector(".statsWindow");
const statsMovie = document.querySelector(".statsMovie")
const closeStats = document.querySelector(".closeStats");
const statsFondo = document.querySelector(".statsFondo");
const cleanerButton = document.querySelector(".cleanerButton");

movieCards.appendChild(renderItems(newData));

movieSearch.addEventListener("input", function () {
const results = [];
const textSearch = movieSearch.value.toLowerCase();
const search = newData.filter((elemento) => {
return elemento.name.toLowerCase().includes(textSearch);
});

if (search) {
movieCards.innerHTML = "";
results.push(...search);
movieCards.appendChild(renderItems(results));
}
});

gendersFilms.addEventListener("change", function () {
movieCards.innerHTML = "";
sortFilms;
const selectedGender = gendersFilms.value;
const filterMovie = filterGenders(newData, "genders", selectedGender);
movieCards.appendChild(renderItems(filterMovie));
});

gendersFilms.addEventListener("change", function () {
movieCards.innerHTML = "";
const selectedGender = gendersFilms.value;
const filterMovie = filterGenders(newData, "genders", selectedGender);
sortFilms;
movieCards.appendChild(renderItems(filterMovie));

});

orderFilms.addEventListener("change", function () {
movieCards.innerHTML = "";
gendersFilms.value = "genres";
const selectOrder = orderFilms.value;
let filmAsc;

if (selectOrder === "asc") {
filmAsc = sortFilms(newData, "name", "asc");
} else {
filmAsc = sortFilms(newData, "name", "desc");
}
movieCards.appendChild(renderItems(filmAsc));
});

cleanerButton.addEventListener("click", function () {
const newData = [...data];
movieSearch.value = "";
movieCards.innerHTML = "";
gendersFilms.value = "genres";
orderFilms.value = "todos";
movieCards.appendChild(renderItems(newData));
});

statsButton.addEventListener("click", function () {
statsMovie.textContent = computeStats(newData);
statsWindow.classList.remove("noVisual");
statsFondo.classList.remove("noVisual");
});

closeStats.addEventListener("click", function () {
statsWindow.classList.add("noVisual");
statsFondo.classList.add("noVisual");
return closeStats;
});
Loading