.ebeat
This commit is contained in:
parent
baa70d2e8e
commit
7964f987bb
2 changed files with 40 additions and 0 deletions
|
@ -74,6 +74,11 @@
|
||||||
<li><a href="/notes/buggy-trackpoint.html">Workaround for broken TrackPoint</a></li>
|
<li><a href="/notes/buggy-trackpoint.html">Workaround for broken TrackPoint</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<h2>Stuff</h2>
|
||||||
|
<ul>
|
||||||
|
<li><a href="/stuff/ebeat.html">.ebeat</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h2>Recipes</h2>
|
<h2>Recipes</h2>
|
||||||
<ul lang="sv">
|
<ul lang="sv">
|
||||||
<li><a href="/recipes/enchiladas-med-bönchili.html">Enchiladas med bönchili</a></li>
|
<li><a href="/recipes/enchiladas-med-bönchili.html">Enchiladas med bönchili</a></li>
|
||||||
|
|
35
public/stuff/ebeat.html
Normal file
35
public/stuff/ebeat.html
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>.ebeat</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#beats {
|
||||||
|
font-size: 20pt;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<code id="beats"></code>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<a href="https://en.wikipedia.org/wiki/Swatch_Internet_Time">.beats</a>
|
||||||
|
since <a href="https://en.wikipedia.org/wiki/Unix_time">Unix epoch</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
let numFmt = new Intl.NumberFormat("en", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
||||||
|
let beatsEl = document.getElementById("beats");
|
||||||
|
|
||||||
|
function setContents() {
|
||||||
|
let beats = beatsSinceEpoch(new Date())
|
||||||
|
beatsEl.textContent = numFmt.format(beats);
|
||||||
|
}
|
||||||
|
|
||||||
|
function beatsSinceEpoch(date) {
|
||||||
|
return date.getTime() / 1000 / 86.4;
|
||||||
|
}
|
||||||
|
|
||||||
|
setContents();
|
||||||
|
const intervalID = setInterval(setContents, 864);
|
||||||
|
</script>
|
Loading…
Add table
Reference in a new issue