-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
73 lines (66 loc) · 2.5 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
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<meta name="description" content="Adventures and travel photos">
<meta name="keywords" content="HTML, CSS, JavaScript, travelsite, travel, travelblog, blog, travellog, log, photos, photoblog, photolog, sorrel, sorrelsprout, sorrelsprouts">
<meta name="author" content="Sorrel">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="referrer" content="origin">
<title>Peaks</title><!-- dragonfly -->
<link rel="icon" href="https://sorrelsprout.com/resources/heroes/mountain.png" type="image/x-icon" />
<link href="styles.css" rel="stylesheet">
</head>
<body>
<img id="hero" src="https://sorrelsprout.com/resources/heroes/night1.jpg" alt="Hero Background"></img>
<div id="loginbox" class="lightbox" >
<img src="./travellog.png" alt="Travel Log" id="travelLogTitle">
<div class="horizontal">
<div class="vertical">
<div class="box">
<input style="margin: 16px; text-align: center;" id="password" type="password" placeholder="password" /> <br />
<button id="loginbutton" type="button">Enter</button>
<p id="wrongPassword" style="display: none">wrong password</p>
</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 + "/index.html";
$.ajax({
url : url,
dataType : "html",
success : function(data) {
window.location= url;
},
error : function(xhr, ajaxOptions, thrownError) {
parent.location.hash= hash;
$("#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();
setHeroText();
window.addEventListener('resize', function(event) { setHeroText(); });
function setHeroText() {
if (window.innerWidth < 640) { document.getElementById("travelLogTitle").setAttribute("src", "./travellog-mobile.png"); }
else { document.getElementById("travelLogTitle").setAttribute("src", "./travellog.png"); }
}
</script>
</body>
</html>