@johnoscott/isometric-engine 0.0.0-stage → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EDITOR-GUIDE.md +355 -0
- package/LICENSE +21 -0
- package/LICENSES/ajv.txt +22 -0
- package/LICENSES/lucide-static.txt +43 -0
- package/LICENSES/yaml.txt +13 -0
- package/README.md +62 -2
- package/assets/app.css +269 -0
- package/assets/default-theme.yaml +99 -0
- package/assets/icons.svg +1 -0
- package/assets/marks.css +39 -0
- package/assets/skin.css +181 -0
- package/iso-editor.d.ts +4 -0
- package/iso-editor.js +550 -0
- package/iso-render.d.ts +3 -0
- package/iso-render.js +388 -0
- package/iso-systems.d.ts +4 -0
- package/iso-systems.js +389 -0
- package/js/iso-core/compile-schema.js +22 -0
- package/js/iso-core/depth.js +55 -0
- package/js/iso-core/errors.js +65 -0
- package/js/iso-core/glyphs.js +100 -0
- package/js/iso-core/index.js +55 -0
- package/js/iso-core/kernel.js +158 -0
- package/js/iso-core/metrics.json +1 -0
- package/js/iso-core/package.json +6 -0
- package/js/iso-core/parse.js +79 -0
- package/js/iso-core/schema-errors.js +170 -0
- package/js/iso-core/shims/crypto.js +125 -0
- package/js/iso-core/shims/path.js +49 -0
- package/js/iso-core/svg-dom.js +144 -0
- package/js/iso-core/theme.js +48 -0
- package/js/iso-core/vdom.js +48 -0
- package/js/iso-editor/adapter.js +0 -0
- package/js/iso-editor/clipboard.js +152 -0
- package/js/iso-editor/commands.js +173 -0
- package/js/iso-editor/complete.js +55 -0
- package/js/iso-editor/doc.js +182 -0
- package/js/iso-editor/index.js +105 -0
- package/js/iso-editor/model.js +210 -0
- package/js/iso-editor/outline.js +111 -0
- package/js/iso-editor/package.json +6 -0
- package/js/iso-editor/path.js +19 -0
- package/js/iso-editor/providers.js +96 -0
- package/js/iso-editor/schema-nav.js +117 -0
- package/js/iso-editor/splice.js +443 -0
- package/js/iso-editor/storage-keys.js +6 -0
- package/js/iso-editor/ui/actions.js +116 -0
- package/js/iso-editor/ui/canvas-layer.js +0 -0
- package/js/iso-editor/ui/canvas.js +1403 -0
- package/js/iso-editor/ui/clip.js +133 -0
- package/js/iso-editor/ui/dialog.js +26 -0
- package/js/iso-editor/ui/flat-canvas.js +54 -0
- package/js/iso-editor/ui/icons.js +15 -0
- package/js/iso-editor/ui/keys.js +26 -0
- package/js/iso-editor/ui/later.js +28 -0
- package/js/iso-editor/ui/layer.js +11 -0
- package/js/iso-editor/ui/menu.js +105 -0
- package/js/iso-editor/ui/monaco-entry.js +2 -0
- package/js/iso-editor/ui/mount-kit.js +0 -0
- package/js/iso-editor/ui/mount.js +767 -0
- package/js/iso-editor/ui/pane.js +0 -0
- package/js/iso-editor/ui/part.js +0 -0
- package/js/iso-editor/ui/plain-icons.js +34 -0
- package/js/iso-editor/ui/props.js +314 -0
- package/js/iso-editor/ui/scope-css.js +81 -0
- package/js/iso-editor/ui/setup.js +149 -0
- package/js/iso-editor/ui/text.js +323 -0
- package/js/iso-editor/ui/tree.js +728 -0
- package/js/iso-editor/validate.js +33 -0
- package/js/iso-editor/window/protocol.js +8 -0
- package/js/iso-objects/assemble.js +43 -0
- package/js/iso-objects/assets.js +88 -0
- package/js/iso-objects/board.js +162 -0
- package/js/iso-objects/compile.js +60 -0
- package/js/iso-objects/css.js +154 -0
- package/js/iso-objects/flat.js +696 -0
- package/js/iso-objects/focus.js +16 -0
- package/js/iso-objects/geometry.js +76 -0
- package/js/iso-objects/index.js +93 -0
- package/js/iso-objects/kinds.js +12 -0
- package/js/iso-objects/labels.js +325 -0
- package/js/iso-objects/package.json +6 -0
- package/js/iso-objects/place.js +347 -0
- package/js/iso-objects/route.js +461 -0
- package/js/iso-objects/scene.js +350 -0
- package/js/iso-objects/steps.js +246 -0
- package/js/iso-objects/types.js +0 -0
- package/js/iso-systems/catalog.js +42 -0
- package/js/iso-systems/compile.js +34 -0
- package/js/iso-systems/css.js +8 -0
- package/js/iso-systems/index.js +16 -0
- package/js/iso-systems/nodes.js +124 -0
- package/js/iso-systems/package.json +6 -0
- package/js/iso-systems/schema.json +311 -0
- package/js/iso-systems/validate.js +35 -0
- package/js/iso-viewer/bundle.js +20 -0
- package/js/iso-viewer/card-motion.js +228 -0
- package/js/iso-viewer/dom.js +14 -0
- package/js/iso-viewer/dual-view.js +212 -0
- package/js/iso-viewer/flat-view.js +124 -0
- package/js/iso-viewer/history.js +990 -0
- package/js/iso-viewer/index.js +98 -0
- package/js/iso-viewer/morph.js +192 -0
- package/js/iso-viewer/overlay.js +199 -0
- package/js/iso-viewer/package.json +6 -0
- package/js/iso-viewer/page.js +138 -0
- package/js/iso-viewer/player.js +409 -0
- package/js/iso-viewer/still.js +81 -0
- package/js/iso-viewer/timeline-contract.js +14 -0
- package/js/iso-viewer/timeline-engine.js +475 -0
- package/js/iso-viewer/timeline-export.js +36 -0
- package/js/iso-viewer/timeline-scale.js +116 -0
- package/js/iso-viewer/timeline-scope.js +58 -0
- package/js/iso-viewer/timeline-search.js +216 -0
- package/js/iso-viewer/timeline-time.js +55 -0
- package/js/iso-viewer/view-css.js +68 -0
- package/js/iso-viewer/viewport.js +177 -0
- package/package.json +511 -4
- package/src/iso-core/compile-schema.ts +23 -0
- package/src/iso-core/depth.ts +56 -0
- package/src/iso-core/errors.ts +73 -0
- package/src/iso-core/glyphs.ts +108 -0
- package/src/iso-core/index.ts +27 -0
- package/src/iso-core/kernel.ts +163 -0
- package/src/iso-core/metrics.json +1 -0
- package/src/iso-core/package.json +6 -0
- package/src/iso-core/parse.ts +91 -0
- package/src/iso-core/schema-errors.ts +163 -0
- package/src/iso-core/shims/crypto.ts +37 -0
- package/src/iso-core/shims/path.ts +24 -0
- package/src/iso-core/svg-dom.ts +103 -0
- package/src/iso-core/theme.ts +64 -0
- package/src/iso-core/vdom.ts +41 -0
- package/src/iso-editor/adapter.ts +147 -0
- package/src/iso-editor/clipboard.ts +163 -0
- package/src/iso-editor/commands.ts +191 -0
- package/src/iso-editor/complete.ts +73 -0
- package/src/iso-editor/doc.ts +207 -0
- package/src/iso-editor/index.ts +67 -0
- package/src/iso-editor/model.ts +234 -0
- package/src/iso-editor/outline.ts +126 -0
- package/src/iso-editor/package.json +6 -0
- package/src/iso-editor/path.ts +18 -0
- package/src/iso-editor/providers.ts +113 -0
- package/src/iso-editor/schema-nav.ts +129 -0
- package/src/iso-editor/splice.ts +477 -0
- package/src/iso-editor/storage-keys.ts +6 -0
- package/src/iso-editor/ui/actions.ts +119 -0
- package/src/iso-editor/ui/app.css +230 -0
- package/src/iso-editor/ui/canvas-layer.ts +56 -0
- package/src/iso-editor/ui/canvas.ts +1227 -0
- package/src/iso-editor/ui/clip.ts +97 -0
- package/src/iso-editor/ui/dialog.ts +25 -0
- package/src/iso-editor/ui/flat-canvas.ts +51 -0
- package/src/iso-editor/ui/icons.ts +21 -0
- package/src/iso-editor/ui/keys.ts +30 -0
- package/src/iso-editor/ui/later.ts +22 -0
- package/src/iso-editor/ui/layer.ts +7 -0
- package/src/iso-editor/ui/marks.css +39 -0
- package/src/iso-editor/ui/menu.ts +67 -0
- package/src/iso-editor/ui/monaco-entry.ts +6 -0
- package/src/iso-editor/ui/mount-kit.ts +35 -0
- package/src/iso-editor/ui/mount.ts +684 -0
- package/src/iso-editor/ui/pane.ts +45 -0
- package/src/iso-editor/ui/part.ts +45 -0
- package/src/iso-editor/ui/plain-icons.ts +83 -0
- package/src/iso-editor/ui/props.ts +347 -0
- package/src/iso-editor/ui/scope-css.ts +65 -0
- package/src/iso-editor/ui/setup.ts +153 -0
- package/src/iso-editor/ui/skin.css +181 -0
- package/src/iso-editor/ui/text.ts +262 -0
- package/src/iso-editor/ui/tree.ts +657 -0
- package/src/iso-editor/validate.ts +62 -0
- package/src/iso-editor/window/protocol.ts +33 -0
- package/src/iso-objects/assemble.ts +57 -0
- package/src/iso-objects/assets.ts +122 -0
- package/src/iso-objects/board.ts +169 -0
- package/src/iso-objects/compile.ts +76 -0
- package/src/iso-objects/css.ts +163 -0
- package/src/iso-objects/flat.ts +653 -0
- package/src/iso-objects/focus.ts +14 -0
- package/src/iso-objects/geometry.ts +86 -0
- package/src/iso-objects/index.ts +33 -0
- package/src/iso-objects/kinds.ts +56 -0
- package/src/iso-objects/labels.ts +310 -0
- package/src/iso-objects/package.json +6 -0
- package/src/iso-objects/place.ts +318 -0
- package/src/iso-objects/route.ts +444 -0
- package/src/iso-objects/scene.ts +376 -0
- package/src/iso-objects/steps.ts +234 -0
- package/src/iso-objects/types.ts +68 -0
- package/src/iso-systems/catalog.ts +31 -0
- package/src/iso-systems/compile.ts +39 -0
- package/src/iso-systems/css.ts +9 -0
- package/src/iso-systems/index.ts +12 -0
- package/src/iso-systems/nodes.ts +126 -0
- package/src/iso-systems/package.json +6 -0
- package/src/iso-systems/schema.json +311 -0
- package/src/iso-systems/validate.ts +34 -0
- package/src/iso-viewer/bundle.ts +15 -0
- package/src/iso-viewer/card-motion.ts +237 -0
- package/src/iso-viewer/dom.ts +13 -0
- package/src/iso-viewer/dual-view.ts +212 -0
- package/src/iso-viewer/flat-view.ts +127 -0
- package/src/iso-viewer/history.ts +781 -0
- package/src/iso-viewer/index.ts +40 -0
- package/src/iso-viewer/morph.ts +191 -0
- package/src/iso-viewer/overlay.ts +212 -0
- package/src/iso-viewer/package.json +6 -0
- package/src/iso-viewer/page.ts +150 -0
- package/src/iso-viewer/player.ts +321 -0
- package/src/iso-viewer/still.ts +74 -0
- package/src/iso-viewer/timeline-contract.ts +342 -0
- package/src/iso-viewer/timeline-engine.ts +420 -0
- package/src/iso-viewer/timeline-export.ts +31 -0
- package/src/iso-viewer/timeline-scale.ts +129 -0
- package/src/iso-viewer/timeline-scope.ts +56 -0
- package/src/iso-viewer/timeline-search.ts +198 -0
- package/src/iso-viewer/timeline-time.ts +54 -0
- package/src/iso-viewer/view-css.ts +59 -0
- package/src/iso-viewer/viewport.ts +142 -0
- package/types/iso-core/compile-schema.d.ts +11 -0
- package/types/iso-core/depth.d.ts +6 -0
- package/types/iso-core/errors.d.ts +24 -0
- package/types/iso-core/glyphs.d.ts +19 -0
- package/types/iso-core/index.d.ts +17 -0
- package/types/iso-core/kernel.d.ts +130 -0
- package/types/iso-core/metrics.json +1 -0
- package/types/iso-core/parse.d.ts +18 -0
- package/types/iso-core/schema-errors.d.ts +14 -0
- package/types/iso-core/shims/crypto.d.ts +9 -0
- package/types/iso-core/svg-dom.d.ts +15 -0
- package/types/iso-core/theme.d.ts +38 -0
- package/types/iso-core/vdom.d.ts +26 -0
- package/types/iso-editor/adapter.d.ts +178 -0
- package/types/iso-editor/clipboard.d.ts +23 -0
- package/types/iso-editor/commands.d.ts +32 -0
- package/types/iso-editor/complete.d.ts +25 -0
- package/types/iso-editor/doc.d.ts +50 -0
- package/types/iso-editor/index.d.ts +57 -0
- package/types/iso-editor/model.d.ts +96 -0
- package/types/iso-editor/outline.d.ts +28 -0
- package/types/iso-editor/path.d.ts +7 -0
- package/types/iso-editor/providers.d.ts +43 -0
- package/types/iso-editor/schema-nav.d.ts +34 -0
- package/types/iso-editor/splice.d.ts +53 -0
- package/types/iso-editor/storage-keys.d.ts +5 -0
- package/types/iso-editor/ui/actions.d.ts +23 -0
- package/types/iso-editor/ui/canvas-layer.d.ts +65 -0
- package/types/iso-editor/ui/canvas.d.ts +307 -0
- package/types/iso-editor/ui/clip.d.ts +14 -0
- package/types/iso-editor/ui/dialog.d.ts +7 -0
- package/types/iso-editor/ui/flat-canvas.d.ts +2 -0
- package/types/iso-editor/ui/icons.d.ts +5 -0
- package/types/iso-editor/ui/keys.d.ts +7 -0
- package/types/iso-editor/ui/later.d.ts +12 -0
- package/types/iso-editor/ui/layer.d.ts +2 -0
- package/types/iso-editor/ui/menu.d.ts +21 -0
- package/types/iso-editor/ui/mount-kit.d.ts +31 -0
- package/types/iso-editor/ui/mount.d.ts +146 -0
- package/types/iso-editor/ui/pane.d.ts +60 -0
- package/types/iso-editor/ui/part.d.ts +40 -0
- package/types/iso-editor/ui/plain-icons.d.ts +10 -0
- package/types/iso-editor/ui/props.d.ts +57 -0
- package/types/iso-editor/ui/scope-css.d.ts +5 -0
- package/types/iso-editor/ui/setup.d.ts +49 -0
- package/types/iso-editor/ui/text.d.ts +19 -0
- package/types/iso-editor/ui/tree.d.ts +100 -0
- package/types/iso-editor/validate.d.ts +36 -0
- package/types/iso-editor/window/protocol.d.ts +60 -0
- package/types/iso-objects/assemble.d.ts +35 -0
- package/types/iso-objects/assets.d.ts +49 -0
- package/types/iso-objects/board.d.ts +36 -0
- package/types/iso-objects/compile.d.ts +35 -0
- package/types/iso-objects/css.d.ts +16 -0
- package/types/iso-objects/flat.d.ts +130 -0
- package/types/iso-objects/focus.d.ts +1 -0
- package/types/iso-objects/geometry.d.ts +59 -0
- package/types/iso-objects/index.d.ts +26 -0
- package/types/iso-objects/kinds.d.ts +53 -0
- package/types/iso-objects/labels.d.ts +92 -0
- package/types/iso-objects/place.d.ts +25 -0
- package/types/iso-objects/route.d.ts +67 -0
- package/types/iso-objects/scene.d.ts +63 -0
- package/types/iso-objects/steps.d.ts +90 -0
- package/types/iso-objects/types.d.ts +140 -0
- package/types/iso-systems/catalog.d.ts +4 -0
- package/types/iso-systems/compile.d.ts +6 -0
- package/types/iso-systems/css.d.ts +3 -0
- package/types/iso-systems/index.d.ts +5 -0
- package/types/iso-systems/nodes.d.ts +3 -0
- package/types/iso-viewer/card-motion.d.ts +56 -0
- package/types/iso-viewer/dom.d.ts +1 -0
- package/types/iso-viewer/dual-view.d.ts +44 -0
- package/types/iso-viewer/flat-view.d.ts +25 -0
- package/types/iso-viewer/history.d.ts +91 -0
- package/types/iso-viewer/index.d.ts +31 -0
- package/types/iso-viewer/morph.d.ts +28 -0
- package/types/iso-viewer/overlay.d.ts +135 -0
- package/types/iso-viewer/page.d.ts +13 -0
- package/types/iso-viewer/still.d.ts +26 -0
- package/types/iso-viewer/timeline-contract.d.ts +345 -0
- package/types/iso-viewer/timeline-engine.d.ts +20 -0
- package/types/iso-viewer/timeline-export.d.ts +5 -0
- package/types/iso-viewer/timeline-scale.d.ts +44 -0
- package/types/iso-viewer/timeline-scope.d.ts +33 -0
- package/types/iso-viewer/timeline-search.d.ts +52 -0
- package/types/iso-viewer/timeline-time.d.ts +8 -0
- package/types/iso-viewer/view-css.d.ts +7 -0
- package/types/iso-viewer/viewport.d.ts +50 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// The page and SVG styles, from the reference pages. Colours are theme tokens (see theme.ts); nothing here
|
|
2
|
+
// names a colour that should change between light and dark, except the fixed artwork of icons and screens.
|
|
3
|
+
|
|
4
|
+
import { type KindCatalog, kindsCss } from './kinds.ts';
|
|
5
|
+
import { markCss } from './assets.ts';
|
|
6
|
+
|
|
7
|
+
/** The page around a figure (the standalone page only). */
|
|
8
|
+
export const PAGE_CSS = `
|
|
9
|
+
*{box-sizing:border-box}
|
|
10
|
+
html,body{margin:0}
|
|
11
|
+
body{background:var(--bg);color:var(--ink);font:15px/1.55 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;-webkit-font-smoothing:antialiased;overflow-x:hidden}
|
|
12
|
+
code,pre,.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
|
|
13
|
+
code{font-size:.92em;background:var(--code-bg);padding:1px 5px;border-radius:5px;overflow-wrap:anywhere}
|
|
14
|
+
.wrap{max-width:1180px;margin:0 auto;padding:32px 16px 64px}
|
|
15
|
+
header.page{display:flex;flex-wrap:wrap;gap:12px 24px;align-items:flex-end;justify-content:space-between;margin-bottom:8px}
|
|
16
|
+
h1{font-size:clamp(24px,4vw,34px);line-height:1.15;margin:0;letter-spacing:-.01em}
|
|
17
|
+
.lede{color:var(--muted);max-width:76ch;margin:8px 0 0}
|
|
18
|
+
.pills{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
|
|
19
|
+
.pill{display:inline-block;font-size:12px;font-weight:600;padding:3px 10px;border-radius:99px;border:1px solid var(--line);color:var(--muted);background:var(--surface)}
|
|
20
|
+
.theme{font:inherit;font-size:12px;border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:99px;padding:3px 10px;cursor:pointer}
|
|
21
|
+
h2{font-size:20px;margin:44px 0 4px;letter-spacing:-.005em;text-wrap:balance}
|
|
22
|
+
.sec-sub{color:var(--muted);margin:0 0 14px;font-size:14px;max-width:84ch}
|
|
23
|
+
.figure{background:var(--surface);border:1px solid var(--line);border-radius:16px;margin:12px 0 10px;overflow:hidden}
|
|
24
|
+
.scroller{overflow-x:auto;-webkit-overflow-scrolling:touch}
|
|
25
|
+
.scroller svg{display:block;width:100%;min-width:720px;height:auto}
|
|
26
|
+
.legend{display:flex;flex-wrap:wrap;gap:6px 18px;padding:10px 18px;border-top:1px solid var(--line);font-size:12.5px;color:var(--muted)}
|
|
27
|
+
.legend:empty{display:none}
|
|
28
|
+
.legend span{display:inline-flex;align-items:center;gap:8px}
|
|
29
|
+
.legend i{display:inline-block;width:26px;height:0;border-top:3px solid}
|
|
30
|
+
.legend i.box{height:10px;border-width:1.5px;border-style:solid;border-radius:2px}
|
|
31
|
+
footer{margin-top:40px;font-size:12.5px;color:var(--muted)}
|
|
32
|
+
`;
|
|
33
|
+
|
|
34
|
+
/** The drawing itself (a page's, and an interactive view's, scoped: src/iso-viewer/view-css.ts). */
|
|
35
|
+
/** the drawing's stylesheet; the catalogue's kinds add their own rules (kindsCss) in the middle, as they always sat */
|
|
36
|
+
/** the drawing's styles for a catalogue, with the marks a host has registered so far (registerMarks) */
|
|
37
|
+
export const drawingCss = (cat: KindCatalog): string => DRAWING_CSS_A + kindsCss(cat) + DRAWING_CSS_B + markCss();
|
|
38
|
+
const DRAWING_CSS_A = `
|
|
39
|
+
/* blocks: hue per role, lightness per face and theme */
|
|
40
|
+
.blk .top{fill:hsl(var(--h) var(--s) var(--l-top))}
|
|
41
|
+
.blk .lft{fill:hsl(var(--h) var(--s) var(--l-left))}
|
|
42
|
+
.blk .rgt{fill:hsl(var(--h) var(--s) var(--l-right))}
|
|
43
|
+
.blk polygon,.blk path.top,.blk path.lft{stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:.8;stroke-linejoin:round}
|
|
44
|
+
.blk .det{stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:1.4;fill:none;stroke-linecap:round;opacity:.7}
|
|
45
|
+
.k-slab .top{fill:var(--slab-top)} .k-slab .lft{fill:var(--slab-l)} .k-slab .rgt{fill:var(--slab-r)}
|
|
46
|
+
.k-pad .top{fill:var(--pad-top)}
|
|
47
|
+
.wall polygon{fill-opacity:.34}
|
|
48
|
+
.zone polygon{fill:hsl(var(--h) var(--s) 50% / .12);stroke:hsl(var(--h) var(--s) 45% / .55);stroke-dasharray:5 4;stroke-width:1.2}
|
|
49
|
+
.ghost polygon{fill:transparent!important;stroke:var(--muted);stroke-dasharray:4 4;stroke-width:1.2}
|
|
50
|
+
.ghost .det{opacity:.45}
|
|
51
|
+
.blk polygon.ico-unknown{fill:none;stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:1.2;stroke-dasharray:3 2.5}
|
|
52
|
+
.blk .ico-unknown-q{stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:1.6;stroke-linecap:round;fill:none}
|
|
53
|
+
.blk polygon.sock-hole{fill:hsl(var(--h) var(--s) 18%);opacity:.8}
|
|
54
|
+
.scr .t{fill:#1d1f27;stroke:#3a3b44;stroke-width:.6}
|
|
55
|
+
.scr .ln{stroke:#8fd3b0;stroke-width:1.2;stroke-linecap:round}
|
|
56
|
+
.scr .bar{fill:#2a2c36}
|
|
57
|
+
.scr .win{fill:#e9e9ee}
|
|
58
|
+
.scr .wall{fill:#3b5bbd}
|
|
59
|
+
.scr .glass{fill:#0d0e12;stroke:#3a3b44;stroke-width:1}
|
|
60
|
+
.scr .w{fill:#f4f4f2}
|
|
61
|
+
.scr .d{fill:#0b0b0d}
|
|
62
|
+
.scr .m{fill:#3a3934}
|
|
63
|
+
.scr .unk{fill:none;stroke:#8a8d99;stroke-width:1;stroke-dasharray:3 2.5}
|
|
64
|
+
.scr .unk-q{fill:none;stroke:#8a8d99;stroke-width:1.4;stroke-linecap:round}
|
|
65
|
+
.scr .unk-dot{fill:#8a8d99}
|
|
66
|
+
.orb .ball{fill:url(#orbG);stroke:#8a8b93;stroke-width:.8}
|
|
67
|
+
.orb .shade{fill:#000;opacity:.18}
|
|
68
|
+
.orb .eye{fill:#0b0b0d}
|
|
69
|
+
.person .body{fill:hsl(var(--h) var(--s) var(--l-left));stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:.8}
|
|
70
|
+
.person .head{fill:hsl(var(--h) var(--s) var(--l-top));stroke:hsl(var(--h) var(--s) var(--l-edge));stroke-width:.8}
|
|
71
|
+
|
|
72
|
+
/* text */
|
|
73
|
+
.lbl{font-size:13px;font-weight:700;fill:var(--ink);paint-order:stroke;stroke:var(--surface);stroke-width:4px;stroke-linejoin:round}
|
|
74
|
+
.sub{font-size:11px;fill:var(--muted);font-weight:400;paint-order:stroke;stroke:var(--surface);stroke-width:4px;stroke-linejoin:round}
|
|
75
|
+
.floor{font-size:11px;font-weight:600;letter-spacing:.01em}
|
|
76
|
+
.floor.t-control{fill:var(--muted)}
|
|
77
|
+
.slabname{font-size:15px;font-weight:800;fill:var(--muted);letter-spacing:.12em;opacity:.8}
|
|
78
|
+
.slabname.sm{font-size:10.5px;letter-spacing:.1em;opacity:1}
|
|
79
|
+
`;
|
|
80
|
+
const DRAWING_CSS_B = `.tunnel polygon{fill:hsl(205 85% 55% / .17);stroke:hsl(205 75% 45% / .8);stroke-width:1.3;stroke-linejoin:round}
|
|
81
|
+
.tunnel .top{fill:hsl(205 85% 65% / .22)}
|
|
82
|
+
.tunnel .rib{fill:none;stroke:hsl(205 75% 45% / .5);stroke-width:1}
|
|
83
|
+
.tunname{font-size:12px;font-weight:800;letter-spacing:.14em;fill:var(--tunnel-text);paint-order:stroke;stroke:var(--surface);stroke-width:3px;stroke-linejoin:round}
|
|
84
|
+
|
|
85
|
+
/* flows */
|
|
86
|
+
.flow{fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
|
|
87
|
+
`;
|
|
88
|
+
|
|
89
|
+
/** a page's stylesheet: the page's own rules and the drawing's */
|
|
90
|
+
export const baseCss = (cat: KindCatalog): string => PAGE_CSS + drawingCss(cat);
|
|
91
|
+
|
|
92
|
+
/** Step marks and step focus, drawn in the SVG (the page, and the editor's canvas). */
|
|
93
|
+
export const MARKS_CSS = `
|
|
94
|
+
/* step marks */
|
|
95
|
+
.xm circle{fill:var(--surface);stroke:var(--blocked);stroke-width:2.5}
|
|
96
|
+
.xm path{stroke:var(--blocked);stroke-width:3;stroke-linecap:round}
|
|
97
|
+
.say rect{fill:var(--surface);stroke-width:1.5}
|
|
98
|
+
.say text{font-size:12px;font-weight:600}
|
|
99
|
+
.badge{cursor:pointer}
|
|
100
|
+
.badge circle{fill:var(--c);stroke:var(--surface);stroke-width:2.5}
|
|
101
|
+
.badge text{font-size:11.5px;font-weight:800;fill:var(--on);text-anchor:middle;dominant-baseline:central;pointer-events:none}
|
|
102
|
+
.tok{stroke:var(--surface);stroke-width:2.5}
|
|
103
|
+
.pulse{fill:none;stroke-width:2.5;transform-box:fill-box;transform-origin:center;animation:pulse 1.5s ease-out infinite}
|
|
104
|
+
@keyframes pulse{from{transform:scale(.35);opacity:.95}to{transform:scale(1.5);opacity:0}}
|
|
105
|
+
.sub{stroke-width:5px}
|
|
106
|
+
|
|
107
|
+
/* step focus: what a step does not touch dims; things that appear later are hidden */
|
|
108
|
+
[data-hl],[data-id],[data-step]{transition:opacity .25s}
|
|
109
|
+
svg.focus [data-hl]:not(.hl){opacity:.12}
|
|
110
|
+
svg.focus.dim-all [data-dim]:not(.hl){opacity:.14}
|
|
111
|
+
svg.focus .badge:not(.on){opacity:.14}
|
|
112
|
+
svg.all .badge{opacity:1}
|
|
113
|
+
svg.focus.all [data-hl]:not(.hl),svg.focus.all.dim-all [data-dim]:not(.hl){opacity:.9}
|
|
114
|
+
svg [data-step]:not(.on),svg.all [data-step]{opacity:0!important;pointer-events:none}
|
|
115
|
+
.pre{opacity:0!important;pointer-events:none}
|
|
116
|
+
`;
|
|
117
|
+
|
|
118
|
+
/** The player's controls (the page only). */
|
|
119
|
+
export const PLAYER_UI_CSS = `
|
|
120
|
+
/* player */
|
|
121
|
+
.player{display:flex;align-items:flex-start;gap:10px 14px;padding:12px 16px;border-top:1px solid var(--line);flex-wrap:wrap}
|
|
122
|
+
.ctrls{display:flex;gap:6px;flex:none}
|
|
123
|
+
.pbtn{font:inherit;font-size:13px;font-weight:700;display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line);background:var(--bg);color:var(--ink);border-radius:99px;padding:6px 14px;cursor:pointer}
|
|
124
|
+
.pbtn.icon{padding:6px 11px}
|
|
125
|
+
.pbtn:hover{border-color:var(--muted)}
|
|
126
|
+
.pbtn:disabled{opacity:.6;cursor:default}
|
|
127
|
+
.pbtn.primary{background:var(--ink);color:var(--surface);border-color:var(--ink);min-width:92px;justify-content:center}
|
|
128
|
+
.pbtn:focus-visible,.dot:focus-visible,.badge:focus-visible{outline:2px solid var(--send);outline-offset:2px}
|
|
129
|
+
.cap{flex:1 1 360px;min-width:0}
|
|
130
|
+
.cap-h{font-size:14.5px;font-weight:700;display:flex;align-items:center;gap:8px}
|
|
131
|
+
.cap-h .cnt{margin-left:auto;font-weight:500;color:var(--muted);font-size:12px;white-space:nowrap}
|
|
132
|
+
.num{flex:none;display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--c,var(--control));color:var(--on);font-size:11px;font-weight:800}
|
|
133
|
+
.cap-t{font-size:13.5px;color:var(--ink);margin:4px 0 0;max-width:92ch;min-height:3.1em}
|
|
134
|
+
.cap-c{margin:8px 0 0;background:var(--code-bg);border-radius:8px;padding:7px 10px;font-size:12px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;max-height:9.5em;overflow-y:auto;color:var(--ink)}
|
|
135
|
+
.cap-c:empty{display:none}
|
|
136
|
+
.prog{height:3px;background:var(--line);border-radius:3px;overflow:hidden;margin-top:9px}
|
|
137
|
+
.prog i{display:block;height:100%;width:0;background:var(--c,var(--ink))}
|
|
138
|
+
.dots{display:flex;gap:5px;flex-wrap:wrap;flex-basis:100%;padding-left:2px;order:4}
|
|
139
|
+
.dot{width:10px;height:10px;border-radius:50%;background:var(--line);border:0;padding:0;cursor:pointer}
|
|
140
|
+
.dot.on{background:var(--ink)} .dot.done{background:var(--muted)}
|
|
141
|
+
details.steps{margin:0 0 8px;font-size:13.5px}
|
|
142
|
+
details.steps summary{cursor:pointer;color:var(--muted);font-size:13px}
|
|
143
|
+
details.steps ol{margin:8px 0 0;padding-left:22px;max-width:92ch}
|
|
144
|
+
details.steps li{margin:6px 0}
|
|
145
|
+
details.steps li code{font-size:11.5px}
|
|
146
|
+
@media (prefers-reduced-motion:reduce){.pulse{animation:none;opacity:.8}}
|
|
147
|
+
@media (max-width:560px){.cap{flex-basis:100%}}
|
|
148
|
+
.still .pulse{animation:none;opacity:.85}
|
|
149
|
+
.still *,.still *::before{transition:none!important}
|
|
150
|
+
.still .prog{display:none}
|
|
151
|
+
.still .ctrls,.still .tools{display:none}
|
|
152
|
+
.tools{display:flex;gap:6px;flex:none;order:3;margin-left:auto}
|
|
153
|
+
.pbtn.small{font-size:12px;padding:4px 11px;font-weight:600;color:var(--muted)}
|
|
154
|
+
.pbtn.small[aria-pressed="true"]{color:var(--ink);border-color:var(--muted);background:var(--surface)}`;
|
|
155
|
+
|
|
156
|
+
/** The floor grid and the assemble intro, in the SVG. */
|
|
157
|
+
export const GRID_CSS = `
|
|
158
|
+
.grid{display:none;fill:none;stroke:var(--ink);stroke-width:.6;opacity:.16;pointer-events:none}
|
|
159
|
+
svg.show-grid .grid{display:inline}
|
|
160
|
+
svg.pre-assemble > g:not(.g-anim){opacity:0}
|
|
161
|
+
`;
|
|
162
|
+
|
|
163
|
+
export const PLAYER_CSS = MARKS_CSS + PLAYER_UI_CSS + GRID_CSS;
|