-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
56 lines (51 loc) · 1.37 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="sha512.js"></script>
<script src="http://code.jquery.com/jquery-3.2.0.min.js"></script>
<script type="text/javascript" >
function onPass(event) {
event = event || window.event;
if (event.keyCode != 13) {
return;
}
var pass = $("#pass").val();
var url = window.location.href + hex_sha512(pass) + "/index.html";
$("#status").text("...");
$.ajax({
type: 'HEAD',
url: url,
success: function() {
var iframe = $("#iframe");
iframe.css("display", "inherit");
iframe.attr("src", url);
$("#prompt").css("display", "none");
},
error: function() {
$("#status").text("ERROR!");
}
});
}
</script>
<style>
body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; }
#content { position:absolute; left: 0; right: 0; bottom: 0; top: 0px; }
#iframe { display: none; }
#prompt { margin-left: 1%; }
</style>
</head>
<body>
<div id="content">
<div id="prompt">
<p>
Enter password:
<input type="password" onkeyup="onPass(event)" id="pass">
<span id="status"></span>
</p>
<p><a href="https://github.com/gareins/githublock">Github repository</a></p>
</div>
<iframe id="iframe" width="100%" height="100%" frameborder="0" />
</div>
</body>
</html>