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

https://github.com/Carlareneedc/SCL013-data-lovers/pull/new/gh-pages #11

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Binary file added 1.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 2.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 2.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 3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
506 changes: 103 additions & 403 deletions README.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-merlot
Binary file added flujo2.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 flujopapel.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 framefigma.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 newframe.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 primerflujo.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 prototipobaja.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.rar
Binary file not shown.
85 changes: 77 additions & 8 deletions src/data.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,78 @@
// estas funciones son de ejemplo

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

export const anotherExample = () => {
return 'OMG';
};
//En este lugar estamos exportando desde potter.js, las funciones que vamos creando acá, tomando desde la data general enviada por Laboratoria,
// para ser utilizadas en main.js donde éste trabajara con DOM para ver en HTML toda nuestra página con las funciones
//<------- La data general ya está creada por Laboratoria y ya la llamamos en js, con el nombre dataPotter.
//<---Funcion filtrar por casas para enviar (exportar) a main.js
// Dentro de la func filterHouse, creamos la variable let characterHouse con su función dentro,
//que mostrara los personajes de cada casa ya filtrados
export function filterHouse(dataPotter, condition) {
let characterHouse = dataPotter.filter(character => character.house === condition);
return characterHouse;
}
export function filterhogwartsStaff(dataPotter) {
let characterHouse = dataPotter.filter(character => character.hogwartsStaff === true);
return characterHouse;
}
export function filterhogwartsStudent(dataPotter) {
let characterHouse = dataPotter.filter(character => character.hogwartsStudent === true);
return characterHouse;
}
export function filterGender(dataPotter, condition) {
let characterHouse = dataPotter.filter(character => character.gender === condition);
return characterHouse;
}
export function filterSearch(dataPotter, condition) {
const filterBy = (condition) => {
const termLowerCase = condition.toLowerCase();
return (character) =>
Object.keys(character)
.some(() => character.name.toLowerCase().indexOf(termLowerCase) !== -1)
}
let showCharacter = dataPotter.filter(filterBy(condition));
return showCharacter;
}
export function compare( a, b ) {
if ( a.name < b.name ){
return -1;
}
if ( a.name > b.name ){
return 1;
}
return 0;
}
// export function filterOrder(dataPotter, condition) {
// let showCharacter = filterOrder.filter(character => character.name === condition);
// return showCharacter;
// }
// export const orderData = (dataPotter, condition) => {
// let filterOrder = dataArray; //Arreglo nuevo donde guardaremos persojes ordenados
// if(condition==0){
// return filterOrder;
// }
// if(condition == 1){
// filterOrder.sort((a, b) => a.name.localeCompare(b.name));
// return filterOrder;
// }
// if(condition==2){
// filterOrder.sort((a, b) => a.name.localeCompare(b.name));
// const filterOrderReverse=filterOrder.reverse();
// return filterOrderReverse;
// }
// }
// export default orderData;
// export const orderData = (dataArray, condition) => {
// let filterOrder = dataArray; //Arreglo nuevo donde guardaremos persojes ordenados
// if(condition==0){
// return filterOrder;
// }
// if(condition == 1){
// filterOrder.sort((a, b) => a.name.localeCompare(b.name));
// return filterOrder;
// }
// if(condition==2){
// filterOrder.sort((a, b) => a.name.localeCompare(b.name));
// const filterOrderReverse=filterOrder.reverse();
// return filterOrderReverse;
// }
// }
// export default orderData;
Loading