57 lines
2.5 KiB
HTML
57 lines
2.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Domino Clock</title>
|
|
<meta http-equiv="X-UI-Compatible" content="ie-edge" />
|
|
<meta property="og:type" content="website" />
|
|
<meta name="theme-color" content="#000000" />
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
<link href="https://fonts.googleapis.com/css2?family=Mulish&display=swap" rel="stylesheet" />
|
|
<style>
|
|
body {
|
|
font-family: "Mulish", sans-serif;
|
|
font-size: 16px;
|
|
line-height: 1.36;
|
|
letter-spacing: 0.012em;
|
|
}
|
|
p {
|
|
color: #282828;
|
|
max-width: 45ch;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>The Domino Clock</h1>
|
|
<p>
|
|
Sometime around 1996, when I was working for CompuServe, I saw a lovely demonstration of an
|
|
electromechanical watch that used a sort of domino face to tell the time. I liked it so much that
|
|
when I was looking for a toy project for my first Java Applet, I decided to implement the
|
|
algorithm of the watch.
|
|
</p>
|
|
<p>
|
|
25 years later, I found the source code buried somewhere in an old CD. I decided to try an
|
|
re-implement the logic in Javascript, and to experiment with a hand-written
|
|
<a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components">Web Component</a>. This is
|
|
the result.
|
|
</p>
|
|
<p>
|
|
It might seem a bit silly to have implemented the seconds face when the minutes face has a
|
|
resolution of only five minutes, but it allows you to watch the clock in operation and learn what
|
|
each symbol means: an empty face is 0 (12) and all four pips visible is 11 (or 55
|
|
minutes/seconds).
|
|
</p>
|
|
<domino-clock></domino-clock>
|
|
<p>
|
|
The source code, both for this project and for the Java original,
|
|
<a href="https://git.elfsternberg.com/elf/dominoclock"
|
|
>are available at my personal Git repository</a
|
|
>
|
|
at <a href="https://elfsternberg.com">ElfSternberg.com</a>.
|
|
</p>
|
|
<script type="module" src="./src/index.ts"></script>
|
|
</body>
|
|
</html>
|