Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2459d45
Se realizó la base de la interfaz en HTMl (se añadieron controles
greysmpich Sep 12, 2023
f1b666c
avance selectores y propiedades css sin ubicaciones y sin tarjeta
PenLogos Sep 12, 2023
8137043
Se corrigieron errores del test oas:html: Se quitó la etiqueta de cie…
greysmpich Sep 13, 2023
7bfc976
avance en relación de cajas de la tarjeta y partimos rama
PenLogos Sep 13, 2023
eeb8e0c
El background color se aplicó al body en vez de aplicarse al selector…
greysmpich Sep 14, 2023
e3a56c3
se logra crear un elemento dentro de la tarjeta y seleccionar data de…
PenLogos Sep 14, 2023
c0e7cf5
creamos todos los elementos para rellenar tarjeta
PenLogos Sep 15, 2023
8b8f04e
Se conseigue que aparezcan nombres de pokemon en todas las tarjetas e…
PenLogos Sep 15, 2023
58d4f05
Se dividió el código: view contiene las líneas que crean las tarjetas…
greysmpich Sep 18, 2023
f323b20
se refactoriza código de datos que salen en lar cartas y de trabaja e…
PenLogos Sep 18, 2023
79a5682
se corrige lo que no dejaba que salieran als tarjetas
PenLogos Sep 18, 2023
46062c1
se añaden datos de evloución y preevolución y se deja un console log …
PenLogos Sep 18, 2023
1a3c5e4
se terminan de llenar las tarjetas con los datos restantes, queda pen…
PenLogos Sep 19, 2023
ee5ef40
Se cambiaron las concatenaciones con signo + por plantillas literales…
greysmpich Sep 19, 2023
89bf4b5
borrar cambios
PenLogos Sep 19, 2023
ce3f30a
corregir cambios
PenLogos Sep 19, 2023
32837a5
push de actualización manual
PenLogos Sep 19, 2023
54a6f92
Se crearon dinámicamente los label, select y option
greysmpich Sep 19, 2023
eea66a4
cambio local
PenLogos Sep 19, 2023
ef83325
Merge branch 'Diseño-de-interfaz-HTML' of https://github.com/PenLogos…
PenLogos Sep 19, 2023
14eae65
Se añadió eventListener de filtro tipo, aún no funciona
greysmpich Sep 19, 2023
48a7508
Merge branch 'Diseño-de-interfaz-HTML' of https://github.com/PenLogos…
PenLogos Sep 19, 2023
ef5cbfe
Se empezó a trabajar en el CSS del contenido de las cards
greysmpich Sep 21, 2023
c8f60f0
Merge branch 'Diseño-de-interfaz-HTML' of https://github.com/PenLogos…
PenLogos Sep 21, 2023
e6192fa
se organizan los datos de las cartas
PenLogos Sep 21, 2023
6f948da
Pasamos los label y select a HTML, se escribió la función y el addEve…
greysmpich Sep 21, 2023
018bb54
cambios
PenLogos Sep 21, 2023
44f65a5
Merge branch 'Diseño-de-interfaz-HTML' of https://github.com/PenLogos…
PenLogos Sep 21, 2023
7e6fdcf
cambios
PenLogos Sep 21, 2023
40dc176
copiando archivos anteriores
PenLogos Sep 21, 2023
c225a93
se soluciona el problema de la función de filtrado y de las evoluciones
PenLogos Sep 22, 2023
7961ffa
Ya se muestran los resultados de los filtros, estos se acumulan y se …
greysmpich Sep 22, 2023
1f9e5e8
guardar
PenLogos Sep 22, 2023
6e6b438
aceptar cambios
PenLogos Sep 22, 2023
1d8c6f5
cambios
PenLogos Sep 22, 2023
a964366
actualización manual
PenLogos Sep 22, 2023
f4d188d
Se añadieron los íconos de tip. Falta acomodarlos en la card
greysmpich Sep 25, 2023
6f68a47
Merge branch 'Diseño-de-interfaz-HTML' of https://github.com/PenLogos…
PenLogos Sep 25, 2023
916300c
Se elabora prueba unitaria para función de filtrado
PenLogos Sep 25, 2023
6bd7049
Se añade nueva combinación de filtros y se añade option a select con …
PenLogos Sep 26, 2023
44b8650
Se implementó flexbox y se terminaron los estilos de la 1era interfaz
greysmpich Sep 26, 2023
94ce2d0
Se añadió el logo pokémon en h2
greysmpich Sep 26, 2023
df7c6f0
se añaden imágenes de candy, flexbox a select y se arregla footer y m…
PenLogos Sep 26, 2023
111bcfa
Delete docs/data/athletes directory
PenLogos Sep 27, 2023
f848cd4
Delete docs/data/breakingbad directory
PenLogos Sep 27, 2023
e1b330a
Delete docs/data/countries directory
PenLogos Sep 27, 2023
f283097
Delete docs/data/ghibli directory
PenLogos Sep 27, 2023
a03dbbf
Delete docs/data/got directory
PenLogos Sep 27, 2023
bfd9b14
Delete docs/data/lol directory
PenLogos Sep 27, 2023
59db838
Delete docs/data/rickandmorty directory
PenLogos Sep 27, 2023
fa5ee1a
Delete docs/data/tarot directory
PenLogos Sep 27, 2023
f6d30a1
Delete docs/data/pokemon/README.md
PenLogos Sep 27, 2023
aa15010
Delete docs/data/pokemon/pokemon.json
PenLogos Sep 27, 2023
02dc3be
borrando archivos innecesesarios en docs
PenLogos Sep 27, 2023
7fe64d8
Merge branch 'Diseño-de-interfaz-HTML' of https://github.com/PenLogos…
PenLogos Sep 27, 2023
bc6d7fa
borrando archivos innecesarios en docs
PenLogos Sep 27, 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
23,953 changes: 23,953 additions & 0 deletions docs/data/pokemon/pokemon.js

Large diffs are not rendered by default.

23,953 changes: 23,953 additions & 0 deletions docs/data/pokemon/pokemon.json

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions docs/dataFunctions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// estas funciones son de ejemplo

export const dataFilter = (data, filterBy, value) => {
const filter = data.filter((element)=>{
return element[filterBy].includes(value)
})
return filter;
};

// export const anotherExample = (data, filterBy, value) => {
// //const optionPokemonTypeSelected = data.filter(type => type === type.grass);
// const filter = data.filter((element)=>{
// return element[filterBy] == value
// })
// return filter;
// };
Binary file added docs/imagenes/Fondo tarjeta panorámica.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 docs/imagenes/Fondo2-tarjeta.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 docs/imagenes/Img-pokemonType/bug.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 docs/imagenes/Img-pokemonType/dark.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 docs/imagenes/Img-pokemonType/dragon.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 docs/imagenes/Img-pokemonType/electric.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 docs/imagenes/Img-pokemonType/fairy.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 docs/imagenes/Img-pokemonType/fighting.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 docs/imagenes/Img-pokemonType/fire.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 docs/imagenes/Img-pokemonType/flying.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 docs/imagenes/Img-pokemonType/ghost.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 docs/imagenes/Img-pokemonType/grass.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 docs/imagenes/Img-pokemonType/ground.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 docs/imagenes/Img-pokemonType/ice.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 docs/imagenes/Img-pokemonType/normal.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 docs/imagenes/Img-pokemonType/poison.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 docs/imagenes/Img-pokemonType/psychic.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 docs/imagenes/Img-pokemonType/rock.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 docs/imagenes/Img-pokemonType/steel.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 docs/imagenes/Img-pokemonType/water.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
404 changes: 404 additions & 0 deletions docs/imagenes/Pokemon-img.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 docs/imagenes/candy.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 docs/imagenes/headerImage.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Data Lovers</title>
<link rel="stylesheet" href="style.css" />
<link
href="https://fonts.googleapis.com/css2?family=Titillium+Web&display=swap"
rel="stylesheet"
/>
</head>

<body>
<header>
<h1>BienvenidX a App</h1>
</header>
<main class="filters">
<h2>Encuentra cualquier <img class="pokemon-h2" src="imagenes/Pokemon-img.svg" alt="pokemon-logo"> de las regiones de Kanto y Johto</h2>
<label name="row2" class="choose" for="search-by-name">
Elige los criterios de búsqueda para comenzar
<input type="text" placeholder="busca por nombre de pokémon" />
</label>
<label name="row2" for="boton-limpiar"><button data-testid="button-clear">Limpiar</button></label>
<div>
<p class="color"> Filtrar por:</p>
<label class="filter" for="type">
Tipo
<select name="type" data-testid="select-filter" id="type">
<option>Todos</option>
</select>
</label>
<label class="filter" for="resistant-to">
Resiste a
<select name="resistant-to" data-testid="select-filter" id="resistant-to">
<option>Sin filtro</option>
</select>
</label>
<label class="filter" for="weak-to">
Débil a
<select name="weak-to" data-testid="select-filter" id="weak-to">
<option>Sin filtro</option>
</select>
</label>
<label for="order-by">
Ordenar por
<select name="order-by" data-testid="select-sort" id="order-by">
<option value="spawnChance">Tasa de aparición</option>
<option value="costEvolution">Costo de evolución</option>
</select>
</label>
<label for="change-order-asc"
><input type="radio" name="sort-order" value="asc" id="change-order-asc" />Ascendente</label
>
<label for="change-order-desc"
><input type="radio" name="sort-order" value="desc" id="change-order-desc" />Descendente</label
>
</div>
</main>
<section id="root">
<ul class="contenedor"></ul>
</section>
<footer>Desarrollado por Grecia Mendieta y Penélope Logos|2023</footer>
<script src="main.js" type="module"></script>
</body>
</html>
82 changes: 82 additions & 0 deletions docs/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import { dataFilter } from "./dataFunctions.js";
import { renderItems } from "./view.js";

import data from "./data/pokemon/pokemon.js";

const selectPokemon = data.pokemon;
const selectFilterType = document.querySelector("select[name=type]");
const selectFilterResistant = document.querySelector("select[name=resistant-to]");
const selectFilterWeakness = document.querySelector("select[name=weak-to]");
const selectFilterName = document.querySelector("input[type=text]");
const cardContainer = document.querySelector(".contenedor");

const arrayTypeValues = Object.values(selectPokemon).flatMap(
(item) => item.type
);

const cleanArrayTypeValues = arrayTypeValues.filter((value, index, self) => {
return self.indexOf(value) === index;
});

function createOption(value) {
const optionType = document.createElement("option");
selectFilterType.appendChild(optionType);
optionType.innerHTML = value;
optionType.setAttribute("class", "type-filter");
optionType.setAttribute("value", optionType.value);
const optionResistant = document.createElement("option");
selectFilterResistant.appendChild(optionResistant);
optionResistant.innerHTML = value;
optionResistant.setAttribute("value", optionResistant.value);
const optionWeakness = document.createElement("option");
selectFilterWeakness.appendChild(optionWeakness);
optionWeakness.innerHTML = value;
optionWeakness.setAttribute("value", optionWeakness.value);
}

selectPokemon.forEach(renderItems);

cleanArrayTypeValues.forEach(createOption);

const filteredResults = {
type: [],
resistant: [],
weaknesses: [],
};

const applyFilter = (filterName, selectedValue) => {
selectFilterName.value = "";
filteredResults[filterName] = dataFilter(selectPokemon, filterName, selectedValue);
cardContainer.innerHTML = "";
let filterIntersection = [...selectPokemon];
for (const filter in filteredResults) {
if (filteredResults[filter].length > 0) {
filterIntersection = filterIntersection.filter((element) =>
filteredResults[filter].includes(element)
);
}
}
if (filterIntersection.length > 0) {
filterIntersection.forEach(renderItems);
} else {
const noResults = document.createElement("p");
cardContainer.appendChild(noResults);
noResults.setAttribute("class", "message")
noResults.innerHTML = "No hay pokemones así por atrapar, sigue buscando"
}
};
selectFilterType.addEventListener("change", () => {
applyFilter("type", selectFilterType.value);
});
selectFilterResistant.addEventListener("change", () => {
applyFilter("resistant", selectFilterResistant.value);
});
selectFilterWeakness.addEventListener("change", () => {
applyFilter("weaknesses", selectFilterWeakness.value);
});
selectFilterName.addEventListener("change", () => {
const resultFilterName = dataFilter(selectPokemon, "name", selectFilterName.value);
cardContainer.innerHTML = "";
resultFilterName.forEach(renderItems);
});

Loading