Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
439 changes: 32 additions & 407 deletions README.md

Large diffs are not rendered by default.

Binary file added Sin título.key
Binary file not shown.
10 changes: 10 additions & 0 deletions src/data lovers.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "."
},
{
"path": "/Users/zayrajeronimo/Documents/Laboratoria/Proyecto2/CDMX009-Data-Lovers/img"
}
]
}
21 changes: 17 additions & 4 deletions src/data.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
// import data from './data/injuries/injuries.js';
// import data from './data/lol/lol.js';
// import data from './data/patient/patient.js';
// import data from './data/pokemon/pokemon.js';
import data from './data/pokemon/pokemon.js';
// import data from './data/rickandmorty/rickandmorty.js';
// import data from './data/steam/steam.js';
// import data from './data/steam/worldbank.js';

// esta es una función de ejemplo

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excelente trabajo! Un comentario muy picky, hay que borrar los comentarios que no se utilicen.



const filterData = (data, condition) => {
let arrType = [];
for (let i = 0; i < data.length; i++) {
for (let x = 0; x < data[i].type.length; x++) {
if (data[i].type[x] === condition) {
arrType.push(data[i]);
}
}
}
return arrType;
};

export {sortData, filterData}
Binary file added src/img/backg-font.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/img/buscar-icon.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/go-logo copia.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/go-logo.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/pokeball.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/pokedex-logo.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/pokedex.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/pokemon-go.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/prototipo.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/sketches.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/img/usuarios.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/wireframe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
108 changes: 103 additions & 5 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,111 @@
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Data Lovers</title>
<title>PokémonGO</title>
<link rel="icon" type="image/png" sizes="128x128" href="img/pokeball.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="style.css" >

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


</head>

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

<div class="container container-1" id="start-page">
<img src="img/pokemon-go.png" id="logo">
<img src="img/pokedex.png" id="pokedex">
<h3 id="welcome">¿Estas listo para convertirte en <br> un verdadero maestro Pokémon?</h3>
<input class="button-next" type="image" onclick="nextContainer('start-page','pokemon-page');" img src="img/go-logo.png" alt="Go" width="auto" height="50px">
</div>


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recuerden borrar los espacios innecesarios :)


<section>
<div class="container container-2" id="pokemon-page">

<div class="logo">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recuerden que las clases deben ser más descriptivas, se deben nombrar en relación a lo que contienen y no a lo que hacen, container-2 no es muy descriptiva

<img src="img/pokedex-logo.png">
</div>

<!--Segunda parte menu-->

<div class="container-bar" id="btn-menu">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La clase debe ser lo suficientemene descriptiva para que no se necesiten comentarios.


<nav>
<ul>
<li><a href="">Región</a>
<ul>
<li><a href="#" id= "kanto">Kanto</a></li>

<!-- <div class="shadow">
<li><a>Johto</a></li>
<li><a>Sinnoh</a></li>
<li><a>Hoenn</a></li>
</div>-->
</ul>
</li>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si este código no se v a utilizar, debemos eliminarlo.

<li><a href="" id="typePokemon">Tipo</a>

<ul>
<li><a href="#" id="All">Ver todos</a></li>
<li><a href="#" id="Water">Agua</a></li>
<li><a href="#" id="Bug">Bicho</a></li>
<li><a href="#" id="Dragon">Dragón</a></li>
<li><a href="#" id="Electric">Eléctrico</a></li>
<li><a href="#" id="Ghost">Fantasma</a></li>
<li><a href="#" id="Fire">Fuego</a></li>
<li><a href="#" id="Ice">Hielo</a></li>
<li><a href="#" id="Fighting">Lucha</a></li>
<li><a href="#" id="Normal">Normal</a></li>
<li><a href="#" id="Grass">Hierba</a></li>
<li><a href="#" id="Psychic">Psíquico</a></li>
<li><a href="#" id="Rock">Roca</a></li>
<li><a href="#" id="Ground">Tierra</a></li>
<li><a href="#" id="Poison">Veneno</a></li>
<li><a href="#" id="Flying">Volador</a></li>
</ul>

</li>
</ul>

</nav>


<div class="logo-go">

<input type="image" onclick="filterData"('typePokemon') img src="img/go-logo copia.png" class="logo-go"></button>

</div>



<div class="search_bar">
<form action="#" id="search" method="post" class="formulario">
<a class="search-btn"></a>
<input class="search-txt" type="text" id="barra" placeholder="Búsqueda..." class="src" autocomplete="off">

</form>
</div>
</div>


</section>

<div class="pokemon-list">
<div class="main-container" id="pokemon-listing"></div> <!-- Contenedor de todos los pokemones-->
</div>
</div>



<!-- <script src="data.js"></script>-->
<!-- <script src="main.js"></script>-->



Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Borrar código que no utilizamos! :)

</body>
</html>
</html>
90 changes: 88 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,90 @@
import { example } from './data.js';
import data from './data/pokemon/pokemon.js';

console.log(example);
console.log(data);

function nextContainer(idHideContainer, idNextContainer) { //Funcion para oculpar la primera pagina
document.getElementById(idNextContainer).style.display = 'block';
document.getElementById(idHideContainer).style.display = 'none';
}

window.nextContainer = nextContainer;

//function ShowContainerPokemon(){

//}

function createPokemonItemHTML(pokemonObj) {
const name = pokemonObj.name, imgUrl = pokemonObj.img, id = pokemonObj.id;
let HTML = `<div class="pokemon-item-container pokemon" id="pokemon-item-${id}">
<div class="pokemon-item-img">
<img src="${imgUrl}" alt=${name}"></div>
<div class="pokemon-item-name">
<p class="pokemon-name" id="pokemon-${id}"> #${id} ${name}</p>
</div>
</div>`; //plantilla de cadena de texto//

return HTML;
}

function addPokemonHTMLToMainContainer(HTML) {
document.getElementById('pokemon-listing').innerHTML = HTML;
}

function showAllPokemon() {
let pokemonHTML = '';
data.pokemon.forEach((pokemonObj) => {
//console.log(pokemonObj);
//console.log(createPokemonItemHTML(pokemonObj));
pokemonHTML += createPokemonItemHTML(pokemonObj);
});

addPokemonHTMLToMainContainer(pokemonHTML);
}

function initial() {
//console.log(data.pokemon);
showAllPokemon();
}

window.initial = initial;
initial();


//funcion lista tipo pokemon

document.getElementById('typePokemon').addEventListener('change', (e) => {
const selectedIndex = e.currentTarget.selectedIndex;
if (selectedIndex === Ver) {
template(filterData(pokemon, 'All'));
} else if (selectedIndex === Agua) {
template(filterData(pokemon, 'Water'));
} else if (selectedIndex === Bicho) {
template(filterData(pokemon, 'Bug'));
} else if (selectedIndex === Dragón) {
template(filterData(pokemon, 'Dragon'));
} else if (selectedIndex === Eléctrico) {
template(filterData(pokemon, 'Electric'));
} else if (selectedIndex === Fantasma) {
template(filterData(pokemon, 'Ghost'));
} else if (selectedIndex === Fuego) {
template(filterData(pokemon, 'Fire'));
} else if (selectedIndex === Hielo) {
template(filterData(pokemon, 'Ice'));
} else if (selectedIndex === Lucha) {
template(filterData(pokemon, 'Fighting'));
} else if (selectedIndex === Normal) {
template(filterData(pokemon, 'Normal'));
} else if (selectedIndex === Hierva) {
template(filterData(pokemon, 'Grass'));
} else if (selectedIndex === Psíquico) {
template(filterData(pokemon, 'Psychic'));
} else if (selectedIndex === Roca) {
template(filterData(pokemon, 'Rock'));
} else if (selectedIndex === Tierra) {
template(filterData(pokemon, 'Ground'));
} else if (selectedIndex === Veneno) {
template(filterData(pokemon, 'Poison'));
} else if (selectedIndex === Volador) {
template(filterData(pokemon , 'Flying'));
}
});
Loading