forked from ladybug-tools/spider
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path404.html
47 lines (34 loc) · 1.57 KB
/
404.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
<!doctype html>
<html lang=en >
<head>
<meta charset=utf-8 >
<meta name=author content='Theo Armour' >
<title></title>
</head>
<body>
<script>
// Welcome. Anybody who looks at the source code of other people's error pages must be wonderful!
// Written in 'everything-JavaScript' style
document.body.style.cssText = ' font: bold 12pt monospace; height: ' + window.innerHeight + 'px; overflow: hidden;';
const user = 'ladybug-tools';
const repo = '/spider';
const info = document.body.appendChild( document.createElement( 'div' ) );
document.title = '404 for ' + user + repo
info.innerHTML =
'<div style=background-color:white;left:0;margin:auto;max-width:50%;opacity:0.5;right:0;text-align:center; >' +
'<h1 title="This is the 404 error page" >Oops</h1>' +
'<h2>Website: <a href=https://' + user + '.github.io' + repo + ' title="Go to the apps" >' + user + '.github.io' + repo + '</a></h2>' +
'<h2>Source code: <a href=https://github.com/' + user + repo + ' title="Go to the source code" >github.com/' + user + repo + '</a></h2>' +
'</div>';
toggleBackgroundGradient();
function toggleBackgroundGradient() {
// 2016-07-18
var col = function() { return ( 0.5 + 0.5 * Math.random() ).toString( 16 ).slice( 2, 8 ); };
var pt = function() { return ( Math.random() * window.innerWidth ).toFixed( 0 ); }
var image = document.body.style.backgroundImage;
document.body.style.backgroundImage = image ? '' : 'radial-gradient( circle farthest-corner at ' +
pt() + 'px ' + pt() + 'px, #' + col() + ' 0%, #' + col() + ' 50%, #' + col() + ' 100% ) ';
}
</script>
</body>
</html>