Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solicitando primer pull request #27

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
6173414
cambios Readme
fabi-pharoxysme Feb 28, 2020
f29ad25
subiendo primeros cambios de css y html
EdithOrt Feb 28, 2020
4524efd
Cambios a header con botones
EdithOrt Mar 2, 2020
aa922d4
Subiendo avances menú desplegable.
EdithOrt Mar 2, 2020
69aa0d7
Subiendo cambios de cascada con CSS
EdithOrt Mar 2, 2020
d5ffc62
cambios data.js
fabi-pharoxysme Mar 2, 2020
e3e15ae
Merge branch 'master' of https://github.com/EdithOrt/CDMX009-Data-Lovers
fabi-pharoxysme Mar 2, 2020
1102c72
cambios data.js
fabi-pharoxysme Mar 2, 2020
2b86974
Cambios de menu cascada
EdithOrt Mar 2, 2020
5cb656e
Mezclando info
EdithOrt Mar 2, 2020
7a85962
mostrando data
fabi-pharoxysme Mar 3, 2020
31a156d
Ya filtra :)
EdithOrt Mar 4, 2020
e2417e1
Subiendo partes comentadas
EdithOrt Mar 4, 2020
ed6fd6b
Subiendo ultimos cambios a css
EdithOrt Mar 4, 2020
5108f07
Haciendo flexblox
EdithOrt Mar 5, 2020
89225a2
Subiendo cambios con ForEach imagenes
EdithOrt Mar 5, 2020
8f7f167
Subiendo cambios con Flexbox
EdithOrt Mar 5, 2020
5e34c69
Mostrando cuadros contenedores de imagen con JS a HTML
EdithOrt Mar 9, 2020
3ac0ee7
imagen dentro de etiqueta img
EdithOrt Mar 9, 2020
e82380d
IMAGENES YA MOSTRADAS DE CADA POKÉMON EN HTML
EdithOrt Mar 9, 2020
1813c3b
COMENZANDO DISEÑO
EdithOrt Mar 10, 2020
f140cc3
Modal Ranking
fabi-pharoxysme Mar 10, 2020
597da22
SUBIENDO CAMBIOS IMPORTANTES PARA JALAR DATA
EdithOrt Mar 10, 2020
5f6e93a
Creación de modal en JS
fabi-pharoxysme Mar 11, 2020
d3529d8
Modal que abre y cierra
fabi-pharoxysme Mar 11, 2020
a2fdad7
Todos los botones tienen funcionalidad
fabi-pharoxysme Mar 12, 2020
fc16d54
class de cada img
fabi-pharoxysme Mar 12, 2020
665d9a5
O.H.A
fabi-pharoxysme Mar 13, 2020
5b6b471
Ya aparece en HTML abajo modal de cada pokemon
EdithOrt Mar 16, 2020
97b3778
imagenes responsive
fabi-pharoxysme Mar 17, 2020
91f25b5
cierre modal
fabi-pharoxysme Mar 17, 2020
c4139af
Ya abre modales con Eventlistener
EdithOrt Mar 18, 2020
7e94613
subiendo cambios a readme
EdithOrt Mar 19, 2020
c2a95a5
subiendo a github
EdithOrt Mar 19, 2020
d64b5ae
subiendo cambios modal sin poder jalar data UNDEFINED
EdithOrt Mar 20, 2020
4ecb997
Porfiin salio modal
fabi-pharoxysme Mar 23, 2020
d30c8d4
ya no se desfasa infor pokemones
EdithOrt Mar 23, 2020
b5721d4
Modal que abre y cierra con info correcta y comienzo de filtración
fabi-pharoxysme Mar 23, 2020
1155601
cambios select
fabi-pharoxysme Mar 24, 2020
1ce6bdd
filter
fabi-pharoxysme Mar 26, 2020
f17ef91
Ya muestra pokemones en pantalla filtrados
EdithOrt Mar 27, 2020
79c32d2
subiendo cambios edith
EdithOrt Mar 27, 2020
23d51ce
funcion correcta
fabi-pharoxysme Mar 27, 2020
3d45eab
Iterando opciones menú cascada con object keys
EdithOrt Mar 27, 2020
d051233
O.H filtración
fabi-pharoxysme Mar 31, 2020
1c34545
muestra imagenes filtradas correctamente
fabi-pharoxysme Apr 1, 2020
3f0cfe5
función modal en pokemones filtrado pero no correctamente
fabi-pharoxysme Apr 2, 2020
81d0c41
modal pantalla principal
fabi-pharoxysme Apr 3, 2020
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
436 changes: 34 additions & 402 deletions README.md

Large diffs are not rendered by default.

Binary file added imgReadme/DiagramadeFlujo.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 imgReadme/Thumbs.db
Binary file not shown.
Binary file added imgReadme/Wireframe-Pokemon.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 imgReadme/demo.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 imgReadme/desktop.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 imgReadme/sketchPantallaEmergente.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 imgReadme/sketchPantallaPrincipal.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 imgReadme/sketchPantallaRanking.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 imgReadme/tablet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added src/b.id)
Empty file.
37 changes: 24 additions & 13 deletions src/data.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
// 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/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';
};
import data from './data/pokemon/pokemon.js';
//Mostrar la data
export const dataPokemon= data.pokemon;
//Filtracion
function onChange(e){
let value = e.target.value
let nuevaListaFiltrada = data.pokemon.filter(p=>p.type.includes(value))
}
//console.log(nuevaListaFiltrada)

//Orden por numero de Pokedex
export let numberPokedex=
data.pokemon.sort((a, b)=>{
if(a.id< b.id){
return -1;
}
if (a.id> b.id){
return 1;
}
});
//console.log(numberPokedex)



Binary file added src/images/background.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/bienvenida.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/youdex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 42 additions & 2 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,53 @@
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Data Lovers</title>
<title>YouDex</title>
<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" />
</head>
<body>
<div id="root"></div>
<div class="container">
<header>
<img class="logo" src="images/youdex.png">
<nav>
ORDENAR POR:
<li><a href="#">NÚMERO DE POKÉDEX</a></li>
<li class="dropdown">

<select class="dropdown-content">
<option id="grass">grass</option>
<option id= "poison">poison</option>
<option id= "fire">fire</option>
<option id = "fairy">fairy</option>
<option id= "water">water</option>
<option id = "bug">bug</option>
<option id = "normal">normal</option>
<option id = "electric">electric</option>
<option id = "ground">ground</option>
<option id = "fighting">fighting</option>
<option id = "psychic">psychic</option>
<option id = "rock">rock</option>
<option id = "ice">ice</option>
<option id = "ghost">ghost</option>
<option id = "dragon">dragon</option>
Copy link
Contributor

Choose a reason for hiding this comment

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

Esto pudo crearse dinámicamente con la misma data de los pokemons.

</select>

</nav>
</header>
<main>
<div class="dinamic" id="boxImages">
</div>
<section id="modalPokemon" class="modalPokemon">
<span class= "close" id= "close">&times;</span>
<div id="contentInfo"></div>
</section>
</main>
<footer>
Hola soy el footer
</footer>
</div>
<!-- <div id="root"></div> -->
<script type="module" src="main.js"></script>
</body>
</html>
59 changes: 57 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,59 @@
import { example } from './data.js';
import {dataPokemon} from './data.js';
import pokemon from './data/pokemon/pokemon.js';

console.log(example);
console.log();
//Nodos
let closeModal = document.querySelectorAll(".close");

//Mostrar imagenes pantalla principal
const images = dataPokemon.forEach((item) => {
let image= item.img;
let label= document.createElement('img');
label.id= ("a"+item.type)
let btn= document.createElement('button');
btn.className+= ("btn-Images")
Copy link
Contributor

Choose a reason for hiding this comment

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

className no existe en native, eso es de ReactJS, la forma de trabajar con clases en Vanilla es:

btn.classList.add("btn-Images")

Copy link
Contributor

Choose a reason for hiding this comment

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

Eviten usar clases con mayusculas o camelCase, btn-images

btn.id+= item.id
btn.appendChild(label);
label.src= image;
let node= btn;
document.getElementById("boxImages").appendChild(node);
});
//Modal Información Pokemon

let btnImg = document.querySelectorAll('.btn-Images');
let Imgs = document.querySelector('#a')
Copy link
Contributor

Choose a reason for hiding this comment

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

Eviten las mayusculas en las variables, a menos que se entienda qué es una clase (JS) y porqué se usan Mayusculas en una declaración de clase, bien por el uso de querySelector

btnImg.forEach(poke =>{
let a = poke.id -1;

const showData = () => {

document.getElementById("modalPokemon").style.display="block";
let container= document.getElementById("contentInfo");
document.createElement('div');
container.innerHTML=`
<h3 class="num"> ${dataPokemon[a].num}</h3>
<h4 class= "name"> ${dataPokemon[a].name}</h4>
<div class= "img-contain"> <img class="img poke" src='${dataPokemon[a].img}' /> </div>
<p class="type"> Tipo: ${dataPokemon[a].type} </p>
<p class="weigth"> Peso: ${dataPokemon[a].weight} Altura: ${dataPokemon[a].height} </p>
<p class="candy"> Dulces: ${dataPokemon[a].candy_count} ${dataPokemon[a].candy}</p>
<p class="egg"> Tipo de huevo: ${dataPokemon[a].egg}</p>
<p class="average spawn"> Frecuencia de aparición: ${dataPokemon[a].avg_spawns}</p>`
}
poke.addEventListener('click',showData)
});
closeModal.forEach(closeModalPoke=>{
closeModalPoke.addEventListener('click',function(){
document.getElementById("modalPokemon").style.display = 'none';})
});

//Filtración
let options= document.querySelector(".dropdown-content");
options.addEventListener('click',onChange)

function onChange(e){
let value = e.target.value
let nuevaListaFiltrada = dataPokemon.filter(p=>p.type.includes(value))
console.log(nuevaListaFiltrada)
Copy link
Contributor

Choose a reason for hiding this comment

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

Evitar español, y cuidado con la identación de las funciones, lo vuelve difícil de leer

};

240 changes: 240 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
background: linear-gradient(to right,#FF6950, #FF3050);
font-family: 'Open Sans';
}

.logo {
height: 77.98px;
width: 90px;
}

.container {
background: linear-gradient(to right,#FF6950, #FF3050);
width: 100%;
max-width: 1500vw;
height: 150vh;
/* background: #ffffff; */
margin: auto;
/*Flex*/
display: flex;
flex-direction: row;
flex-wrap: wrap;
}

header{
width: 100%;
padding: 20px;
height: 150px;
/*Flex*/
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: row;
flex-wrap: wrap;
}

header nav {
list-style-type: none;
width: 50%;
/*Flex*/
display: flex;
flex-wrap: wrap;
align-items: center;
}

header nav a {
border: 1px solid #ffffff;
margin-left: 30px;
margin-right: 30px;
width: 200px;
height: 55px;
border-radius: 30px;
text-align: center;
text-decoration: none;
padding: 10px;
display: block;
font-family: 'Open Sans';
/*Flex*/
flex-grow: 1;
}

main {
/* background-color: yellowgreen; */
padding: 10px;
/*Flex*/
flex: 1 1 100%;
}

main .dinamic {
margin-bottom: 20px;
padding-bottom: 20px;
/*Flex*/
display: flex;
flex-wrap: wrap;
justify-content: center;
padding: 5px;
}

main section .bienvenida {
flex: 0 0 382px;
}

main div img {
height: 80px;
width: 80px;
}

li a, .dropbtn {
color: white;
text-align: center;
/* padding: 14px 16px; Desacomoda el desplegable a forma hotizontal*/
text-decoration: none;
}

li a:hover, dropdown:hover .dropbtn {
background-color: white;
color: #FF3050;
}

/*cajas contenedoras de texto para tipos de pokemon*/
.dropdown-content {
/* display: none; */
min-width: 160px;
z-index: 1;
position: absolute; /*Hizo que el menú multinivel apareciera vertical*/
}

/*texto para tipos de pokemon*/
.dropdown-content a {
background-color: #ffffff;
color:#FF3050;
border-radius: 0px;
text-decoration: none;
display: block; /*Hace de forma vertical el acomodo desplegable*/
text-align: center;
}

.dropdown-content a:hover {
color: #ffffff;
background-color:#FF6950;
}

.dropdown:hover .dropdown-content {
display: block;
}

footer {
width: 100%;
padding: 20px;
background: red;
display: flex;
flex-wrap: wrap;
color: white;
text-decoration: none;
}

img {
width: 160vw;
height: 160vh;
}

@media screen and (max-width: 10vw) {
.container {
flex-direction: column;
}
header {
flex-direction: column;
padding: 0;
}
header img {
margin: 20px 0;
}
header nav {
width: 100%;
}
}
/* Modal Ranking */
.modal-container{
display: none;
position: fixed;
z-index: 1;
overflow: auto;
left: 20vw;
top: 20vh;
width: 60%;
height: 60%;
background: rgb(238, 235, 235);
}
.contenido-modal{
position: relative;
background-color: rgb(214, 210, 210);
margin: auto;
width: 30%;
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.4);
}
.close{
color: rgb(3, 3, 3);
font-size: 30px;
font-weight: bold;
}
.close:hover{
color: rgb(224, 30, 30);
text-decoration: none;
cursor: pointer;
}
/* Modal Información Pokemon */
.modalPokemon{
display: none;
position: fixed;
z-index: 1;
overflow: auto;
left: 20vw;
top: 20vh;
width: 20%;
height: 50%;
background: rgb(238, 235, 235);
}
.contenido-modal-pokemon{
position: relative;
background-color: rgb(214, 210, 210);
margin: auto;
width: 60%;
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.4);
}
.closePokemon{
color: rgb(3, 3, 3);
font-size: 30px;
font-weight: bold;
}
.closePokemon:hover{
color: rgb(224, 30, 30);
text-decoration: none;
cursor: pointer;
}

.btn-Images{
background-color: transparent;
border: transparent;
}

/*
.button {
display: block;
padding: 15px 20px;
background-color: transparent;
border: 1px solid #ffffff;
margin-left: 30px;
margin-right: 30px;
width: 200px;
height: 55px;
border-radius: 30px;
font-family: 'Open Sans';
font-weight: bold;
color: white;
}*/
Empty file added src/{
Empty file.