-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
49 lines (30 loc) · 1.23 KB
/
script.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* Declare variables below to save the different sections (divs) of your story*/
let storyOpening = document.querySelector(".story-opening");
let buttons = document.querySelector(".buttons");
let proceed = document.querySelector(".option-one");
let stay = document.querySelector(".option-two");
let optionOneScreen = document.querySelector(".option-one-screen");
let optionTwoScreen = document.querySelector(".option-two-screen");
let optionOneEnd = document.querySelector(".option-one-end");
let optionTwoEnd = document.querySelector(".option-two-end");
let boss = document.querySelector(".boss");
let fruit = document.querySelector(".fruit");
let body = document.querySelector("body");
// When you're ready to make event handlers, uncomment the code below. Then fill in the blanks with the correct variables!
proceed.onclick=function(){
optionOneScreen.style.display="block";
};
stay.onclick=function(){
optionTwoScreen.style.display="block";
};
boss.onclick=function(){
optionOneEnd.style.display="block";
};
fruit.onmouseover=function(){
optionTwoEnd.style.display="block";
};
function timer(){
setTimeout(() => {body.innerHTML="Times up";}, 30000);
storyOpening.style.display="block";
buttons.style.display="block";
}