aboutsummaryrefslogtreecommitdiff
path: root/src/lib.ts
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2023-01-15 12:25:08 +1100
committerTerry Truong <terry06890@gmail.com>2023-01-15 12:25:08 +1100
commit356ffa2250c66c442cfa8c4e638ca53926396a65 (patch)
treecbfd3d2229df6a1b3c0e4837bcc7aff5c624c8a5 /src/lib.ts
parente045f6461b5ceabb285b00fb9db0050a3d1f9d8d (diff)
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
Diffstat (limited to 'src/lib.ts')
-rw-r--r--src/lib.ts5
1 files changed, 5 insertions, 0 deletions
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 {