-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy patheecs.js
163 lines (142 loc) · 4.18 KB
/
eecs.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
var introAudio = new Audio('intro.wav');
var loopAudio = new Audio('loop.wav');
var eecsShit = [
["./bonus_clips/AnantSahai.wav", function () {
$(".bonus-image").attr("src", "./bonus_imgs/sahai.jpg");
}],
["./bonus_clips/EECSforLifeYo.wav", function () {
$(".bonus-image").attr("src", "./bonus_imgs/eecs4lyfe.jpg");
}],
["./bonus_clips/ImBetterThanYou.wav", function () {
$(".bonus-image").attr("src", "./bonus_imgs/betterthanyou.jpg");
}],
["./bonus_clips/PaulHilfinger.wav", function () {
$(".bonus-image").attr("src", "./bonus_imgs/hilfinger.jpg");
}],
["./bonus_clips/SixFigsRespeck.wav", function () {
$(".bonus-image").attr("src", "./bonus_imgs/sixfigsrespek.jpg");
}]
];
var BEAT_TIME = (60 / 143.1) * 1000;
// used to be 143 bpm
var fonts = [
"Georgia, serif",
"Palatino Linotype",
"Times New Roman",
"Impact, Charcoal, sans-serif",
"Century Gothic, sans-serif",
"Arial Black, Gadget, sans-serif",
"Copperplate / Copperplate Gothic Light, sans-serif",
"Lucida Console, Monaco, monospace",
"Courier New, Courier, monospace",
"Comic Sans MS"
];
var titles = [
"__*EECS*__",
"__/__EECS__\\__",
"_*EECS*_",
"*_EECS_*",
"_xX_EECS_Xx_"
];
function getRandomColor() {
hue = Math.floor(Math.random() * 360);
return "hsl(" + hue + ", 100%, 50%)";
}
function getRandomColorDark() {
hue = Math.floor(Math.random() * 360);
return "hsl(" + hue + ", 100%, 25%)";
}
function loop() {
$(".bg").css("background-color", getRandomColor());
$(".eecs-text").css("color", getRandomColor());
$(".dark").css("color", getRandomColorDark());
var WIGGLE = window.screen.availHeight * window.screen.availWidth / 100000; // approximately 20 for full-screen
var w = $(".bg").width();
var h = $(".bg").height();
$(".dark").css("left", w / 2 + Math.random() * WIGGLE - WIGGLE / 2);
$(".dark").css("top", h / 2 + Math.random() * WIGGLE - WIGGLE / 2);
}
function fontChange() {
var font = fonts[Math.floor(Math.random() * fonts.length)];
$(".eecs-text").css("font-family", font);
}
function pulse() {
$(".eecs-text").css("font-size", "40vh");
$(".eecs-text").animate({"font-size": "20vh"}, 60);
}
function iam() {
$(".iam-text").text("I'm in");
setTimeout(function() {
$(".iam-text").text("");
}, BEAT_TIME);
}
function masterrace() {
$(".masterrace-text").text("MasterRace");
setTimeout(function() {
$(".masterrace-text").text("");
}, BEAT_TIME);
}
function fourpointoh() {
$(".fourpointoh-text").css("left", "220%");
$(".fourpointoh-text").animate({"left": "-200%"}, 4000, "linear");
}
function title() {
document.title = titles[Math.floor(Math.random() * titles.length)];
}
function start1() {
pulse();
introAudio.play();
setTimeout(start2, BEAT_TIME * 2);
}
function start2() {
pulse();
setTimeout(start3, BEAT_TIME * 2);
}
function start3() {
pulse();
setTimeout(pulse, BEAT_TIME);
setTimeout(pulse, BEAT_TIME * 2);
setTimeout(pulse, BEAT_TIME * 3);
setTimeout(body, BEAT_TIME * 4);
}
function loopMusic() {
loopAudio.pause();
loopAudio.currentTime = 0;
loopAudio.play();
}
function body() {
setInterval(loop, 50);
setTimeout(function () {
iam();
setTimeout(function () {
iam();
setTimeout(function () {
iam();
setInterval(iam, BEAT_TIME * 4);
}, BEAT_TIME * 8);
}, BEAT_TIME * 8);
}, BEAT_TIME * 15);
setTimeout(function () {
setInterval(masterrace, BEAT_TIME * 4);
}, BEAT_TIME * 45);
setInterval(fontChange, 100);
setInterval(title, 10);
setInterval(pulse, BEAT_TIME);
setTimeout(function () {
setInterval(fourpointoh, BEAT_TIME * 32);
setInterval(loopMusic, BEAT_TIME * 32);
}, BEAT_TIME * 48);
}
introAudio.load();
loopAudio.load();
loopAudio.loop = true;
loopAudio.play();
loopAudio.pause();
setTimeout(start1, 10);
function moreeecs() {
var shitArray = eecsShit[Math.floor(Math.random() * eecsShit.length)];
var sound = new Audio(shitArray[0]);
var f = shitArray[1];
sound.play();
f();
}