Skip to content

Instantly share code, notes, and snippets.

@DestinyLuong
Created April 20, 2017 23:39
Show Gist options
  • Save DestinyLuong/d2b1a57afba68b3b26792cf6e3ee628a to your computer and use it in GitHub Desktop.
Save DestinyLuong/d2b1a57afba68b3b26792cf6e3ee628a to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=d2b1a57afba68b3b26792cf6e3ee628a
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<link href="https://fonts.googleapis.com/css?family=Stint+Ultra+Expanded" rel="stylesheet">
</head>
<body>
<p>Guess between: 1-15</p>
<input id= "one"><button id="first">Submit</button>
<div class="sup">You Guessed:</div><div id="word"></div>
<p id="hi"></p>
<div><input id= "two"><button id="sec">dont CLICK ME</button></div>
<p id="next"></p>
<div><input id= "three"><button id="third"> pls dont CLICK ME</button></div>
<p id="last"></p>
<button id="reset">RESET</button>
</body>
</html>
{"enabledLibraries":["jquery"]}
var secret = 1 + Math.floor(Math.random() * 15);
$('#reset').click(function() {
location.reload();
});
$("#first").click( function() {
var guess = $("input").val();
if (secret < guess) {
$("#hi").html("TRY AGAIN POTATO WARRIOR as i am smaller");
} else if (secret > guess) {
$("#hi").html("TRY AGAIN SPONGEY MERMAN i am larger");
} else {
$("#hi").html("FINALLYYYYY");
}
$("#word").html( $("input").val());
});
$("#sec").click( function() {
var death = 7.001;
var guess = $("#two").val();
if (death < guess) {
$("#next").html("DO NOT GUESS FURTHER!");
} else if (death > guess) {
$("#next").html("YOUR EXISTENCE WILL BE QUESTIONED....");
} else {
$("#next").html("SInCe yOu KnOw tHe SeCRet....");
}
});
$("#third").click( function() {
var life = 1000300;
var guess = $("#three").val();
if (life < guess) {
$("#last").html("DO NOT PUSH YOUR LUCK!");
} else if (life > guess) {
$("#last").html("YOUR EXISTENCE WILL NOT EXIST...");
} else {
$("#last").html("SInCe yOu KnOw tHe SeCRet, aT MidNigHt I shaLL RisE");
}
});
#two {
border: white;
}
#three {
border: white;
}
#sec {
background-color: white;
margin-top: 200px;
}
#third {
background-color: white;
margin-top: 20px;
}
body {
text-align: center;
font-family: "Stint Ultra Expanded";
}
#reset {
margin-top: 200px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment