let-time-in
v1.0.0
Published
CDN-first utility that makes your interface age over time.
Maintainers
Readme
let-time-in
CDN-first utility that weathers UI elements over time.
CDN usage
<link rel="stylesheet" href="https://unpkg.com/let-time-in@1/let-time-in.css" />
<script src="https://unpkg.com/let-time-in@1/let-time-in.js" defer></script>Markup
<div data-ages-as="paper" data-born="2007-06-29">Aging card</div>data-ages-as:paper | metal | plasticdata-born: parsable date string or timestamp- Runtime computes
--agein range0..1
Runtime behavior
- Auto-initializes in browser builds
- Re-scans DOM when
data-bornchanges or new nodes are added - Leaves empty
data-bornvalues untouched (manual--agecontrol)
Optional JS API
import { init, refresh, calculateAge } from 'let-time-in';
init({ observe: true, lifespanYears: 20 });
refresh();
const age = calculateAge(new Date('2007-06-29'));Local package commands
bun run build
bun run check
bun run fixPublish model
let-time-in is consumed directly from CDN. The npm package is the distribution transport that enables
unpkg/jsDelivr delivery of let-time-in.css and let-time-in.js.
First release checklist
- Set the version in
package.json. - Run
bun run buildand verifylet-time-in.css+let-time-in.js(top-level). - Update
CHANGELOG.mdin repo root. - Commit, tag, and push (
git tag vX.Y.Z && git push --tags). - Confirm CDN URLs load:
https://unpkg.com/let-time-in@1/let-time-in.csshttps://unpkg.com/let-time-in@1/let-time-in.js
