-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.xhtml
167 lines (143 loc) · 5 KB
/
index.xhtml
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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta charset="utf-8"/>
<title>UJD — UNIX / Julian date</title>
<link rel="copyright" href="http://creativecommons.org/licenses/by-sa/3.0/" type="text/html;charset=utf-8"/>
<style>
/* <![CDATA[ */
@import url('http://resources.yreality.net/Design/960/reset.css') screen, print;
@import url('html5.css') screen, print;
@import url('http://resources.yreality.net/Design/Typography/Typography.css') screen, print;
@media screen {
html, body {
font: 500 12pt/1.45 Garamond, Georgia, serif;
color: #111111;
background: #F1F1F1;
}
body {
height: 100%;
width: 35em;
margin: auto;
}
#time {
margin-left: -0.75em;
margin-top: -0.20em;
margin-bottom: 2.20em;
font: 300 350%/1.0 "Diavlo", "Helvetica", sans-serif;
-webkit-transition: all 0.15s ease-in-out;
}
#time:hover {
margin-top: 0.05em;
margin-bottom: 1.95em;
}
#time > * {
padding-left: 0.25em;
padding-right: 0.25em;
}
#time > #glyph {
font: 500 100%/1.0 "FertigoPro", Helvetica, sans-serif;
font-style: italic;
}
#time > #ksol { color: #DDD; text-shadow: #CCC 0px 0px 2px; }
#time > #sol { color: #DDD; text-shadow: #CCC 0px 0px 2px; }
#time > #glyph { color: #111; text-shadow: #000 0px 0px 2px; }
#time > #msol { color: #111; text-shadow: #000 0px 0px 2px; }
#time > #usol { color: #DDD; text-shadow: #CCC 0px 0px 2px; }
header h1, h2, h3, h4, h5, h6 {
font: 100 100%/1.0 "MuseoSans", Helvetica, sans-serif;
float: right;
}
section#content > section:before {
margin-left: -0.75em;
padding-right: 0.75em;
font: 500 375%/0.1 "FertigoPro", Helvetica, sans-serif;
font-style: italic;
color: #DDD;
content: 'ſ';
}
section {
padding-bottom: 0.5em;
}
section p {
padding-bottom: 0.5em;
}
#by {
font-size: 10pt;
position: absolute;
top: 0;
right: 0;
padding: 4px;
}
#by a:before {
content: '?';
}
#by a:hover:before {
content: '!';
}
}
/* ]]> */
</style>
<script type="text/javascript" charset="utf-8">
/* <![CDATA[ */
var updateUJD;
window.onload = function () {
var getUJD = function () {
return (((new(Date)()).getTime() / 1000) / 86400).toFixed(9).split('.'); };
var splitSol = function (sol) {
return sol
.split('').reverse().join('')
.match(/\d{1,3}/g).join(' ')
.split('').reverse().join('')
.split(' '); };
var splitSolBits = function (solBits) {
return solBits.match(/\d{1,3}/g); };
var ksol = window.document.getElementById("ksol"),
sol = window.document.getElementById("sol"),
msol = window.document.getElementById("msol"),
usol = window.document.getElementById("usol");
// TODO: DRY these four functions up. Should be a single recursive function.
var update_usol = function (UJD) {
var val = splitSolBits(UJD[1])[1],
cycle = (parseInt(usol.textContent) > val);
usol.textContent = val;
if (cycle) update_msol(UJD);
};
var update_msol = function (UJD) {
var val = splitSolBits(UJD[1])[0],
cycle = (parseInt(msol.textContent) > val);
msol.textContent = val;
if (cycle) update_sol(UJD);
};
var update_sol = function (UJD) {
var val = splitSol(UJD[0])[1],
cycle = (parseInt(sol.textContent) > val);
sol.textContent = val;
if (cycle) update_ksol(UJD);
};
var update_ksol = function (UJD) {
ksol.textContent = splitSol(UJD[0])[0];
};
updateUJD = function (all) { var UJD;
update_usol(UJD = getUJD());
if (all) {
update_msol(UJD);
update_sol(UJD);
update_ksol(UJD);
}
};
window.setInterval(function () {
updateUJD(); }, 85);
window.setInterval(function () {
updateUJD(true); }, 2500);
updateUJD(true);
};
/* ]]> */
</script>
</head>
<body><div id="center-me">
<header id="time">
<span id="ksol">14</span><span id="sol">000</span><span id="glyph">ſ</span><span id="msol">000</span><span id="usol">000</span>
</header>
<aside id="by">by: <a href="http://elliottcable.name">elliottcable</a></aside>
</div></body>
</html>