html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<html>
<head>
<script type="text/javascript" src="script.js"></script>
<title>Try to escape!</title>
</head>
<body>
<h1 align="center">Try to escape!</h1>
<div>
<p>You wake up in a dark room. The only thing you can see are two rooms in front of you. What do you do?</p>
</div>
<div id="result"></div>
<div id="result2"></div>
<div id="result3"></div>
<div id="result4"></div>
<div id="result5"></div>
<div id="result6"></div>
<br>
<img src="https://media.tenor.co/images/ee9312e65b300f7fcfee5d05f62d56d7/tenor.gif" id="loseGif1"/>
<img src="http://reactiongifs.me/wp-content/uploads/2013/10/i-wingman-successfully-leonardo-dicaprio.gif" id="winGif"/> <!-- The gifs that are showing when lost/won -->
<iframe src="https://www.youtube.com/embed/7JIdJLkJ0S4?autoplay=1" id="music"></iframe> <!-- The Youtube video -->
<div>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
h1{
font-family: fantasy;
font-size: 60px;
}
div{
font-family: monospace;
text-align: center;
}
button {
border-radius: 15px;
font-family: Courier New;
color: #ffffff;
font-size: 12px;
background: #3498db;
padding: 10px 20px 10px 20px;
}
body {
background-color: powderblue;
}
#winGif{
display: none;
position: absolute;
left: 0; right:0;
margin: auto;
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
alert("Hey there! Thanks for checking this code out. Turn on sounds for a better experience. If there's any errors, please let me know!");
alert("Woooooow people! Thanks for freaking 3.3K thumbs up!")
// Special thanks to Ulisses Cruz for fixing my problems ;)
// Special thanks to Utkarsh for suggesting sounds
// Music is from Lucas King: https://www.youtube.com/watch?v=7JIdJLkJ0S4
// Thanks for the likes and comments!
// Made by Maart (dont copy without my permission!)
/* Highest ranks:
* #2 in trending (all languages)
* #6 in most popular (all languages)
* #3 in most popular (web)
And that wouldn't be possible without YOUR support, so thank you so much!
*/
//TO DO: different options for different doors
function Direction(Choice){
// The choice of the first buttons
if(Choice == "left" || Choice == "right"){
document.getElementById("result").innerHTML = "You chose to go " + Choice + "!<br><br>You open the door and come into a new room. <br>A voice pops up: 'I'm glad you didn't try to escape. This isn't over yet though. Choose the next door.' <br> <br> You hear growls coming from the left door and a man talking behind the right door. What do you do?";
document.getElementById('left1').style.display = 'none';
document.getElementById("right1").style.display = 'none';
document.getElementById("escape1").style.display = 'none';
document.getElementById("result").style.display = 'inline';
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run