Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
467544e
inicial commit
Oct 9, 2022
f8acd4c
commit inicial
pibmunoz Oct 9, 2022
2893107
prueba 1
pibmunoz Oct 9, 2022
5e4ffa7
Merge pull request #1 from pibmunoz/main
gabrielavillarrealdiaz Oct 9, 2022
69459ad
Merge branch 'main' of https://github.com/gabrielavillarrealdiaz/DEV0…
Oct 10, 2022
93ec71c
h1
Oct 10, 2022
6d57e30
estructura inicial html
pibmunoz Oct 10, 2022
296d867
html + js cards
pibmunoz Oct 13, 2022
133ffa8
html js cards
Oct 13, 2022
788fec5
html js cards
Oct 13, 2022
25c75ec
Co-authored-by: gabrielavillarrealdiaz <gabrielavillarrealdiaz@users.…
pibmunoz Oct 13, 2022
804a414
html + js cards
pibmunoz Oct 13, 2022
46c4a35
Merge pull request #3 from pibmunoz/main
gabrielavillarrealdiaz Oct 13, 2022
bd3dc22
función filtrar
pibmunoz Oct 14, 2022
bd2ae49
Merge pull request #4 from pibmunoz/main
gabrielavillarrealdiaz Oct 14, 2022
2a8875c
funcion
Oct 17, 2022
3f85642
Merge branch 'main' of https://github.com/gabrielavillarrealdiaz/DEV0…
Oct 17, 2022
ac01287
Cambios función filtrado + función ordenar
pibmunoz Oct 17, 2022
83b6984
Merge pull request #5 from pibmunoz/main
gabrielavillarrealdiaz Oct 18, 2022
ba22d20
filter
Oct 18, 2022
ae79a4b
Tests filter + sort
pibmunoz Oct 19, 2022
d8254f6
Merge pull request #6 from pibmunoz/main
gabrielavillarrealdiaz Oct 19, 2022
5adf00b
Test funciones
pibmunoz Oct 21, 2022
9455d40
Merge pull request #7 from pibmunoz/main
gabrielavillarrealdiaz Oct 21, 2022
a51b976
Cambio estilo desktop + función sort
pibmunoz Oct 21, 2022
2fd8ace
Sort nuevos filtros + estructura responsivo dispositivo movil
pibmunoz Oct 23, 2022
1c3985e
Reestructuración HTML + Responsive Desktop y Mobile + Filtro search e…
pibmunoz Oct 25, 2022
f295d85
Merge pull request #8 from pibmunoz/main
gabrielavillarrealdiaz Oct 25, 2022
693a42e
Test función buscar + función estadísticas en pantalla + botón clear …
pibmunoz Oct 27, 2022
dd1527b
Merge pull request #9 from pibmunoz/main
gabrielavillarrealdiaz Oct 27, 2022
c9418ae
Quiz en modal + test función buscar()
pibmunoz Oct 31, 2022
1374d03
Merge pull request #10 from pibmunoz/main
gabrielavillarrealdiaz Oct 31, 2022
87d66fa
Gráficos chart.js + cambios quiz responsivo
pibmunoz Nov 2, 2022
12eeb96
Merge pull request #11 from pibmunoz/main
gabrielavillarrealdiaz Nov 2, 2022
22977de
Agrega readme
pibmunoz Nov 7, 2022
d829d97
Merge pull request #12 from pibmunoz/main
gabrielavillarrealdiaz Nov 7, 2022
403f0e1
Img Readme
gabrielavillarrealdiaz Nov 7, 2022
a4f549e
Arregla links imagenes fondo + favicon + 2 personajes
pibmunoz Nov 9, 2022
5881165
Merge branch 'main' of https://github.com/pibmunoz/DEV001-data-lovers
pibmunoz Nov 9, 2022
5100649
Merge pull request #13 from pibmunoz/main
gabrielavillarrealdiaz Nov 9, 2022
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
668 changes: 44 additions & 624 deletions README.md

Large diffs are not rendered by default.

12,175 changes: 12,175 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
"@babel/core": "^7.6.2",
"@babel/plugin-transform-modules-commonjs": "^7.6.0",
"babel-jest": "^27.0.1",
"chart.js": "^3.9.1",
"chart.js-plugin-labels-dv": "^3.3.0",
"chartjs-plugin-datalabels": "^2.1.0",
"eslint": "^8.3.0",
"gh-pages": "^3.1.0",
"htmlhint": "^1.0.0",
Expand All @@ -27,4 +30,3 @@
"node": ">=16.x"
}
}

64 changes: 59 additions & 5 deletions src/data.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,63 @@
// estas funciones son de ejemplo
// Exporta función filterGender que filtra según data ingresada y el género del personaje dentro del objeto
export const filterGender = (data, gender) => {
const filtrado = data.filter(item => item.gender === gender);
return filtrado;
};

// Exporta función filterStatus que filtra según data ingresada y el estado del personaje dentro del objeto
export const filterStatus = (data, status) => {
const filtrado = data.filter(item => item.status === status);
return filtrado;
};

// Exporta función filterSpecies que filtra según data ingresada y la especie del personaje dentro del objeto
export const filterSpecies = (data, species) => {
const filtrado = data.filter(item => item.species === species);
return filtrado;
};

export const example = () => {
return 'example';
// Exporta función ordenAZ que ordenan de forma ascendente los personajes del objeto según la data filtrada ingresada
export const ordenAZ = (dataFilter) => {
const sortOrdenAZ = dataFilter.sort(function (a, b) {
if (a.name < b.name) {
return 1;
}
if (a.name > b.name) {
return -1;
}
//return 0;
})
return sortOrdenAZ;
};

export const anotherExample = () => {
return 'OMG';
// Exporta función ordenZA que ordenan de forma descendente los personajes del objeto según la data filtrada ingresada
export const ordenZA = (dataFilter) => {
const sortOrdenZA = dataFilter.sort(function (a, b) {
if (a.name > b.name) {
return 1;
}
if (a.name < b.name) {
return -1;
}
//return 0;

})
return sortOrdenZA;
};

// Exporta función statisticsFrequency que retorna la proporción de la categoría de los personajes respecto del total de la data
export const statisticsFrequency = (originalDataLength, categoryDataLength) => {
let firstData = originalDataLength.length;
let secondData = categoryDataLength.length;
return Math.round(secondData * 100 / firstData);
};

//Buscar
export const buscar = (data, condition, value) => {
return data.filter(item => item[condition].toLowerCase().includes(value.toLowerCase()));
};

// función selección al azar de personaje Quiz
export function quiz (data){
return data [Math.floor(Math.random()*data.length)]
}
4 changes: 2 additions & 2 deletions src/data/rickandmorty/rickandmorty.js
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ export default {
"name": "unknown",
"url": ""
},
"image": "https://raw.githubusercontent.com/Laboratoria/rick-and-morty-images/master/images/19.jpeg",
"image": "https://raw.githubusercontent.com/pibmunoz/DEV001-data-lovers/main/src/img/characters-404/antenna-rick.webp",
"episode": [
"https://rickandmortyapi.com/api/episode/10"
],
Expand Down Expand Up @@ -2455,7 +2455,7 @@ export default {
"name": "Dorian 5",
"url": "https://rickandmortyapi.com/api/location/29"
},
"image": "https://raw.githubusercontent.com/Laboratoria/rick-and-morty-images/master/images/104.jpeg",
"image": "https://raw.githubusercontent.com/pibmunoz/DEV001-data-lovers/main/src/img/characters-404/doom-nomitron.webp",
"episode": [
"https://rickandmortyapi.com/api/episode/25"
],
Expand Down
Binary file added src/img/Historia1.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/img/Historia2.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/img/Historia3.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/img/Historia4.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/img/Historia5.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/img/Prototipo1.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/img/Prototipo2.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/img/Prototipo3.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/img/Prototipo4.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/img/Prototipo5.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/img/Prototipo6.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/img/Prototipo7.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/img/Prototipo8.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/img/characters-404/antenna-rick.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/img/characters-404/doom-nomitron.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/img/favicon/favicon.ico
Binary file not shown.
189 changes: 189 additions & 0 deletions src/img/logo-mobile.svg
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/img/rickandmorty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions src/img/rickandmortypattern.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
196 changes: 185 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,186 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Data Lovers</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="root"></div>
<script src="main.js" type="module"></script>
</body>
</html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Lovers</title>
<script src="https://kit.fontawesome.com/da6daf1276.js" crossorigin="anonymous"></script>
<link rel="icon" type="image/x-icon" href="https://raw.githubusercontent.com/pibmunoz/DEV001-data-lovers/main/src/img/favicon/favicon.ico">
<link rel="stylesheet" href="style.css" />
</head>

<body>
<!--Inicio menu-->
<div id="container-mobile">
<input type="checkbox" id="inMenu">
<label class="iconoMenu" for="inMenu"><i class="fa-solid fa-bars"></i></label>

<select name="Gender" id="filterGender">
<optgroup label="Genders">
<option value="all">All Genders</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
<option value="Genderless">Genderless</option>
<option value="unknown">Unknown</option>
</optgroup>
</select>
<select name="Status" id="filterStatus">
<optgroup label="Status">
<option value="all">All Status</option>
<option value="Alive">Alive</option>
<option value="Dead">Dead</option>
<option value="unknown">Unknown</option>
</optgroup>
</select>
<select name="Species" id="filterSpecies">
<optgroup label="Species">
<option value="all">All Species</option>
<option value="Human">Human</option>
<option value="Alien">Alien</option>
<option value="Mytholog">Mytholog</option>
<option value="unknown">Unknown</option>
<option value="Robot">Robot</option>
<option value="Poopybutthole">Poopybutthole</option>
<option value="Parasite">Parasite</option>
<option value="Animal">Animal</option>
<option value="Disease">Disease</option>
<option value="Humanoid">Humanoid</option>
<option value="Cronenberg">Cronenberg</option>
<option value="Vampire">Vampire</option>
</optgroup>
</select>
<button id="clear-button">Clear Filter</button>
</div>

<div class="container">
<nav>
<div class="statisticsbtn">
<div class="statistics-button">
<a href="index2.html"><button>Statistics</button></a>
</div>
</div>
<div class="logo">
<a href="index.html">
<img src="./img/rickandmorty.png" alt="Logo Rick and Morty " id="home"></a>
</div>
<div class="quiz">
<!--Inicio Modal-->
<button id="myBtn">Quiz</button>
<div id="myModal" class="modal">

<!-- Modal content -->
<div class="modal-content">
<span class="close">&times;</span>
<h2>Quiz</h2>
<h3> Which Rick and Morty character are you?</h3>
<div id="checkedornot">
<h4>Choose Gender</h4>

<input type="radio" id="genderFemale" name="quizGender" value="Female">
<label for="genderFemale"> Female</label> <br>
<input type="radio" id="genderMale" name="quizGender" value="Male">
<label for="genderMale">Male</label> <br>
<input type="radio" id="genderLess" name="quizGender" value="Genderless">
<label for="genderLess"> Genderless</label> <br>
<input type="radio" id="genderUnknown" name="quizGender" value="unknown">
<label for="genderUnknown"> Unknown</label> <br>
</div>
<br>
<div id="checkedornot2">
<h4>Choose Status</h4>
<input type="radio" id="StatusAlive" name="quizStatus" value="Alive">
<label for="StatusAlive">Alive</label> <br>
<input type="radio" id="StatusDead" name="quizStatus" value="Dead">
<label for="StatusDead">Dead</label> <br>
<input type="radio" id="StatusUnknown" name="quizStatus" value="unknown">
<label for="StatusUnknown">Unknown</label> <br>
</div>
<br>
<div id="checkedornot3">
<h4>Choose Food</h4>
<input type="radio" name="quizfood" id="pizza">
<label for="pizza">Pizza</label> <br>
<input type="radio" name="quizfood" id="iceCream">
<label for="iceCream">Ice Cream</label> <br>
<input type="radio" name="quizfood" id="burgers">
<label for="burgers">Burgers and fries</label> <br>
<input type="radio" name="quizfood" id="chocolate">
<label for="chocolate">Chocolate</label> <br>
<br>
<h4>Choose Drink</h4>
<input type="radio" name="quizdrink" id="beer">
<label for="beer">Beer</label> <br>
<input type="radio" name="quizdrink" id="whiskey">
<label for="whiskey">Whiskey</label> <br>
<input type="radio" name="quizdrink" id="gin">
<label for="gin">Gin</label> <br>
<input type="radio" name="quizdrink" id="vodka">
<label for="vodka">Vodka</label> <br>
<button id="random-function">Send your answers</button>
</div>
<div id="cardPersonaje"></div>
</div>
</div>
<!--Fin Modal-->
</div>
</nav>
<!--Fin menu-->


<!--Inicio menú categorías, search y sort-->
<div class="category" id="category">

<div class="section-title">
<h2>CHARACTERS</h2>
<div class="statistics" id="statistics"> </div>

<div class="seccion-botones">
<div class="search">
<h3>Search</h3>
<input id="buscar" type="text" placeholder="Search your character!">
</div>

<div class="filter-data">
<h3>Order the characters</h3>
<section>
<select name="ordenar" id="sort">
<option value="title">Order by</option>
<option value="name">Name A-Z</option>
<option value="nameZ">Name Z-A</option>

</select>

</section>

</div>
</div>
</div>
</div>
<!--Fin menú categorías, search y sort-->
<!--Inicio sección cards de personajes-->



<div class="cards" id="cards">
<div class="card-1">
</div>
</div>



<!--Fin sección cards de personajes-->
<!--Inicio footer-->
<footer>
<div class="credits">Made with &#x1F499 by <span>Gabriela Villarreal</span> and <span>Pilar Muñoz</span> for
#DEV001 Laboratoria
<p id="schwifty">You gotta get schwifty!</p>
</div>
</footer>
<!--Fin footer-->
</div>

<script src="main.js" type="module"></script>
</body>

</html>
Loading