Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
168 lines (143 sloc) 5 KB
<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>
Jump to Line
Something went wrong with that request. Please try again.