From 356ffa2250c66c442cfa8c4e638ca53926396a65 Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Sun, 15 Jan 2023 12:25:08 +1100 Subject: Add visual indication of pan/zoom failure Add tick display data to Tick objects Add 'movement fail' divs Add animateWithClass() utility function Add animate-show-then-fade class --- src/lib.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/lib.ts') diff --git a/src/lib.ts b/src/lib.ts index 6a9f553..c2c61cc 100644 --- a/src/lib.ts +++ b/src/lib.ts @@ -59,6 +59,11 @@ export function getNumTrailingZeros(n: number): number { } throw new Error('Exceeded floating point precision'); } +export function animateWithClass(el: HTMLElement, className: string){ + el.classList.remove(className); + el.offsetWidth; // Triggers reflow + el.classList.add(className); +} // For calendar conversion (mostly copied from backend/hist_data/cal.py) export function gregorianToJdn(year: number, month: number, day: number): number { -- cgit v1.2.3