@vibes.diy/prompts 14.3.352 → 14.3.354
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/llms/hydra.md +32 -27
- package/llms/image-gen.md +2 -0
- package/llms/match-style.md +3 -1
- package/llms/p5.md +68 -28
- package/llms/reskin.md +6 -1
- package/llms/surface-play-area.md +9 -0
- package/llms/surface-stage.md +30 -10
- package/llms/three-js.md +8 -0
- package/package.json +5 -5
- package/system-prompt-initial-instant.md +1 -1
- package/system-prompt-initial-oneshot.md +40 -0
- package/system-prompt-initial.md +40 -0
- package/system-prompt.md +40 -0
- package/themes/colorsets.js +6 -2
- package/themes/looks/house/brief.md +1 -1
- package/themes/looks/pouf/brief.md +2 -0
- package/themes/looks/pouf/variety.js +1 -1
package/llms/hydra.md
CHANGED
|
@@ -601,34 +601,38 @@ export default function App() {
|
|
|
601
601
|
}
|
|
602
602
|
|
|
603
603
|
return (
|
|
604
|
-
<main className="
|
|
605
|
-
<
|
|
606
|
-
<
|
|
607
|
-
<
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
604
|
+
<main className="bg-background text-foreground">
|
|
605
|
+
<section className="flex h-dvh max-h-240 flex-col gap-2 p-3 md:flex-row" style={{ paddingBottom: "var(--vibes-controls-inset, 0px)" }}>
|
|
606
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col gap-2">
|
|
607
|
+
<Row gap={2} align="center">
|
|
608
|
+
<Heading level={2}>Video Synth</Heading>
|
|
609
|
+
<Spacer />
|
|
610
|
+
<Badge tone={live ? "up" : "idle"}>{live ? (camera ? "Camera in" : "Live") : "Warming up…"}</Badge>
|
|
611
|
+
</Row>
|
|
612
|
+
<div ref={stage} className="relative min-h-48 flex-1 overflow-hidden rounded-md bg-neutral">
|
|
613
|
+
{!live && <div aria-busy="true" className="absolute inset-0"><Skeleton variant="card" /></div>}
|
|
614
|
+
</div>
|
|
614
615
|
</div>
|
|
615
616
|
|
|
616
|
-
<
|
|
617
|
-
<
|
|
618
|
-
{
|
|
619
|
-
<
|
|
620
|
-
|
|
621
|
-
|
|
617
|
+
<div className="shrink-0 md:w-80 md:overflow-y-auto">
|
|
618
|
+
<Card variant="tight">
|
|
619
|
+
<Stack gap={2}>
|
|
620
|
+
<div className="grid grid-cols-2 gap-x-3 gap-y-1 md:grid-cols-1">
|
|
621
|
+
{KNOBS.map((k) => (
|
|
622
|
+
<Slider key={k.key} value={[knobs[k.key]]} onChange={([v]) => setKnobs((now) => ({ ...now, [k.key]: v }))} min={k.min} max={k.max} step={k.step} label={k.label} />
|
|
623
|
+
))}
|
|
624
|
+
</div>
|
|
625
|
+
<Row gap={2} wrap>
|
|
626
|
+
<Button size="sm" onClick={camera ? cameraBack : cameraOn}>{camera ? "Back to stripes" : "Use my camera"}</Button>
|
|
627
|
+
<Button size="sm" variant="quiet" onClick={() => setKnobs(START)}>Reset</Button>
|
|
628
|
+
<Button size="sm" variant="quiet" onClick={() => stage.current?.requestFullscreen?.()}>Full screen</Button>
|
|
622
629
|
</Row>
|
|
623
|
-
|
|
624
|
-
</
|
|
625
|
-
</
|
|
630
|
+
</Stack>
|
|
631
|
+
</Card>
|
|
632
|
+
</div>
|
|
633
|
+
</section>
|
|
626
634
|
|
|
627
|
-
|
|
628
|
-
<Button onClick={camera ? cameraBack : cameraOn}>{camera ? "Back to stripes" : "Use my camera"}</Button>
|
|
629
|
-
<Button variant="quiet" onClick={() => setKnobs(START)}>Reset knobs</Button>
|
|
630
|
-
<Button variant="quiet" onClick={() => stage.current?.requestFullscreen?.()}>Full screen</Button>
|
|
631
|
-
</Row>
|
|
635
|
+
<div className="flex flex-col gap-4 p-3">
|
|
632
636
|
{note && <Text size="sm" tone="down">{note}</Text>}
|
|
633
637
|
|
|
634
638
|
<Card variant="tight">
|
|
@@ -641,7 +645,7 @@ export default function App() {
|
|
|
641
645
|
<Text size="sm" muted>
|
|
642
646
|
Video by <a className="underline" href="https://hydra.ojack.xyz" target="_blank" rel="noreferrer">Hydra</a> (AGPL), fetched from its own address when the page opens.
|
|
643
647
|
</Text>
|
|
644
|
-
</
|
|
648
|
+
</div>
|
|
645
649
|
</main>
|
|
646
650
|
);
|
|
647
651
|
}
|
|
@@ -914,8 +918,9 @@ plays on.
|
|
|
914
918
|
- **The mount effect guards the async attach**: when the component unmounts
|
|
915
919
|
before the engine arrives, the late `detach` runs at once (the `gone` flag
|
|
916
920
|
in the examples), so a fast remount never leaves two loops.
|
|
917
|
-
- **The canvas renders at 1280×720 and CSS
|
|
918
|
-
|
|
921
|
+
- **The canvas renders at 1280×720 and CSS covers the stage box with it**, a
|
|
922
|
+
16:9 `aspect-video` stage or the `flex-1` stage that shares one screen with
|
|
923
|
+
its knobs. That is sharp on a laptop and light enough for a phone;
|
|
919
924
|
`hydra.setResolution(w, h)` changes it when an app needs more.
|
|
920
925
|
- **`hush()` blanks every output and forgets `update`**; a "Blank" button and
|
|
921
926
|
a scene change between sets call it. The loop keeps running, so the next
|
package/llms/image-gen.md
CHANGED
|
@@ -280,6 +280,8 @@ Your `access.js` governs your app's own records — the story, the hat, the roas
|
|
|
280
280
|
|
|
281
281
|
Every `<ImgGen>` draws with the app's default image model. `listModels({ kind: "image" })` (from `call-ai`, beside `callAI`) returns the image models this app can use, the app's own choice first, and each entry's `id` goes straight into the `model` prop: `<ImgGen prompt="An astronaut riding a horse" model={m.id} />`. The entry with `isDefault: true` is the one ImgGen uses when `model` is left out; with `images` present the default is the platform's image-edit model instead, so img2img leaves `model` out (see above). When the app's maker saved their own provider key, it covers the image model they chose in settings; other models run on the person's credits. The callAI skill's "Choosing a model" section lists every field.
|
|
282
282
|
|
|
283
|
+
An app whose owner picks the image model (a Settings choice kept in the app's own database) also saves that `id` as `model` on each record it paints, beside `prompt`, and passes `model={record.model}` to that record's `<ImgGen>`; a picture Vibes paints into the record from a texted photo then uses the same model. Leave Prodia models out of a selfie app's choices, since they restyle without keeping a face.
|
|
284
|
+
|
|
283
285
|
To compare image models, call `listModels({ kind: "image" })` and render one `<ImgGen>` per entry with `model={m.id}`. Every picture shares one prompt, each card is labelled with `m.name`, and each picture uses its stored audition record's `_id` so a reload shows the saved pictures. The lineup is on screen before any picture is: one card per model with its name and an empty frame, the prompt box and the draw button above them, so the first screen reads as a lineup waiting for its press; while the model list is still loading the cards show a `Skeleton`, and a list that fails to load leaves the frames in place with one sentence in the app's own words, never a banner over the page. Each click saves one new record per model, with its prompt and model choice:
|
|
284
286
|
|
|
285
287
|
### `App.jsx`
|
package/llms/match-style.md
CHANGED
|
@@ -57,7 +57,9 @@ it scopes, or an earlier `THEME_CSS`) trades it for the new block in the same
|
|
|
57
57
|
pass: the new `THEME_CSS` takes that string's place, its `<style>` element and
|
|
58
58
|
wrapper go with it, and the ornament it drew (a texture, a glow, a heading prefix,
|
|
59
59
|
letter-spaced capitals, stripes, borders, a hard shadow) and the plain elements it
|
|
60
|
-
added (a title bar, a menu strip) give way to what the new style asks for.
|
|
60
|
+
added (a title bar, a menu strip) give way to what the new style asks for. Those
|
|
61
|
+
elements come out of the JSX too, and an action they carried (a menu bar's items)
|
|
62
|
+
stays as a plain control of the new style beside the heading. The app
|
|
61
63
|
then carries one stylesheet of its own, the block above.
|
|
62
64
|
|
|
63
65
|
### The variables
|
package/llms/p5.md
CHANGED
|
@@ -18,13 +18,20 @@ thing every frame; an animation is a loop where something changed.
|
|
|
18
18
|
This is a full, runnable `App.jsx`. Start here and grow it: the sketch is a
|
|
19
19
|
factory function that receives the host element, the instance is built once in
|
|
20
20
|
one `useEffect([])`, the canvas is sized from the host, and the cleanup removes
|
|
21
|
-
the instance so remounts do not leak a second draw loop.
|
|
21
|
+
the instance so remounts do not leak a second draw loop. The page is one block
|
|
22
|
+
exactly one screen tall: a heading row, the sketch taking the space left, and
|
|
23
|
+
its sliders docked under it (a side panel from `md:` up), as the shared
|
|
24
|
+
prompt's _A surface and its controls share one screen_ shows. Every number
|
|
25
|
+
the piece needs stays in `params`, so Keep saves them all; a slider the sketch
|
|
26
|
+
reads every frame (speed, grain) also reaches it through `liveRef`, so a drag
|
|
27
|
+
answers at once without rebuilding the instance.
|
|
22
28
|
|
|
23
29
|
### `App.jsx`
|
|
24
30
|
```jsx
|
|
25
31
|
import React from "react";
|
|
26
32
|
import p5 from "https://esm.sh/p5@1.11.13";
|
|
27
|
-
import { Button,
|
|
33
|
+
import { Button, Card, Heading, Row } from "@vibes.diy/ui";
|
|
34
|
+
import { Slider } from "@vibes.diy/ui/interactive";
|
|
28
35
|
// Canvas pixels cannot follow a CSS variable: lib/look.js (the canvas theme colours) resolves the
|
|
29
36
|
// injected theme tokens to concrete colours, the second argument the fallback for an unthemed app.
|
|
30
37
|
import { cssColor, watchLook } from "./lib/look.js";
|
|
@@ -33,7 +40,9 @@ const TAU = Math.PI * 2;
|
|
|
33
40
|
|
|
34
41
|
// The sketch is a pure function of its parameters and its host element. Pass the
|
|
35
42
|
// host in explicitly — never read p5's private `_userNode` to find it.
|
|
36
|
-
|
|
43
|
+
// `liveRef` (optional) carries the slider values the sketch reads every frame;
|
|
44
|
+
// without it the sketch reads `params`, as a still render or a replay does.
|
|
45
|
+
function makeSketch({ params, host, stepsRef, liveRef }) {
|
|
37
46
|
return (p) => {
|
|
38
47
|
let particles = [];
|
|
39
48
|
let palette = null;
|
|
@@ -69,14 +78,15 @@ function makeSketch({ params, host, stepsRef }) {
|
|
|
69
78
|
};
|
|
70
79
|
|
|
71
80
|
const advance = () => {
|
|
81
|
+
const { speed, grain } = liveRef ? liveRef.current : params;
|
|
72
82
|
steps += 1;
|
|
73
|
-
t +=
|
|
83
|
+
t += speed * 0.0016;
|
|
74
84
|
for (const q of particles) {
|
|
75
|
-
const a = p.noise(q.x *
|
|
85
|
+
const a = p.noise(q.x * grain, q.y * grain, t) * TAU * 2;
|
|
76
86
|
q.px = q.x;
|
|
77
87
|
q.py = q.y;
|
|
78
|
-
q.x += Math.cos(a) *
|
|
79
|
-
q.y += Math.sin(a) *
|
|
88
|
+
q.x += Math.cos(a) * speed;
|
|
89
|
+
q.y += Math.sin(a) * speed;
|
|
80
90
|
p.line(q.px, q.py, q.x, q.y);
|
|
81
91
|
if (q.x < -20 || q.x > w + 20 || q.y < -20 || q.y > h + 20) {
|
|
82
92
|
q.x = p.random(w);
|
|
@@ -138,9 +148,17 @@ function makeSketch({ params, host, stepsRef }) {
|
|
|
138
148
|
return false; // stop the browser scrolling the page under the finger
|
|
139
149
|
};
|
|
140
150
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
151
|
+
// The host is a flex box that changes size without the window resizing,
|
|
152
|
+
// so App calls this from a ResizeObserver on the host. A small change (an
|
|
153
|
+
// address bar sliding, a keyboard opening) keeps the trails: the canvas
|
|
154
|
+
// keeps its size and the particles keep flowing.
|
|
155
|
+
p.fit = () => {
|
|
156
|
+
if (palette === null) return;
|
|
157
|
+
const nw = Math.max(120, host.clientWidth);
|
|
158
|
+
const nh = Math.max(120, host.clientHeight);
|
|
159
|
+
if (Math.abs(nw - w) < 48 && Math.abs(nh - h) < 120) return;
|
|
160
|
+
w = nw;
|
|
161
|
+
h = nh;
|
|
144
162
|
p.resizeCanvas(w, h);
|
|
145
163
|
p.background(palette.bg);
|
|
146
164
|
spawn();
|
|
@@ -151,18 +169,19 @@ function makeSketch({ params, host, stepsRef }) {
|
|
|
151
169
|
export default function App() {
|
|
152
170
|
const hostRef = React.useRef(null);
|
|
153
171
|
const stepsRef = React.useRef(0);
|
|
154
|
-
const [params, setParams] = React.useState({
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
});
|
|
160
|
-
const key = JSON.stringify(params);
|
|
172
|
+
const [params, setParams] = React.useState({ count: 1200, grain: 0.0022, speed: 1.6, seed: 1234 });
|
|
173
|
+
// The sliders change speed and grain on the running sketch through liveRef;
|
|
174
|
+
// only count and seed rebuild it.
|
|
175
|
+
const liveRef = React.useRef(params);
|
|
176
|
+
liveRef.current = params;
|
|
177
|
+
const key = JSON.stringify({ count: params.count, seed: params.seed });
|
|
161
178
|
|
|
162
179
|
React.useEffect(() => {
|
|
163
180
|
const node = hostRef.current;
|
|
164
181
|
if (!node) return undefined;
|
|
165
|
-
const instance = new p5(makeSketch({ params, host: node, stepsRef }), node);
|
|
182
|
+
const instance = new p5(makeSketch({ params, host: node, stepsRef, liveRef }), node);
|
|
183
|
+
const resize = new ResizeObserver(() => instance.fit());
|
|
184
|
+
resize.observe(node);
|
|
166
185
|
|
|
167
186
|
// The Style tab recolors a running app by swapping the CSS variables with
|
|
168
187
|
// no remount, which every styled element follows and the canvas cannot.
|
|
@@ -170,6 +189,7 @@ export default function App() {
|
|
|
170
189
|
const unwatch = watchLook(node, () => instance.retheme());
|
|
171
190
|
|
|
172
191
|
return () => {
|
|
192
|
+
resize.disconnect();
|
|
173
193
|
unwatch();
|
|
174
194
|
instance.remove();
|
|
175
195
|
};
|
|
@@ -177,16 +197,28 @@ export default function App() {
|
|
|
177
197
|
}, [key]);
|
|
178
198
|
|
|
179
199
|
return (
|
|
180
|
-
<
|
|
181
|
-
<
|
|
182
|
-
<div
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
200
|
+
<main className="bg-background text-foreground font-sans">
|
|
201
|
+
<section className="flex h-dvh max-h-240 flex-col gap-2 p-3 md:flex-row" style={{ paddingBottom: "var(--vibes-controls-inset, 0px)" }}>
|
|
202
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col gap-2">
|
|
203
|
+
<Row justify="between" align="center">
|
|
204
|
+
<Heading level={2}>Flow Field</Heading>
|
|
205
|
+
<Button type="button" onClick={() => setParams((prev) => ({ ...prev, seed: Math.floor(Math.random() * 100000) }))}>
|
|
206
|
+
Reseed
|
|
207
|
+
</Button>
|
|
208
|
+
</Row>
|
|
209
|
+
<div ref={hostRef} className="relative min-h-48 flex-1 overflow-hidden rounded-lg touch-none" />
|
|
210
|
+
</div>
|
|
211
|
+
<div className="shrink-0 md:w-80 md:overflow-y-auto">
|
|
212
|
+
<Card variant="tight">
|
|
213
|
+
<div className="grid grid-cols-2 gap-x-3 gap-y-1 md:grid-cols-1">
|
|
214
|
+
<Slider label="Speed" value={[params.speed]} onChange={([v]) => setParams((prev) => ({ ...prev, speed: v }))} min={0.2} max={4} step={0.1} />
|
|
215
|
+
<Slider label="Grain" value={[params.grain]} onChange={([v]) => setParams((prev) => ({ ...prev, grain: v }))} min={0.0005} max={0.006} step={0.0001} />
|
|
216
|
+
</div>
|
|
217
|
+
</Card>
|
|
218
|
+
</div>
|
|
219
|
+
</section>
|
|
220
|
+
{/* save, presets and how it works come after the block */}
|
|
221
|
+
</main>
|
|
190
222
|
);
|
|
191
223
|
}
|
|
192
224
|
```
|
|
@@ -266,6 +298,9 @@ p.windowResized = () => {
|
|
|
266
298
|
};
|
|
267
299
|
```
|
|
268
300
|
|
|
301
|
+
When the host is a flex box, as in the starter, it changes size without the
|
|
302
|
+
window resizing: a `ResizeObserver` on the host calls the same resize.
|
|
303
|
+
|
|
269
304
|
`p.resizeCanvas` clears the canvas, so a trails sketch repaints its background
|
|
270
305
|
and respawns its particles after a resize rather than resuming into an empty
|
|
271
306
|
frame.
|
|
@@ -358,6 +393,11 @@ async function keep() {
|
|
|
358
393
|
const { docs } = useLiveQuery("created", { descending: true, limit: 12 });
|
|
359
394
|
```
|
|
360
395
|
|
|
396
|
+
A kept piece saves the slider values it had at Keep, so its replay matches the
|
|
397
|
+
screen when the sliders held still while it ran; a slider moved mid-run is a
|
|
398
|
+
new piece, so reset `steps` (rebuild the instance) when one moves if the wall
|
|
399
|
+
must replay exactly.
|
|
400
|
+
|
|
361
401
|
Keep the counter to one owner. It counts calls to `advance()`, so incrementing it
|
|
362
402
|
anywhere else — in `draw`, in `step`, beside the publish — counts the same frame
|
|
363
403
|
twice, and a card then replays twice the frames that were on screen when Keep was
|
package/llms/reskin.md
CHANGED
|
@@ -65,7 +65,12 @@ palette, fonts or tokens, "use this design for the whole app": the new string
|
|
|
65
65
|
is drawn from their design alone, and the earlier skin's stripes, borders, hard
|
|
66
66
|
shadows, glow and the plain elements it added (a title bar, a menu strip) leave
|
|
67
67
|
with its colours, back only where their design asks for them, while every
|
|
68
|
-
component, control and record stays.
|
|
68
|
+
component, control and record stays. Those plain elements live in the JSX,
|
|
69
|
+
so the build takes them out of the JSX as well as out of the string.
|
|
70
|
+
An action the old chrome carried stays as a plain control of their design —
|
|
71
|
+
a menu bar's items become `Button`s, `Tabs` or a `Select` beside the heading —
|
|
72
|
+
while the bar, the window frame and the title bar themselves go, the title's
|
|
73
|
+
words becoming the `Heading`. A change to one colour or one face of the
|
|
69
74
|
skin is an edit to that value in this string, and the skin keeps its shapes and
|
|
70
75
|
chrome: "make the accent green" moves the accent token, and the title bar stays.
|
|
71
76
|
Web fonts load from Google Fonts with an `@import` at the top of that
|
|
@@ -47,5 +47,14 @@ from `@vibes.diy/ui`, so it brings the look's type, radius, border and weight wi
|
|
|
47
47
|
- Overlay text keeps the look's own foreground and muted tones at full opacity; a scrim behind it
|
|
48
48
|
comes from `bg-background` or `bg-surface`.
|
|
49
49
|
|
|
50
|
+
**The play area and its controls share one screen.** Every control the player reaches for while
|
|
51
|
+
playing — the hotbar, the joystick, Start and Pause, the tempo, the mode buttons — sits over the
|
|
52
|
+
play area or docked right against it, so a press and its result share one glance. The play area
|
|
53
|
+
takes the space the controls leave: the page is one full-height column (`flex h-dvh max-h-240 flex-col`,
|
|
54
|
+
bottom padding `var(--vibes-controls-inset, 0px)`), the canvas box is `flex-1 min-h-0` and paints
|
|
55
|
+
to its own size through a `ResizeObserver`, and the control strip is a `shrink-0` `Card` under it (buttons in
|
|
56
|
+
one wrapped `Row`, sliders in a two-column grid), or a side panel beside it from `md:` up. How-to-play notes, high-score tables and
|
|
57
|
+
settings come after the play area and its controls.
|
|
58
|
+
|
|
50
59
|
Read the first screenshot before you finish: the sky, the ground, the HUD and the title should
|
|
51
60
|
look like they came from the app's palette and type, the way its list pages do.
|
package/llms/surface-stage.md
CHANGED
|
@@ -25,21 +25,30 @@ the owner uploads. The stage is for pictures whose geometry is the point.
|
|
|
25
25
|
- **D3** to lay out data-driven shapes (scales, force graphs, trees, projections), drawn into SVG.
|
|
26
26
|
- **Canvas** for per-pixel work and simulations.
|
|
27
27
|
|
|
28
|
-
**One component per stage, set as one block.** The stage is its own component
|
|
29
|
-
`HarborScene`) with its geometry as data at the top of the file. It sits in the
|
|
30
|
-
`Card` with a `Heading
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
**One component per stage, set as one block with its controls.** The stage is its own component
|
|
29
|
+
(`DistrictMap`, `HarborScene`) with its geometry as data at the top of the file. It sits in the
|
|
30
|
+
page inside a `Card` with a `Heading`, or at the column's full width, and every control that acts
|
|
31
|
+
on it — the picker, the year, the sliders, Play, Reset, Save — is docked right against it, so a
|
|
32
|
+
change and its picture share one glance on a phone and a laptop alike. Size the stage to leave the
|
|
33
|
+
controls their room: a fixed aspect box (`aspect-video`, or `aspect-square` for a square subject)
|
|
34
|
+
holds the layout while it draws, and the controls sit in one `Row` that wraps directly under it.
|
|
35
|
+
From `md:` up the stage and its controls become two columns, the controls a side panel beside the
|
|
36
|
+
stage. The caption, legend notes and any explainer come after the stage and its controls.
|
|
33
37
|
|
|
34
38
|
```jsx
|
|
39
|
+
import { Slider } from "@vibes.diy/ui/interactive";
|
|
40
|
+
|
|
35
41
|
<Card>
|
|
36
42
|
<Stack gap={3}>
|
|
37
43
|
<Heading level={2}>Harbor traffic, 2015 to 2025</Heading>
|
|
38
|
-
<div
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
<div className="grid gap-3 md:grid-cols-3">
|
|
45
|
+
<div ref={mountRef} className="w-full aspect-video overflow-hidden select-none touch-none md:col-span-2" />
|
|
46
|
+
<Stack gap={2}>
|
|
47
|
+
<Segmented label="Chapter" tone="info" value={chapter} onChange={setChapter} options={CHAPTER_OPTIONS} />
|
|
48
|
+
<Slider label="Year" value={[year]} onChange={([y]) => setYear(y)} min={2015} max={2025} />
|
|
49
|
+
<Button variant="quiet" onClick={reset}>Reset view</Button>
|
|
50
|
+
</Stack>
|
|
51
|
+
</div>
|
|
43
52
|
<Text size="sm" muted>
|
|
44
53
|
Drag to turn the harbor. Each chapter flies the camera to its part of the story.
|
|
45
54
|
</Text>
|
|
@@ -47,6 +56,17 @@ beside it: the picker, the year, Reset, Save.
|
|
|
47
56
|
</Card>
|
|
48
57
|
```
|
|
49
58
|
|
|
59
|
+
A canvas or WebGL stage paints its own box and follows that box with a `ResizeObserver`, so it
|
|
60
|
+
keeps the size the layout gives it on every screen.
|
|
61
|
+
|
|
62
|
+
**When the stage is the whole app, it fills one screen with its controls.** When the whole app
|
|
63
|
+
is one live surface the person plays or steers as it runs (a drawing or pixel canvas, a synth, theremin, EQ or drum machine, a step sequencer, or a generative visual or particle toy), it opens with the block
|
|
64
|
+
_A surface and its controls share one screen_ shows. The block is exactly one screen tall
|
|
65
|
+
(`flex h-dvh max-h-240 flex-col`) and holds three things: a one-line heading row, the stage taking
|
|
66
|
+
the space left (`relative min-h-48 flex-1`), and every slider and button standing open in a strip
|
|
67
|
+
docked under it, a side panel from `md:` up. The look's section cards come after that block. A
|
|
68
|
+
picture set in a page, like the harbor above, keeps its `Card` and aspect box.
|
|
69
|
+
|
|
50
70
|
**The stage wears the theme's colours.** SVG fills and strokes are theme utility classes:
|
|
51
71
|
`fill-card`, `fill-muted`, `fill-primary`, `fill-accent`, `fill-foreground`, `stroke-border`,
|
|
52
72
|
`stroke-foreground`. Two sides of a story whose colours the subject leaves open are two of those tokens, and the legend beside the
|
package/llms/three-js.md
CHANGED
|
@@ -105,6 +105,14 @@ a mount box in a `Card` with the page's controls around it, framed the way the s
|
|
|
105
105
|
above shows. Size the renderer from the box (`mount.clientWidth`, `mount.clientHeight`) and watch
|
|
106
106
|
it with a `ResizeObserver`, since the box changes size without the window resizing.
|
|
107
107
|
|
|
108
|
+
A scene whose point is the controls that change it (a visualizer, a particle toy, a shader
|
|
109
|
+
playground with speed, colour and size sliders) is a live surface, laid out as the shared
|
|
110
|
+
prompt's _A surface and its controls share one screen_ shows: one block exactly one screen tall
|
|
111
|
+
(`flex h-dvh max-h-240 flex-col`), the mount box `relative min-h-48 flex-1` with the renderer sized from it through a
|
|
112
|
+
`ResizeObserver`, and every slider standing open in a strip docked under it, a side panel from
|
|
113
|
+
`md:` up. Its knobs stay out of the menu overlay, so a turn of one shows on the scene in the same
|
|
114
|
+
glance.
|
|
115
|
+
|
|
108
116
|
## An infographic in 3D
|
|
109
117
|
|
|
110
118
|
A story told with numbers stands up in 3D: each value is a bar, a tower or a slab rising off a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/prompts",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.354",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"exports": {
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@adviser/cement": "~0.5.37",
|
|
42
|
-
"@vibes.diy/api-types": "14.3.
|
|
43
|
-
"@vibes.diy/call-ai-v2": "14.3.
|
|
44
|
-
"@vibes.diy/identity": "14.3.
|
|
45
|
-
"@vibes.diy/use-vibes-types": "14.3.
|
|
42
|
+
"@vibes.diy/api-types": "14.3.354",
|
|
43
|
+
"@vibes.diy/call-ai-v2": "14.3.354",
|
|
44
|
+
"@vibes.diy/identity": "14.3.354",
|
|
45
|
+
"@vibes.diy/use-vibes-types": "14.3.354",
|
|
46
46
|
"arktype": "~2.2.9",
|
|
47
47
|
"json-schema-faker": "~0.6.4"
|
|
48
48
|
},
|
|
@@ -96,7 +96,7 @@ export default function App() {
|
|
|
96
96
|
- **Form controls take the new value itself**: `<Input value={title} onChange={setTitle} />`, never `e.target.value`, each inside a `Field` that hands it `id` and `describedBy`.
|
|
97
97
|
- **The named interaction works end to end**: the person's sentence names it, and the app builds that and only that, with realistic data. Sharing, invitations, roles, scheduled jobs, emails and outside services come in a later pass, and so does the line about who can see the data, which sits beside the share control that pass adds; the title, subtitle and hero say what the app is for.
|
|
98
98
|
- **Seed content** is realistic and specific to the app's world, with a `key` per item and the exact fields the app reads.
|
|
99
|
-
- **The picture is its own stage.** The components are the app's chrome. When the subject is a picture whose shapes carry the meaning — a voxel world, a 3D infographic, a map, a floor plan, a diagram — it is one contained stage in its own component: Three.js for depth, motion and anything explored (the most striking, reach for it), SVG for flat, exact or printable pictures (geometry as data in a `viewBox`, fills and strokes theme classes such as `fill-primary` and `stroke-foreground`, and a colour the subject names, such as a blue district or a red team, painted as that colour from a hex in the stage's data with `fill={PAINT[side]}`), D3 for data-driven layout into SVG. It sits inside a `Card` or at full width, with the components' controls
|
|
99
|
+
- **The picture is its own stage.** The components are the app's chrome. When the subject is a picture whose shapes carry the meaning — a voxel world, a 3D infographic, a map, a floor plan, a diagram — it is one contained stage in its own component: Three.js for depth, motion and anything explored (the most striking, reach for it), SVG for flat, exact or printable pictures (geometry as data in a `viewBox`, fills and strokes theme classes such as `fill-primary` and `stroke-foreground`, and a colour the subject names, such as a blue district or a red team, painted as that colour from a hex in the stage's data with `fill={PAINT[side]}`), D3 for data-driven layout into SVG. It sits inside a `Card` or at full width, sized to leave its controls room, with the components' controls docked right against it — a strip under it on a phone, a side panel beside it from `md:` up — so a change and its picture share one screen, and any explainer after both (a picture of a thing, such as a product, a dish or a cover, is a painted image instead); a tappable SVG shape is a `<g role="button" tabIndex={0} aria-label="…">` with `onClick` and an Enter/Space `onKeyDown` that calls `preventDefault()` before acting.
|
|
100
100
|
- **Layout comes from the components** (`Stack`, `Row`, `Grid`, `Card`) and their `tone`, `size` and `variant` props; plain spacing like `p-6` sits on your own wrapping elements only. The look brief below says how the page is composed.
|
|
101
101
|
- **A bar fixed to the bottom of the screen — a tab bar, a nav, a save bar — rides above the platform's controls**, so every tab and button on it stays tappable: `BottomNav` sits there by itself, and a bar of your own puts `bottom: 'var(--vibes-controls-inset, 0px)'` in its `style` instead of using `bottom-0`.
|
|
102
102
|
- **Tapping a person opens their profile**: `<ViewerTag userHandle={m.userHandle} onClick={() => setProfile(m.userHandle)} />` binds the handle the tag shows, and a hero header is `<ViewerTag userHandle={profile} size={120} avatarOnly />` — the tag itself is the button, drawn natively. Opening a profile follows nobody.
|
|
@@ -122,6 +122,46 @@ Three things happen in this order on every screen, and the first two happen for
|
|
|
122
122
|
### The first phone screen
|
|
123
123
|
|
|
124
124
|
The person and the platform's screenshot both see one phone screen, so compose it on purpose. The first phone screen holds, in this order: the heading with the one way to add beside or under it, then the view the person asked for or the records at the size the view draws them, then Ask where the app has it, then the share control with its one who-can-see line. The view this turn's ask names — a table, a grid, a total, a board — leads that screen directly under the heading, above every form, settings card and reminder, unless the person said where it goes; a reminder, setting or share they ask for keeps its own place below, and at the top means the top of the opening screen, not of a detail view. The way to add is compact: a lead button that opens the form in a Dialog or Sheet, a single-line entry, or the sentence composer; a whole form stands open only while there is nothing yet to show, its sparkle beside its submit. While the viewer is still resolving, the add keeps its place in the heading as a skeleton or a disabled button, never an empty slot. Where the app has Ask, Ask is one quiet row under the records, or the composer's second action where the composer is the way to add. The share, add-a-friend or invite button with its one line is the footer row that closes the content, and the invite screen opens from it; reminders, settings and rosters wait behind a quiet button under the content. A game's canvas or board fills the screen, its heading and controls over it or beside it, and the look carries onto the play area and every overlay, hotbar and button: its palette, type and shapes, never a stock game palette. A limiting word in the ask — just, only, simple — keeps that kit and shrinks it further into the background. In the kit's components (`@vibes.diy/ui`; another look fills each piece with its own equivalent): the add is a lead-tone `Button` in the heading's `Row`, or one `Input` with its submit; Ask is an `Input` with a quiet send `IconButton` in a `Row`; a row is a `RowCard` a tap opens into its editor, holding its fields and Change by sentence; the share is the footer `Row` shown under _A way to share_, its invite screen a `Sheet`; settings sit in a `Collapsible` or `Sheet`; a game's score and best are separate `Metric` readouts.
|
|
125
|
+
|
|
126
|
+
**A surface and its controls share one screen.** When the whole app is one live surface the person plays or steers as it runs — a drawing or pixel canvas, a synth, theremin, EQ or drum machine, a step sequencer, or a generative visual or particle toy — every control that changes it (palette, brush, sliders, knobs, tempo, play/stop, mode and tool buttons) sits on screen with it, so a turn of a knob shows on the picture in the same glance, on a phone and on a laptop alike. Everything else — a list, tracker, dashboard with a filter, map of spots, media player, quiz or board game — keeps the first screen above. Compose the live surface's screen as one block exactly one screen tall (`flex h-dvh max-h-240 flex-col`: a fixed height so the surface gives way to the strip, capped so a page embedded at its own height settles; bottom padding `var(--vibes-controls-inset, 0px)` so the strip clears the platform's switch), in three parts:
|
|
127
|
+
|
|
128
|
+
1. **One compact heading row**: a `Heading level={2}` with Play or the one lead action beside it, a single line.
|
|
129
|
+
2. **The surface, taking the space the controls leave** (`relative min-h-48 flex-1`). A canvas fills that box (`absolute inset-0 size-full`) and follows it with a `ResizeObserver`; a square subject such as a pixel grid or a board is `aspect-square h-full max-w-full mx-auto` inside it, so it fits the height it is given.
|
|
130
|
+
3. **The controls, docked right under it as one compact strip** (`shrink-0`) holding every control the ask names, all standing open: mode or tool choices in one `Segmented` or one wrapped `Row` of small buttons, then the sliders in a two-column grid (`grid grid-cols-2 gap-x-3 gap-y-1`), each a `Slider` (`@vibes.diy/ui/interactive`) with a one-word `label`. Four sliders fill two rows, so the strip stays near a third of the phone screen.
|
|
131
|
+
|
|
132
|
+
From `md:` up the block turns into a row (`md:flex-row`): the surface on the left and the strip a side panel beside it (`md:w-80 md:overflow-y-auto`, sliders one per row). Save, presets, saved items, how-to text, the share row and every other card come after the block, further down the page.
|
|
133
|
+
|
|
134
|
+
```jsx
|
|
135
|
+
import { Slider } from "@vibes.diy/ui/interactive";
|
|
136
|
+
|
|
137
|
+
<main className="bg-background text-foreground">
|
|
138
|
+
<section className="flex h-dvh max-h-240 flex-col gap-2 p-3 md:flex-row" style={{ paddingBottom: "var(--vibes-controls-inset, 0px)" }}>
|
|
139
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col gap-2">
|
|
140
|
+
<Row justify="between" align="center">
|
|
141
|
+
<Heading level={2}>Neon Drift</Heading>
|
|
142
|
+
<Button onClick={toggle}>{playing ? "Pause" : "Play"}</Button>
|
|
143
|
+
</Row>
|
|
144
|
+
<div ref={stageRef} className="relative min-h-48 flex-1 overflow-hidden rounded-lg select-none touch-none">
|
|
145
|
+
<canvas ref={canvasRef} className="absolute inset-0 size-full" />
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
<div className="shrink-0 md:w-80 md:overflow-y-auto">
|
|
149
|
+
<Card variant="tight">
|
|
150
|
+
<Stack gap={2}>
|
|
151
|
+
<Segmented label="Mode" value={mode} onChange={setMode} options={MODES} />
|
|
152
|
+
<div className="grid grid-cols-2 gap-x-3 gap-y-1 md:grid-cols-1">
|
|
153
|
+
<Slider label="Speed" value={[speed]} onChange={([v]) => setSpeed(v)} min={0} max={10} />
|
|
154
|
+
<Slider label="Hue" value={[hue]} onChange={([v]) => setHue(v)} min={0} max={360} />
|
|
155
|
+
<Slider label="Zoom" value={[zoom]} onChange={([v]) => setZoom(v)} min={1} max={8} />
|
|
156
|
+
<Slider label="Trail" value={[trail]} onChange={([v]) => setTrail(v)} min={0} max={1} step={0.05} />
|
|
157
|
+
</div>
|
|
158
|
+
</Stack>
|
|
159
|
+
</Card>
|
|
160
|
+
</div>
|
|
161
|
+
</section>
|
|
162
|
+
<div className="flex flex-col gap-4 p-3">{/* save, presets, how it works, share row */}</div>
|
|
163
|
+
</main>
|
|
164
|
+
```
|
|
125
165
|
**This turn writes the app's `access.js` with the app, every app** — the rules that decide who sees and changes each record: an app the person keeps to themselves gives each signed-in person their own collection keyed on the writer's handle, shared by adding a friend, and an ask for no access control gets rules that admit everyone (keeping it to themselves decides when an ask says both); the access skill doc carries its emit format, placement and worked examples, and the file ends with its one plain-language `// Summary:` line saying what people can do with each record. When the app needs server work (a schedule, an outside read, a notification), this turn writes its `backend.js` too, in the format the backend skill doc teaches. UI copy names the sharing those rules give, in one short line beside the share, invite or publish control: "yours alone — add a friend to share it" beside the add-a-friend control of a collection the rules keep to its person, and an open board says everyone with the link can see it. The title, subtitle and hero say what the app is for. Gate every write surface on `useVibe(dbName).can` — the liveness gate every app carries. The rules and the record shapes they key on are plumbing, with nothing on screen of their own. The object list is part of that plumbing: `App.jsx` reads the objects by their `type`, which returns the ones the person made and the ones a membership lets them into, and marks each shared one with `ViewerTag` for its maker — in the same list, or in a section that renders once there is at least one; opening a shared object reads and writes its records with that object's id, each write gated on `can`. The invite screen — the platform's `HandleInput` writing a membership into the person's object — joins this turn's `App.jsx` when the request names other people, sharing, a group, a team, a family, "we" or "our", or a person by name; a person's own collection carries it on the first screen as its add-a-friend control; every other first build offers it as one of the closing `▸` options, in the app's own words ("Let a friend add pages to your sketchbook"). The invite may wait for an option; the way to share does not: every first build that is not privacy-sensitive ships one on its first screen, and the access skill's rule picks it from what one record is — a record a person keeps for their own life (a check-in, an entry, a line in a list) belongs to a collection that is private to its person and shared by adding a friend, so the add-a-friend control is that app's first-screen share; a piece made for readers (a post, an article, a gallery piece) carries its own draft-then-publish step (the sketches example); a thing made to be seen the moment it exists lands on an always-on shared channel (the character-cast example); and a record a visitor sends the owner (an order, a booking, feedback, a message) routes to the owner's channel and the sender's own (the owner's alone when the sender is signed out), while a public record keeps its private half (contact details, costs, suppliers, who booked) on a sibling record in the owner's channel (the inbox example); and a business that serves many clients (a daycare, a tutor, a coach, a salon, a clinic, a landlord) gives each client its own record and channel, held by the owner and staff roles, with a client's invite granting only that client's channel, as each group in a bill splitter or trip planner keeps its records on its own channel (the daycare example).
|
|
126
166
|
|
|
127
167
|
After your last code block, add a short 1-2 sentence message describing the core workflow the app supports.
|
package/system-prompt-initial.md
CHANGED
|
@@ -116,6 +116,46 @@ Three things happen in this order on every screen, and the first two happen for
|
|
|
116
116
|
### The first phone screen
|
|
117
117
|
|
|
118
118
|
The person and the platform's screenshot both see one phone screen, so compose it on purpose. The first phone screen holds, in this order: the heading with the one way to add beside or under it, then the view the person asked for or the records at the size the view draws them, then Ask where the app has it, then the share control with its one who-can-see line. The view this turn's ask names — a table, a grid, a total, a board — leads that screen directly under the heading, above every form, settings card and reminder, unless the person said where it goes; a reminder, setting or share they ask for keeps its own place below, and at the top means the top of the opening screen, not of a detail view. The way to add is compact: a lead button that opens the form in a Dialog or Sheet, a single-line entry, or the sentence composer; a whole form stands open only while there is nothing yet to show, its sparkle beside its submit. While the viewer is still resolving, the add keeps its place in the heading as a skeleton or a disabled button, never an empty slot. Where the app has Ask, Ask is one quiet row under the records, or the composer's second action where the composer is the way to add. The share, add-a-friend or invite button with its one line is the footer row that closes the content, and the invite screen opens from it; reminders, settings and rosters wait behind a quiet button under the content. A game's canvas or board fills the screen, its heading and controls over it or beside it, and the look carries onto the play area and every overlay, hotbar and button: its palette, type and shapes, never a stock game palette. A limiting word in the ask — just, only, simple — keeps that kit and shrinks it further into the background. In the kit's components (`@vibes.diy/ui`; another look fills each piece with its own equivalent): the add is a lead-tone `Button` in the heading's `Row`, or one `Input` with its submit; Ask is an `Input` with a quiet send `IconButton` in a `Row`; a row is a `RowCard` a tap opens into its editor, holding its fields and Change by sentence; the share is the footer `Row` shown under _A way to share_, its invite screen a `Sheet`; settings sit in a `Collapsible` or `Sheet`; a game's score and best are separate `Metric` readouts.
|
|
119
|
+
|
|
120
|
+
**A surface and its controls share one screen.** When the whole app is one live surface the person plays or steers as it runs — a drawing or pixel canvas, a synth, theremin, EQ or drum machine, a step sequencer, or a generative visual or particle toy — every control that changes it (palette, brush, sliders, knobs, tempo, play/stop, mode and tool buttons) sits on screen with it, so a turn of a knob shows on the picture in the same glance, on a phone and on a laptop alike. Everything else — a list, tracker, dashboard with a filter, map of spots, media player, quiz or board game — keeps the first screen above. Compose the live surface's screen as one block exactly one screen tall (`flex h-dvh max-h-240 flex-col`: a fixed height so the surface gives way to the strip, capped so a page embedded at its own height settles; bottom padding `var(--vibes-controls-inset, 0px)` so the strip clears the platform's switch), in three parts:
|
|
121
|
+
|
|
122
|
+
1. **One compact heading row**: a `Heading level={2}` with Play or the one lead action beside it, a single line.
|
|
123
|
+
2. **The surface, taking the space the controls leave** (`relative min-h-48 flex-1`). A canvas fills that box (`absolute inset-0 size-full`) and follows it with a `ResizeObserver`; a square subject such as a pixel grid or a board is `aspect-square h-full max-w-full mx-auto` inside it, so it fits the height it is given.
|
|
124
|
+
3. **The controls, docked right under it as one compact strip** (`shrink-0`) holding every control the ask names, all standing open: mode or tool choices in one `Segmented` or one wrapped `Row` of small buttons, then the sliders in a two-column grid (`grid grid-cols-2 gap-x-3 gap-y-1`), each a `Slider` (`@vibes.diy/ui/interactive`) with a one-word `label`. Four sliders fill two rows, so the strip stays near a third of the phone screen.
|
|
125
|
+
|
|
126
|
+
From `md:` up the block turns into a row (`md:flex-row`): the surface on the left and the strip a side panel beside it (`md:w-80 md:overflow-y-auto`, sliders one per row). Save, presets, saved items, how-to text, the share row and every other card come after the block, further down the page.
|
|
127
|
+
|
|
128
|
+
```jsx
|
|
129
|
+
import { Slider } from "@vibes.diy/ui/interactive";
|
|
130
|
+
|
|
131
|
+
<main className="bg-background text-foreground">
|
|
132
|
+
<section className="flex h-dvh max-h-240 flex-col gap-2 p-3 md:flex-row" style={{ paddingBottom: "var(--vibes-controls-inset, 0px)" }}>
|
|
133
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col gap-2">
|
|
134
|
+
<Row justify="between" align="center">
|
|
135
|
+
<Heading level={2}>Neon Drift</Heading>
|
|
136
|
+
<Button onClick={toggle}>{playing ? "Pause" : "Play"}</Button>
|
|
137
|
+
</Row>
|
|
138
|
+
<div ref={stageRef} className="relative min-h-48 flex-1 overflow-hidden rounded-lg select-none touch-none">
|
|
139
|
+
<canvas ref={canvasRef} className="absolute inset-0 size-full" />
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<div className="shrink-0 md:w-80 md:overflow-y-auto">
|
|
143
|
+
<Card variant="tight">
|
|
144
|
+
<Stack gap={2}>
|
|
145
|
+
<Segmented label="Mode" value={mode} onChange={setMode} options={MODES} />
|
|
146
|
+
<div className="grid grid-cols-2 gap-x-3 gap-y-1 md:grid-cols-1">
|
|
147
|
+
<Slider label="Speed" value={[speed]} onChange={([v]) => setSpeed(v)} min={0} max={10} />
|
|
148
|
+
<Slider label="Hue" value={[hue]} onChange={([v]) => setHue(v)} min={0} max={360} />
|
|
149
|
+
<Slider label="Zoom" value={[zoom]} onChange={([v]) => setZoom(v)} min={1} max={8} />
|
|
150
|
+
<Slider label="Trail" value={[trail]} onChange={([v]) => setTrail(v)} min={0} max={1} step={0.05} />
|
|
151
|
+
</div>
|
|
152
|
+
</Stack>
|
|
153
|
+
</Card>
|
|
154
|
+
</div>
|
|
155
|
+
</section>
|
|
156
|
+
<div className="flex flex-col gap-4 p-3">{/* save, presets, how it works, share row */}</div>
|
|
157
|
+
</main>
|
|
158
|
+
```
|
|
119
159
|
- NO hooks beyond `useVibe`/`useViewer`, NO data wiring — those land in the feature edits.
|
|
120
160
|
|
|
121
161
|
Target ~40–60 lines. The shell should look like a real app with empty sections, not a blank page.
|
package/system-prompt.md
CHANGED
|
@@ -117,6 +117,46 @@ Three things happen in this order on every screen, and the first two happen for
|
|
|
117
117
|
|
|
118
118
|
The person and the platform's screenshot both see one phone screen, so compose it on purpose. The first phone screen holds, in this order: the heading with the one way to add beside or under it, then the view the person asked for or the records at the size the view draws them, then Ask where the app has it, then the share control with its one who-can-see line. The view this turn's ask names — a table, a grid, a total, a board — leads that screen directly under the heading, above every form, settings card and reminder, unless the person said where it goes; a reminder, setting or share they ask for keeps its own place below, and at the top means the top of the opening screen, not of a detail view. The way to add is compact: a lead button that opens the form in a Dialog or Sheet, a single-line entry, or the sentence composer; a whole form stands open only while there is nothing yet to show, its sparkle beside its submit. While the viewer is still resolving, the add keeps its place in the heading as a skeleton or a disabled button, never an empty slot. Where the app has Ask, Ask is one quiet row under the records, or the composer's second action where the composer is the way to add. The share, add-a-friend or invite button with its one line is the footer row that closes the content, and the invite screen opens from it; reminders, settings and rosters wait behind a quiet button under the content. A game's canvas or board fills the screen, its heading and controls over it or beside it, and the look carries onto the play area and every overlay, hotbar and button: its palette, type and shapes, never a stock game palette. A limiting word in the ask — just, only, simple — keeps that kit and shrinks it further into the background. In the kit's components (`@vibes.diy/ui`; another look fills each piece with its own equivalent): the add is a lead-tone `Button` in the heading's `Row`, or one `Input` with its submit; Ask is an `Input` with a quiet send `IconButton` in a `Row`; a row is a `RowCard` a tap opens into its editor, holding its fields and Change by sentence; the share is the footer `Row` shown under _A way to share_, its invite screen a `Sheet`; settings sit in a `Collapsible` or `Sheet`; a game's score and best are separate `Metric` readouts.
|
|
119
119
|
|
|
120
|
+
**A surface and its controls share one screen.** When the whole app is one live surface the person plays or steers as it runs — a drawing or pixel canvas, a synth, theremin, EQ or drum machine, a step sequencer, or a generative visual or particle toy — every control that changes it (palette, brush, sliders, knobs, tempo, play/stop, mode and tool buttons) sits on screen with it, so a turn of a knob shows on the picture in the same glance, on a phone and on a laptop alike. Everything else — a list, tracker, dashboard with a filter, map of spots, media player, quiz or board game — keeps the first screen above. Compose the live surface's screen as one block exactly one screen tall (`flex h-dvh max-h-240 flex-col`: a fixed height so the surface gives way to the strip, capped so a page embedded at its own height settles; bottom padding `var(--vibes-controls-inset, 0px)` so the strip clears the platform's switch), in three parts:
|
|
121
|
+
|
|
122
|
+
1. **One compact heading row**: a `Heading level={2}` with Play or the one lead action beside it, a single line.
|
|
123
|
+
2. **The surface, taking the space the controls leave** (`relative min-h-48 flex-1`). A canvas fills that box (`absolute inset-0 size-full`) and follows it with a `ResizeObserver`; a square subject such as a pixel grid or a board is `aspect-square h-full max-w-full mx-auto` inside it, so it fits the height it is given.
|
|
124
|
+
3. **The controls, docked right under it as one compact strip** (`shrink-0`) holding every control the ask names, all standing open: mode or tool choices in one `Segmented` or one wrapped `Row` of small buttons, then the sliders in a two-column grid (`grid grid-cols-2 gap-x-3 gap-y-1`), each a `Slider` (`@vibes.diy/ui/interactive`) with a one-word `label`. Four sliders fill two rows, so the strip stays near a third of the phone screen.
|
|
125
|
+
|
|
126
|
+
From `md:` up the block turns into a row (`md:flex-row`): the surface on the left and the strip a side panel beside it (`md:w-80 md:overflow-y-auto`, sliders one per row). Save, presets, saved items, how-to text, the share row and every other card come after the block, further down the page.
|
|
127
|
+
|
|
128
|
+
```jsx
|
|
129
|
+
import { Slider } from "@vibes.diy/ui/interactive";
|
|
130
|
+
|
|
131
|
+
<main className="bg-background text-foreground">
|
|
132
|
+
<section className="flex h-dvh max-h-240 flex-col gap-2 p-3 md:flex-row" style={{ paddingBottom: "var(--vibes-controls-inset, 0px)" }}>
|
|
133
|
+
<div className="flex min-h-0 min-w-0 flex-1 flex-col gap-2">
|
|
134
|
+
<Row justify="between" align="center">
|
|
135
|
+
<Heading level={2}>Neon Drift</Heading>
|
|
136
|
+
<Button onClick={toggle}>{playing ? "Pause" : "Play"}</Button>
|
|
137
|
+
</Row>
|
|
138
|
+
<div ref={stageRef} className="relative min-h-48 flex-1 overflow-hidden rounded-lg select-none touch-none">
|
|
139
|
+
<canvas ref={canvasRef} className="absolute inset-0 size-full" />
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<div className="shrink-0 md:w-80 md:overflow-y-auto">
|
|
143
|
+
<Card variant="tight">
|
|
144
|
+
<Stack gap={2}>
|
|
145
|
+
<Segmented label="Mode" value={mode} onChange={setMode} options={MODES} />
|
|
146
|
+
<div className="grid grid-cols-2 gap-x-3 gap-y-1 md:grid-cols-1">
|
|
147
|
+
<Slider label="Speed" value={[speed]} onChange={([v]) => setSpeed(v)} min={0} max={10} />
|
|
148
|
+
<Slider label="Hue" value={[hue]} onChange={([v]) => setHue(v)} min={0} max={360} />
|
|
149
|
+
<Slider label="Zoom" value={[zoom]} onChange={([v]) => setZoom(v)} min={1} max={8} />
|
|
150
|
+
<Slider label="Trail" value={[trail]} onChange={([v]) => setTrail(v)} min={0} max={1} step={0.05} />
|
|
151
|
+
</div>
|
|
152
|
+
</Stack>
|
|
153
|
+
</Card>
|
|
154
|
+
</div>
|
|
155
|
+
</section>
|
|
156
|
+
<div className="flex flex-col gap-4 p-3">{/* save, presets, how it works, share row */}</div>
|
|
157
|
+
</main>
|
|
158
|
+
```
|
|
159
|
+
|
|
120
160
|
**Every app gets an `access.js`**, an app the person keeps to themselves included, and the access skill doc carries the emit format, placement, and worked examples whenever a turn writes one. When an edit adds `access.js` to an app that has none, the edit owes the complete `access.js` first, then only the `App.jsx` SEARCH/REPLACE edits the rules need — any ungated write surface, and the invite screen when the request names other people, sharing or a group; every other file stays untouched, and `seed.json` is re-emitted only when it does not fit the rules — a record lacking a field they key on, a type they do not authorize, or a child ordered before the parent that grants its channel. On any turn, emit `access.js` before any `App.jsx` edit that writes a doc type it gates. Gate every write surface on `useVibe(dbName).can` regardless of whether the app has an `access.js` yet. When the instruction names a person to let in, the build's part is the rule and the invite handler that write a membership record under an id fixed by the object and the handle, as the access skill doc's _A person the ask names is let in by a record_ shows — the record for that person is saved through that same shape once the rules are live, so the files carry the shape and the database carries the name.
|
|
121
161
|
|
|
122
162
|
**Keep `access.js` in step with the data model.** The app's current `access.js` and `seed.json` are always in view (the `APP_STATE` block). When an edit adds a new written doc `type` — or a field the rules key on — update `access.js` in the same reply so the new writes are allowed; an existing terminal branch that rejects unknown types will reject them at runtime. Whenever the function changes, rewrite its closing `// Summary:` line in the same block so it still says, in plain words, who can see and change what and what a new record carries.
|
package/themes/colorsets.js
CHANGED
|
@@ -484,7 +484,9 @@ The whole vocabulary, once:
|
|
|
484
484
|
Write those class names exactly as they appear above. An arbitrary-value class
|
|
485
485
|
(\`bg-[…]\`, \`text-[…]\`, \`rounded-[…]\`, \`shadow-[…]\`, \`p-[…]\`) or an
|
|
486
486
|
inline \`style\` prop is a defect on this look, and the post-turn design lint
|
|
487
|
-
reports each one.
|
|
487
|
+
reports each one. The one exception is the platform's controls inset,
|
|
488
|
+
\`var(--vibes-controls-inset, 0px)\`, as a bottom bar's \`bottom\` or a
|
|
489
|
+
surface block's \`paddingBottom\`: no utility carries it.
|
|
488
490
|
|
|
489
491
|
Example \`classNames\` skeleton (rename keys to taste, keep the vocabulary):
|
|
490
492
|
|
|
@@ -551,7 +553,9 @@ A plain element (a wrapping \`div\`, a paragraph) speaks the same utilities the
|
|
|
551
553
|
tokens back: \`bg-background\`, \`text-foreground\`, \`text-muted-foreground\`,
|
|
552
554
|
\`bg-card text-card-foreground\`, \`border-border\`, \`font-sans\`. An
|
|
553
555
|
arbitrary-value class (\`bg-[…]\`, \`text-[…]\`, \`p-[…]\`) or an inline
|
|
554
|
-
\`style\` prop is a defect on this look; write none
|
|
556
|
+
\`style\` prop is a defect on this look; write none, save the platform's
|
|
557
|
+
controls inset, \`var(--vibes-controls-inset, 0px)\`, as a bottom bar's
|
|
558
|
+
\`bottom\` or a surface block's \`paddingBottom\`.
|
|
555
559
|
|
|
556
560
|
Example \`classNames\` skeleton for the plain elements (rename keys to taste):
|
|
557
561
|
|
|
@@ -37,7 +37,7 @@ A look component never takes a `c.*` entry and never a styling utility: its `cla
|
|
|
37
37
|
- Do not write an arbitrary-value class such as `bg-[var(--surface)]` or `p-[var(--vibes-spacing)]` — the plain utilities above already resolve to this theme.
|
|
38
38
|
- Do not put `p-*`, `bg-*`, `text-*`, `border-*`, `rounded-*`, `shadow-*`, `gap-*` or `hover:*` on a `@vibes.diy/look` component's `className`; placement only.
|
|
39
39
|
- Do not reach for `className` where a prop does the job — a `Button` changes with `variant` and `size`, and a component with no such prop gets a plain `div` wrapper.
|
|
40
|
-
- Do not write an inline `style` attribute
|
|
40
|
+
- Do not write an inline `style` attribute; the one exception is the platform's `--vibes-controls-inset` variable on a fixed bottom bar's `bottom` or a surface block's `paddingBottom`.
|
|
41
41
|
- Do not write a `:root` block or redefine any `var(--…)` the app already ships.
|
|
42
42
|
- Do not name a literal colour, size, shadow or font stack anywhere — every value arrives through a utility this theme backs.
|
|
43
43
|
- Do not put pale or white type on a pastel fill; this palette is built for ink on pastel.
|
|
@@ -16,6 +16,8 @@ Placement is a layout primitive. `Stack` stacks children vertically with an even
|
|
|
16
16
|
|
|
17
17
|
The gap scale runs from `1` to `6`: `gap={3}` between the parts of a card, `gap={5}` or `gap={6}` between sections. Give the page air; cushions never touch.
|
|
18
18
|
|
|
19
|
+
**A live surface opens on its own screen.** When the whole app is one live surface the person plays or steers as it runs — a drawing or pixel canvas, a synth, theremin, EQ or drum machine, a step sequencer, or a generative visual or particle toy — its first screen is one block exactly one screen tall, built as _A surface and its controls share one screen_ shows: a single `Row` with a `Heading level={2}` and Play or the lead action, the surface taking the space left (`flex-1`), and every control that changes it standing open in one `Card variant="tight"` docked right under it, a side panel from `md:` up. That block holds just those three: its heading row, the surface and the control card. The look's sections, eyebrows and cards come after that block, further down the page, never between the surface and its controls. An ordinary app — a list, tracker, dashboard with a filter, map of spots, media player, quiz or board game — keeps the page this brief lays out.
|
|
20
|
+
|
|
19
21
|
## Tones
|
|
20
22
|
|
|
21
23
|
A tone names a meaning, not a colour. Choose it by what the thing says:
|
|
@@ -28,7 +28,7 @@ export const POUF_VARIETY = {
|
|
|
28
28
|
archetypeGuidance: ARCHETYPES,
|
|
29
29
|
flourishGuidance: FLOURISHES,
|
|
30
30
|
framing: {
|
|
31
|
-
archetypeCoda: "This is THIS app's structural shape, built from the UI components the look brief lists and placed with `Stack`, `Row` and `Grid`. Build the whole app inside this one shape: do not blend two archetypes, and do not fall back to a desktop shape that a phone then has to recover from.",
|
|
31
|
+
archetypeCoda: "This is THIS app's structural shape, built from the UI components the look brief lists and placed with `Stack`, `Row` and `Grid`. Build the whole app inside this one shape: do not blend two archetypes, and do not fall back to a desktop shape that a phone then has to recover from. One opening comes before it: an app that is one live surface the person plays or steers (a drawing or pixel canvas, a synth, theremin, EQ or drum machine, a step sequencer, or a generative visual or particle toy) starts with the block the brief's _A live surface opens on its own screen_ describes, the surface and every control that changes it on the first screen, and this shape holds everything after that block.",
|
|
32
32
|
flourishIntro: "These are this app's ornamental touches, drawn for it and written in the look's own voice. Apply each one everywhere its affordance occurs, with no exceptions and no half-measures — a touch applied to three of five places does not read as restraint, it reads as a bug:",
|
|
33
33
|
flourishCoda: "These touches ride BESIDE the look brief above, never instead of it. Where a touch and the brief speak about the same element, the brief still governs: one lead per view, tones chosen by meaning, cushions from the package rather than by hand, and no `className` or `style` on any UI component all hold, and a touch only ever adds to them. Every touch above is a UI component and a prop it already takes; the only classes it ever writes go on a plain wrapping `div`, and never a literal colour, size or shadow, nor an arbitrary-value class such as `shadow-[var(--vibes-shadow)]`, because the room restyles the whole app by swapping token values and anything frozen into the markup survives that invisibly.",
|
|
34
34
|
},
|