Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -609,4 +609,11 @@ const entries = [
author: "Rupesh Soni",
github: "rsoni124"
},
{
title: "Guess the color",
filename: "GuessTheColor.html",
description: "Try to guess the color",
author: "Eshaan Ahuja",
github: "ahujaesh"
},
];
33 changes: 33 additions & 0 deletions entries/GuessTheColor.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>Guess the color</title>
<style>
html {
background-color: #8DCFEC;
}
</style>
</head>
<body>
<h1>Guess the color</h1>
<p>The color is in HEX, and you need to include the # and it needs to be in all caps. Ex: #FFFFFF. </p>
<form id="form">
<input type="text" id="color"></input>
<button type="submit">Submit</button>
</form>
<p>Stuck? Hit CTRL + SHIFT + I and read the JS</p>
<p>By Eshaan Ahuja</p>
<script>
document.getElementById('form').addEventListener("submit", function (e) {
e.preventDefault();

const color = document.getElementById('color').value.toUpperCase(); // Retrieve input value and convert to uppercase
if (color === "#8DCFEC") {
alert("You did it!");
} else {
alert("Wrong!");
}
});
</script>
</body>
</html>