Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
3b23f01
Titulo
Mar 24, 2023
fac32a3
Merge pull request #1 from novoalba/main
yessicapv-24 Mar 24, 2023
0670b7b
Merge pull request #1 from yessicapv-24/main
novoalba Mar 24, 2023
b3e0204
package-lock
Mar 24, 2023
4ca0ff8
Merge branch 'main' of https://github.com/novoalba/DEV006-data-loversAY
Mar 24, 2023
59d43a2
Historia de usuario 1
Mar 27, 2023
1b8cfee
cambios en imágenes, en index.htm, en style.css, se añadió novato.html
Mar 27, 2023
72ef6eb
novato.html, novato.css, e inicio de data.js y main.js
Mar 28, 2023
d4b4032
Merge branch 'main' into YessicaDataLovers
yessicapv-24 Mar 28, 2023
651497e
acomodo
yessicapv-24 Mar 28, 2023
fc31e89
Yessica data lovers (#2)
yessicapv-24 Mar 28, 2023
f2406aa
se agregaron cambios a peliculas.html y .css. Se inició con las funci…
Mar 29, 2023
bdc7956
Merge branch 'main' of https://github.com/novoalba/DEV006-data-loversAY
Mar 29, 2023
0c8ac65
Merge remote-tracking branch 'origin/main' into YessicaDataLovers
yessicapv-24 Mar 30, 2023
9abe1fd
merge main
yessicapv-24 Mar 30, 2023
263afec
se modificaron los estilos de la tabla en css, se añadieron elementos…
Apr 3, 2023
c29a89d
none
yessicapv-24 Apr 3, 2023
a8ed069
Merge remote-tracking branch 'origin/main' into YessicaDataLovers
yessicapv-24 Apr 3, 2023
43a402d
implementación del método de filtrado, eventos del DOM en el main.js,…
Apr 4, 2023
d4c366e
Merge branch 'main' of https://github.com/novoalba/DEV006-data-loversAY
Apr 4, 2023
93b0346
idioma inglés implementado. Método sort implementado en data.js. Adic…
Apr 5, 2023
782a575
actualización fundadores
Apr 10, 2023
b5cf7e4
limpiar archivo data js
yessicapv-24 Apr 10, 2023
499b63d
Merge remote-tracking branch 'origin/main' into YessicaDataLovers
yessicapv-24 Apr 10, 2023
fdd6766
modificaciones en characters, data, fandom, index, main, novato y pel…
Apr 13, 2023
11ac0d9
l
yessicapv-24 Apr 14, 2023
ea127b0
che
yessicapv-24 Apr 14, 2023
6c6e3de
Limpiar datos
yessicapv-24 Apr 14, 2023
96f8a14
Merge branch 'main' into YessicaDataLovers
yessicapv-24 Apr 17, 2023
6cb14a3
modificaciones para responsive en todo el CSS. Se modificaron y pasar…
Apr 18, 2023
04de37c
Merge branch 'main' into YessicaDataLovers
yessicapv-24 Apr 18, 2023
87a31d3
merge
yessicapv-24 Apr 18, 2023
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
7,515 changes: 7,515 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

Binary file added src/Imágenes/Hayao_M.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/Imágenes/Hayao_m.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/Imágenes/Toshio_S.jpeg
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/Imágenes/Yasuyoshi.jpeg
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/Imágenes/fandom.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/Imágenes/fandompage/fandom01.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/Imágenes/fandompage/fandom03.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/Imágenes/fandompage/fandom04.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/Imágenes/isao-takahata.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/Imágenes/newbie.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/Imágenes/newbiepage/newbie01.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/Imágenes/newbiepage/newbie02.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/Imágenes/newbiepage/newbie03.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/Imágenes/newbiepage/newbie04.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/Imágenes/newbiepage/newbie05.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/Imágenes/newbiepage/newbie06.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/Imágenes/paisaje.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/Imágenes/top-image.jfif
Binary file not shown.
Binary file added src/Imágenes/toshio_s.jpeg
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/Imágenes/yasuyoshi.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
127 changes: 127 additions & 0 deletions src/characters.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
table {
width: 80%;
font-family: "Jockey One", sans-serif;
font-size: 120%;
margin:auto;
text-align: justify;
}
.characterImg {
width: 80%;
height: 10%;
border-radius: 8%;
}
#charactersTableColumnOne {
width: 50%;
margin:auto;
}
#charactersTableColumnTwo {
width: 50%;
margin-top: 15%;
}
#charactersTable td {
vertical-align: top;
padding: 20px;
text-align: center;
}
#charactersTable img {
height: 342px;
width: 250px;
}
.justify {
text-align: justify;
}
button {
display: flex;
width: auto;
}
#sortMoviesByDateID {
flex-direction: row;
flex-wrap: wrap;
margin: auto;
margin-left: 50%;
display: inline-flex;
background-color: #3CD1EF;
font-family: "Jockey One", sans-serif;
font-size: 120%;
}
#sortMoviesByDateID:hover {
background-color: #EE9547;
color: #fff;
}
#sortMoviesByTitleID {
flex-direction: row;
flex-wrap: wrap;
margin: auto;
display: inline-flex;
background-color: #3CD1EF;
font-family: "Jockey One", sans-serif;
font-size: 120%;
}
#sortMoviesByTitleID:hover {
background-color: #EE9547;
color: #fff;
}
#refresh {
flex-direction: row;
flex-wrap: wrap;
margin: auto;
display: inline-flex;
background-color: #3CD1EF;
font-family: "Jockey One", sans-serif;
font-size: 120%;
}
#refresh:hover {
background-color: #EE9547;
color: #fff;
}
label {
font-family: "Jockey One", sans-serif;
font-size: 120%;
color: #fff;
}
#genderSelect {
font-family: "Jockey One", sans-serif;
font-size: 120%;
background-color: #3CD1EF;
}
#charactersSpecieSelect {
font-family: "Jockey One", sans-serif;
font-size: 120%;
background-color: #3CD1EF;
}
#sortCharactersByAge {
flex-direction: row;
flex-wrap: wrap;
margin: auto;
display: inline-flex;
background-color: #3CD1EF;
font-family: "Jockey One", sans-serif;
font-size: 120%;
}
#sortCharactersByAge:hover {
background-color: #EE9547;
color: #fff;
}
@media screen and (max-width: 768px) {
.block {
display: flex;
flex-direction: column;
margin-left: -5%;
}
.CharacteresPosterContainer {
display: flex;
justify-content: center;
max-width: 400px;
}
.moviePoster {
max-width: 100%;
height: auto;
}
tr {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin: 0.5em 0;
border: 1px solid rgba(3,3,3,0.2);
}
}
68 changes: 68 additions & 0 deletions src/characters.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1" name="viewport" /> <!-- qué es esto-->
<title>Data Lovers</title>
<link rel="stylesheet" href="style.css"/>
<link rel="stylesheet" href="characters.css"/>
</head>
<body>
<header>
<div class="navbar">
<ul>
<li><a href="index.html">HOME</a></li>
<li><a href="novato.html">NEWBIE</a></li>
<li><a href="fandom.html">FANDOM</a></li>
</ul>
</div>
</header>

<label for="genderSelect">Filter by gender:</label>
<select id="genderSelect">
<option value="allGenders">All</option>
<option value="Female">Female</option>
<option value="Male">Male</option>
</select>

<label for="charactersSpecieSelect">Filter by species:</label>
<select id="charactersSpecieSelect">
<option value="allSpecies">All</option>
<option value="Arch-mage/Human">Arch-mage/Human</option>
<option value="Bird">Bird</option>
<option value="Borrower">Borrower</option>
<option value="Cat">Cat</option>
<option value="Deity">Deity</option>
<option value="Deity, Dragon">Deity, Dragon</option>
<option value="Demon">Demon</option>
<option value="Dog">Dog</option>
<option value="Fish/Human">Fish/Human</option>
<option value="Human">Human</option>
<option value="Human/Scarecrow">Human/Scarecrow</option>
<option value="Raccoon Dog">Raccoon Dog</option>
<option value="Red elk">Red elk</option>
<option value="Spirit">Spirit</option>
<option value="Spirit of The White Fox">Spirit of The White Fox</option>
<option value="Totoro">Totoro</option>
<option value="unknown">Unknown</option>
<option value="Witch">Witch</option>
<option value="Witch/Human">Witch/Human</option>
<option value="Wizard">Wizard</option>
<option value="Wolf">Wolf</option>
</select>

<button id="sortCharactersByAge">Sort by age</button>

<table id="charactersTable">
<tbody id="charactersTableBody">
<tr>
<td id="charactersTableColumnOne"></td>
<td id="charactersTableColumnTwo"></td>
</tr>
</tbody>
</table>


<script src="main.js" type="module"></script>
</body>
</html>
198 changes: 191 additions & 7 deletions src/data.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,193 @@
// estas funciones son de ejemplo
//importar mi bloque gigante de data:
import data from './data/ghibli/ghibli.js';
const dataFilms = data.films;

export const example = () => {
return 'example';
};

export const anotherExample = () => {
return 'OMG';
};
export function filterByMovies(director) {
const moviesTable = document.getElementById("moviesTable");
if (!moviesTable) {
//console.error("moviesTable element not found");
return;
}
const moviesBody = moviesTable.getElementsByTagName('tbody')[0];
let filteredFilms = dataFilms;

if (director !== "allDirectors") {
filteredFilms = dataFilms.filter(movie => movie.director === director);
}

let tableBody = "";
filteredFilms.forEach((movie, index) => {
if (index % 3 === 0) {
tableBody = tableBody + "<tr>"
}
tableBody = tableBody + "<td>"

const posterImg = "<img src='" + movie.poster + "' class='moviePoster'/>"
const movieTitle = "<h3>" + movie.title + "</h3>";
const director = "<p> Directed by " + movie.director + "</p>";
const producer = "<p> Produced by " + movie.producer + "</p>";
const releaseDate = "<p>" + movie.release_date + "</p>";
const description = "<p class='justify'>" + movie.description + "</p>";

tableBody = tableBody + posterImg + movieTitle + director + producer + releaseDate + description;
tableBody = tableBody + "</td>"

if (index % 3 === 2) {
tableBody = tableBody + "</tr>";
}
});
moviesBody.innerHTML = tableBody;
}
<<<<<<< HEAD

filterBy("allDirectors");

export function sortMoviesByDate() {
dataFilms.sort((a, b) => (a.release_date) - (b.release_date));
filterBy("allDirectors");
}

export function sortMoviesByTitle() {
dataFilms.sort((a, b) => (a.title).localeCompare(b.title));
filterBy("allDirectors");
}
=======
filterByMovies("allDirectors");

export function sortMoviesByDateNewestToOldest() {
dataFilms.sort((a, b) => (b.release_date) - (a.release_date));
}

export function sortMoviesByDateOldestToNewest() {
dataFilms.sort((a, b) => (a.release_date) - (b.release_date));
}

export function filterCharactersBySpeciesAndGender(specie, gender) {
const charactersTable = document.getElementById("charactersTable");
if(!charactersTable){
//console.log("charactersTable element not found")
return;
}
const charactersBody = charactersTable.getElementsByTagName('tbody')[0];
const characterSpecieSelection = document.getElementById("charactersSpecieSelect").value;

const filteredCharacters = dataFilms.flatMap(film => {
return film.people.filter(person => {
if (specie !== "allSpecies" && gender !== "allGenders") {
return person.specie === characterSpecieSelection && person.gender === gender;
} else if (specie !== "allSpecies") {
return person.specie === characterSpecieSelection;
} else if (gender !== "allGenders") {
return person.gender === gender;
} else {
return true;
}
});
});

let tableBody = "";
let index = 0;
filteredCharacters.forEach((person) => {
if (index % 3 === 0) {
tableBody = tableBody + "<tr>";
}
tableBody = tableBody + "<td>";

const characterImg = "<img src='" + person.img + "' class='characterImg'/>";
const characterName = "<h3>" + person.name + "</h3>";
const characterGender = "<p> Gender: " + person.gender + "</p>";
const characterSpecie = "<p> Species: " + person.specie + "</p>";
const characterAge = "<p> Age: " + person.age + "</p>";
const characterEyesAndHair = "<p> Eye and hair color: " + person.eye_color + " and " + person.hair_color + "</p>";

tableBody = tableBody + characterImg + characterName + characterGender + characterSpecie + characterAge + characterEyesAndHair;
tableBody = tableBody + "</td>";

if(index % 3 === 2) {
tableBody = tableBody + "</tr>";
}
index++;
});
charactersBody.innerHTML = tableBody;
}
filterCharactersBySpeciesAndGender("allSpecies", "allGenders");

export function filterLocationsByClimate(climate) {
const locationsTable = document.getElementById("locationsTable");
if (!locationsTable) {
//console.log("charactersTable element not found")
return;
}
const locationsBody = locationsTable.getElementsByTagName("tbody")[0];
const locationsClimateSelection = document.getElementById("climateSelect").value;

const filteredLocations = dataFilms.flatMap((film) => {
return film.locations.filter(place => {
if (climate !== "allClimates") {
return place.climate === locationsClimateSelection;
} else {
return true;
}
});
});

let tBody = "";
tBody = "";
let indexOne = 0;
filteredLocations.forEach((location) => {
if (indexOne % 2 === 0) {
tBody = tBody + "<tr>";
}
tBody = tBody + "<td>";
const locationImg = "<img src='" + location.img + "' class='locationImg'/>";
const locationName = "<h3>" + location.name + "</h3>";
const locationClimate = "<p> Climate: " + location.climate + "</p>";
const terrain = "<p> Terrain: " + location.terrain + "</p>";
const locationSurfaceWater = "<p> Surface water: " + location.surface_water + "</p>";
tBody = tBody + locationImg + locationName + locationClimate + terrain + locationSurfaceWater;
tBody = tBody + "</td>";
if (indexOne % 2 === 1) {
tBody = tBody + "</tr>";
}
indexOne++;
});
locationsBody.innerHTML = tBody;
}
filterLocationsByClimate("allClimates");

function vehiclesTableOne() {
const vehiclesTable = document.getElementById("vehiclesTable");
if (!vehiclesTable) {
return;
}
const vehiclesBody = vehiclesTable.getElementsByTagName("tbody")[0];

const flattenedVehicles = dataFilms.flatMap((film => film.vehicles)
);

let tBody = "";
tBody = "";
let indexOne = 0;
flattenedVehicles.forEach((vehicle) => {
if (indexOne % 2 === 0) {
tBody = tBody + "<tr>";
}
tBody = tBody + "<td>";
const vehicleImg = "<img src='" + vehicle.img + "' class='vehicleImg'/>";
const vehicleName = "<h3>" + vehicle.name + "</h3>";
const description = "<p class= 'justify'>" + vehicle.description + "</p>";
const vehicleClass = "<p> Class: " + vehicle.vehicle_class + "</p>";
//const pilotName = "<p> Pilot name: " + vehicle.pilot + "</p>";
tBody =
tBody + vehicleImg + vehicleName + description + vehicleClass;
tBody = tBody + "</td>";
if (indexOne % 2 === 1) {
tBody = tBody + "</tr>";
}
indexOne++;
});
vehiclesBody.innerHTML = tBody;
}
vehiclesTableOne("");

Loading