Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1b8dc3f
change
Leonor-HC Apr 10, 2023
1b43be6
modificado
shadiasw Apr 11, 2023
d2b19f1
prueba
shadiasw Apr 11, 2023
f172701
prueba1
Leonor-HC Apr 12, 2023
a90c384
Merge pull request #1 from Leonor-HC/Leonor
Leonor-HC Apr 12, 2023
cf89274
Merge branch 'main' of https://github.com/shadiasw/DEV006-data-lovers
shadiasw Apr 12, 2023
188632a
Merge branch 'main' of https://github.com/shadiasw/DEV006-data-lovers…
shadiasw Apr 12, 2023
df2add2
esto es un cambio de prueba
shadiasw Apr 12, 2023
caf5883
Merge pull request #2 from shadiasw/shadia
shadiasw Apr 12, 2023
447554e
change2
Leonor-HC Apr 13, 2023
9faaf25
Merge pull request #3 from Leonor-HC/Leonor
Leonor-HC Apr 13, 2023
02e635a
Merge branch 'main' of https://github.com/shadiasw/DEV006-data-lovers
shadiasw Apr 13, 2023
15a5f91
change3
Leonor-HC Apr 13, 2023
167c162
Merge pull request #4 from Leonor-HC/Leonor
Leonor-HC Apr 13, 2023
6dfa16e
modificado de shadia
shadiasw Apr 13, 2023
17722b0
Merge pull request #5 from shadiasw/main
shadiasw Apr 13, 2023
baef3f1
change4
Leonor-HC Apr 13, 2023
ab150ae
arreglos
shadiasw Apr 14, 2023
8306ac5
ultimo
shadiasw Apr 14, 2023
32e911f
resolviendo conflictos
shadiasw Apr 14, 2023
f349db6
cambio5
shadiasw Apr 14, 2023
f93ade8
change5
Leonor-HC Apr 17, 2023
66c33fc
change 6
shadiasw Apr 17, 2023
018a424
Merge pull request #6 from shadiasw/main
Leonor-HC Apr 17, 2023
ad42606
change7
Leonor-HC Apr 17, 2023
30bf992
Merge branch 'main' of https://github.com/Leonor-HC/DEV006-data-lover…
Leonor-HC Apr 17, 2023
1cab694
Merge pull request #7 from Leonor-HC/Leonor
Leonor-HC Apr 17, 2023
db9abfe
change8
Leonor-HC Apr 20, 2023
a8b7bf2
Merge pull request #8 from Leonor-HC/Leonor
Leonor-HC Apr 20, 2023
499fcbd
change9
Leonor-HC Apr 20, 2023
7eb0373
Merge pull request #9 from Leonor-HC/Leonor
Leonor-HC Apr 20, 2023
35502ad
change 10
Leonor-HC Apr 25, 2023
a588dc2
Merge pull request #10 from Leonor-HC/Leonor
Leonor-HC Apr 25, 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.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "data-lovers",
"version": "1.0.0",
"type": "module",
"main": "src/index.html",
"license": "MIT",
"scripts": {
Expand Down
95 changes: 95 additions & 0 deletions src/characters.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Data Lovers</title>
<link rel="stylesheet" href="styleCharacters.css" />
</head>


<body>

<header>
<div class="wrapper">
<div>
<a href="index.html">
<img src="images/logo.png" id="miLogo" class="logo" alt="logo rick and Morty">
</a>
</div>
<nav>
<a href="index.html">HOME</a>
<a href="characters.html">CHARACTERS</a>
<a href="episodes.html">EPISODES</a>
<a href="wallpapers.html">WALLPAPERS</a>

</nav>
</div>
</header>


<main>
<div class=" side sideLeft">
<div>
<article>
<div>
<h1>Rick & <br>
Morty page.</h1>
</div>
</article>
<section>
<div class="subir">
<img src="images/icons8-linea-vertical-50.png" alt="linea verde2">
<h2>Find your favorites Rick and <br> Morty characters.</h2>
</div>
</section>
</div>
<div>
<input class="search" type="text" id="search-input" placeholder="Search character...">
</div>
<button class="buttons" id="A-Z"> A - Z </button>
<button class="buttons" id="Z-A" > Z - A </button>

<div class="lineaFilter">
<img class="filter" src="images/icons8-editar-filtro-50.png" alt="Icono Filtro">
<h3> FILTER </h3>
</div>
<div class="">
<h4>
<div>
<a href="characters.html" > >> All</a>
<br><br>
<a href="#" id="Human" class="filtro"> >> Human</a>
<br><br>
<a href="#" id="Male" class="gender"> >> Male</a>
<br><br>
<a href="#" id="Female" class="gender"> >> Female</a>
<br><br>
<a href="#" id="Alive" class="status"> >> Alive</a>
<br><br>
<a href="#" id="Dead" class="status"> >> Dead</a>
</div>

</h4>
</div>
</div>

<aside>
<div class="container">
<div class="card">
<div class="card-body">
<a href="character1.html"> <img src="images/1.jpeg"></a>
<div>
<h5 class="card-title">Card Title</h5>
</div>
</div>
</div>
</div>
</aside>
</main>


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

</html>
74 changes: 74 additions & 0 deletions src/characters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import {getCharacters, getCharactersByQuery, filterBySpecies, filterByGender,
filterByStatus, ordinationAz, ordinationZa} from "./data.js";

const container = document.querySelector(".container");

function renderCharacters(characters) {
container.innerHTML = characters.map(character => `
<div class="card">
<div class="card-body">
<a href=" "> <img src="${character.image}"></a>
<div>
<h5 class="card-title">${character.name}</h5>
</div>
</div>
</div>
`).join("");
} renderCharacters(getCharacters());

const searchInput = document.getElementById("search-input");
searchInput.addEventListener("input", () => {
const query = searchInput.value.toLowerCase();
const filteredCharacters = getCharactersByQuery(query);
renderCharacters(filteredCharacters);
});
// Ordenar A-Z
const orderAz = document.getElementById("A-Z");
orderAz.addEventListener("click", () => {
const allCharacters = getCharacters();
const filterCharactersAz = ordinationAz(allCharacters);
renderCharacters(filterCharactersAz);
});
// Ordenar Z-A
const orderZa = document.getElementById("Z-A");
orderZa.addEventListener("click", () => {
const allCharacters = getCharacters();
const filterCharactersZa = ordinationZa(allCharacters);
renderCharacters(filterCharactersZa);
});
//Filter Human
const characterHuman= document.getElementById("Human");
characterHuman.addEventListener("click", () => {
const allCharacters = getCharacters();
const filterHumanCharacters= filterBySpecies(allCharacters, "Human");
renderCharacters(filterHumanCharacters);
});
//Filter Male
const characterMale= document.getElementById("Male");
characterMale.addEventListener("click", () => {
const allCharacters = getCharacters();
const filterMaleCharacters= filterByGender(allCharacters,"Male");
renderCharacters(filterMaleCharacters);
});
//Filter Female
const characterFemale= document.getElementById("Female");
characterFemale.addEventListener("click", () => {
const allCharacters = getCharacters();
const filterFemaleCharacters=filterByGender(allCharacters,"Female");
renderCharacters(filterFemaleCharacters);
});
//Filter Alive
const characterAlive= document.getElementById("Alive");
characterAlive.addEventListener("click", () => {
const allCharacters = getCharacters();
const filterAliveCharacters= filterByStatus(allCharacters,"Alive")
renderCharacters(filterAliveCharacters);
});
//Filter Dead
const characterDead= document.getElementById("Dead");
characterDead.addEventListener("click", () => {
const allCharacters = getCharacters();
const filterDeadCharacters= filterByStatus(allCharacters, "Dead")
renderCharacters(filterDeadCharacters);
});

51 changes: 43 additions & 8 deletions src/data.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,44 @@
// estas funciones son de ejemplo
import dataRickAndMorty from "./data/rickandmorty/rickandmorty.js"
//console.log(dataRickAndMorty);

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

export const anotherExample = () => {
return 'OMG';
};
export function getCharacters () {
return dataRickAndMorty.results;
}
export function getCharactersByQuery(query){
return dataRickAndMorty.results.filter(character =>
character.name.toLowerCase().includes(query));
}
export function ordinationAz (dataCharacters){
return dataCharacters.sort((a,b)=>{
if(a.name < b.name){
return -1;
}
if (a.name > b.name){
return 1;
}
return 0;
});
}
export function ordinationZa (dataCharacters){
return dataCharacters.sort((a,b)=>{
if(a.name > b.name){
return -1;
}
if (a.name < b.name){
return 1;
}
return 0;
});
}
export function filterBySpecies (dataCharacters,species){
const speciesFilter= dataCharacters.filter((character)=> character.species === species);
return speciesFilter;
}
export function filterByGender (dataCharacters,gender){
const genderFilter= dataCharacters.filter((character)=> character.gender === gender);
return genderFilter;
}
export function filterByStatus(dataCharacters,status){
const statusFilter= dataCharacters.filter((character)=>character.status === status);
return statusFilter;
}
47 changes: 47 additions & 0 deletions src/episodes.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>Data Lovers</title>
<link rel="stylesheet" href="styleCharacters.css" />
</head>


<body>

<header>
<div class="wrapper">
<div>
<a href="index.html">
<img src="images/logo.png" id="miLogo" class="logo" alt="logo rick and Morty">
</a>
</div>
<nav>
<a href="index.html">HOME</a>
<a href="characters.html">CHARACTERS</a>
<a href="episodes.html">EPISODES</a>
<a href="wallpapers.html">WALLPAPERS</a>


</nav>
</div>
</header>


<main>

<section>
<div class="subir">
<img src="images/icons8-linea-vertical-50.png" alt="linea verde2">
<h2>Find your favorites Rick and Morty <br> Episodes.</h2>
</div>
</section>

</main>


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

</html>
Binary file added src/images/cel1.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/images/cel2.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/images/cel3.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/images/cel4.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/images/cel5.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/images/d1.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/images/d10.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/images/d2.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/images/d3.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/images/d4.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/images/d5.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/images/d6.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/images/d7.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/images/d8.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/images/d9.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/images/icons8-editar-filtro-50.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/images/icons8-linea-vertical-50.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/images/img1.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/images/img2.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/images/img3.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/images/img4.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/images/img5.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/images/imgluna.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/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
58 changes: 56 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,61 @@
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="root"></div>
<script src="main.js" type="module"></script>
<header>
<div class="wrapper">
<div>
<a href="index.html">
<img src="images/logo.png" id="miLogo" class="logo" alt="logo rick and Morty">
</a>
</div>
<nav>
<a href="index.html">HOME</a>
<a href="characters.html">CHARACTERS</a>
<a href="episodes.html">EPISODES</a>
<a href="wallpapers.html">WALLPAPERS</a>
<a href="#">LOGIN</a>

</nav>
</div>
</header>
<main>
<div class="wrapper">
<article>
<div class="side">
<img src="images/icons8-linea-vertical-50.png" alt="linea verde1">
<h1 class="down">Welcome to the
<br>
Rick and Morty page.</h1>
</div>

</article>
<section >
<div class="side">
<img src="images/icons8-linea-vertical-50.png" alt="linea verde2">
<h2>American adult animated television series created
by Justin Roiland and Dan Harmon in 2013 for Adult Swim, also
aired on Cartoon Network. The series follows the misadventures of a
scientist, Rick Sanchez, and his easily influenced grandson, Morty,
who pass the time between domestic life and space travel,
temporary and intergalactic. Dan Harmon, the co-creator of the series and
Justin Roiland are responsible for the main voices of Morty and Rick,
the series also includes the voices of Chris Parnell, Spencer Grammer and
Sarah Chalke.
<br>
<br>
The series originated from a scrappy short animated by Roiland
for the Channel 102 film festival called Doc and Mharti, a parody of
the main protagonists of Back to the Future. When NBC
fired Harmon in 2013 over arguments between him and show executives
he had created, Community, he and Roiland developed a series based on the
characters already created by Roiland.</h2>
</div>
</section>
</div>
</main>



</body>
<script src="main.js" type="module"></script>
</html>
20 changes: 15 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import { example } from './data.js';
// import data from './data/lol/lol.js';
import data from './data/pokemon/pokemon.js';
// import data from './data/rickandmorty/rickandmorty.js';
const backgrounds = [];
backgrounds[0] = '../images/img1.jpeg';
backgrounds[1] = '../images/img2.jpeg';
backgrounds[2] = '../images/img3.jpeg';
backgrounds[3] = '../images/img4.jpeg';
backgrounds[4] = '../images/img5.jpeg';

function setBackground(){
const setBackground = Math.floor(Math.random() * backgrounds.length);
document.body.style.backgroundImage = `url(${backgrounds[setBackground]})`;
}

window.onload = setBackground



console.log(example, data);
Loading