-
Notifications
You must be signed in to change notification settings - Fork 0
/
bedroom.html
294 lines (270 loc) · 10.2 KB
/
bedroom.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
<html>
<head>
<link rel="stylesheet" href="/bedroom.css" />
<script src="./jquery-3.6.0.min.js"></script>
<script>
$(document).ready(function () {
sessionStorage.setItem('bedroom', 'done')
var dialogueProgress = 0;
var clicked = false;
var currentPage = 0;
var choiceProgress = 0;
document.getElementById("mainTheme").play();
document.getElementById("mainTheme").loop = true;
$(".diary").click(function () {
if (clicked == true) {
$(".pages").show();
document.getElementById("pageFlick").play();
}
$(".dialogueBox").show();
$(".dialogue").html(
"I think this looks like someone's diary. Maybe it belongs to the girl in the closet."
);
clicked = true;
$(".diary").css("pointer-events", "none");
});
$(".dialogueBox").click(function () {
dialogueProgress++;
if (dialogueProgress == 1) {
$(".dialogue").html(
"Maybe I should call her and ask if it's okay to read it first, I wouldn't want to be rude."
);
}
if (dialogueProgress == 2) {
$('.dialogueBox').css('pointer-events', 'none')
$(".reminder, .good, .bad").show();
$(".reminder").html("Should you ask permission?");
$(".good").html("ask permission first");
$(".bad").html(
"no one is gonna know, there's no point wasting time"
);
}
if (dialogueProgress == 3) {
$(".dialogueBox, .dialogue").toggleClass("girlDialogue");
$(".dialogue").html(
"I found a diary, seems like a good place to look for a key. Can I open it?"
);
}
if (dialogueProgress == 4) {
$(".dialogueBox, .dialogue").toggleClass("girlDialogue");
$(".dialogue").html(
"Whatever you need to do to find that key is okay with me."
);
}
if (dialogueProgress == 5) {
$(".dialogueBox, .dialogue").toggleClass("girlDialogue");
$(".dialogue").html("Oh alright then.");
$(".iphone").slideUp();
}
if (dialogueProgress == 6) {
document.getElementById("pageFlick").play();
$(".dialogueBox, .diary").hide();
$(".page1, .next").show();
}
if (dialogueProgress == 7) {
$(".dialogue").html(
"'Only a matter of time...' Oh no. She didn't... did she?"
);
$(".dialogueBox").css("pointer-events", "none");
document.getElementById("mainTheme").pause();
setTimeout(function () {
$(".calling, .ignoreCall, .recieveCall").show();
$(".dialogueBox").hide();
document.getElementById("ringtone").play();
}, 3000);
}
if (dialogueProgress == 8) {
$(".dialogueBox, .dialogue").toggleClass("girlDialogue").css('pointer-events', 'none');
$(".dialogue").html("Not yet...");
$(".good, .bad").show();
$(".good").html("Actually I wanted to ask you something");
$(".bad").html(
"If you actually gave me some time to look instead of calling i'll find it sooner!"
);
}
if (dialogueProgress == 9) {
document.getElementById('callTheme').play()
$(".dialogueBox, .dialogue").toggleClass("girlDialogue");
$(".dialogue").html(
"It's important.The old lady who lives here, is she your mum?"
);
}
if (dialogueProgress == 10) {
$(".dialogueBox, .dialogue").toggleClass("girlDialogue");
$(".dialogue").html("Sadly, yes. Is there anything else?");
}
if (dialogueProgress == 11) {
$(".dialogueBox, .dialogue").toggleClass("girlDialogue");
$(".dialogue").html(
"How long have you been living here then? I moved in here 3 months ago and I've never seen you before"
);
}
if (dialogueProgress == 12) {
$(".dialogueBox, .dialogue").toggleClass("girlDialogue");
$(".dialogue").html(
"Since I was born... She stopped...letting me go outside..."
);
}
if (dialogueProgress == 13) {
$(".dialogue").html(
"Oh that's so sad. I'm sorry she did that to you, I think if it wasn't for that we could of been friends. "
);
}
if (dialogueProgress == 14) {
$(".dialogueBox, .dialogue").toggleClass("girlDialogue");
$(".dialogue").html(
"We're wasiting time. Please keep looking for the key, I'm sure you can find it. "
);
}
if (dialogueProgress == 15) {
document.getElementById('callTheme').pause()
$(".iphone").slideUp();
$(".background").fadeOut(3000);
setTimeout(function(){
window.location = "hallway.html";
}, 3000)
}
});
function addPoint(value) {
choiceProgress++;
if (value == "good") {
var point = parseInt(sessionStorage.getItem("goodCounter"));
point++;
sessionStorage.setItem("goodCounter", point);
}
if (value == "bad") {
var point = parseInt(sessionStorage.getItem("badCounter"));
point++;
sessionStorage.setItem("badCounter", point);
}
}
function addClue(){
var clues = sessionStorage.getItem('cluesFound')
if(clues == null){
sessionStorage.setItem('cluesFound', '1')
} else {
clues = parseInt(clues)
clues++;
sessionStorage.setItem('cluesFound', clues)
}
}
$(".good").on("click", function () {
addPoint("good");
if (choiceProgress == 2) {
addClue()
$('.good, .bad').hide()
$(".dialogue").html("Can it wait till after you get me out?");
$('.dialogueBox, .dialogue').css('pointer-events', 'auto')
} else {
$(".good, .bad, .dialogueBox, .reminder").hide();
$(".iphone").slideDown();
document.getElementById("ringing").play();
setTimeout(function () {
document.getElementById("ringing").pause();
$(".ringing").hide();
$('.dialogueBox').css('pointer-events', 'auto')
$(".dialogueBox, .dialogue ").show().toggleClass("girlDialogue");
$(".dialogue").html("Hello?").show();
}, 2000);
}
});
$(".bad").click(function () {
addPoint("bad");
if (choiceProgress == 2) {
$(".dialogue").html(
"Well sorry geeze! Don't mind me locked up in here for hours with no way out."
);
dialogueProgress = 14;
$('.dialogueBox').css('pointer-events', 'auto')
} else {
document.getElementById("pageFlick").play();
$(".dialogueBox, .diary, .good, .bad").hide();
$(".page1, .next").show();
}
});
$(".next").click(function () {
document.getElementById("pageFlick").play();
if (currentPage == 0) {
console.log(currentPage);
$(".page1").hide();
$(".page2").show();
currentPage++;
} else if (currentPage == 1) {
$(".page2").hide();
$(".page3").show();
currentPage++;
} else if (currentPage == 2) {
console.log(currentPage, "second");
$(".page3").hide();
$(".page4").show();
$(".next").hide();
currentPage++;
setTimeout(function () {
$(".dialogueBox").show().css('pointer-events', 'auto');
$(".reminder").hide();
$(".dialogue").html("I wonder what kind of brew she means...");
dialogueProgress = 6;
}, 2000);
}
});
$(".recieveCall").click(function () {
document.getElementById("ringtone").pause();
$(".calling, .recieveCall, .ignoreCall").hide();
$(".iphone").show();
$(".dialogueBox, .dialogue")
.toggleClass("girlDialogue")
.css("pointer-events", "auto")
.show();
$(".dialogue").html("Did you find the key?");
});
$(".ignoreCall").click(function () {
document.getElementById("ringtone").pause();
document.getElementById("ringtone").currentTime = 0;
$(".calling").hide();
setTimeout(function () {
document.getElementById("ringtone").play();
$(".calling").show();
}, 2000);
});
});
</script>
</head>
<body>
<audio id="mainTheme">
<source src="/sound/bedroom theme.mp3" />
</audio>
<audio id="ringing">
<source src="/sound/internalRingign.mp3" />
</audio>
<audio id="pageFlick">
<source src="/sound/Book Flipping Sound Effect.mp3" />
</audio>
<audio id="ringtone">
<source src="sound/ringTone.mp3" />
</audio>
<audio id="callTheme">
<source src="/sound/phonecallTheme.mp3" />
</audio>
<div class="background">
<img class="diary" src="/images/diaryUnOpen.png" />
<img class="iphone" src="/images/incomingCall.png" />
<img class="calling" src="images/incomingCall.png" />
<div class="ignoreCall"></div>
<div class="recieveCall"></div>
<img class="page1" src="/images/diary/page1.png" />
<img class="page2" src="/images/diary/page2.png" />
<img class="page3" src="/images/diary/page3.png" />
<img class="page4" src="/images/diary/page4.png" />
<div class="next">
<img class="arrow" src="/images/arrow.png" />
<p class="nextPage">Next page</p>
</div>
<p class="good"></p>
<p class="bad"></p>
<div class="dialogueBox">
<p class="dialogue"></p>
<p class="reminder"></p>
</div>
</div>
</body>
</html>