-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
99 lines (94 loc) · 2.34 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
<doctype html>
<meta charset="UTF-8">
<title>See what Hacker News looked like on the day you joined</title>
<style>
@keyframes flubber {
from {padding:30px;}
to {padding:50px;}
}
#誤 {
background: yellow;
}
body {
background: #F6F6EF;
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif;
font-weight: 300;
line-height: 21px;
display: flex;
align-items: center;
justify-content: center;
}
input {
border-radius: 5px;
font-size: 150%;
padding: 10px 20px;
}
h1, input {
margin: 5px 5px 5px 0px;
}
form {
max-width: 900px;
margin: 0 auto;
padding: 50px;
border: solid 1px white;
border-radius: 3px;
background: white;
box-shadow: 0px 0px 4px rgba(0,0,0,0.2);
animation-name: flubber;
animation-duration: 1s;
animation-timing-function: cubic-bezier(0,4.5,0.5,1);
}
h1 {
padding: 0px 0px 31.4159265358979px 0px;
font-size: 30px;
font-weight: 300;
}
#postamble {
margin-top: 50px;
}
img {
display: none;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://cdn.firebase.com/js/client/2.2.7/firebase.js"></script>
<form>
<img src="bf.gif">
<div id=allelse>
<h1>See what Hacker News looked like on the day you joined</h1>
<input type=text autofocus placeholder="HN username" name=username id=username>
<input type=submit>
<p><span id=誤>
Sorry, your username was not found. Maybe you have never submitted or commented
anything? Note that the username is case sensitive.
</span></p>
<div id=postamble>
<p>Inspired by <a href="http://i.puthtml.com/revgeorge/cakeday">a similar tool for Reddit</a></p>
<pre>
Changelog:
2018-02-28 Updated to use /front?day=... instead of archive.org
2015-07-19 Created</pre>
</div>
</div>
</form>
<script>
$(function () {
var 火 = new Firebase("https://hacker-news.firebaseio.com/");
$("#誤").hide();
$("form").submit(function () {
火.child("v0/user/" + $("#username").val()).on("value", function(結果) {
var 人 = 結果.val();
if (人 && 人.created) {
var 時 = new Date(人.created * 1e3);
var ꜛ = "https://news.ycombinator.com/front?day=" + 時.toISOString().slice(0,10);
$('#allelse').hide();
$('img').show();
location = ꜛ;
} else {
$("#誤").show();
}
});
return false;
});
});
</script>