Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,8 @@
"createdAt": "2023-06-06T21:37:46.504Z",
"version": "6.3.0",
"commit": "a942adeb868f1fe54b86e34cc4fc4ddb0601700d"
},
"dependencies": {
"firebase": "^9.20.0"
}
}
40 changes: 36 additions & 4 deletions src/home.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,42 @@
/* eslint-disable semi */
export default () => {
const viewHome = `
<h2 class="text-center">Bienvenido a LabsConnect</h2>
<figure class="text-center">
<img clas="image" src="https://www.google.com/search?q=laboratoria+bootcamp+imagenes&tbm=isch&ved=2ahUKEwje3PTwspuAAxVIFN4AHeleAwEQ2-cCegQIABAA&oq=Laboratoria+boo&gs_lcp=CgNpbWcQARgAMgQIIxAnMgQIIxAnMgcIABAYEIAEMgcIABAYEIAEOgUIABCABDoICAAQgAQQsQM6CggAEIoFELEDEEM6CwgAEIAEELEDEIMBOgcIABCKBRBDOgcIIxDqAhAnOggIABCxAxCDAToECAAQAzoGCAAQCBAeOgkIABAYEIAEEApQrxBY_G9g2n5oAXAAeACAAeoCiAHBIZIBCDAuMjEuNC4xmAEAoAEBqgELZ3dzLXdpei1pbWewAQrAAQE&sclient=img&ei=_yq4ZJ7hLsio-LYP6b2NCA&bih=467&biw=1155&rlz=1C5CHFA_enMX897MX897#imgrc=TvsX2bcq3KAzqM"></img>
</figure>`;
<header>
<h1>LabsConnect</h1>
<nav>
<ul>
<li>
<a href="#/">LabsConnect</a>
</li>
<li>
<a href="#/iniciodeSesion">Inicio de Sesión</a>
</li>
<li>
<a href="#/crearcuenta">Crear cuenta</a>
</li>
<li>
<a href="#/Muro">Muro</a>
</li>
</ul>
</nav>
</header>
<section>
<h2>Start by creating your account</h2>
<label for="nombre">Full name</label>
<input type="text" id="nombre">
<label for="correo">Email</label>
<input type="email" id="correo">
<label for="contrasena">Password</label>
<input type="password" id="contrasena">
<label for="confirmar">Confirm password</label>
<input type="password" id="confirmar">
<button type="submit">Sign Up</button>
</section>


`;


const divElem = document.createElement('div');
divElem.innerHTML = viewHome;
return divElem;
Expand Down
Binary file added src/imagenes/fondo.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/fondoPeque.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,33 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<title class="Labs">LabsConnect</title>
<style>
</style>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<header>
<!-- <header>
<nav>
<ul>
<li>
<a href="#/">LabsConnect</a>
<a herf="#/">LabsConnect</a>
</li>
<li>
<a href="#/iniciodeSesion">Inicio de Sesión</a>
<a href="#/crearCuenta">Crear cuenta</a>
</li>
<li>
<a href="#/crearcuenta">Crear cuenta</a>
<a href="#/inicioSesion">Inicio de Sesion</a>
</li>
<li>
<a href="#/Muro">Muro</a>
</li>
</ul>
</nav>
</header>
<section id="container"></section>
<footer> Creador por Mahanaim y Vanessa</footer>
<section id='container'></section>
<footer> Creador por Mahanaim</footer> -->
<div id ="root"></div>
<script type="module" src="./main.js"></script>
</body>
</html>
16 changes: 15 additions & 1 deletion src/inicioSesion.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import logo from "./imagenes/elq.png"
import logo from "./imagenes/elq.png";

export default () => {
const viewiniciodeSesion = `

<h2 class="tex-center">Inicio de sesión </h2>
<figure>
<img src="${logo}">
Expand All @@ -9,3 +11,15 @@ export default () => {
divElem.innerHTML = viewiniciodeSesion;
return divElem;
};
//const nombreRed = document.createElement('h1');
//const textoLabsConnect = document.createTextNode('LabsConnect');

//seleccionar elemento padre

//const container = document.querySelector('padre');
// agregamos Nodos
//container.appendChild(nombreRed);
//nombreRed.appendChild(textoLabsConnect);
//const imagen = document.createElement('img');
//imagen.src = logo;
//container.appendChild(imagen);
50 changes: 50 additions & 0 deletions src/init-firebase.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// Import the functions you need from the SDKs you need
import { initializeApp } from "firebase/app";
import { getAuth, createUserWithEmailAndPassword, signInWithEmailAndPassword, reauthenticateWithRedirect, } from "firebase/auth";
import { getFirestore, collection, addDoc, onSnapshot, getDocs, deleteDoc, doc } from "firebase/firestore";

// TODO: Add SDKs for Firebase products that you want to use
// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
// For Firebase JS SDK v7.20.0 and later, measurementId is optional
const firebaseConfig = {
apiKey: "AIzaSyCwiC-udkA0cxSXnG-4HsCOkG0ND8Wh8Gs",
authDomain: "labsconnect-af7fc.firebaseapp.com",
projectId: "labsconnect-af7fc",
storageBucket: "labsconnect-af7fc.appspot.com",
messagingSenderId: "15071454950",
appId: "1:15071454950:web:bfba5781d2daee928b7d27",
measurementId: "G-D78E3JTRSC"
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);

export const registrarUsuario = (email, password) => createUserWithEmailAndPassword(auth, email, password);

export const loginUsuario = (email, password) => signInWithEmailAndPassword(auth, email, password);

//Inicia Firestore
const firestore = getFirestore(app);

export function crearPublicacion(actividad, descripcion) {
const direccionColeccion = collection(firestore, 'post');

const publicacion = {
actividad,
publicacion: descripcion,
};
return addDoc(direccionColeccion, publicacion);
}
const db = getFirestore();

export function juntarPublis() {
const lugarDeColeccion = collection(db, 'post');

return getDocs(lugarDeColeccion);
}
export function eliminarPublicacion(id) {
return deleteDoc(doc(db, 'post', id));
};
27 changes: 27 additions & 0 deletions src/lib/rutas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {login} from '../vistas/login.js';
import {registro} from '../vistas/registro.js';
import {muro, muroComportamiento} from '../vistas/muro.js';

export const changeView = (route) => {
const root = document.getElementById("root");
root.innerHTML = '';
switch (route) {
case '#/':
{
return root.appendChild(login());
}
case '#/muro':
{
root.appendChild(muro());
muroComportamiento();
return;
}
case '#/registro':
{ return root.appendChild(registro()); }
default:
break;
}
console.log(route);
};

//export { changeView };
Loading