Skip to content

Instantly share code, notes, and snippets.

@etale
Last active December 21, 2015 00:28
Show Gist options
  • Save etale/6220209 to your computer and use it in GitHub Desktop.
Save etale/6220209 to your computer and use it in GitHub Desktop.
simple demo for Planck clock
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<script>
var d = 99.6290 - Math.log(1e3), c, p = Date.parse, n = Date.now
onload = function() {
var t = location.hash.slice(1).split(',').filter(p).map(p)
t.push(n())
t.unshift(-13.772e9 * 365.25 * 24 * 3600 * 1e3)
/*
Nine-Year Wilkinson Microwave Anisotropy Probe (WMAP) Observations: Final Maps and Results
http://arxiv.org/abs/1212.5225
*/
c = t.map(function(a) {
var e = document.createElement('h1')
e.start = a
document.body.appendChild(e)
return e
})
setInterval(function() {
var t = n()
c.forEach(function(a) {
a.textContent = (Math.log(t - a.start) + d).toString()
})
}, 1)
}
onhashchange = function() {
c.forEach(function(a) {
document.body.removeChild(a)
})
onload()
}
</script>
</head>
<body></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment