three-kit

Mockup page

The dev-only page that renders any area’s variant in the app’s own look: a @zkmake/three-studio page. Loaded by step 3 when the app has no mockups.html yet, and when adding an area.

Files

File Holds
mockups.html (beside index.html) A copy of the app’s index.html (or studio.html) whose script is /src/mockups.tsx, titled Mockups | <App>. Vite builds index.html alone, so the page never ships.
src/mockups.tsx The page: the config (every area’s variants and views), the stage (ground, lights, fog), <Studio>.
src/mockups/<area>.tsx One area: its variants, exported as <AREA>_VARIANTS.
src/scene/<part>-kit.ts Builders shared by the mockups and, once picked, the scene.

The page

import { orbitViews } from "@zkmake/three-studio";
import { Studio } from "@zkmake/three-studio/react";

<Studio
  config={{
    views: orbitViews(centre, near, { play: { offset, fov } }),
    areas: { signs: { title: "Signs", variants: SIGNS_VARIANTS } },
  }}
  canvas={(state) => ({
    ...APP_CANVAS,
    scene: OUTDOOR.has(state.areaName) ? { fog: appFog() } : {},
  })}
  stage={(state) => <Stage ground={state.variant.ground} />}
/>;

A variant

import type { StudioReactVariant } from "@zkmake/three-studio/react";

type MockupVariant = StudioReactVariant & { ground: "flat" | "road" | "none" };

export const SIGNS_VARIANTS = {
  now: { label: "Now: …", render: () => <NowSigns />, ground: "flat" },
  rich: { label: "…", render: () => <RichSigns />, ground: "flat" },
} satisfies Record<string, MockupVariant>;

More of scene-mockups