init commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
body {
|
||||
|
||||
background-color: rgb(57, 36, 57);
|
||||
color: white;
|
||||
font-family: Lato, Helvetica, sans-serif;
|
||||
|
||||
}
|
||||
|
||||
h1, p {
|
||||
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
h1 {
|
||||
|
||||
font-size: 5em;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0" lang="en">
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<script src="js/script.js"></script>
|
||||
<title>JS Birthday</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="personalizedGreetings"></h1>
|
||||
|
||||
<p>It's your special time of the year, where you're another year older! What new adventures await for the next year? Only time will tell...</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
var userName = prompt("What is your name?");
|
||||
var userAge = prompt("What is your age?");
|
||||
|
||||
if(userAge < 50) {
|
||||
|
||||
alert("Welcome, " + userName +"! You're " + userAge + ". You're so young!");
|
||||
|
||||
} else {
|
||||
|
||||
alert("Welcome, " + userName +"! You're " + userAge + ".\n\nWhat was it like when dinosaurs roamed the Earth?");
|
||||
|
||||
}
|
||||
window.onload = function() {
|
||||
|
||||
document.getElementById("personalizedGreetings").innerHTML = "Happy " + userAge + " birthday, " + userName + "!"
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user