-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.html
445 lines (396 loc) · 13.1 KB
/
index.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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="description" content="An experiment with CSS3 transitions in 2012." />
<title>The Cube</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script type="text/javascript">
/* Default configuration */
var _config = {
enableKeys: false,
transformProperty: null,
}
/* Check for transform property */
var dummy = document.createElement('div');
$.each('transform MozTransform WebkitTransform OTransform msTransform'.split(' '), function(i, prop) {
if(typeof dummy.style[prop] !== "undefined") {
_config.transformProperty = prop;
return false;
}
});
$(document).ready(function() {
/* Rotate! */
var rotate = (function() {
var x = y = 0,
cube = $('#cube')[0];
return function(direction) {
switch(direction) {
case 'left':
y -= 90;
break;
case 'right':
y += 90;
break;
case 'up':
x += 90;
break;
case 'down':
x -= 90;
break;
}
cube.style[_config.transformProperty] = 'translateZ(-160px) rotateX(' + x + 'deg) rotateY(' + y + 'deg)';
};
})();
$('a[data-rotate]').click(function() {
$.each($(this).attr('data-rotate').split('-'), function(i, direction) {
rotate(direction);
});
return false;
});
$('.login form').submit(function() {
rotate('down');
setTimeout(function() {
$('.login').addClass('error');
rotate('up');
}, 1500);
return false;
});
$('.join form').submit(function() {
rotate('down');
setTimeout(function() {
$('.about').addClass('success');
rotate('left');
rotate('down');
setTimeout(function() {
rotate('down');
}, 300);
}, 1500);
return false;
});
$('.help form').submit(function() {
rotate('down');
setTimeout(function() {
$('.help').addClass('success');
rotate('up');
}, 1500);
return false;
});
/* Controls */
$('#enable-keys').change(function() {
_config.enableKeys = $(this).is(':checked');
});
/* Arrow navigation */
$(document).on('keydown', function(e) {
if(_config.enableKeys) {
var mapping = {
37: 'left',
38: 'up',
39: 'right',
40: 'down'
}
if(mapping[e.keyCode]) {
rotate(mapping[e.keyCode]);
};
}
});
});
</script>
<style type="text/css">
* {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 0;
}
html, body {
font-family: 'Helvetica Neue', Helvetica, sans-serif;
width: 100%;
height: 100%;
color: #483A3A;
font-size: 18px;
}
body {
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAD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po1XuUC3KING0aWx6z0rZHLC/N3g/+3WfPaoQvifRZEUMFd4z1eHgItUyOFbXlNJY8XiOmk4JtF4gZUz/uTPtoBPZtqY0apmQ3DRl81jmRJr3WgPb9Ca3bThan7Uz4e/5m69tqJRNDizT/DbQGngmDpxpCcjRW5TGVIbkaBtMtqZY8gysybI9R5ry3r1rUfpsmreFkNJq1bPtlsm3rYC9azJ9qxaXQqJkSpJSSJRJE0PbZlECyFdeMveeO41xmKjZc63f3gZom/ikE+0RvEnUUyIpyZZQ3qe2789MhIrE979RNdLtuq7nP3p40MqbSSeqVDFW22hLP9YfpopJrX9g+f/skiqKwIxWJm0Zv/kdt9+0z4pwyh+gETkqDEtvApCJmfKl8zcAGIOdY6VuqpozUxaim8aN96QcHb9tBwSMtGNSa8XPQZRWNjlReNtSuRkQlMZ/SjT7tinanQh7g9QhSibHpGdD9y0466UEygb1DR6bzhqbtGiBUV6tj+xZEwarGv0dg5llJO85G+io9U5Tl7cq0X76abvafv4PMfnUWgiRIfEAAAAASUVORK5CYII=');
}
#stage {
height: 100%;
width: 100%;
-webkit-perspective: 800px;
-moz-perspective: 800px;
perspective: 800px;
-webkit-perspective-origin: 50% 70%;
-moz-perspective-origin: 50% 70%;
perspective-origin: 50% 70%;
}
#cube {
position: relative;
top: 50%;
left: 50%;
margin: -160px 0 0 -160px;
height: 320px;
width: 320px;
text-align: center;
-moz-transform-style: preserve-3d;
-moz-transition: all 300ms ease-in;
-webkit-transform-style: preserve-3d;
-webkit-transition: all 300ms ease-in;
transform-style: preserve-3d;
transition: all 300ms ease-in;
-moz-transform: translateZ(-160px);
-webkit-transform: translateZ(-160px);
transform: translateZ(-160px);
pointer-events: none;
}
.side {
position: absolute;
width: 100%;
height: 100%;
background-color: #F5EEDB;
padding: 20px;
border: 5px solid #EAE1C0;
z-index: 1;
pointer-events: auto;
}
.side.front {
-moz-transform: translateZ(160px);
-webkit-transform: translateZ(160px);
transform: translateZ(160px);
}
.side.top {
-moz-transform: rotateX(90deg) translateZ(160px);
-webkit-transform: rotateX(90deg) translateZ(160px);
transform: rotateX(90deg) translateZ(160px);
}
.side.left {
-moz-transform: rotateY(-90deg) translateZ(160px);
-webkit-transform: rotateY(-90deg) translateZ(160px);
transform: rotateY(-90deg) translateZ(160px);
}
.side.bottom {
-moz-transform: rotateX(-90deg) translateZ(160px);
-webkit-transform: rotateX(-90deg) translateZ(160px);
transform: rotateX(-90deg) translateZ(160px);
}
.side.right {
-moz-transform: rotateY(90deg) translateZ(160px);
-webkit-transform: rotateY(90deg) translateZ(160px);
transform: rotateY(90deg) translateZ(160px);
}
.side.back {
-moz-transform: rotateY(180deg) translateZ(160px);
-webkit-transform: rotateY(180deg) translateZ(160px);
transform: rotateY(180deg) translateZ(160px);
}
.error-message, .success-message {
display: none;
background-color: #de564b;
color: white;
position: relative;
top: -25px;
padding: 5px 10px;
border-radius: 0 0 6px 6px;
font-size: 14px;
}
.error .error-message {
display: inline-block;
}
.error input {
border-left-color: #DE564B;
padding-left: 5px;
}
.success .success-message {
background-color: #8fb98b;
display: inline-block;
}
.side a {
color: #483A3A;
display: inline-block;
font-size: 14px;
padding: 3px 7px;
text-decoration: none;
}
.side a:hover {
background-color: #EAE1C0;
}
.side form {
display: block;
margin-bottom: 10px;
}
p {
margin: 20px 0;
}
.separator:after {
content: '·';
color: #d3c9a5;
font-weight: bold;
}
.emoticon {
color: #d3c9a5;
font-size: 145px;
line-height: 100%;
vertical-align: middle;
margin: -20px 0 40px 0;
-moz-transform: rotate(45deg);
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
#spinner {
height: 100%;
width: 100%;
}
#spinner img {
height: 100px;
width: 100px;
margin: 85px;
-moz-animation: rotation 1s infinite linear;
-webkit-animation: rotation 1s infinite linear;
animation: rotation 1s infinite linear;
}
@-moz-keyframes rotation {
from { transform: rotate(0deg); }
to { transform: rotate(359deg); }
}
@-webkit-keyframes rotation {
from { transform: rotate(0deg); }
to { transform: rotate(359deg); }
}
@keyframes rotation {
from { transform: rotate(0deg); }
to { transform: rotate(359deg); }
}
input {
width: 100%;
padding: 5px 5px 5px 1px;
margin-bottom: 10px;
border: 0 none;
border-left: 4px solid transparent;
background-color: white;
color: #483A3A;
outline: none;
font-size: 18px;
}
input[type=submit] {
color: white;
background-color: #d3c9a5;
border-left-color: transparent;
cursor: pointer;
}
input::-webkit-input-placeholder {
color: #888;
}
input:-moz-placeholder {
color: #888;
}
.octocat img {
display: block;
margin: -20px 0 0 -20px;
height: 310px;
width: 310px;
}
#header {
position: absolute;
top: 20px;
left: 20px;
}
#header span {
color: #777;
font-size: 16px;
}
#controls {
position: absolute;
bottom: 20px;
right: 20px;
text-align: left;
background-color: #eee;
padding: 0 7px;
color: #777;
border-radius: 6px;
}
label {
font-size: 14px;
padding-left: 5px;
cursor: pointer;
}
#controls input[type=checkbox] {
width: auto;
cursor: pointer;
}
</style>
</head>
<body>
<div id="header">
<h1>The Cube</h1>
<span>— an experiment with CSS3 transitions in 2012.</span>
</div>
<div id="stage">
<div id="cube">
<!-- Login -->
<div class="side front login">
<div class="error-message">Invalid credentials</div>
<form action="#" method="post">
<input type="text" name="username" placeholder="Email" />
<input type="password" name="password" placeholder="Password" />
<input type="submit" name="send" value="Login" />
</form>
<a href="#" data-rotate="right">Join</a>
<span class="separator"></span>
<a href="#" data-rotate="left">Help</a>
</div>
<!-- Loader -->
<div class="side top loader">
<div id="spinner">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAMAAABHPGVmAAAAnFBMVEUAAADUxqPSyKXTyKXTyaXGwpLTyqXTyaXTyaXYtpTTyabTyqXYy6PXwKbTyaXUyaXSyKXTyaXTyKXTyaXUyKPTyqXUyKXUyqXTyaXVyKjUyKXTyKbTyqXTyKbSxKXY0aXTyaXTyaXUyKXUyaXSyKXUyaXUyqXSyKXTyaXTyqXTyaXSyKXTyabTyaXUyqXUyKXTyaXn3LXg1a/268CgGvChAAAAMHRSTlMAI0putQSRjdwGUJ4mFPnbTLJruxr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zph+OqBBqEQTbiZcFMv7WIEFSue9wwDMd4R4NgfTidPd+wGxXCwOH3ZPoz9kQIMmprooJjdhzIEIj86Tr6e9OO6BDYtOahbUOHASGyPWjH8doDUCIw7FcZAKNFYkPnBCmCMSBHkKBH4L8jPwE0Smn+NZ57/AAAAABJRU5ErkJggg==" />
</div>
</div>
<!-- Join -->
<div class="side left join">
<form action="#" method="post">
<input type="text" name="username" placeholder="Email" />
<input type="password" name="password" placeholder="Password" />
<input type="password" name="password" placeholder="Repeat password" />
<input type="submit" name="send" value="Join" />
</form>
<a href="#" data-rotate="left">Login</a>
<span class="separator"></span>
<a href="#" data-rotate="left-left">Help</a>
</div>
<!-- Help -->
<div class="side right help">
<div class="success-message">Success!</div>
<form action="#" method="post">
<input type="text" name="username" placeholder="Email" />
<input type="submit" name="send" value="Reset Password" />
</form>
<a href="#" data-rotate="right">Login</a>
<span class="separator"></span>
<a href="#" data-rotate="right-right">Join</a>
</div>
<!-- About -->
<div class="side bottom about">
<div class="success-message">Success!</div>
<div class="emoticon">=)</div>
<p>
<a href="https://pstadler.dev" rel="me">pstadler.dev</a>
</p>
<p>
<a href="https://github.com/pstadler" rel="me">GitHub @pstadler</a>
<a href="https://twitter.com/pstadler" rel="me">Twitter @pstadler</a>
</p>
</div>
<!-- Empty -->
<div class="side back octocat">
<img src="https://octodex.github.com/images/grim-repo.jpg" alt="The Grim Repo" />
</div>
</div>
</div>
<div id="controls">
<form>
<input type="checkbox" name="enable-keys" id="enable-keys" autocomplete="off" />
<label for="enable-keys">Enable arrow navigation</label>
</form>
</div>
<a href="https://github.com/pstadler/the-cube"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
</body>
</html>