-
Notifications
You must be signed in to change notification settings - Fork 9
/
redditisdown.html
202 lines (177 loc) · 5.83 KB
/
redditisdown.html
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
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<head>
<title>reddit is down, as usual</title>
<link href="https://fonts.googleapis.com/css?family=VT323" rel="stylesheet">
<style>
@font-face {
font-family: 'SilkscreenNormal';
src: url('/static/down/slkscr-webfont.eot');
src: url('/static/down/slkscr-webfont.eot?#iefix') format('embedded-opentype'),
url('/static/down/slkscr-webfont.woff') format('woff'),
url('/static/down/slkscr-webfont.ttf') format('truetype'),
url('/static/down/slkscr-webfont.svg#SilkscreenNormal') format('svg');
font-weight: normal;
font-style: normal;
}
html { overflow:hidden; }
body { font: 60px VT323, Arial, sans-serif; letter-spacing:0; margin:0; overflow:hidden; background:#25d; color:#fff; }
html, body, #container {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
/* Thanks, http://www.colorzilla.com/gradient-editor/ */
#container {
background: #083a7f;
background: -moz-linear-gradient(top, #083a7f 0%, #242b3d 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#083a7f), color-stop(100%,#242b3d));
background: -webkit-linear-gradient(top, #083a7f 0%,#242b3d 100%);
background: -o-linear-gradient(top, #083a7f 0%,#242b3d 100%);
background: -ms-linear-gradient(top, #083a7f 0%,#242b3d 100%);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#083a7f', endColorstr='#242b3d', GradientType=0);
background: linear-gradient(top, #083a7f 0%,#242b3d 100%);
}
h1, h2 { margin:0; text-shadow:0 5px 0px rgba(0,0,0,.2); }
h1 { font-size:1em; }
h2 { font-size:.5em; }
a { color:#fff; }
h3 { font-size:.25em; margin:1em 50px; }
h3, h3 a { color:#6b778d; }
h3 img { margin:0 3px; }
#snoo { display:block; height:218px; margin-bottom:10px; background:url(//www.redditstatic.com/down/reddit_pixel.png) center 0 no-repeat; }
#title { position:absolute; top:50%; width:100%; height:322px; margin-top:-180px; text-align:center; z-index:10; }
.cloud { position:absolute; display:block; }
.puff { position:absolute; display:block; width:15px; height:15px; background:white; opacity:.05; filter:alpha(opacity=5); }
#banana { position:absolute; right:0; bottom:0; display:block; width:52px; height:56px; padding:5px; background:url(//www.redditstatic.com/down/reddit_pixel.png) 0 -218px no-repeat; opacity:.25; filter:alpha(opacity=25); z-index:10; }
</style>
<script>
function randomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min
}
function randomChoice(items) {
return items[randomInt(0, items.length-1)]
}
var PIXEL_SIZE = 25
function makeCloud() {
var w = 8,
h = 5,
maxr = Math.sqrt(w*w + h*h),
density = .4
var cloud = document.createElement('div')
cloud.className = 'cloud'
for (var x=-w; x<=w; x++) {
for (var y=-h; y<=h; y++) {
r = Math.sqrt(x*x + y*y)
if (r/maxr < Math.pow(Math.random(), density)) {
var puff = document.createElement('div')
puff.className = 'puff'
puff.style.left = (x + w) * PIXEL_SIZE + 'px'
puff.style.top = (y + h) * PIXEL_SIZE + 'px'
cloud.appendChild(puff)
}
}
}
return cloud
}
clouds = []
function randomPosition(max) {
return Math.round(randomInt(-400, max)/PIXEL_SIZE)*PIXEL_SIZE
}
function addCloud(randomLeft) {
var cloudiness = .3
if (Math.random() < cloudiness) {
newCloud = {
x: randomLeft ? randomPosition(document.documentElement.clientWidth) : -400,
el: makeCloud()
}
newCloud.el.style.top = randomPosition(document.documentElement.clientHeight) + 'px'
newCloud.el.style.left = newCloud.x + 'px'
document.body.appendChild(newCloud.el)
clouds.push(newCloud)
}
}
function animateClouds() {
var speed = 25
addCloud()
var newClouds = []
for (var i=0; i<clouds.length; i++) {
var cloud = clouds[i]
cloud.x += speed
if (cloud.x > document.documentElement.clientWidth) {
document.body.removeChild(cloud.el)
} else {
cloud.el.style.left = cloud.x + 'px'
newClouds.push(cloud)
}
}
clouds = newClouds
}
function changeMessage(msg) {
var msgEl = document.getElementById('message')
msgEl.innerHTML = msg || randomChoice(messages)
}
function startMessages() {
try {
if (window.sessionStorage) {
var times
if (sessionStorage.times) {
times = ++sessionStorage.times
} else {
times = sessionStorage.times = 0
}
var msg = 'you have smashed your keyboard '+times+' time'+(times != 1 ? 's' : '')+'.'
messages.push(msg)
}
} catch (e) {}
setInterval(function() { changeMessage() }, 10*1000)
}
messages = [
'Never gonna give you up, never gonna let you down',
'i is masr haxx0r kneel befor me',
'Hello World!',
'did you see today\'s picture of my penis?',
'go ahead, make my day',
'there may be more information in North Korea than this site right now.',
'did you know we\'re open for business? Nah, we\'re down.',
'i wonder if you\'ll have a party when reddit\'s back?',
'in the meantime, go check out what\'s new at reddit! Oh...',
'it\'s not you, it\'s literally me.',
'I wonder what\'s new on reddi-- oh, sorry. Dammit admins got there first!',
'this episode was brought to you by the letter Ö.',
'don\'t touch that button!',
'well, there goes our new weeks resolutions.',
'BSOWD: blue screen of weekly downtime',
'reply hunter2, try again.',
'SHUT DOWN IMGUR'
]
function start() {
if (arguments.callee.ran) { return; }
arguments.callee.ran = true
startMessages()
setInterval(animateClouds, 2*1000)
for (n=0; n<50; n++) {
addCloud(true)
}
}
if (document.addEventListener) {
document.addEventListener('DOMContentLoaded', start, false)
}
window.onload = start
</script>
</head>
<body>
<div id="container">
<div id="title">
<div id="snoo"></div>
<h1>reddit is down, again</h1>
<h2>because somebody spilled coffee in the servers</h2>
<h3 id="message"></h3>
</div>
<a href="https://youtu.be/lXMskKTw3Bc" id="banana" title="Bananas will soon be a new size entity. Font-size:0.5 bananas."></a>
</div>
</body>
</html>