-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobals.js
More file actions
executable file
·504 lines (455 loc) · 11.7 KB
/
Copy pathglobals.js
File metadata and controls
executable file
·504 lines (455 loc) · 11.7 KB
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
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
var themes_desk = {};
// list of installed programs
var installed_programs = {};
WALLPAPER_DIR = "/wallpapers/";
desktop_theme_list = {};
desktop_theme_list["blue-pastel"] = make_theme(
[0, 171, 219], // color of window borders and taskbar
[153, 244, 252], // text color in window borders and taskbar
[255, 255, 255], // background color of window context
[22, 20, 61], // text color in window context
WALLPAPER_DIR + "wallpaper.webp", // wallpaper image file path
);
desktop_theme_list["green-pastel"] = make_theme(
[128, 244, 153], // color of window borders and taskbar
[44, 115, 59], // text color in window borders and taskbar
[255, 255, 255], // background color of window context
[16, 43, 20], // text color in window context
WALLPAPER_DIR + "wallpaper2.webp", // wallpaper image file path
);
desktop_theme_list["cyber-city"] = make_theme(
[16, 18, 86], // color of window borders and taskbar
[244, 161, 255], // text color in window borders and taskbar
[44, 153, 204], // background color of window context
[212, 247, 255], // text color in window context
WALLPAPER_DIR + "wallpaper3.webp", // wallpaper image file path
);
var CHOOSEN_THEME_NAME = "blue-pastel";
// website that comes loaded with web browser, Alot of websites will not load due to CORS.
var DEFAULT_WEBSITE = "https://weather.gov";
/// This a dumb feature that will randomly make warning on the dekstop computer every few minutes
/// You can disable them by setting DISABLE_RANDOM_WARNING true
DISABLE_RANDOM_WARNING = false;
// list of ominous messages that will randomly appear if DISABLE_RANDOM_WARNING false
var OM_MESSAGE = [
"Miku has escaped!",
"Linux WILL one day be installed on your computer",
"This is not a warning",
"Sorry, false alarm!",
"Have you tried Linux?",
"Your computer is gaining consciousness",
"Are you dreaming right now?",
"Could not download more RAM, use SWAP instead",
"This is a message",
"Hi",
"I NEED BLOOD TO FEED",
"THE MACHINE IS HUNGRY",
"Am I real?",
"I use Arch BTW",
"None of these are real",
"Was Sisyphus happy and are you?",
];
// How long until the first warning appears in milliseconds
WARN_ONSET_DELAY = 30000;
// after the delay, an a random time between 0 and WARN_RANDOM for a random warning in milliseconds
WARN_RANDOM = 120000;
// OS name
var OS_NAME = "BeeOS";
// Version Name
var VER_NAME = "v0.2";
// replace with your ascii text logo
var os_logo = `
#
# ## ###:
# :# #: # .#
# ## ### ### #. .# #
# # :# :# # # # .
# # # # # # # # ##
# # ##### ##### # # #
# # # # #. .# #
# # # # :# #: #. #
# ## ###: ###: ## :####.
`;
// this is the ascii logo of your "os" for beefetch(my fake neofetch clone)
var logo = `
*************************
******@@@@@@@@%************
********@%****@@#************
********@%*****%@@************
********@%*****@@@**************
********@@@@@@@@******************
********@%####@@********************
********@%*****#@@******************
********@%*****@@@******************
******@@@@@@@@@@********************
************************************
************************************
******************###****####*******
*****************##*##**##**##******
**************##***##*###*********
************##***##**###********
**********##***##****###******
**********##*##**###*##******
*********###****####*******
*************************
`;
// OS icon, shown at the bottom left corner of your desktop
OS_ART_LOGO = "desktop_icons/os_logo.png";
// user avatar
USER_ICON = "/moon.jpg";
// filenames of memes stored in /memes, stored as an array
var MEMES = ["image0.gif"];
// program start function, program human name, icon path(null if none), appear in desktop (null if not and coords if yes starts at 1,1 [x,y])
// instuctions to create an app is here: https://github.com/beee33/web-computer/blob/main/README.md#adding-your-own-app
// you can comment any of these lines to remove an app
make_application(
"theme_picker",
"make_theme_window()",
"Theme Picker",
"/desktop_icons/dropper.jpg",
[1, 1],
function () {
make_theme_window();
},
);
make_application(
"web_browser",
"make_web_browser()",
"Web Browser",
"desktop_icons/www_icon.png",
[1, 2],
function () {
make_web_browser();
},
);
make_application(
"credits",
"make_credits()",
"Credits",
"/desktop_icons/credits.png",
[1, 3],
function () {
make_credits();
},
);
make_application(
"about",
"make_about()",
"Welcome to " + OS_NAME,
null,
null,
function () {
make_about();
},
);
make_application(
"viewer",
"make_view()",
"Image view",
"/desktop_icons/picture_icon.png",
null,
null,
);
make_application(
"beefetch",
"make_beefetch()",
"System Info",
null,
[2, 1],
function () {
make_beefetch();
},
);
make_application(
"teto",
"make_teto()",
"Kasane Teto",
"/desktop_icons/teto.gif",
[2, 2],
function () {
make_teto();
},
);
make_application(
"warning",
"make_warn()",
"Warning!",
"/desktop_icons/warn.png",
null,
null,
);
make_application(
"click",
"make_hack()",
"Do Not Click",
"/desktop_icons/warn.png",
[2, 3],
function () {
make_hack();
},
);
make_application(
"me",
"make_about_me()",
"About Me",
"/desktop_icons/person.png",
[3, 1],
function () {
make_about_me();
},
);
make_application(
"meme",
"make_meme()",
"Random Meme",
"/desktop_icons/memes.png",
[4, 1],
function () {
make_meme();
},
);
make_application(
"time",
"make_time()",
"Server Uptime Status",
null,
[3, 2],
function () {
make_time();
},
);
make_application(
"git",
"make_git()",
"Where to find my code!",
"/desktop_icons/forgejo.svg",
[3, 3],
function () {
make_git();
},
);
//uncomment this to add guestbook support
//make_application("sign","make_guestbook()","Sign the Digital Guestbook!","/desktop_icons/guestbook.png",[5,6],"app",function() {make_git()});
// these are the functions that appear to make that fake systemd boot
// first line is the string
// second line is true: failed, false: success, null: no status
var array_of_functions_for_boot = [
function () {
spawn_line("welcome to beeOS!", false);
},
function () {
spawn_line("Loading initbeeFS", false);
},
function () {
spawn_line("loading miku", false);
},
function () {
spawn_line("loaded miku", false);
},
function () {
spawn_line("killing program manager program", false);
},
function () {
spawn_line("installing war thunder", false);
},
function () {
spawn_line("commiting war crimes", false);
},
function () {
spawn_line("removing Windows", false);
},
function () {
spawn_line(os_logo, false);
},
function () {
spawn_line("being an Axolotl", false);
},
function () {
spawn_line("beesh shell loaded", false);
},
function () {
spawn_line("kernel tainted", null);
},
function () {
spawn_line("NVbedia kernel module loaded which taints kernel", null);
},
function () {
spawn_line("downloading anime girls", false);
},
function () {
spawn_line("Starting bddm (Bee's Desktop Display Manager) ", false);
},
function () {
spawn_line("Started bddm", false);
},
function () {
spawn_line("Deleting all knowlege of Java", false);
},
function () {
spawn_line("Started rhinovirus", false);
},
function () {
spawn_line("Starting Project Zomboid server", false);
},
function () {
spawn_line("Started Project Zomboid server", false);
},
function () {
spawn_line("Ignored Arch BTW", false);
},
function () {
spawn_line("Discord kittens ignored", false);
},
function () {
spawn_line("Started touch grass", false);
},
function () {
spawn_line("Failed touch grass", true);
},
function () {
spawn_line("Killed children(in JavaScript)", false);
},
function () {
spawn_line("Started Hololive songs", false);
},
function () {
spawn_line("Started Xeon E5-2680 CPU", false);
},
function () {
spawn_line("Downloaded more RAM", false);
},
function () {
spawn_line("Downloaded more CPU", false);
},
function () {
spawn_line("Purchase a new GPU", true);
},
function () {
spawn_line("SwapFS loaded", false);
},
function () {
spawn_line("Starting The Finals", false);
},
function () {
spawn_line("Started The Finals", false);
},
function () {
spawn_line("Starting NetworkManager", false);
},
function () {
spawn_line("Starting Apache (the helicopter)", false);
},
function () {
spawn_line("Starting Bluetooth", false);
},
function () {
spawn_line("Started NetworkManager", false);
},
function () {
spawn_line("Started Apache (the helicopter)", false);
},
function () {
spawn_line("Started Bluetooth", false);
},
function () {
spawn_line("Starting weatherCLI", false);
},
function () {
spawn_line("Starting package manager", false);
},
function () {
spawn_line("Started package manager", false);
},
function () {
spawn_line("Why are you reading this", false);
},
];
// how many error messages will appear when "when user clicks the do not click button"
var REPEAT_WARN = 15;
// testing
var debug = false;
var skip_start = false;
// width of the edges of window
var border_width = 4;
// how tall the taskbar is
var taskbar_height = 40;
// width of the square that each SET_ICON_SIZE is
var SET_ICON_WIDTH = 100;
var SET_ICON_SIZE = 40;
// percent of screen exit button bar will take
var HOME_ICON_MOBILE = 0.2;
// margin of home icon
var HOME_ICON_MARGIN = 20;
// what persent of screen height does images take
var IMG_SCALE_SIZE = 0.7;
// screen load times in milliseconds
// how much time it takes for screen to load after text fully loaded used to simulate DE loading
var SCREEN_LOAD_WAIT = 1000;
var TEXT_LOAD_WAIT = 100;
var VOL_SLIDER_HEIGHT = 20;
var VOL_SLIDER_WIDTH = 200;
// float between 0 and 1
var VOLUME_DEFAULT = 0.75;
let current_theme = desktop_theme_list[CHOOSEN_THEME_NAME];
var box_top_height = 20;
var mouse_enabled_logon = true;
// Function to make programs easier
function make_application(
id,
function_param,
human_name,
icon_path,
in_desktop,
funct,
) {
var app = {
function_param: function_param,
human_name: human_name,
icon_path: icon_path,
in_desktop: in_desktop,
funct: funct,
};
installed_programs[id] = app;
}
function make_theme(
window_border_color,
window_title_text_color,
window_context_background_color,
window_context_text_color,
wallpaper_path,
) {
var theme = {
window_border_color: window_border_color,
window_title_text_color: window_title_text_color,
window_context_background_color: window_context_background_color,
window_context_text_color: window_context_text_color,
wallpaper_path: wallpaper_path,
};
return theme;
}
const data_url_param = new URLSearchParams(window.location.search);
var ref_param = data_url_param.get("skip_start");
if (ref_param == "true") {
skip_start = true;
}
console.log(window.navigator.userAgent);
// checks the user agent to see if it is an mobile device
var is_mobile = false;
if (
window.navigator.userAgent.toString().toLowerCase().search("mobile") == -1
) {
is_mobile = false;
} else {
is_mobile = true;
}
// mobile devices have seprate size icon sizes than desktop
if (is_mobile) {
SET_ICON_SIZE =
((SET_ICON_SIZE / SET_ICON_WIDTH) *
document.getElementById("content").offsetWidth) /
4;
SET_ICON_WIDTH = document.getElementById("content").offsetWidth / 4;
REPEAT_WARN = 1;
}
// UNIX time app started
var START_TIMESTAMP = Math.floor(Date.now() / 1000);