aboutsummaryrefslogtreecommitdiff
path: root/src/lib.ts
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-10-11 00:34:42 +1100
committerTerry Truong <terry06890@gmail.com>2022-10-11 00:35:50 +1100
commit6a46c220406477914c01a77c47016575aab8bdde (patch)
tree6509f4ae4da9c874df6fefd8b6bdf4b7513e785b /src/lib.ts
parent4aa28afe7bead19f633e2ce8829a66b7c65ea746 (diff)
Add global store, do general refactor
Resolve typescript issues Make terminology more consistent
Diffstat (limited to 'src/lib.ts')
-rw-r--r--src/lib.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib.ts b/src/lib.ts
index 1e4b1f9..28994f1 100644
--- a/src/lib.ts
+++ b/src/lib.ts
@@ -5,3 +5,13 @@
export const MIN_DATE = -1000;
export const MAX_DATE = 1000;
export const SCALES = [200, 50, 10, 1, 0.2]; // Timeline gets divided into units of SCALES[0], then SCALES[1], etc
+
+export const WRITING_MODE_HORZ =
+ window.getComputedStyle(document.body)['writing-mode' as any].startsWith('horizontal');
+ // Used with ResizeObserver callbacks, to determine which resized dimensions are width and height
+
+export type TimelineRange = {
+ id: number,
+ start: number,
+ end: number,
+};