summaryrefslogtreecommitdiff
path: root/apps/web/src/defaultDoc.ts
diff options
context:
space:
mode:
authorJosh Kingsley <josh@joshkingsley.me>2025-11-24 15:46:22 +0200
committerJosh Kingsley <josh@joshkingsley.me>2025-11-24 15:46:22 +0200
commitd724cc0bf6ff6d351319e6fb00f5184a04e16ac0 (patch)
treecb43253479df5db8f4844e17e68a48ea5a212df4 /apps/web/src/defaultDoc.ts
parent7c966e105cd9f65853de1aba0ecce63aa56aca0b (diff)
chore: improve dev tasks
Diffstat (limited to 'apps/web/src/defaultDoc.ts')
-rw-r--r--apps/web/src/defaultDoc.ts42
1 files changed, 42 insertions, 0 deletions
diff --git a/apps/web/src/defaultDoc.ts b/apps/web/src/defaultDoc.ts
new file mode 100644
index 0000000..0a3fbfb
--- /dev/null
+++ b/apps/web/src/defaultDoc.ts
@@ -0,0 +1,42 @@
+import Ratio from "./math/Ratio";
+import { Cell, Doc } from "./types";
+
+export default function defaultDoc(): Doc {
+ const defaultCells: Cell[] = Array.from({ length: 16 }, () => ({
+ widthRatio: new Ratio(1, 16),
+ }));
+
+ return {
+ grids: [
+ {
+ id: globalThis.crypto.randomUUID(),
+ baseCellSize: 42,
+ baseCellWidthRatio: new Ratio(1, 16),
+ parts: [
+ {
+ rows: Array.from({ length: 4 }, () => ({
+ cells: [...defaultCells],
+ })),
+ },
+ ],
+ },
+ {
+ id: globalThis.crypto.randomUUID(),
+ baseCellSize: 42,
+ baseCellWidthRatio: new Ratio(1, 16),
+ parts: [
+ {
+ rows: Array.from({ length: 2 }, () => ({
+ cells: [...defaultCells],
+ })),
+ },
+ {
+ rows: Array.from({ length: 2 }, () => ({
+ cells: [...defaultCells],
+ })),
+ },
+ ],
+ },
+ ],
+ };
+}