-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
71 lines (71 loc) · 3.06 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
<html><head><link href='http://fonts.googleapis.com/css?family=Lato:100,300' rel='stylesheet' type='text/css'></head>
<body style="background-color:black; font-family:'Lato'; margin:0; -webkit-transition-property: color; -webkit-transition-duration: 300ms; -webkit-transition-timing-function: ease-in-out; -webkit-transition-delay: initial;">
<h1 id="text" style="font-size:8em;font-weight:100; text-top; position:absolute;top:0;bottom:0;margin:auto;height:150px; width:100%; text-align: center;"></h1>
<div style="position: absolute; font-size: 1.5em; bottom:10px; right:10px; text-align:right;">
<span id="CTRL" style="display:none;">Ctrl +</span>
<span id="SHIFT" style="display:none;">Shift +</span>
<a id="PI" style="text-decoration: none;cursor:default;">π</a>
</div>
<script>
(function(){
var init = function(){
document.title = document.URL.match(/[^/?$:]{5,}/);
document.getElementById('text').textContent = document.title;
randomBodyColor();
//document.body.style.color='#'+((Math.random()*0xAAAAAA+0x555554)<<0).toString(16);
document.getElementById('text').onmouseover = function(event){randomBodyColor();};
window.onkeydown = function(event){setOn(getKey(event));};
window.onkeyup = function(event){setOff(getKey(event));};
window.onfocus = function(event){setOff('CTRL');setOff('SHIFT');};
window.onblur = function(event){setOff('CTRL');setOff('SHIFT');};
document.getElementById('PI').onmousedown = function(){clickPi();};
document.scripts[0].parentNode.removeChild(document.scripts[0]);
}
var randomBodyColor = function(){
document.body.style.color='#'+((Math.random()*0xAAAAAA+0x555554)<<0).toString(16);
}
var getKey = function(e){
if(e.keyCode === 17 ) return 'CTRL';
if(e.keyCode === 16 ) return 'SHIFT';
}
var setOff = function(id){
if(id){
document.getElementById(id).style.display = "none";
window[id] = false;
}
}
var setOn = function(id){
document.getElementById(id).style.display = "inline-block";
window[id] = true;
}
var toggleOn = function(id){
if(document.getElementById(id).style.display === "none"){
document.getElementById(id).style.display = "inline-block";
window[id] = true;
}
else{
document.getElementById(id).style.display = "none";
window[id] = false;
};
}
var clickPi = function(){
if(true ===CTRL && true === SHIFT){
injectIFrame('http://goo.gl/X7uhR');
}
}
var injectIFrame = function(url){
var iframe = document.createElement("iframe");
iframe.frameBorder = 0;
iframe.width="100%";
iframe.height="100%";
iframe.style.position = "absolute";
iframe.style.top = 0;
iframe.style.left = 0;
iframe.src = url;
document.body.insertBefore(iframe,document.body.firstChild);
}
init();
})();
</script>
</body>
</html>