|
2 years ago | |
---|---|---|
src | 2 years ago | |
.eslintrc.json | 2 years ago | |
.gitignore | 2 years ago | |
.pre-commit-config.yaml | 2 years ago | |
.prettierrc | 2 years ago | |
LICENSE.md | 2 years ago | |
README.md | 2 years ago | |
index.html | 2 years ago | |
package-lock.json | 2 years ago | |
package.json | 2 years ago | |
tsconfig.json | 2 years ago | |
vite.config.js | 2 years ago |
README.md
The Pendor Clock
This is code that's been around since 1996 or so, and is one of the three first Javascript programs I ever wrote. It's just the "time of day" counter for the fictional world that's the setting of my long-running space opera series. It has its own calendar, and unlike Star Trek, I had in mind what the "star dates" would mean early on.
Motivation
This is a slightly modernized version, just to see what it would be
like to write this in 2021. The answer is that not much has changed;
the code runs just fine, although getYear()
has been deprecated,
replaced by .geUTCFullYear()
. The syntax of 2021 Javascript is a lot
nicer than 1996, although there is a limit to how much density one can
achieve when it's a lot of fiddly calculations around converting
human-readable dates into Pendorian-readable ones.
What this project really involves is preserving the basic elements of prettier, eslint, vitejs, and typescript that I routinely use these days as the basis of my Javascript work. Most of the configuration files are short, as you'd expect from a vanilla javascript project with a single source file and no framework, but they do include things like sourcemap inclusion, minification, and using rollup to generate proper EcmaScript-6.
Running it
Really? Okay:
$ npm install
$ npm run dev
The demo will be on port 3000 by default.
License
This code is released under the Mozilla 2.0 Public License. A copy of the License File is included in this folder.