-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
98 lines (78 loc) · 1.88 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
---
layout: blank
title: Portfolio
---
<style>
.lightbox {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
text-align: center;
margin: auto;
}
div.horizontal {
display: flex;
justify-content: center;
height: 100%;
}
div.vertical {
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
}
</style>
<div id="loginbox" class="lightbox">
<div class="horizontal">
<div class="vertical">
<div class="u-p+ text-center" style="width: 400px; margin: auto; text-align:center;">
<div>
<img class="" src="/img/rg-logo__brand-mark.svg" height="45" alt="Rhys Gregory">
</div>
<div>
<input class="u-p-" style="margin: 16px; text-align: center;" id="password" type="password" placeholder="Password" />
</div>
<div>
<button class="o-btn c-btn" id="loginbutton" type="button">Enter</button>
</div>
<div id="wrongPassword" style="display: none">
<p>wrong password</p>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript" src="https://rawcdn.githack.com/chrisveness/crypto/7067ee62f18c76dd4a9d372a00e647205460b62b/sha1.js"></script>
<script type="text/javascript">
"use strict";
function loadPage(pwd) {
var hash= pwd;
hash= Sha1.hash(pwd);
var url= hash + "/portfolio/";
$.ajax({
url : url,
dataType : "html",
success : function(data) {
window.location= url;
},
error : function(xhr, ajaxOptions, thrownError) {
parent.location.hash= hash;
//$("#wrongPassword").show();
$("#password").attr("placeholder","wrong password");
$("#password").val("");
}
});
}
$("#loginbutton").on("click", function() {
loadPage($("#password").val());
});
$("#password").keypress(function(e) {
if (e.which == 13) {
loadPage($("#password").val());
}
});
$("#password").focus();
</script>