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

Code Review #20

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2f8af05
diseño de pagina
karenfn Feb 28, 2020
78b0422
Ingreso de div
akaren29 Feb 28, 2020
c018044
Obtendiendo data de .js
akaren29 Mar 2, 2020
1d7003f
Lista función para mostrar en tarjetas a los Pokemones
akaren29 Mar 5, 2020
bb7dfa2
test
akaren29 Mar 5, 2020
c602afe
Cambios en divs
akaren29 Mar 6, 2020
25a5e9e
Se alineo los pokemones y se agrego option para ordenar
akaren29 Mar 8, 2020
9abe985
Se implemento función ordenar
akaren29 Mar 11, 2020
6a623c5
Cambios finales
akaren29 Mar 13, 2020
92fbe41
Merge pull request #1 from akaren29/anaj
akaren29 Mar 13, 2020
1e4c2ee
Update README.md
akaren29 Mar 18, 2020
ead587b
Comentario de console
akaren29 Mar 18, 2020
d6b0b41
Merge branch 'master' of https://github.com/akaren29/CDMX009-Data-Lovers
akaren29 Mar 18, 2020
449c0c7
Cambios en Diseño
akaren29 Mar 18, 2020
bf60610
Update README.md
akaren29 Mar 20, 2020
661e501
Update README.md
akaren29 Mar 20, 2020
e96cbc9
Update README.md
akaren29 Mar 23, 2020
440c3eb
Update README.md
akaren29 Mar 23, 2020
fd96e1e
Copiando archivos src para publicar en gh-pages
akaren29 Mar 31, 2020
bc9c92a
Archivo index para gh-pages
akaren29 Mar 31, 2020
a2b38eb
Archivos para gh-pages
akaren29 Mar 31, 2020
8d7e22a
Archivo para gh-pages
akaren29 Mar 31, 2020
3930a35
Archivos para gh-pages
akaren29 Mar 31, 2020
2de4e9a
se ingresa div para busqueda de pokemones
akaren29 Apr 3, 2020
bf66752
Modificando readme
akaren29 May 23, 2020
2ef5c74
Update README.md
akaren29 May 23, 2020
ce2a2d5
Update README.md
akaren29 May 23, 2020
7a58cd1
Update README.md
akaren29 May 23, 2020
c298ee6
Update README.md
akaren29 May 23, 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
460 changes: 38 additions & 422 deletions README.md

Large diffs are not rendered by default.

Binary file added assets/aplicacion.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 assets/prototipoalta.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 assets/prototipobaja.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions docs/data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

const sortData = (data, sortBy, sortOrder) => {
let arrOrder = [];
/*Ordenar Alfabeticamente*/
if (sortBy === 'name'){
if (sortOrder === 'A-Z'){
arrOrder = data.sort(function(abc,bcd){
if (abc.name > bcd.name) return 1;
if (abc.name === bcd.name) return 0;
return -1;
});
}else{
arrOrder = data.sort(function (abc, bcd){
if (bcd.name > abc.name) return 1;
if (bcd.name === abc.name) return 0;
return -1;
});
}
/*Ordenar por número*/
} else if (sortBy === 'number'){
if (sortOrder === 'asc'){
arrOrder = data.sort(function (abc, bcd){
if(abc.num > bcd.num) return 1;
if(abc.num === bcd.num) return 0;
return -1;
});
}else {
arrOrder = data.sort(function(abc, bcd){
if (bcd.num > abc.num) return 1;
if (bcd.num === abc.num) return 0;
return -1;
});
}
}
return arrOrder;
};





//funcion filtrar

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}
Loading