@rizom/site-rizom-ai 0.2.0-alpha.263 → 0.2.0-alpha.264
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/dist/index.js +91 -77
- package/dist/index.js.map +5 -5
- package/package.json +1 -1
- package/src/opening.tsx +55 -55
- package/src/story/living-organism.tsx +8 -2
- package/src/story/story-page.tsx +2 -1
- package/src/story.css +23 -15
package/package.json
CHANGED
package/src/opening.tsx
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
ASK_DRAWING_ATTRIBUTE,
|
|
13
13
|
ASK_LEADS_ATTRIBUTE,
|
|
14
14
|
ASK_MARK_ATTRIBUTE,
|
|
15
|
-
ASK_ROOM_ATTRIBUTE,
|
|
16
15
|
} from "@brains/contracts";
|
|
17
16
|
import { createTemplate, type Template } from "@brains/templates";
|
|
18
17
|
import { z } from "@rizom/site";
|
|
@@ -169,59 +168,15 @@ export function Opening(data: OpeningData): JSX.Element {
|
|
|
169
168
|
const headingLead = data.headingLead ?? DEFAULT_COPY.headingLead;
|
|
170
169
|
const lede = data.lede ?? DEFAULT_COPY.lede;
|
|
171
170
|
return (
|
|
172
|
-
//
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
>
|
|
182
|
-
<div
|
|
183
|
-
className="opening__words"
|
|
184
|
-
{...(data.askBox ? { [ASK_COLUMN_ATTRIBUTE]: "" } : {})}
|
|
185
|
-
>
|
|
186
|
-
{data.kicker && <p className="eyebrow">{data.kicker}</p>}
|
|
187
|
-
<h1>
|
|
188
|
-
{headingLead}
|
|
189
|
-
{data.headingAccent && (
|
|
190
|
-
<>
|
|
191
|
-
{" "}
|
|
192
|
-
<em>{data.headingAccent}</em>
|
|
193
|
-
</>
|
|
194
|
-
)}
|
|
195
|
-
</h1>
|
|
196
|
-
<p className="lede">{lede}</p>
|
|
197
|
-
{data.askBox ? (
|
|
198
|
-
<div className="ask">
|
|
199
|
-
<AskBoxHost
|
|
200
|
-
prefix="opening"
|
|
201
|
-
placeholder={data.prompt ?? undefined}
|
|
202
|
-
/>
|
|
203
|
-
{data.topics.length > 0 && (
|
|
204
|
-
<ul className="ask__topics" aria-label="Suggested questions">
|
|
205
|
-
{data.topics.map((topic) => (
|
|
206
|
-
<li key={topic}>
|
|
207
|
-
<button type="button" data-atlas-fill={topic}>
|
|
208
|
-
{topic}
|
|
209
|
-
</button>
|
|
210
|
-
</li>
|
|
211
|
-
))}
|
|
212
|
-
</ul>
|
|
213
|
-
)}
|
|
214
|
-
<script src={ASK_BOX_SCRIPT_PATH} defer />
|
|
215
|
-
</div>
|
|
216
|
-
) : (
|
|
217
|
-
data.ctaHref &&
|
|
218
|
-
data.ctaLabel && (
|
|
219
|
-
<a className="opening__door" href={data.ctaHref}>
|
|
220
|
-
{data.ctaLabel}
|
|
221
|
-
</a>
|
|
222
|
-
)
|
|
223
|
-
)}
|
|
224
|
-
</div>
|
|
171
|
+
// The drawing and the lead layer stand before the opening's words in the
|
|
172
|
+
// chapters column: on a wide screen the drawing holds the figure's place
|
|
173
|
+
// down the story, leaving only through its centre point once the reading
|
|
174
|
+
// has moved the figure on. With the box, the story is an Ask room
|
|
175
|
+
// (@brains/contracts ask-box): the words are its column, which scrolls
|
|
176
|
+
// within the screen beside the drawing; the drawing is lent to a phone's
|
|
177
|
+
// open conversation; the room draws leads from an answer's sources to
|
|
178
|
+
// the dots.
|
|
179
|
+
<>
|
|
225
180
|
<NetworkLayer {...placeNetwork(data)} lendable={data.askBox} />
|
|
226
181
|
{data.askBox && (
|
|
227
182
|
<svg
|
|
@@ -230,7 +185,52 @@ export function Opening(data: OpeningData): JSX.Element {
|
|
|
230
185
|
aria-hidden="true"
|
|
231
186
|
/>
|
|
232
187
|
)}
|
|
233
|
-
|
|
188
|
+
<section id="hero" className="chapter chapter--opening" data-title="Top">
|
|
189
|
+
<div
|
|
190
|
+
className="opening__words"
|
|
191
|
+
{...(data.askBox ? { [ASK_COLUMN_ATTRIBUTE]: "" } : {})}
|
|
192
|
+
>
|
|
193
|
+
{data.kicker && <p className="eyebrow">{data.kicker}</p>}
|
|
194
|
+
<h1>
|
|
195
|
+
{headingLead}
|
|
196
|
+
{data.headingAccent && (
|
|
197
|
+
<>
|
|
198
|
+
{" "}
|
|
199
|
+
<em>{data.headingAccent}</em>
|
|
200
|
+
</>
|
|
201
|
+
)}
|
|
202
|
+
</h1>
|
|
203
|
+
<p className="lede">{lede}</p>
|
|
204
|
+
{data.askBox ? (
|
|
205
|
+
<div className="ask">
|
|
206
|
+
<AskBoxHost
|
|
207
|
+
prefix="opening"
|
|
208
|
+
placeholder={data.prompt ?? undefined}
|
|
209
|
+
/>
|
|
210
|
+
{data.topics.length > 0 && (
|
|
211
|
+
<ul className="ask__topics" aria-label="Suggested questions">
|
|
212
|
+
{data.topics.map((topic) => (
|
|
213
|
+
<li key={topic}>
|
|
214
|
+
<button type="button" data-atlas-fill={topic}>
|
|
215
|
+
{topic}
|
|
216
|
+
</button>
|
|
217
|
+
</li>
|
|
218
|
+
))}
|
|
219
|
+
</ul>
|
|
220
|
+
)}
|
|
221
|
+
<script src={ASK_BOX_SCRIPT_PATH} defer />
|
|
222
|
+
</div>
|
|
223
|
+
) : (
|
|
224
|
+
data.ctaHref &&
|
|
225
|
+
data.ctaLabel && (
|
|
226
|
+
<a className="opening__door" href={data.ctaHref}>
|
|
227
|
+
{data.ctaLabel}
|
|
228
|
+
</a>
|
|
229
|
+
)
|
|
230
|
+
)}
|
|
231
|
+
</div>
|
|
232
|
+
</section>
|
|
233
|
+
</>
|
|
234
234
|
);
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -84,8 +84,14 @@ export const livingOrganism: Organism = organism({
|
|
|
84
84
|
),
|
|
85
85
|
},
|
|
86
86
|
stages: [
|
|
87
|
-
// The opening draws the live network itself
|
|
88
|
-
|
|
87
|
+
// The opening draws the live network itself; the first team waits at the
|
|
88
|
+
// centre point, where that network draws in, so the science opens out of
|
|
89
|
+
// it (and closes back into it when the reading returns).
|
|
90
|
+
{
|
|
91
|
+
T1: [C, 300, 0, 0],
|
|
92
|
+
T2: [C, 300, 0, 0],
|
|
93
|
+
T3: [C, 300, 0, 0],
|
|
94
|
+
},
|
|
89
95
|
// The science: a team, its shared memory glowing at the centre.
|
|
90
96
|
{
|
|
91
97
|
L: [C, 300, 8, 1],
|
package/src/story/story-page.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** @jsxImportSource react */
|
|
2
2
|
import type { JSX, ReactNode } from "react";
|
|
3
|
+
import { ASK_ROOM_ATTRIBUTE } from "@brains/contracts";
|
|
3
4
|
import type { Organism } from "./organism";
|
|
4
5
|
|
|
5
6
|
/**
|
|
@@ -56,7 +57,7 @@ export function StoryPage({
|
|
|
56
57
|
<>
|
|
57
58
|
<link rel="stylesheet" href="/styles/story.css" precedence="page" />
|
|
58
59
|
<ReadingThread />
|
|
59
|
-
<div className="story">
|
|
60
|
+
<div className="story" {...{ [ASK_ROOM_ATTRIBUTE]: "" }}>
|
|
60
61
|
<div className="chapters">{children}</div>
|
|
61
62
|
<figure
|
|
62
63
|
className={`figure ${figure.className}`}
|
package/src/story.css
CHANGED
|
@@ -784,11 +784,13 @@
|
|
|
784
784
|
width: min(100%, calc(100svh - var(--bar-height, 4.6rem) - 2rem));
|
|
785
785
|
aspect-ratio: 1;
|
|
786
786
|
}
|
|
787
|
-
/* On a wide screen the opening's drawing
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
the words
|
|
787
|
+
/* On a wide screen the opening's drawing holds the figure's place: it stands
|
|
788
|
+
before the opening in the chapters column and sticks at the figure's centre
|
|
789
|
+
line down the whole story (the story is a size container, so nothing in it
|
|
790
|
+
can be fixed to the screen). It stays while the opening is read, an answer
|
|
791
|
+
included, and the words scroll past it. Once the reading has moved the
|
|
792
|
+
figure on, it draws into its centre point and the figure's first drawing
|
|
793
|
+
opens out of that same point; back up the page, the other way round. */
|
|
792
794
|
@media not all and (max-width: 60rem) {
|
|
793
795
|
/* The words are the room's column (the kit scrolls it within the screen);
|
|
794
796
|
the bar and the opening's 4rem of padding above and below stay clear, so
|
|
@@ -796,29 +798,37 @@
|
|
|
796
798
|
.chapter--opening .opening__words {
|
|
797
799
|
--ask-column-clear: calc(8rem + var(--bar-height, 4.6rem));
|
|
798
800
|
}
|
|
799
|
-
:where(.
|
|
801
|
+
:where(.chapters) > .net-layer {
|
|
800
802
|
position: sticky;
|
|
801
|
-
order: -1;
|
|
802
803
|
top: calc(
|
|
803
804
|
var(--bar-height, 4.6rem) + (100svh - var(--bar-height, 4.6rem)) / 2
|
|
804
805
|
);
|
|
806
|
+
left: auto;
|
|
807
|
+
right: auto;
|
|
805
808
|
height: 0;
|
|
806
809
|
margin-left: calc(var(--words) + var(--words-gap));
|
|
807
810
|
width: calc(
|
|
808
811
|
100cqi - max(0px, (100cqi - 80rem) / 2) - clamp(1rem, 5vw, 5rem) -
|
|
809
812
|
var(--words) - var(--words-gap) - clamp(1rem, 6vw, 7rem)
|
|
810
813
|
);
|
|
811
|
-
|
|
814
|
+
/* Back from the point, lit at once. */
|
|
815
|
+
transition: opacity 0.3s ease;
|
|
812
816
|
}
|
|
813
|
-
:where(.
|
|
817
|
+
:where(.chapters) > .net-layer > * {
|
|
814
818
|
translate: 0 -50%;
|
|
819
|
+
transition: scale 1.2s cubic-bezier(0.3, 0.7, 0.2, 1);
|
|
820
|
+
}
|
|
821
|
+
.story:has(.figure:not([data-stage="0"])) :where(.chapters) > .net-layer > * {
|
|
822
|
+
scale: 0;
|
|
815
823
|
}
|
|
816
|
-
.story:has(.figure:not([data-stage="0"]))
|
|
817
|
-
:where(.chapter--opening)
|
|
818
|
-
> .net-layer,
|
|
824
|
+
.story:has(.figure:not([data-stage="0"])) :where(.chapters) > .net-layer,
|
|
819
825
|
.story:has(.figure:not([data-stage="0"])) .net-leads {
|
|
820
826
|
opacity: 0;
|
|
821
827
|
}
|
|
828
|
+
/* Lit while it draws in; out at the point. */
|
|
829
|
+
.story:has(.figure:not([data-stage="0"])) :where(.chapters) > .net-layer {
|
|
830
|
+
transition: opacity 0.6s ease 0.6s;
|
|
831
|
+
}
|
|
822
832
|
.net-leads {
|
|
823
833
|
transition: opacity 0.6s ease;
|
|
824
834
|
}
|
|
@@ -1460,11 +1470,9 @@
|
|
|
1460
1470
|
viewport is their frame. On a phone the opening's drawing joins the open
|
|
1461
1471
|
conversation as the first item of its scroll, a slot holding its place. */
|
|
1462
1472
|
.net-leads {
|
|
1463
|
-
position:
|
|
1473
|
+
position: absolute;
|
|
1464
1474
|
inset: 0;
|
|
1465
1475
|
z-index: 2;
|
|
1466
|
-
width: 100vw;
|
|
1467
|
-
height: 100vh;
|
|
1468
1476
|
overflow: visible;
|
|
1469
1477
|
pointer-events: none;
|
|
1470
1478
|
}
|