-
+
-
- {" "}
- {" "}
-
-
-
-
-
-
-
-
-
-
-
- >
+
);
};
diff --git a/lib/pages/debug-page.tsx b/lib/pages/debug-page.tsx
index 4453088..8fb8301 100644
--- a/lib/pages/debug-page.tsx
+++ b/lib/pages/debug-page.tsx
@@ -3,6 +3,7 @@ import { AutoSizingSvg } from "../auto-sizing-svg";
import { CreatureContext, CreatureContextType } from "../creature-symbol";
import { createCreatureSymbolFactory } from "../creature-symbol-factory";
import { HoverDebugHelper } from "../hover-debug-helper";
+import { Page } from "../page";
import { createSvgSymbolContext } from "../svg-symbol";
import { svgScale, SvgTransform } from "../svg-transform";
import { SvgVocabulary } from "../svg-vocabulary";
@@ -60,18 +61,21 @@ export const DebugPage: React.FC<{}> = () => {
};
return (
- <>
-
Debug!
-
-
-
-
-
- {EYE_CREATURE}
-
-
-
-
- >
+
+
+
+
+
+
+
+
+
+ {EYE_CREATURE}
+
+
+
+
+
+
);
};
diff --git a/lib/pages/index.tsx b/lib/pages/index.tsx
new file mode 100644
index 0000000..37c87d0
--- /dev/null
+++ b/lib/pages/index.tsx
@@ -0,0 +1,28 @@
+import { WavesPage } from "./waves-page";
+import { VocabularyPage } from "./vocabulary-page";
+import { CreaturePage } from "./creature-page";
+import { MandalaPage } from "./mandala-page";
+import { DebugPage } from "./debug-page";
+
+export const Pages = {
+ vocabulary: VocabularyPage,
+ creature: CreaturePage,
+ waves: WavesPage,
+ mandala: MandalaPage,
+ debug: DebugPage,
+};
+
+export type PageName = keyof typeof Pages;
+
+export const pageNames = Object.keys(Pages) as PageName[];
+
+export const DEFAULT_PAGE: PageName = "vocabulary";
+
+export function isPageName(page: string): page is PageName {
+ return pageNames.includes(page as any);
+}
+
+export function toPageName(page: string, defaultValue: PageName): PageName {
+ if (isPageName(page)) return page;
+ return defaultValue;
+}
diff --git a/lib/pages/mandala-page.tsx b/lib/pages/mandala-page.tsx
index fdbc512..ea75e4c 100644
--- a/lib/pages/mandala-page.tsx
+++ b/lib/pages/mandala-page.tsx
@@ -29,6 +29,7 @@ import {
CompositionContextWidget,
createSvgCompositionContext,
} from "../svg-composition-context";
+import { Page } from "../page";
type ExtendedMandalaCircleParams = MandalaCircleParams & {
scaling: number;
@@ -281,71 +282,65 @@ export const MandalaPage: React.FC<{}> = () => {
}
return (
- <>
-
Mandala!
-
-
-
+
+
+
+
+
+
+ {useTwoCircles && (
-
-
-
- {useTwoCircles && (
-
- )}
-
- {" "}
-
-
-
-
-
-
- {circles}
-
-
+ )}
+
+ {" "}
+
- >
+
+
);
};
diff --git a/lib/pages/vocabulary-page.tsx b/lib/pages/vocabulary-page.tsx
index e625d85..67941ae 100644
--- a/lib/pages/vocabulary-page.tsx
+++ b/lib/pages/vocabulary-page.tsx
@@ -9,6 +9,7 @@ import { SvgVocabulary } from "../svg-vocabulary";
import { SvgSymbolContext } from "../svg-symbol";
import { SymbolContextWidget } from "../symbol-context-widget";
import { HoverDebugHelper } from "../hover-debug-helper";
+import { Page } from "../page";
type SvgSymbolProps = {
data: SvgSymbolData;
@@ -49,43 +50,47 @@ export const VocabularyPage: React.FC<{}> = () => {
);
return (
- <>
- Mystic Symbolic Vocabulary
-
-
-
setFilter(e.target.value)}
- />
+
+
+
+
+ setFilter(e.target.value)}
+ placeholder="🔎"
+ />
+
+
-
-
- {items.map((symbolData) => (
-
+
+
+ {items.map((symbolData) => (
- {symbolData.name}
+
+ {symbolData.name}
+
+
+
+
-
-
-
-
- ))}
-
- >
+ ))}
+
+
+
);
};
diff --git a/lib/pages/waves-page.tsx b/lib/pages/waves-page.tsx
index 234be23..f7c2303 100644
--- a/lib/pages/waves-page.tsx
+++ b/lib/pages/waves-page.tsx
@@ -1,6 +1,7 @@
import React, { useState } from "react";
import { ColorWidget } from "../color-widget";
import { NumericSlider } from "../numeric-slider";
+import { Page } from "../page";
const WAVE_STROKE = "#79beda";
const WAVE_FILL = "#2b7c9e";
@@ -104,61 +105,64 @@ const Waves: React.FC<{}> = () => {
return (
<>
-
-
- {" "}
-
-
-
-
-
-
-
+
+
+
+
+
+ {" "}
+
+
+
+
+
+
+
+
>
);
};
export const WavesPage: React.FC<{}> = () => (
- <>
-
Waves!
+
- >
+
);
diff --git a/lib/vocabulary-widget.tsx b/lib/vocabulary-widget.tsx
index 8a26de3..c3dac7c 100644
--- a/lib/vocabulary-widget.tsx
+++ b/lib/vocabulary-widget.tsx
@@ -20,7 +20,7 @@ export function VocabularyWidget
({
id = id || slugify(label);
return (
- <>
+
- >
+
);
}