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,19 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title>Menú cine</title>
|
||||
<link rel="stylesheet" href="misEstilos.css">
|
||||
<script src="misScripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>¡Bienvenidos al cine!</h1>
|
||||
<h3>--- Menú ---</h3>
|
||||
<p>Queremos hacer de tu visita, una experiencia más placentera. Para eso, ingresa tu edad y selecciona el género que más te guste, y te recomendamos tu pelicula ideal.</p>
|
||||
<p>Edad: <input type="text" id="edad"></p>
|
||||
<button onclick="recomendar('drama')">Drama</button>
|
||||
<button onclick="recomendar('comedia')">Comedia</button>
|
||||
<button onclick="recomendar('musical')">Musical</button>
|
||||
<button onclick="recomendar('crimen')">Crimen</button>
|
||||
<h3>Nuestra recomendación:</h3>
|
||||
<h2 id="recomendacion"></h2>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,18 @@
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
background-color: antiquewhite;
|
||||
}
|
||||
|
||||
input {
|
||||
height: 20px;
|
||||
width: 80px;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 35px;
|
||||
width: 140px;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
function recomendar(genero){
|
||||
let edad = document.getElementById("edad").value;
|
||||
let recomendacion = document.getElementById("recomendacion");
|
||||
|
||||
switch(genero) {
|
||||
case 'drama':
|
||||
if (edad < 13) {
|
||||
recomendacion.textContent = "Casablanca";
|
||||
} else {
|
||||
if (edad < 16) {
|
||||
recomendacion.textContent = "The Shawshank Redemption";
|
||||
} else {
|
||||
recomendacion.textContent = "Taxi Driver";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'comedia':
|
||||
if (edad < 13) {
|
||||
recomendacion.textContent = "Back to the Future";
|
||||
} else {
|
||||
if (edad < 16) {
|
||||
recomendacion.textContent = "The Truman Show";
|
||||
} else {
|
||||
recomendacion.textContent = "The Wolf of Wall Street";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'musical':
|
||||
if (edad < 13) {
|
||||
recomendacion.textContent = "La La Land";
|
||||
} else {
|
||||
if (edad < 16) {
|
||||
recomendacion.textContent = "Les Miserables";
|
||||
} else {
|
||||
recomendacion.textContent = "The Rocky Horror Picture Show";
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'crimen':
|
||||
if (edad < 13) {
|
||||
recomendacion.textContent = "No hay opciones para esta edad";
|
||||
} else {
|
||||
if (edad < 16) {
|
||||
recomendacion.textContent = "El Secreto de tus Ojos";
|
||||
} else {
|
||||
recomendacion.textContent = "The Godfather";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user