@zkmake/three-meter 0.10.0 → 0.11.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/README.md +29 -6
- package/dist/{mount-perf-hud-U_Xlj0Od.js → mount-perf-hud-JJIFHJCt.js} +1365 -1226
- package/dist/mount-perf-hud-JJIFHJCt.js.map +1 -0
- package/dist/react.js +1 -1
- package/dist/styles.css +57 -5
- package/dist/ui.d.ts +43 -2
- package/dist/ui.js +2 -2
- package/package.json +1 -1
- package/dist/mount-perf-hud-U_Xlj0Od.js.map +0 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ textures and shaders in GPU memory. Zero dependencies. Works with `WebGLRenderer
|
|
|
9
9
|
bun add -d @zkmake/three-meter # or npm i -D / pnpm add -D
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Live demo: [three-
|
|
12
|
+
Live demo: [three-kit.pages.dev/three-meter](https://three-kit.pages.dev/three-meter/), with a vanilla three and a
|
|
13
13
|
React Three Fiber take on the same scene. Add `?webgpu` for the WebGPU renderer and `?count=30000` to
|
|
14
14
|
load the scene up past the demo's triangle budget.
|
|
15
15
|
|
|
@@ -277,15 +277,38 @@ The resolved theme lands on `data-theme` of `.perf-hud` and `.perf-monitor`. To
|
|
|
277
277
|
palette, override the `--perf-*` custom properties (`bg`, `fg`, `fg-dim`, `muted`, `row`,
|
|
278
278
|
`border`, `accent`, `warn`, `shadow`) on those selectors. `warn` is the over-budget amber.
|
|
279
279
|
|
|
280
|
+
## The dev-panel frame
|
|
281
|
+
|
|
282
|
+
The HUD's frame is `mountDevPanel` from `@zkmake/three-meter/ui`: the docked host, a card with a
|
|
283
|
+
brand label on top, and the drag / expand-compact / dim-on-leave discs. Other zkmake dev panels
|
|
284
|
+
(`@zkmake/three-textures`) mount through it too, so they all dock, wake, dim and theme the same way.
|
|
285
|
+
A tool of your own can use it:
|
|
286
|
+
|
|
287
|
+
```ts
|
|
288
|
+
const panel = mountDevPanel({
|
|
289
|
+
brand: "my-tool",
|
|
290
|
+
label: "My tool",
|
|
291
|
+
content: myElement,
|
|
292
|
+
theme: new HudTheme("system"),
|
|
293
|
+
storageKey: "my-tool",
|
|
294
|
+
onToggle: () => myElement.classList.toggle("is-compact"),
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
panel.detail.textContent = "3 items"; // the brand row's right-hand slot
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
The card is `.perf-hud__card`, holding `.perf-hud__brand` and your content (the HUD's is
|
|
301
|
+
`.perf-monitor`).
|
|
302
|
+
|
|
280
303
|
## Examples
|
|
281
304
|
|
|
282
|
-
[`apps/three-meter
|
|
283
|
-
|
|
284
|
-
[`
|
|
285
|
-
[`
|
|
305
|
+
[`apps/site/src/demos/three-meter`](https://github.com/zkmake/three-kit/tree/main/apps/site/src/demos/three-meter) is what runs at [three-kit.pages.dev/three-meter](https://three-kit.pages.dev/three-meter/):
|
|
306
|
+
both integrations of the same scene, swapped from the header.
|
|
307
|
+
[`vanilla.ts`](https://github.com/zkmake/three-kit/blob/main/apps/site/src/demos/three-meter/vanilla.ts) is plain three with `mountPerfHud`;
|
|
308
|
+
[`r3f.tsx`](https://github.com/zkmake/three-kit/blob/main/apps/site/src/demos/three-meter/r3f.tsx) is React Three Fiber with `PerfSampler` and
|
|
286
309
|
`PerfHud`. Both set a 250K triangle budget on top of the timing defaults. `?r3f` opens on Fiber,
|
|
287
310
|
`?webgpu` uses `WebGPURenderer` in either, `?count=` scales the scene. The header's theme toggle sets the page theme and the HUD's `theme` layer together; the row
|
|
288
|
-
inside the panel overrides the HUD alone. Run `bun run dev`
|
|
311
|
+
inside the panel overrides the HUD alone. Run `bun run dev` in `apps/site` after a `bun install` at the repo root.
|
|
289
312
|
|
|
290
313
|
## Shipping it
|
|
291
314
|
|