-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
acfa26d
commit 6848b81
Showing
2,315 changed files
with
233,760 additions
and
106 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
21 changes: 9 additions & 12 deletions
21
...rioIV/JS/e-commerce2022/client/js/cart.js → ...ript/Clase 1/e-commerce/client/js/cart.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 |
---|---|---|
@@ -1,35 +1,32 @@ | ||
const modalContainer = document.getElementById("modalContainer"); | ||
const modalContent = document.getElementById("modal-overlay"); | ||
const modalContainer = document.getElementById("modal-container"); | ||
const modalOverlay = document.getElementById("modal-overlay"); | ||
|
||
const cartBtn = document.getElementById("cart-btn"); | ||
|
||
const displayCart = () => { | ||
modalContainer.innerHTML = ""; | ||
modalContainer.style.display = "block"; | ||
modalOverlay.style.display = "block"; | ||
//modal Header | ||
//modal header | ||
const modalHeader = document.createElement("div"); | ||
|
||
const modalClose = document.createElement("div"); | ||
modalClose.innerText = "X"; | ||
modalClose.innerText = "❌"; | ||
modalClose.className = "modal-close"; | ||
modalHeader.append(modalClose); | ||
modalHeader.append(modalClose); | ||
|
||
modalClose.addEventListener("click", () => { | ||
modalClose.addEventListener("click", ()=>{ | ||
modalContainer.style.display = "none"; | ||
modalOverlay.style.display = "none"; | ||
}) | ||
}); | ||
|
||
const modalTitle = document.createElement("div"); | ||
modalTitle.innerText = "Cart"; | ||
modalTitle.innerText = "cart"; | ||
modalTitle.className = "modal-title"; | ||
modalHeader.append(modalTitle); | ||
|
||
modalContainer.append(modalHeader); | ||
|
||
//modal Body | ||
cart. | ||
}; | ||
|
||
|
||
cartBtn.addEventListener("click", displayCart) | ||
cartBtn.addEventListener("click", displayCart); |
29 changes: 29 additions & 0 deletions
29
LaboratorioIV/JavaScript/Clase 1/e-commerce/client/js/index.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,29 @@ | ||
const shopContent = document.getElementById("shopContent"); | ||
const cart =[];//Este es nuestro carrito, un array vacio | ||
|
||
productos.forEach((product) =>{ | ||
const content = document.createElement("div"); | ||
content.innerHTML = ` | ||
<img src="${product.img}"> | ||
<h3>${product.productName}</h3> | ||
<p>${product.price} $</p> | ||
`; | ||
shopContent.append(content); | ||
|
||
const buyButton = document.createElement('button'); | ||
buyButton.innerText = "Comprar"; | ||
|
||
content.append(buyButton); | ||
|
||
buyButton.addEventListener("click", () => { | ||
cart.push({ | ||
id: product.id, | ||
productName: product.productName, | ||
price: product.price, | ||
quanty: product.quanty, | ||
img: product.img, | ||
}) | ||
console.log(cart) | ||
}) | ||
|
||
}); |
61 changes: 61 additions & 0 deletions
61
LaboratorioIV/JavaScript/Clase 1/e-commerce/client/js/products.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,61 @@ | ||
const productos = [ | ||
{ | ||
id: 1, | ||
productName: "Brochette de verduras", | ||
price: 2800, | ||
quanty: 1, | ||
img: "/client/media/brochette_de_verduras.png", | ||
}, | ||
{ | ||
id: 2, | ||
productName: "Hamburguesa de soja", | ||
price: 2500, | ||
quanty: 1, | ||
img: "/client/media/hamburguesa_de_soja.png", | ||
}, | ||
{ | ||
id: 3, | ||
productName: "Salteado de verduras", | ||
price: 1500, | ||
quanty: 1, | ||
img: "/client/media/salteado_de_verduras.png", | ||
}, | ||
|
||
|
||
{ | ||
id: 4, | ||
productName: "Proteico de vegetales", | ||
price: 2800, | ||
quanty: 1, | ||
img: "/client/media/Proteico_vegetales.jpg", | ||
}, | ||
{ | ||
id: 5, | ||
productName: "Sushi con degustación de vinos (para compartir)", | ||
price: 3200, | ||
quanty: 1, | ||
img: "/client/media/Sushi_degustación_vinos.jpg", | ||
}, | ||
{ | ||
id: 6, | ||
productName: "Sushi y vino", | ||
price: 2800, | ||
quanty: 1, | ||
img: "/client/media/sushi_vino.jpg", | ||
}, | ||
{ | ||
id: 7, | ||
productName: "Mix vegetales y queso", | ||
price: 2100, | ||
quanty: 1, | ||
img: "/client/media/Mix_vegetales_queso.jpg", | ||
}, | ||
{ | ||
id: 8, | ||
productName: "Ensalada proteica con frutos rojos o piña", | ||
price: 2000, | ||
quanty: 1, | ||
img: "/client/media/Ensalada_proteica_con_frutosRojos_o_piña.jpg", | ||
}, | ||
|
||
]; |
Binary file added
BIN
+346 KB
...pt/Clase 1/e-commerce/client/media/Ensalada_proteica_con_frutosRojos_o_piña.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
BIN
+325 KB
LaboratorioIV/JavaScript/Clase 1/e-commerce/client/media/Mix_vegetales_queso.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
BIN
+336 KB
LaboratorioIV/JavaScript/Clase 1/e-commerce/client/media/Proteico_vegetales.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
BIN
+262 KB
...atorioIV/JavaScript/Clase 1/e-commerce/client/media/Sushi_degustación_vinos.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
BIN
+1.22 MB
LaboratorioIV/JavaScript/Clase 1/e-commerce/client/media/brochette_de_verduras.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
+1.14 MB
LaboratorioIV/JavaScript/Clase 1/e-commerce/client/media/hamburguesa_de_soja.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions
24
LaboratorioIV/JavaScript/Clase 1/e-commerce/client/media/index.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,24 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<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"> | ||
<link rel="stylesheet" href="styles.css"> | ||
<title>E-Commerce</title> | ||
</head> | ||
<body> | ||
<div class="card-products-container"> | ||
<div class="card-products" id="shopContent"></div> | ||
</div> | ||
|
||
<!--cart-btn--> | ||
<div class="cart-btn" id="cart-btn">🛒</div> | ||
<!--modal--> | ||
<div class="modal-overlay" id="modal-overlay"></div> | ||
<div class="modal-container" id="modal-container"></div> | ||
<script src="/client/js/products.js"></script> | ||
<script src="/client/js/index.js"></script> | ||
<script src="/client/js/cart.js"></script> | ||
</body> | ||
</html> |
Binary file added
BIN
+1.26 MB
LaboratorioIV/JavaScript/Clase 1/e-commerce/client/media/salteado_de_verduras.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
Binary file added
BIN
+242 KB
LaboratorioIV/JavaScript/Clase 1/e-commerce/client/media/sushi_vino.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions
32
LaboratorioIV/JavaScript/Clase2/e-commerce/client/js/cart.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,32 @@ | ||
const modalContainer = document.getElementById("modal-container"); | ||
const modalOverlay = document.getElementById("modal-overlay"); | ||
|
||
const cartBtn = document.getElementById("cart-btn"); | ||
|
||
const displayCart = () => { | ||
modalContainer.innerHTML = ""; | ||
modalContainer.style.display = "block"; | ||
modalOverlay.style.display = "block"; | ||
//modal header | ||
const modalHeader = document.createElement("div"); | ||
|
||
const modalClose = document.createElement("div"); | ||
modalClose.innerText = "❌"; | ||
modalClose.className = "modal-close"; | ||
modalHeader.append(modalClose); | ||
|
||
modalClose.addEventListener("click", ()=>{ | ||
modalContainer.style.display = "none"; | ||
modalOverlay.style.display = "none"; | ||
}); | ||
|
||
const modalTitle = document.createElement("div"); | ||
modalTitle.innerText = "cart"; | ||
modalTitle.className = "modal-title"; | ||
modalHeader.append(modalTitle); | ||
|
||
modalContainer.append(modalHeader); | ||
}; | ||
|
||
|
||
cartBtn.addEventListener("click", displayCart); |
Oops, something went wrong.