Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1f10c57
creamos estructura html, header con sus secciones y title
AlexaFuenmayor Jul 29, 2022
f3c31fe
cree estructura html: header con el logo, titulo y el input. Agregue …
AlexaFuenmayor Jul 29, 2022
34e907b
actualizacion readme
Yibrika Aug 1, 2022
20002db
Merge pull request #1 from Yibrika/develop
AlexaFuenmayor Aug 1, 2022
a6f0391
modifiqué html: quitando la lista y colocando la estrucutra para una …
AlexaFuenmayor Aug 2, 2022
4fd5cdf
Merge branch 'develop' of github.com:AlexaFuenmayor/BOG005-data-lover…
AlexaFuenmayor Aug 2, 2022
9129b20
En javaScript Creamos función para mostrar atletas filtrando por depo…
AlexaFuenmayor Aug 4, 2022
e253ac0
EN java Scripr cree función para visualizar la data en el select de p…
AlexaFuenmayor Aug 6, 2022
f9248c9
Creamos función para visualizar los atletas por deporte
AlexaFuenmayor Aug 8, 2022
2355c17
creamos función para mostrar atletas por paises
AlexaFuenmayor Aug 9, 2022
bb8074f
edité cada función que muestra los atletas, agregandole pais, eevento…
AlexaFuenmayor Aug 9, 2022
a539c55
di estilos en css a los tr, y divs creados en js (main), y elimine có…
AlexaFuenmayor Aug 10, 2022
0a6e532
en el html cambié dos div por sections, y cree el select para la func…
AlexaFuenmayor Aug 11, 2022
3eb374b
Agregue imagenes para cambiar el fondo, y el icono de inicio, cambie …
AlexaFuenmayor Aug 12, 2022
ee7a77f
creamos botton para ordenar en index, en main lo ocultamos y en main …
AlexaFuenmayor Aug 16, 2022
c640172
prueba con cambio en el readme
AlexaFuenmayor Aug 16, 2022
32c9009
terminamos
Yibrika Aug 16, 2022
418c84b
Merge pull request #2 from Yibrika/develop
AlexaFuenmayor Aug 16, 2022
e72c987
responsive de celular
Yibrika Aug 17, 2022
7a6e6c7
Merge pull request #3 from Yibrika/develop
AlexaFuenmayor Aug 17, 2022
c579643
descise ultimo commit
AlexaFuenmayor Aug 17, 2022
5ae4630
traje los cambios del responsive realizado por Yibrika
AlexaFuenmayor Aug 17, 2022
3b60689
creamos función ordenar y función calcular en data, luego en el html…
AlexaFuenmayor Sep 5, 2022
8fba8e7
creamos función porcentaje en data, en main para pintar lo retornado …
AlexaFuenmayor Sep 5, 2022
0d16eac
ultimos cambios: refactorización(el titulo se muestra con un inner ht…
AlexaFuenmayor Sep 6, 2022
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
637 changes: 42 additions & 595 deletions README.md

Large diffs are not rendered by default.

11,655 changes: 11,655 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"test": "jest --verbose --coverage",
"open-coverage-report": "opener ./coverage/lcov-report/index.html",
"start": "serve src/",
"deploy": "gh-pages -d src"
"deploy": "gh-pages -d src",
"lint": "eslint --fix --ext .js,.jsx ."
},
"dependencies": {
"@babel/core": "^7.6.2",
Expand Down
Binary file added src/IMAGENES/DESCK PAGE 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 src/IMAGENES/DESCK PAGE 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 src/IMAGENES/LOGO RIO1.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/IMAGENES/LOGO2.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/IMAGENES/MOBILE PAGE 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 src/IMAGENES/MOBILE PAGE1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/IMAGENES/flecha-derecha.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/IMAGENES/mascotas.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/IMAGENES/sabiasque.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/IMAGENES/wallpaperflare 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
112 changes: 106 additions & 6 deletions src/data.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,109 @@
// estas funciones son de ejemplo
const objetAthletes = {
filterData: function (data, tipofiltro, valor) {
// console.log(valor);

export const example = () => {
return 'example';
};
let filtrado = [];

if (data.athletes) {
data.athletes.forEach((atleta) => {
if (atleta[tipofiltro] == valor) {
filtrado.push(atleta);
}
});
} else {
data.forEach((atleta) => {
if (atleta[tipofiltro] == valor) {
filtrado.push(atleta);
}
});
}

return filtrado;
},
orderData: function (data) {
const compare = (a, b) => {
if (a.name > b.name) {
return 1;
}
if (a.name < b.name) {
return -1;
}
};

return data.sort(compare);
},

calcularData: function (data) {
let elementos = [];

let jsonNew = {
name: "",
team: "",
sport: "",
Gold: "",
Silver: "",
Bronze: "",
};

let gold = 0;
let silver = 0;
let bronze = 0;

export const anotherExample = () => {
return 'OMG';
for (let i = 0; i < data.length; i++) {
if (data[i].medal == "Gold") {
gold++;
} else if (data[i].medal == "Silver") {
silver++;
} else {
bronze++;
}
if (i + 1 !== data.length) {
console.log(data[i + 1].name, data[i]);
if (data[i + 1].name !== data[i].name) {
jsonNew = {
name: data[i].name,
sport: data[i].sport,
team: data[i].team,
Gold: gold,
Silver: silver,
Bronze: bronze,
};

elementos.push(jsonNew);

gold = 0;
silver = 0;
bronze = 0;
}
} else {
jsonNew = {
name: data[i].name,
sport: data[i].sport,
team: data[i].team,
Gold: gold,
Silver: silver,
Bronze: bronze,
};
elementos.push(jsonNew);
}
}
elementos.sort((a, b) => b.Gold - a.Gold);
elementos.sort((a, b) => b.Silver - a.Silver);
elementos.sort((a, b) => b.Bronze - a.Bronze);

console.log(elementos);
return elementos;
},

maxWinner: function (data) {
let resultado = this.calcularData(data);
return resultado[0].name;
},

porcentaje: function (total, variable) {
let porcentaje = Math.round((variable / total) * 100);
return porcentaje;
},
};

export { objetAthletes };
2 changes: 1 addition & 1 deletion src/data/athletes/athletes.js
Original file line number Diff line number Diff line change
Expand Up @@ -17861,7 +17861,7 @@ export default {
"medal": "Gold"
},
{
"name": "Yulimar del Valle Rojas Rodrguez",
"name": "Yulimar del Valle Rojas Rodriguez",
"gender": "F",
"height": "192",
"weight": "72",
Expand Down
86 changes: 76 additions & 10 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,78 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Data Lovers</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<div id="root"></div>
<script src="main.js" type="module"></script>
</body>
</html>

<head>
<meta charset="utf-8">
<title>INFO OLIMPIADAS</title>
<link rel="stylesheet" href="style.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/css2?family=Secular+One&display=swap" rel="stylesheet">
</head>

<body>
<section id="page1" class="page1">
<header>
<article id="imagenlogo"><img class="logoImagen" src="IMAGENES/LOGO RIO1.png" alt="logo olimpiadas 2016"></article>
<h1>INFO OLIMPIADAS</h1>
<button id="btn1" class="btn1">ABOUT ATHLETES</button>
</header>
</section>

<section id="page2" class="page2">
<header class="selectBusqueda" id="selectBusqueda">
<nav class="selectOptions">
<article class="busqueda" id="filterByMedal">
<input type="text" id="selectSearchByMedal" value="" placeholder="Search by medal">
</article>
<article class="busqueda" id="busquedaPorPais">
<select id="selectSearchByTeam">
<option value=""> -Search by team - </option>
</select>
</article>
<article class="busqueda" id="busquedaPorDeporte">
<select id="selectSearchBySport">
<option value=""> -Search by sport - </option>
</select>
</article>
</nav>
<aside class="buttonsAndMascotas">
<section class="imagenmascotas">
<img class="mascotaimg" src="IMAGENES/mascotas.png" alt="">
</section>
<section class="buttons">
<button id="btnBuscar" class="btnBuscar">Search</button>
<button class="btnLimpiar" type="" id="btnLimpiar">Refresh</button>
</section>
</aside>
</header>
</section>


<main class="container">
<article id="contenedorTarjetas" class="contenedorTarjetas">
<article class="titulo"><article class="encabezado" id="encabezado" ></article></article>
<aside class="buttonsOrderMaxwinner">
<select class="orderButton" id="selectOrder">
<option value="order"> -Order- </option>
<option value="a-z">a-z</option>
<option value="z-a">z-a</option>
</select>
<button id="maxWinner" class="maxWinner">Max Winners</button>
<section id="curiousSection" class="curiousSection">
<p class="datocurioso" id="datocurioso"></p >
<img id="notacuriosaImg" class="notacuriosaImg" src="IMAGENES/sabiasque.png" alt="">
</section>
</aside>
<div id="cardsContainer" class="cardsContainer"></div>
</article>

<footer id="enlaceUp" class="enlaceUp"> <a href="#selectBusqueda"> <img src="IMAGENES/flecha-derecha.png" alt=""> </a>
<p>GO BACK UP</p>
</footer>
</main>


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

</html>
Loading