Compare commits
5 Commits
solucion-e
...
f5347e77e2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5347e77e2 | ||
|
|
e0dc767d48 | ||
|
|
f212ceaee5 | ||
|
|
7775d18ff8 | ||
|
|
80f5ca683e |
@@ -1 +1,18 @@
|
|||||||
// Agregar aquí el código javascript
|
// Agregar aquí el código javascript
|
||||||
|
|
||||||
|
// Crear una página con un campo de texto y un botón. Al hacer clic en el botón,
|
||||||
|
// leer el valor del campo y mostrar en la página el mensaje `"Hola, [nombre]!"`.
|
||||||
|
// Si el campo está vacío, mostrar en su lugar `"Por favor, ingresá tu nombre."`.
|
||||||
|
|
||||||
|
let saludo = document.querySelector("#saludo");
|
||||||
|
let boton = document.querySelector("#enviar");
|
||||||
|
let form = document.querySelector("form");
|
||||||
|
let nombre = document.querySelector("#input-nombre");
|
||||||
|
|
||||||
|
form.addEventListener("submit", (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
if (nombre.value.trim() === ""){
|
||||||
|
saludo.textContent = "Por favor, ingresá tu nombre.";
|
||||||
|
} else {saludo.textContent = `Hola ${nombre.value}!`}
|
||||||
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,13 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Ejercicio 1</h1>
|
<h1>Ejercicio 1</h1>
|
||||||
|
<p>Ingrese su nombre</p>
|
||||||
|
<form action="">
|
||||||
|
<label for="input-nombre"></label>
|
||||||
|
<input type="text" name="input-nombre" id="input-nombre">
|
||||||
|
<button type="submit" id="enviar-form">ver</button>
|
||||||
|
</form>
|
||||||
|
<p id="saludo"></p>
|
||||||
|
|
||||||
<script src="ejercicio1.js"></script>
|
<script src="ejercicio1.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -1 +1,21 @@
|
|||||||
// Agregar aquí el código javascript
|
// Agregar aquí el código javascript
|
||||||
|
|
||||||
|
// Crear una página con un campo de texto y un botón "Agregar". Cada vez que se
|
||||||
|
// haga clic en el botón, agregar el texto del campo como un nuevo ítem en una
|
||||||
|
// lista `<ul>`. Después de agregar el ítem, limpiar el campo.
|
||||||
|
|
||||||
|
// Si el campo está vacío al hacer clic, no agregar nada.
|
||||||
|
|
||||||
|
let input = document.querySelector("input") //almacenamos en variables el boton, el input y la lista
|
||||||
|
let boton = document.querySelector("button");
|
||||||
|
let lista = document.querySelector("ul")
|
||||||
|
|
||||||
|
boton.addEventListener("click", ()=>{ // creamos el listener "click" con la funcion
|
||||||
|
if (!(input.value.trim() === "")){ // si el input NO ESTÁ vacio, continuamos :
|
||||||
|
nuevoLi = document.createElement("li"); //creamos el li ,
|
||||||
|
nuevoLi.textContent = input.value.trim(); // le damos contenido ,
|
||||||
|
lista.appendChild(nuevoLi); // lo anexamos a la lista ,
|
||||||
|
input.value = ""; // y vaciamos el input :)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// fin
|
||||||
@@ -8,7 +8,13 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Ejercicio 2</h1>
|
<h1>Ejercicio 2</h1>
|
||||||
|
<p>escriba un texto para agregar a la lista</p>
|
||||||
|
<br>
|
||||||
|
<input type="text" name="input" id="input">
|
||||||
|
<button id="boton-agregar">Agregar</button>
|
||||||
|
<br>
|
||||||
|
<ul>
|
||||||
|
</ul>
|
||||||
<script src="ejercicio2.js"></script>
|
<script src="ejercicio2.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1 +1,15 @@
|
|||||||
// Agregar aquí el código javascript
|
// Agregar aquí el código javascript
|
||||||
|
|
||||||
|
// Crear una lista con al menos seis ítems de cualquier contenido. Al hacer clic
|
||||||
|
// en un ítem, agregarle la clase `"seleccionado"`. Al hacer clic de nuevo sobre
|
||||||
|
// el mismo ítem, quitarle la clase.
|
||||||
|
|
||||||
|
// Usar delegación de eventos, incluyendo un solo listener en la lista, no uno por
|
||||||
|
// ítem.
|
||||||
|
|
||||||
|
let lista = document.querySelector("ul");
|
||||||
|
|
||||||
|
lista.addEventListener("click", (e)=>{
|
||||||
|
e.target.classList.toggle("defensor-elegido"); //usamos el toggle para agregar/sacar la clase defensor-elegido
|
||||||
|
console.log(e.target.classList)
|
||||||
|
})
|
||||||
@@ -8,7 +8,15 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Ejercicio 3</h1>
|
<h1>Ejercicio 3</h1>
|
||||||
|
<p>Defensores convocados</p>
|
||||||
|
<ul>
|
||||||
|
<li class="defensor">Romero</li>
|
||||||
|
<li class="defensor">Senesi</li>
|
||||||
|
<li class="defensor">Tagliafico</li>
|
||||||
|
<li class="defensor">Molina</li>
|
||||||
|
<li class="defensor">Barco</li>
|
||||||
|
<li class="defensor">Martinez</li>
|
||||||
|
</ul>
|
||||||
<script src="ejercicio3.js"></script>
|
<script src="ejercicio3.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1 +1,34 @@
|
|||||||
// Agregar aquí el código javascript
|
// Agregar aquí el código javascript
|
||||||
|
|
||||||
|
// Crear una página con tres elementos: un botón "Sumar", un botón "Restar" y un
|
||||||
|
// párrafo que muestre el valor actual del contador, empezando en `0`.
|
||||||
|
|
||||||
|
// Requisitos:
|
||||||
|
// - El contador no puede bajar de `0` ni subir de `10`.
|
||||||
|
// - Cuando el contador llega a `10`, el botón "Sumar" se deshabilita.
|
||||||
|
// - Cuando el contador llega a `0`, el botón "Restar" se deshabilita.
|
||||||
|
// - Al volver a un valor intermedio, los botones se vuelven a habilitar.
|
||||||
|
|
||||||
|
let botonSumar = document.querySelector("#botonSumar");
|
||||||
|
let botonRestar = document.querySelector("#botonRestar");
|
||||||
|
let numero = document.querySelector("#numero");
|
||||||
|
|
||||||
|
botonSumar.addEventListener("click", (e)=>{
|
||||||
|
if(numero.textContent < 9){ // siempre que numero < 9 queremos que se ejecute el codigo (supongamos numero = 8)
|
||||||
|
++numero.textContent; // numero = 9
|
||||||
|
botonRestar.disabled = false; //habilitamos el restar en caso de que no esté habilitado
|
||||||
|
} else if (numero.textContent == 9) { // solamente en caso de numero = 9 se ejecuta este else if
|
||||||
|
++numero.textContent; // numero = 10
|
||||||
|
botonSumar.disabled = true; // ya no queremos seguir sumando, ergo, desactivamos el boton sumar
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
botonRestar.addEventListener("click", (e)=>{
|
||||||
|
if(numero.textContent > 1){ // supongamos que en esta instancia numero = 2
|
||||||
|
--numero.textContent; // // ahora numero = 1
|
||||||
|
botonSumar.disabled = false // (esta linea la ejecutamos por las dudas para asegurarnos de que se vuelva a habilitar al boton sumar en caso de estar desabilitado, pero solo seria necesaria si numero = 10)
|
||||||
|
} else if (numero.textContent == 1) {
|
||||||
|
--numero.textContent; // ahora numero = 0
|
||||||
|
botonRestar.disabled = true; // por lo tanto desabilitamos el boton
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
@@ -8,7 +8,9 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>Ejercicio 4</h1>
|
<h1>Ejercicio 4</h1>
|
||||||
|
<button id="botonRestar" disabled="true">Restar (-)</button> <!-- desabilitamos el botonRestar de entrada, ya que empezamos en 0 -->
|
||||||
|
<button id="botonSumar">Sumar (+)</button>
|
||||||
|
<p>contador: <span id="numero">0</span></p>
|
||||||
<script src="ejercicio4.js"></script>
|
<script src="ejercicio4.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1 +1,50 @@
|
|||||||
// Agregar aquí el código javascript
|
// Agregar aquí el código javascript
|
||||||
|
|
||||||
|
// Dado un array de países (al menos diez), construir dinámicamente una lista en
|
||||||
|
// la página con todos ellos. Es decir: la lista de países no debe estar en el
|
||||||
|
// archivo html, sino como array en javascript, y a partir de este array se debe
|
||||||
|
// generar la lista.
|
||||||
|
|
||||||
|
// Agregar un campo de texto arriba de la lista para búsqueda. A
|
||||||
|
// medida que el usuario escribe, mostrar solo los países cuyo nombre contenga el
|
||||||
|
// texto ingresado (sin distinguir mayúsculas de minúsculas). Si el campo está
|
||||||
|
// vacío, mostrar todos.
|
||||||
|
|
||||||
|
// En ningún momento debemos modificar el array original, sino ir reconstruyendo
|
||||||
|
// la lista en el DOM con cada cambio del campo de búsqueda.
|
||||||
|
|
||||||
|
|
||||||
|
// CREACION DE LA LISTA
|
||||||
|
|
||||||
|
//creamos las siguientes variables
|
||||||
|
let arrayPaises = ["Venezuela", "Jamaica", "Dinamarca", "Mongolia", "Singapur", "Vietnam", "Letonia", "Escocia", "Congo", "Argelia"] ; // array con los paises
|
||||||
|
let arrayPaisesMinusculas = arrayPaises.map(pais=>pais.toLowerCase()) //pasamos la lista a minusculas para evitar incompatibilidades
|
||||||
|
let ulPaises = document.createElement("ul"); // cramos la UL (hasta ahora sin items)
|
||||||
|
let input = document.createElement("input"); //creamos el input
|
||||||
|
let body = document.querySelector("body"); // asignamos a esta variable la etiqueta "body"
|
||||||
|
|
||||||
|
body.appendChild(input); // incorporamos el input al body
|
||||||
|
body.appendChild(ulPaises); // lo mismo con la UL vacia
|
||||||
|
|
||||||
|
//IMPORTANTE: este for se ececutara una sola vez al cargar la pagina para crear la lista
|
||||||
|
for (let pais of arrayPaises){ // recorremos los 10 paises originales con un "for"
|
||||||
|
let liPais = document.createElement("li") //creamos el li
|
||||||
|
liPais.textContent = pais // lo llenamos con el pais iterado de la lista
|
||||||
|
ulPaises.appendChild(liPais) // y lo anexamos a la UL
|
||||||
|
}
|
||||||
|
|
||||||
|
input.addEventListener("keyup", () => { //creamos el listener que va a activase con cada "keyup" dentro del input
|
||||||
|
|
||||||
|
ulPaises.innerHTML = ""; // lo primero que hace el listener es borrar la lista para que no se repitan los elementos que queremos agregar
|
||||||
|
|
||||||
|
let busqueda = input.value.trim().toLocaleLowerCase() //texto ingresado en el input sin espacios y convertido a minusculas
|
||||||
|
let arrayPaisesMin = arrayPaises.map(p => p.toLocaleLowerCase()) // convertimos la lista de paises en minusculas
|
||||||
|
let arrayPaisesBusqueda = arrayPaisesMin.filter(pais => pais.includes(busqueda)); // almacenamos en variable los strings del array que coincidan con la busqueda
|
||||||
|
|
||||||
|
for (let p of arrayPaisesBusqueda){ // iteramos las lista que contiene solamente los paises que coinciden con el input
|
||||||
|
let liPais = document.createElement("li"); //creamos el li
|
||||||
|
liPais.textContent = p.charAt(0).toUpperCase() + p.slice(1) ; // lo rellenamos con el pais iterado de la lista ya capitalizado
|
||||||
|
// (aclaracion: la siguiente linea de codigo "charAt(0).toUpperCase() + p.slice(1)" es una forma de capitalizar la palabra, equivalente al metodo capitalize() que se encuentra en python)
|
||||||
|
ulPaises.appendChild(liPais) // lo anexamos
|
||||||
|
}
|
||||||
|
})
|
||||||
@@ -1,72 +1 @@
|
|||||||
const productos = [
|
// Agregar aquí el código javascript
|
||||||
{ nombre: "Teclado", precio: 8500 },
|
|
||||||
{ nombre: "Mouse", precio: 4200 },
|
|
||||||
{ nombre: "Monitor", precio: 62000 },
|
|
||||||
{ nombre: "Auriculares", precio: 11000 },
|
|
||||||
{ nombre: "Webcam", precio: 15500 }
|
|
||||||
];
|
|
||||||
|
|
||||||
// El carrito es un array de objetos { nombre, precio, cantidad }, que
|
|
||||||
// inicializamos vacío fuera de las funciones (para que sea global):
|
|
||||||
const carrito = [];
|
|
||||||
|
|
||||||
const listaProductos = document.querySelector("#productos");
|
|
||||||
|
|
||||||
function actualizarCarrito() {
|
|
||||||
const totalParrafo = document.querySelector("#total");
|
|
||||||
const listaCarrito = document.querySelector("#carrito");
|
|
||||||
listaCarrito.innerHTML = "";
|
|
||||||
|
|
||||||
// Calculamos el total mientras construimos la lista.
|
|
||||||
let total = 0;
|
|
||||||
|
|
||||||
for (const item of carrito) {
|
|
||||||
const subtotal = item.precio * item.cantidad;
|
|
||||||
total += subtotal;
|
|
||||||
|
|
||||||
const li = document.createElement("li");
|
|
||||||
li.textContent = `${item.nombre} x${item.cantidad} — $${subtotal.toLocaleString()}`;
|
|
||||||
listaCarrito.appendChild(li);
|
|
||||||
}
|
|
||||||
|
|
||||||
totalParrafo.textContent = `Total: $${total.toLocaleString()}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function agregarAlCarrito(producto) {
|
|
||||||
// Buscamos si el producto ya está en el carrito.
|
|
||||||
const itemExistente = carrito.find(item => item.nombre === producto.nombre);
|
|
||||||
|
|
||||||
if (itemExistente) {
|
|
||||||
// Si ya existe, solo incrementamos la cantidad.
|
|
||||||
itemExistente.cantidad++;
|
|
||||||
} else {
|
|
||||||
// Si no existe, lo agregamos manualmente con cantidad 1,
|
|
||||||
// copiando las propiedades una por una.
|
|
||||||
carrito.push({
|
|
||||||
nombre: producto.nombre,
|
|
||||||
precio: producto.precio,
|
|
||||||
cantidad: 1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
actualizarCarrito();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Construimos la lista de productos con un botón por cada uno.
|
|
||||||
for (const producto of productos) {
|
|
||||||
const listaProductos = document.querySelector("#productos");
|
|
||||||
const card = document.createElement("div");
|
|
||||||
card.className = "product-card";
|
|
||||||
card.innerHTML = `
|
|
||||||
<div>
|
|
||||||
<p class="product-name">${producto.nombre}</p>
|
|
||||||
<p class="product-price">$${producto.precio.toLocaleString()}</p>
|
|
||||||
</div>
|
|
||||||
<button class="btn-add">+ Agregar</button>
|
|
||||||
`;
|
|
||||||
card.querySelector(".btn-add").addEventListener("click", () => agregarAlCarrito(producto));
|
|
||||||
listaProductos.appendChild(card);
|
|
||||||
}
|
|
||||||
|
|
||||||
actualizarCarrito();
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,215 +1,2 @@
|
|||||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
/* Agregar el código CSS necesario para el ejercicio */
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: system-ui, sans-serif;
|
|
||||||
background: #f5f4f0;
|
|
||||||
color: #1a1a1a;
|
|
||||||
min-height: 100vh;
|
|
||||||
padding: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
h1 {
|
|
||||||
font-size: 1.1rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #555;
|
|
||||||
margin-bottom: 1.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.layout {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
gap: 1.5rem;
|
|
||||||
max-width: 820px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.section-label {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #888;
|
|
||||||
text-transform: uppercase;
|
|
||||||
letter-spacing: 0.06em;
|
|
||||||
margin-bottom: 0.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ── Productos ── */
|
|
||||||
|
|
||||||
.product-list {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-card {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 10px 14px;
|
|
||||||
background: #fff;
|
|
||||||
border: 0.5px solid #ddd;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-name {
|
|
||||||
font-size: 0.875rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #1a1a1a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.product-price {
|
|
||||||
font-size: 0.75rem;
|
|
||||||
color: #888;
|
|
||||||
margin-top: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-add {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
padding: 6px 12px;
|
|
||||||
font-size: 0.75rem;
|
|
||||||
font-weight: 500;
|
|
||||||
background: transparent;
|
|
||||||
border: 0.5px solid #ccc;
|
|
||||||
border-radius: 6px;
|
|
||||||
color: #1a1a1a;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background 0.15s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn-add:hover { background: #f0efeb; }
|
|
||||||
|
|
||||||
/* ── Carrito ── */
|
|
||||||
|
|
||||||
.cart-panel {
|
|
||||||
background: #edecea;
|
|
||||||
border: 0.5px solid #ddd;
|
|
||||||
border-radius: 12px;
|
|
||||||
padding: 1rem 1.25rem;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.badge {
|
|
||||||
display: inline-flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
min-width: 18px;
|
|
||||||
height: 18px;
|
|
||||||
padding: 0 5px;
|
|
||||||
background: #fde8e8;
|
|
||||||
color: #a32d2d;
|
|
||||||
border-radius: 9px;
|
|
||||||
font-size: 0.625rem;
|
|
||||||
font-weight: 500;
|
|
||||||
margin-left: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-empty {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
color: #aaa;
|
|
||||||
text-align: center;
|
|
||||||
padding: 1.5rem 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-items {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-item {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
padding: 8px 10px;
|
|
||||||
background: #fff;
|
|
||||||
border: 0.5px solid #ddd;
|
|
||||||
border-radius: 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-item-name {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #1a1a1a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-item-sub {
|
|
||||||
font-size: 0.7rem;
|
|
||||||
color: #888;
|
|
||||||
margin-top: 2px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-item-right {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-item-total {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #1a1a1a;
|
|
||||||
min-width: 64px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qty-controls {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
gap: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qty-btn {
|
|
||||||
width: 22px;
|
|
||||||
height: 22px;
|
|
||||||
border: 0.5px solid #ccc;
|
|
||||||
border-radius: 4px;
|
|
||||||
background: transparent;
|
|
||||||
color: #1a1a1a;
|
|
||||||
cursor: pointer;
|
|
||||||
font-size: 0.875rem;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.qty-btn:hover { background: #f0efeb; }
|
|
||||||
|
|
||||||
.qty-val {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
font-weight: 500;
|
|
||||||
min-width: 16px;
|
|
||||||
text-align: center;
|
|
||||||
color: #1a1a1a;
|
|
||||||
}
|
|
||||||
|
|
||||||
.divider {
|
|
||||||
border: none;
|
|
||||||
border-top: 0.5px solid #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-total {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-total-label {
|
|
||||||
font-size: 0.8rem;
|
|
||||||
color: #888;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cart-total-amount {
|
|
||||||
font-size: 1.25rem;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #1a1a1a;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,38 +1,13 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="es">
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width">
|
||||||
<title>Ejercicio 8 — Carrito de compras</title>
|
<title>Ejercicio 8</title>
|
||||||
<style></style>
|
|
||||||
<link rel="stylesheet" href="estilo.css">
|
<link rel="stylesheet" href="estilo.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<h1>Ejercicio 8</h1>
|
||||||
<h1>Ejercicio 8 — Carrito de compras</h1>
|
|
||||||
|
|
||||||
<div class="layout">
|
|
||||||
<div>
|
|
||||||
<p class="section-label">Productos</p>
|
|
||||||
<div class="product-list" id="productos"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cart-panel">
|
|
||||||
<div class="cart-header">
|
|
||||||
<p class="section-label" style="margin:0">
|
|
||||||
Carrito
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class="cart-items" id="carrito">
|
|
||||||
<p class="cart-empty" id="empty-msg">El carrito está vacío.</p>
|
|
||||||
</div>
|
|
||||||
<hr class="divider">
|
|
||||||
<div class="cart-total">
|
|
||||||
<span class="cart-total-label">Total</span>
|
|
||||||
<span class="cart-total-amount" id="total">$0</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script src="ejercicio8.js"></script>
|
<script src="ejercicio8.js"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user