-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulch.js
75 lines (55 loc) · 1.76 KB
/
gulch.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
function plob(){
var poo = document.getElementById("plobbutton")
var e = document.getElementById("plobbutton").innerHTML
document.getElementById("plobbutton").innerHTML = "Hola, Plob! Me llamo josh!";
setTimeout(function(){
document.getElementById("plobbutton").innerHTML = e;
}, 2000);
}
function saySomething(){
var text = document.getElementById("TroglodizerTextInput").value;
if(text != "") {
alert("Blud really said \""+text+"\", what a Plob! 🤣😂");
}
}
//creates a listener for when you press a key
window.onkeyup = keyup;
function keyup(e) {
//listens for you to press the ENTER key, at which point your web address will change to the one you have input in the search box
if (e.keyCode == 71) {
alert("Dawg really thought he could press G and get away with it 😭😭😭😭😭😭 Is blud a troll 👹🧌? Or a gremlin 🧝?")
}
}
function getRandomArbitrary(min, max) {
return Math.random() * (max - min) + min;
}
function wopen(url, name, w, h) {
w += 32;
h += 96;
wleft = (screen.width - w) / 2;
wtop = (screen.height - h) / 2;
if (wleft < 0) {
w = screen.width;
wleft = 0;
}
if (wtop < 0) {
h = screen.height;
wtop = 0;
}
if (wleft > 0) {
wleft = Math.floor(Math.random() * wleft); // for example
}
var win = window.open(url, name,
'width=' + w + ',height=' +h+ ',left=' + wleft + ',top=' + wtop + ",popup");
win.focus();
}
let sound = new Audio('./assets/sounds/error.mp3');
function doYouGetToGoToHome() {
var random = getRandomArbitrary(0,100);
if(random < 20){
sound.play();
wopen("./popups/"+Math.round(getRandomArbitrary(1,3))+".html","Gorgon Window",650,380)
}else{
window.location.href = "index.html";
}
}