-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
153 lines (139 loc) · 4.18 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
<!DOCTYPE html>
<html>
<head>
<title>Random kitteh of the now</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css">
body {
background-image: url('bg.png');
color: gray;
}
h1 {
text-align: center;
color: white;
text-shadow: white 0px 0px 25px;
}
.warning {
text-align: center;
color:red;
text-shadow: red 0px 0px 25px;
}
#footer {
color: black;
font-size:0.75em;
text-align: center;
position: fixed;
bottom: 5px;
text-shadow: white 0px 0px 5px;
}
#infobox {
background: black;
border: 5px black;
border-radius: 15px;
-moz-border-radius: 15px;
padding: 15px;
width: 300px;
font-style: italic;
margin-left: auto;
margin-right: auto;
}
a {
color: white;
}
b {
color: white;
}
#image {
background: black;
display:block;
margin-left: auto;
margin-right: auto;
border: 15px black solid;
border-radius: 15px;
-moz-border-radius: 15px;
-moz-box-shadow: 0px 0px 25px black; /* Firefox */
-webkit-box-shadow: 0px 0px 25px black; /* Safari/Chrome */
box-shadow: 0px 0px 25px black; /* Opera and other CSS3 supporting browsers */
}
#ngingxlogo {
border:0px;
position:fixed;
bottom:15px;
right:15px;
}
</style>
<script type="text/javascript">
function setImage() {
var imageName = window.location.hash.substring(1);
imageName = imageName.replace('<', '').replace('/', '').replace(':', '');//prevent xss?
document.getElementById('image').src = "http://lolcats.iskrembilen.com/imgs/" + imageName;
}
function getNew() {
var hasImage;
if (document.getElementById("image").src == "http://lolcats.iskrembilen.com/") {
hasImage = false;
} else {
hasImage = true;
}
var request = window.XMLHttpRequest ? new XMLHttpRequest() : new new ActiveXObject("MSXML2.XMLHTTP.3.0");
request.open("get", "http://lolcats.iskrembilen.com/ajax.php", true);
request.onreadystatechange = function(){
if (request.readyState == 4 && request.status == 200) {
if (request.responseText){
document.getElementById("newLink").href = "http://lolcats.iskrembilen.com/#" + request.responseText;
}
}
}
request.send(null);
}
function load() {
if (window.location.hash == "") {
var request = window.XMLHttpRequest ? new XMLHttpRequest() : new new ActiveXObject("MSXML2.XMLHTTP.3.0");
request.open("get", "http://lolcats.iskrembilen.com/ajax.php", true);
request.onreadystatechange = function() {
if (request.readyState == 4 && request.status == 200) {
if (request.responseText) {
document.getElementById("image").src = "http://lolcats.iskrembilen.com/imgs/" + request.responseText;
window.location.hash = "#" + request.responseText;
}
}
}
request.send(null);
getNew();
} else {
setImage();
getNew();
}
document.getElementById("page").style.display = 'block';
}
function clicked() {
document.getElementById("image").src = "http://lolcats.iskrembilen.com/wait.gif";
window.location = document.getElementById("newLink").href;
setImage();
getNew();
}
function keyPress(e) {
if (e.which == 110) {
clicked();
}
}
document.onkeypress = keyPress;
</script>
</head>
<body onload="javascript:load()" onhashchange="javscript:setImage()">
<noscript>
<h1><span class='warning'>PLZ 2 ENABLE JAVASCRIPT</span></h1>
<p class='warning'><a href='old.php'>... or click here for the old stupid version.</a></p>
</noscript>
<div id='page' style="display:none">
<h1>Random lolcat</h1>
<a href='#' id='newLink' onclick="javascript:clicked();">
<img src='wait.gif' alt='lolcat' id='image' />
</a>
<p id="infobox">Click the image or press '<b>n</b>' for a new, random one.</p>
</div>
<p id="footer"> page © 2011 <a href="http://mts.ms/">sandsmark</a>//<a href="http://validator.w3.org/check?uri=http%3A%2F%2Flolcats.iskrembilen.com%2F">valid html5</a>
</p>
<a href="http://wiki.nginx.org/"><img src="nginx-inside.png" id='ngingxlogo' alt='powered by ngingx' /></a>
</body>
</html>