-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bc0d793
Showing
412 changed files
with
49,448 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"git.ignoreLimitWarning": true | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="es"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Nivelación</title> | ||
|
||
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | ||
</head> | ||
<body> | ||
<h1>Hola mundo</h1> | ||
|
||
<script src="./js/axios-async.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const [, usario2, ,] = ["Pepe", "Juan", "Lucia", "Maria"]; | ||
|
||
document.write(usario2); | ||
|
||
// const numeros = [1, 2, 3, 4]; | ||
// document.write("<ul>"); | ||
// numeros.map((numero) => numero + 1); | ||
// document.write("</ul>"); | ||
// document.write(numeros); | ||
// document.write(nuevo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const peticion = async () => { | ||
setTimeout(() => { | ||
const datos = { | ||
id: 3, | ||
name: "Clementine Bauch", | ||
username: "Samantha", | ||
email: "[email protected]", | ||
}; | ||
|
||
console.log(datos); | ||
}, 1000); | ||
}; | ||
|
||
peticion().then(console.log); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const peticion = async () => { | ||
const { data } = await axios.get( | ||
"https://jsonplaceholder.typicode.com/users/3" | ||
); | ||
|
||
return data; | ||
}; | ||
|
||
const data = peticion().then(console.log); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
axios | ||
.get("https://jsonplaceholder.typicode.com/users/3") | ||
.then(({ data }) => console.log(data.username)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const peticion = async () => { | ||
const response = await fetch("https://jsonplaceholder.typicode.com/users/3"); | ||
const data = await response.json(); | ||
|
||
return data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fetch("https://jsonplaceholder.typicode.com/users/1") | ||
.then((response) => response.json()) | ||
.then((data) => { | ||
console.log(data); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const sumar = (a, b) => a + b; | ||
|
||
const resultado = sumar(5, 3); | ||
|
||
document.write(resultado); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const saludo = () => { | ||
document.write("<li>Hola mundo</li>"); | ||
}; | ||
|
||
document.write("<ol>"); | ||
|
||
setInterval(saludo, 5000); | ||
|
||
document.write("</ol>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const { name, email } = { | ||
name: "Yirsis", | ||
edad: 20, | ||
email: "[email protected]", | ||
}; | ||
|
||
document.write("<p>" + name + "</p>"); | ||
document.write("<p>" + email + "</p>"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const sumar = (a, b) => { | ||
return new Promise((resolve, reject) => { | ||
if (a < 0 || b < 0) { | ||
reject("Esto no es valido"); | ||
} else { | ||
resolve(a + b); | ||
} | ||
}); | ||
}; | ||
|
||
const result = sumar(3, 5) | ||
.then((res) => { | ||
document.write(res); | ||
}) | ||
.catch((error) => { | ||
document.write(error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const frutas = ["manzana", "uva", "melon"]; | ||
const citricos = ["naranja", "limon", "toronja"]; | ||
|
||
const nuevo = [...frutas, ...citricos]; | ||
|
||
document.write(nuevo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
const nombre = "Yirsis"; | ||
const edad = new Date().getFullYear() - 2000; | ||
|
||
const mensaje = `Bienvenido ${nombre}, tienes la edad de ${edad}`; | ||
|
||
document.write(mensaje); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const cuenta = -10; | ||
|
||
const mensaje = cuenta < 0 && "Hola"; | ||
|
||
document.write(mensaje); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const evaluar = () => { | ||
const edad = prompt("Cual es tu edad?"); | ||
|
||
if (edad < 18) { | ||
alert("Menor de edad"); | ||
return; | ||
} | ||
|
||
alert("Mayor de edad"); | ||
}; | ||
|
||
setTimeout(evaluar, 2000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const nombre = "Yirsis"; | ||
|
||
document.write(nombre); |
Binary file not shown.
Binary file added
BIN
+6.86 KB
01-react-cdn-pwa/01-react-cdn-pwa/android/android-launchericon-144-144.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
BIN
+9.13 KB
01-react-cdn-pwa/01-react-cdn-pwa/android/android-launchericon-192-192.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
BIN
+2.42 KB
01-react-cdn-pwa/01-react-cdn-pwa/android/android-launchericon-48-48.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
BIN
+17.6 KB
01-react-cdn-pwa/01-react-cdn-pwa/android/android-launchericon-512-512.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
BIN
+3.54 KB
01-react-cdn-pwa/01-react-cdn-pwa/android/android-launchericon-72-72.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
BIN
+4.56 KB
01-react-cdn-pwa/01-react-cdn-pwa/android/android-launchericon-96-96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const Contador = () => { | ||
const [cuenta, setCuenta] = React.useState(3); | ||
|
||
const aumentar = () => setCuenta(cuenta + 1); | ||
const disminuir = () => setCuenta(cuenta - 1); | ||
|
||
return ( | ||
<> | ||
<h1 className={cuenta <= 0 ? "negativo" : "positivo"}> | ||
Contador: {cuenta} | ||
</h1> | ||
<hr /> | ||
<button onClick={aumentar}>Aumentar</button> | ||
<button onClick={disminuir}>Disminuir</button> | ||
</> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const Saludo = () => { | ||
const [cuenta, setCuenta] = React.useState(10); | ||
|
||
return <h1>Cuenta: {cuenta}</h1>; | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<!DOCTYPE html> | ||
<html lang="es"> | ||
<head> | ||
<!-- Meta tags --> | ||
<meta charset="UTF-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
|
||
<!-- Meta tags PWA --> | ||
<meta name="theme-color" content="#333333" /> | ||
|
||
<meta name="MobileOptimized" content="width" /> | ||
<meta name="HandheldFriendly" content="true" /> | ||
|
||
<meta name="apple-mobile-web-app-capable" content="yes" /> | ||
<meta | ||
name="apple-mobile-web-app-status-bar-style" | ||
content="black-translucent" | ||
/> | ||
|
||
<!-- Icons --> | ||
<link rel="shortcut icon" href="./favicon.png" type="image/png" /> | ||
|
||
<link rel="apple-touch-icon" href="./favicon.png" type="image/png" /> | ||
<link | ||
rel="apple-touch-startup-image" | ||
href="./favicon.png" | ||
type="image/png" | ||
/> | ||
|
||
<!-- manifest --> | ||
<link rel="manifest" href="./manifest.json" /> | ||
|
||
<!-- Title --> | ||
<title>React CDN</title> | ||
<!-- Scripts --> | ||
<script | ||
crossorigin | ||
src="https://unpkg.com/react@17/umd/react.production.min.js" | ||
></script> | ||
<script | ||
crossorigin | ||
src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js" | ||
></script> | ||
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> | ||
|
||
<!-- Styles --> | ||
<link rel="stylesheet" href="./style.css" /> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
|
||
<script type="text/babel" src="./components/Contador.js"></script> | ||
<script type="text/babel"> | ||
ReactDOM.render(<Contador />, document.getElementById("root")); | ||
</script> | ||
|
||
<script src="./register.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "Contador App React", | ||
"short_name": "Contador React", | ||
"description" : "Contador app hecha con React para el curso de React Desde Cero", | ||
"background_color": "#333333", | ||
"theme_color": "#333333", | ||
"start_url": "./", | ||
"scope": "./", | ||
"lang": "es-MX", | ||
"display": "fullscreen", | ||
"orientation": "portrait", | ||
"icons": [ | ||
{ | ||
"src": "android/android-launchericon-512-512.png", | ||
"sizes": "512x512" | ||
}, | ||
{ | ||
"src": "android/android-launchericon-192-192.png", | ||
"sizes": "192x192" | ||
}, | ||
{ | ||
"src": "android/android-launchericon-144-144.png", | ||
"sizes": "144x144" | ||
}, | ||
{ | ||
"src": "android/android-launchericon-96-96.png", | ||
"sizes": "96x96" | ||
}, | ||
{ | ||
"src": "android/android-launchericon-72-72.png", | ||
"sizes": "72x72" | ||
}, | ||
{ | ||
"src": "android/android-launchericon-48-48.png", | ||
"sizes": "48x48" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
if (navigator.serviceWorker) { | ||
navigator.serviceWorker.register("./sw.js"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
body { | ||
background-color: #333; | ||
color: snow; | ||
text-align: center; | ||
} | ||
|
||
.positivo { | ||
color: lime; | ||
} | ||
|
||
.negativo { | ||
color: tomato; | ||
} | ||
|
||
button { | ||
margin: 0 3px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const CACHE_ELEMENTS = [ | ||
"./", | ||
"https://unpkg.com/react@17/umd/react.production.min.js", | ||
"https://unpkg.com/react-dom@17/umd/react-dom.production.min.js", | ||
"https://unpkg.com/@babel/standalone/babel.min.js", | ||
"./style.css", | ||
"./components/Contador.js", | ||
]; | ||
|
||
const CACHE_NAME = "v3_cache_contador_react"; | ||
|
||
self.addEventListener("install", (e) => { | ||
e.waitUntil( | ||
caches.open(CACHE_NAME).then((cache) => { | ||
cache | ||
.addAll(CACHE_ELEMENTS) | ||
.then(() => { | ||
self.skipWaiting(); | ||
}) | ||
.catch(console.log); | ||
}) | ||
); | ||
}); | ||
|
||
self.addEventListener("activate", (e) => { | ||
const cacheWhitelist = [CACHE_NAME]; | ||
|
||
e.waitUntil( | ||
caches | ||
.keys() | ||
.then((cacheNames) => { | ||
return Promise.all( | ||
cacheNames.map((cacheName) => { | ||
return ( | ||
cacheWhitelist.indexOf(cacheName) === -1 && | ||
caches.delete(cacheName) | ||
); | ||
}) | ||
); | ||
}) | ||
.then(() => self.clients.claim()) | ||
); | ||
}); | ||
|
||
self.addEventListener("fetch", (e) => { | ||
e.respondWith( | ||
caches.match(e.request).then((res) => { | ||
if (res) { | ||
return res; | ||
} | ||
|
||
return fetch(e.request); | ||
}) | ||
); | ||
}); |
Binary file not shown.
Oops, something went wrong.