mirror of
https://github.com/CristianCruz0309/proyectos-curso-javascript.git
synced 2026-08-15 02:50:10 +00:00
Proyectos (DIA 1 - 13)
Realizados gracias al curso "JAVASCRIPT TOTAL"
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Registro Automotor</title>
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<script src="script.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>Registro Automotor</h1>
|
||||
<button onclick="mostrarAutomoviles()">Mostrar Automóviles</button>
|
||||
<ul id="listaAutomoviles" class="lista"></ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,37 @@
|
||||
function Automovil(marca, modelo, color, anio, titular) {
|
||||
this.marca = marca;
|
||||
this.modelo = modelo;
|
||||
this.color = color;
|
||||
this.anio = anio;
|
||||
this.titular = titular;
|
||||
}
|
||||
|
||||
let automovil1 = new Automovil('Ford', 'Focus', 'Rojo', 2020, 'Matías Perez');
|
||||
let automovil2 = new Automovil('Chevrolet', 'Camaro', 'Amarillo', 2022, 'Silvina Marquez');
|
||||
let automovil3 = new Automovil('Toyota', 'Corolla', 'Blanco', 2025, 'Carlos García');
|
||||
let automoviles = [automovil1, automovil2, automovil3];
|
||||
|
||||
Automovil.prototype.venderAutomovil = function(nuevoTitular) {
|
||||
this.titular = nuevoTitular;
|
||||
}
|
||||
|
||||
Automovil.prototype.encender = function() {
|
||||
alert(`El ${this.marca} ${this.modelo} fue encendido`);
|
||||
}
|
||||
|
||||
Automovil.prototype.verAutomovil = function() {
|
||||
return `${this.marca} ${this.modelo} (${this.anio}) - Titular: ${this.titular}`;
|
||||
}
|
||||
|
||||
function mostrarAutomoviles() {
|
||||
let lista = document.getElementById("listaAutomoviles");
|
||||
|
||||
// Limpiar lista antes de volver a mostrar
|
||||
lista.innerHTML = "";
|
||||
|
||||
for (let automovil of automoviles) {
|
||||
let item = document.createElement('li');
|
||||
item.innerText = automovil.verAutomovil();
|
||||
lista.appendChild(item);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||
background: linear-gradient(135deg, #e8f0ff, #ffffff);
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.container {
|
||||
background: #ffffff;
|
||||
padding: 30px 40px;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 2.2em;
|
||||
margin-bottom: 20px;
|
||||
color: #2c3e50;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
button {
|
||||
background: linear-gradient(135deg, #4CAF50, #2ecc71);
|
||||
border: none;
|
||||
color: white;
|
||||
padding: 14px 28px;
|
||||
font-size: 16px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
.lista {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.lista li {
|
||||
background: #f8f9fb;
|
||||
margin-bottom: 12px;
|
||||
padding: 15px 20px;
|
||||
border-radius: 8px;
|
||||
font-size: 15px;
|
||||
color: #34495e;
|
||||
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
|
||||
animation: fadeIn 0.4s ease forwards;
|
||||
}
|
||||
|
||||
@keyframes fadeIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(10px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user