-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathscript.js
61 lines (43 loc) · 1.53 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
50
51
52
53
54
55
56
57
58
59
60
61
var answer1 = "<h1 class='f6 f2-m f-subheadline-l fw8 tc b'>No.</h1>";
var answer2 = "<h1 class='f6 f2-m f-subheadline-l fw8 tc b'>Don't text him.</h1>";
var img = "<img src='math-lady.gif'/>";
var button = "<a class='f4 link ph4 pv3 mb2 dib white bg-black tracked' href='#0' onclick='compute(answer2, button)'>Are you sure?</a>";
function shouldITextHim(click){
if (click==true)
var unsure = true;
if (unsure == true)
var fuccboi = true;
if (fuccboi == true)
var answer = false;
return answer;
}
function display(html) {
document.getElementById("main").innerHTML = html;
}
function getRandom(min, max) {
return Math.random() * (max - min) + min;
}
function thinkAboutIt(answer) {
milliseconds = getRandom(1000, 8000);
setTimeout(function () {
display(answer)
}, milliseconds);
}
function compute(answer, button) {
var click = true;
if (! shouldITextHim(click)) {
display(img);
thinkAboutIt(answer + button);
}
}
document.addEventListener("DOMContentLoaded", function (event) {
var aboutBtnOpen = document.getElementById("js-about-open");
var aboutBtnClose = document.getElementById("js-about-close")
var aboutPage = document.getElementById("js-about-page");
aboutBtnOpen.addEventListener('click', function () {
aboutPage.classList.add("open");
}, false);
aboutBtnClose.addEventListener('click', function () {
aboutPage.classList.remove("open");
}, false);
});