2021-11-17 00:45:48 +00:00
|
|
|
<!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" />
|
2021-11-18 00:02:46 +00:00
|
|
|
<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;
|
2023-02-15 01:09:01 +00:00
|
|
|
letter-spacing: 0.012em;
|
|
|
|
padding: 1rem;
|
2021-11-18 00:02:46 +00:00
|
|
|
}
|
|
|
|
p {
|
|
|
|
color: #282828;
|
|
|
|
max-width: 45ch;
|
|
|
|
}
|
|
|
|
</style>
|
2021-11-17 00:45:48 +00:00
|
|
|
</head>
|
|
|
|
<body>
|
2021-11-18 00:02:46 +00:00
|
|
|
<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>
|
2023-02-15 01:09:01 +00:00
|
|
|
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
|
|
|
|
<a href="https://developer.mozilla.org/en-US/docs/Web/Web_Components">Web Component</a>,
|
|
|
|
using the <a href="https://lit.dev">lit-html library</a>. This is the result.
|
2021-11-18 00:02:46 +00:00
|
|
|
</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>
|
2021-11-17 00:45:48 +00:00
|
|
|
</body>
|
|
|
|
</html>
|