This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path001.js
361 lines (321 loc) · 12 KB
/
001.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
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
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
window.addEventListener("load", function () {
//i wanted to add music throughout but no time :(
async function runTyping() {
const f = friendLines;
const r = rileyLines;
const d = depressionLines;
const m = momLines;
const o = ocdLines;
const opt1 = document.getElementById("opt1");
const opt2 = document.getElementById("opt2");
const opt3 = document.getElementById("opt3");
const box1 = document.getElementById("box3");
const box2 = document.getElementById("box4");
const box3 = document.getElementById("box5");
const box4 = document.getElementById("box6");
await typewriter("[JUNE 30, 2022]", box1, 100);
await typewriter("[001: THE VOID OF DEPRESSION]", box2, 100);
await typewriter("[MEMORY BEGIN]", box3, 100);
await sleep(3000);
await reverseTypewriter(box3.textContent.length, box3, 100);
await reverseTypewriter(box2.textContent.length, box2, 100);
await reverseTypewriter(box1.textContent.length, box1, 100);
await sleep(1000);
await playSound("assets/audio/sfxs/schoolAlarm.mp3");
await playLine(f, 1, box1, 50, 500);
await playLine(r, 1, box2, 50, 500);
await playLine(f, 2, box3, 50, 1000);
await clearLines(box1, box2, box3, 1000);
await playLine(r, 2, box1, 50, 500);
await playLine(f, 3, box2, 50, 500);
await clearLines(box1, box2, box3, 5000);
//add traffic noises
await playLine(r, 3, box1, 75, 5000);
await playLine(m, 1, box2, 100, 2000);
await clearLines(box1, box2, box3, 1000);
await typewriter(
"<< PLAYER CHOICES: YOU HAVE 20 ENERGY AND 50 HAPPINESS OUT OF A MAX OF 100 EACH. YOU MAY NOT CHOOSE OPTIONS THAT WOULD REDUCE EITHER VALUE TO BELOW 0. HOW WOULD YOU LIKE TO RESPOND?",
box1,
50
);
await typewriter(
"<< OPTION 1: TALK TO YOUR MOM ABOUT EVERYTHING. (-50 ENERGY, -50 HAPPINESS",
box2,
50
);
await typewriter(
"<< OPTION 2: STAY SILENT ON THE TOPIC. (0 ENERGY, 0 ENERGY)",
box3,
500
);
await opt1.classList.add("disabled2");
await new Promise(async (resolve) => {
await opt2.addEventListener("click", async function () {
await hide(opt1);
await hide(opt2);
await clearLines(box1, box2, box3, 1000);
await opt2.removeEventListener("click");
resolve();
});
});
await show(opt1);
await show(opt2);
await playLine(r, 4, box1, 100, 2000);
await playLine(d, 1, box2, 50, 1000);
await playLine(r, 5, box3, 100, 500);
await clearLines(box1, box2, box3, 1000);
await playLine(o, 1, box1, 100, 2000);
await clearLines(box1, box2, box3, 1000);
//alarm, sirens, countdown from 10 secs to emphasize panic
await typewriter(
"<< PLAYER CHOICES: YOU HAVE 20 ENERGY AND 30 HAPPINESS LEFT. HOW WOULD YOU LIKE TO RESPOND?",
box1,
100
);
await typewriter(
"<< OPTION 1: FIGHT THE THOUGHT OFF. (-20 ENERGY, -10 HAPPINESS).",
box2,
100
);
await typewriter(
"<< OPTION 2: STOMACH THE ANXIETY. (-20 ENERGY, -10 HAPPINESS).",
box3,
100
);
await opt1.classList.remove("disabled2");
await new Promise(async (resolve) => {
await opt1.addEventListener("click", async function () {
await hide(opt1);
await hide(opt2);
await clearLines(box1, box2, box3, 1000);
await playLine(r, 6, box1, 100, 1000);
await clearLines(box1, box2, box3, 1000);
opt1.removeEventListener("click");
opt2.removeEventListener("click");
resolve();
});
});
await new Promise(async (resolve) => {
await opt2.addEventListener("click", async function () {
await hide(opt1);
await hide(opt2);
await clearLines(box1, box2, box3, 1000);
await opt1.removeEventListener("click");
await opt2.removeEventListener("click");
resolve();
});
});
await show(opt1);
await show(opt2);
await typewriter("<< YOU ARE HOME.", box1, 100);
await playLine(r, 7, box2, 100, 1000);
await playLine(d, 2, box3, 50, 1000);
await playLine(r, 8, box4, 100, 2000);
await clearLines(box1, box2, box3, 100);
await clearLines(box2, box3, box4, 9000);
await typewriter(
"<< PLAYER CHOICES: YOU ARE OVERWHELMED. YOU HAVE 0 ENERGY AND 20 HAPPINESS.",
box1,
100
);
await typewriter(
"<< OPTION 1: TRY DEEP BREATHING. (??? ENERGY, ??? HAPPINESS).",
box2,
100
);
await typewriter(
"<< OPTION 2: TRY CREATIVE EXPRESSION. (??? ENERGY, ??? HAPPINESS).",
box3,
100
);
await typewriter(
"<< OPTION 1: TRY PHYSICAL EXERCISE. (??? ENERGY, ??? HAPPINESS).",
box4,
100
);
await new Promise(async (resolve) => {
await opt1.addEventListener("click", async function () {
await hide(opt1);
await hide(opt2);
await hide(opt3);
await clearLines(box1, box2, box3, 100);
await clearLines(box1, box2, box4, 900);
await typewriter(
"<< YOU ARE TOO FATIGUED TO SUCESSFULLY TRY THE BREATHING TECHNIQUES (REQUIRES 10 ENERGY).",
box1,
100
);
await playLine(d, 3, box2, 50, 1000);
await clearLines(box1, box2, box3, 1000);
await opt1.removeEventListener("click");
await opt2.removeEventListener("click");
await opt3.removeEventListener("click");
resolve();
});
});
await new Promise(async (resolve) => {
await opt2.addEventListener("click", async function () {
await hide(opt1);
await hide(opt2);
await hide(opt3);
await clearLines(box1, box2, box3, 100);
await clearLines(box1, box2, box4, 900);
await typewriter(
"<< YOU ARE TOO FATIGUED TO ATTEMPT CREATIVE EXPRESSION. (REQUIRES 20 ENERGY).",
box1,
100
);
await playLine(d, 4, box2, 100, 1000);
await playLine(r, 9, box2, 100, 1000);
await clearLines(box1, box2, box3, 1000);
await opt1.removeEventListener("click");
await opt2.removeEventListener("click");
await opt3.removeEventListener("click");
resolve();
});
});
await new Promise(async (resolve) => {
await opt3.addEventListener("click", async function () {
await hide(opt1);
await hide(opt2);
await hide(opt3);
await clearLines(box1, box2, box3, 100);
await clearLines(box1, box2, box4, 900);
await typewriter(
"<< YOU ARE TOO FATIGUED TO ATTEMPT THE PHYSICAL EXERCISE. (REQUIRES 30 ENERGY).",
box1,
100
);
await playLine(d, 5, box2, 100, 1000);
await clearLines(box1, box2, box3, 1000);
await opt1.removeEventListener("click");
await opt2.removeEventListener("click");
await opt3.removeEventListener("click");
resolve();
});
});
await playLine(r, 10, box1, 100, 1000);
await playLine(r, 11, box2, 100, 1000);
await playLine(d, 6, box3, 100, 1000);
await playLine(o, 2, box4, 100, 1000);
await clearLines(box1, box2, box3, 100);
await clearLines(box2, box3, box4, 900);
//add countdown, sirens
await typewriter(
"<< PLAYER CHOICES: YOU HAVE 0 ENERGY AND 20 HAPPINESS.",
box1,
100
);
await typewriter(
"<< OPTION 1: CHECK THE ROOM. (0 ENERGY, -20 HAPPINESS).",
box2,
100
);
await typewriter(
"<< OPTION 2: DON'T CHECK THE ROOM AND CHALLENGE YOUR OCD. (-30 ENERGY, -20 HAPPINESS).",
box3,
100
);
await opt2.classList.add("disabled2");
await new Promise(async (resolve) => {
await opt1.addEventListener("click", async function () {
await hide(opt1);
await hide(opt2);
await clearLines(box1, box2, box3, 1000);
await opt1.removeEventListener("click");
resolve();
});
});
await show(opt1);
await show(opt2);
await typewriter(
"<< YOU GO AND CHECK AND OF COURSE THERE IS... NOTHING",
box1,
100
);
await playLine(d, 7, box2, 100, 1000);
await playLine(r, 12, box3, 100, 1000);
await clearLines(box1, box2, box3, 1000);
await playLine(d, 8, box1, 100, 1000);
await playLine(r, 13, box2, 100, 1000);
await playLine(d, 9, box3, 100, 1000);
await clearLines(box1, box2, box3, 1000);
await playLine(r, 14, box1, 100, 1000);
await playLine(d, 10, box2, 100, 1000);
await playLine(r, 15, box3, 100, 1000);
await clearLines(box1, box2, box3, 1000);
await typewriter(
"<< YOU WRITE A NOTE, SIMPLY READING, 'I'm sorry. Goodbye. Don't miss me. -Riley'",
box1,
100
);
await typewriter(
"<< IT FEELS AS IF DEPRESSION TOOK OVER YOUR BODY. YOU CANNOT MOVE IT; IT'S MOVING ON ITS OWN.",
box2,
1000
);
await typewriter(
"<< YOU STAND BY AND HORRIFIED, WATCH AS DEPRESSION TAKES A KNIFE AND MOVES TO SLIT YOUR WRISTS.",
box3,
1000
);
await clearLines(box1, box2, box3, 1000);
await playLine(r, 16, box1, 100, 1000);
await playLine(d, 11, box2, 100, 1000);
await clearLines(box1, box2, box3);
await typewriter(
"<< PLAYER CHOICES: YOU HAVE LOST CONTROL OF YOUR BODY. YOU HAVE 0 ENERGY AND 0 HAPPINESS.",
box1,
100
);
await typewriter(
"<< OPTION 1: RESIST AGAINST DEPRESSION. (-50 ENERGY, -10 HAPPINESS).",
box2,
100
);
await typewriter(
"<< OPTION 2: STOP RESISTING. (0 ENERGY, 0 HAPPINESS)",
box3,
100
);
await opt2.classList.remove("disabled2");
await opt1.classList.add("disabled2");
await new Promise(async (resolve) => {
await opt2.addEventListener("click", async function () {
await hide(opt1);
await hide(opt2);
await clearLines(box1, box2, box3, 1000);
await opt2.removeEventListener("click");
resolve();
});
});
await show(opt1);
await show(opt2);
await typewriter(
"<< DEPRESSION SLITS YOUR WRISTS. THE LAST THING YOU REMEMBER IS BLEEDING OUT BEFORE BLACKING OUT AND WAKING UP IN THE HOSPITAL.",
box1,
100
);
await clearLines(box1, box2, box3);
await typewriter("[MEMORY END]", box1, 100);
await reverseTypewriter(box1.textContent.length, box1, 100);
await sleep(2000);
await typewriter(
"As someone who has had a history with OCD and depression, I often see people who do not understand the conditions, which is normal, but if they do not understand the suffering that many people with these disorders go through, it is neigh impossible for them to empathize with individuals who need their support. I frequently see many people saying insensitive things about these mental illnesses and I wanted to create something like a simulation of various commonly misunderstood and stereotyped situations, so people can take the first step towards empathy. If we do not have empathy, it is very easy for people to be oppressed and for society to come crumbling down. Empathy is one of the building blocks of community.",
box2,
25
);
await typewriter(
"OCD, or Obsessive-Compulsive Disorder, is a mental illness in which someone is caught in a cycle of of obsessions and compulsions. Obsessions are unwanted and intrusive thoughts that trigger very distressing feelings, while compulsions are things one does to try to alieve those bad feelings. For more information, visit sites like iocdf.org. Depression, on the other hand, is a serious mental illness that affects one's mood quite negatively. There are many different types of depression, and symptoms for both OCD and depression vary drastically among different people. What I protrayed in this project was in no way the only way people experience these mental illnesses. I encourage you to do your own research and learn more about these topics.",
box3,
25
);
await show(document.getElementById("continue2"));
await document
.getElementById("continue2")
.addEventListener("click", function () {
switchPages(index.html);
});
}
runTyping();
});