devnonla-ui 0.18.1 → 0.19.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/package.json +2 -2
- package/src/chat/AgentChatbox.tsx +10 -3
- package/src/chat/AgentPanel.tsx +10 -3
- package/src/chat/index.ts +3 -1
- package/src/chat/message-ui/ChatInput.tsx +472 -98
- package/src/chat/message-ui/ChatSuggestions.tsx +105 -0
- package/src/chat/message-ui/ChatWelcome.tsx +6 -2
- package/src/chat/message-ui/commandChips.ts +127 -0
- package/src/css.d.ts +1 -0
- package/src/index.ts +0 -4
- package/src/markdown-editor/MarkdownEditor.tsx +9 -1
- package/src/markdown-editor/MarkdownPreview.tsx +83 -16
- package/src/markdown-editor/MarkdownViewer.tsx +18 -11
- package/src/markdown-editor/ReactCodeRunner.tsx +3 -3
- package/src/markdown-editor/ReactCodeSandbox.tsx +100 -30
- package/src/markdown-editor/reactSandboxFrame.css +14 -0
- package/src/markdown-editor/reactSandboxFrame.ts +26 -0
- package/src/styles.css +0 -1
- package/src/avatar/AgentAvatar.tsx +0 -332
- package/src/avatar/AgentBody.tsx +0 -458
- package/src/avatar/avatar.css +0 -600
package/src/avatar/avatar.css
DELETED
|
@@ -1,600 +0,0 @@
|
|
|
1
|
-
@keyframes nonla-avatar-blink {
|
|
2
|
-
0%,
|
|
3
|
-
46%,
|
|
4
|
-
52%,
|
|
5
|
-
100% {
|
|
6
|
-
transform: scaleY(1);
|
|
7
|
-
}
|
|
8
|
-
49% {
|
|
9
|
-
transform: scaleY(0.15);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/* Soft idle bob: rise + stretch, settle + squash. Claude-style weight. */
|
|
14
|
-
@keyframes nonla-avatar-bob {
|
|
15
|
-
0%,
|
|
16
|
-
100% {
|
|
17
|
-
transform: translate3d(0, 0, 0) scale3d(1, 1, 1);
|
|
18
|
-
}
|
|
19
|
-
45% {
|
|
20
|
-
transform: translate3d(0, -6%, 0) scale3d(0.97, 1.045, 1);
|
|
21
|
-
}
|
|
22
|
-
70% {
|
|
23
|
-
transform: translate3d(0, 1.5%, 0) scale3d(1.025, 0.97, 1);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/* The body bobs as one piece. Only the eyes travel for look. */
|
|
28
|
-
.nonla-avatar {
|
|
29
|
-
display: inline-flex;
|
|
30
|
-
flex-shrink: 0;
|
|
31
|
-
line-height: 0;
|
|
32
|
-
vertical-align: middle;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.nonla-avatar-bob {
|
|
36
|
-
display: block;
|
|
37
|
-
width: 100%;
|
|
38
|
-
height: 100%;
|
|
39
|
-
transform-origin: 50% 85%;
|
|
40
|
-
will-change: transform;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.nonla-avatar-gaze {
|
|
44
|
-
transform-box: view-box;
|
|
45
|
-
transform: translate(var(--nonla-avatar-ex, 0), var(--nonla-avatar-ey, 0));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.nonla-avatar-eyes {
|
|
49
|
-
transform-box: fill-box;
|
|
50
|
-
transform-origin: center;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.nonla-avatar[data-motion="idle"] .nonla-avatar-bob {
|
|
54
|
-
animation: nonla-avatar-bob 2.2s ease-in-out infinite;
|
|
55
|
-
animation-delay: var(--nonla-avatar-delay, 0s);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.nonla-avatar[data-motion="idle"] .nonla-avatar-gaze,
|
|
59
|
-
.nonla-body[data-motion] .nonla-avatar-gaze {
|
|
60
|
-
transition: transform 0.35s ease-out;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.nonla-avatar[data-motion="idle"] .nonla-avatar-eyes,
|
|
64
|
-
.nonla-body[data-motion="idle"] .nonla-avatar-eyes,
|
|
65
|
-
.nonla-body[data-motion="walk"] .nonla-avatar-eyes {
|
|
66
|
-
animation: nonla-avatar-blink 6.4s ease-in-out infinite;
|
|
67
|
-
animation-delay: var(--nonla-avatar-delay, 0s);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/* Seen from behind (look="up"): the eyes and mouth are on the far side of the head. */
|
|
71
|
-
.nonla-body[data-back] .nonla-avatar-gaze {
|
|
72
|
-
display: none;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
@media (prefers-reduced-motion: reduce) {
|
|
76
|
-
.nonla-avatar[data-motion] .nonla-avatar-bob,
|
|
77
|
-
.nonla-avatar[data-motion] .nonla-avatar-gaze,
|
|
78
|
-
.nonla-avatar[data-motion] .nonla-avatar-eyes {
|
|
79
|
-
animation: none;
|
|
80
|
-
transition: none;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/* —— AgentBody: stick figure. Every limb is straight in the SVG and rotates around its joint. —— */
|
|
85
|
-
|
|
86
|
-
.nonla-body {
|
|
87
|
-
position: relative;
|
|
88
|
-
display: inline-flex;
|
|
89
|
-
flex-shrink: 0;
|
|
90
|
-
line-height: 0;
|
|
91
|
-
vertical-align: middle;
|
|
92
|
-
overflow: visible;
|
|
93
|
-
|
|
94
|
-
/* One full stride (left step + right step). Docs demo moves ~84px/s at 80px wide to match. */
|
|
95
|
-
--nonla-step: 0.5s;
|
|
96
|
-
/* Gait size. 1 is a walk. `run` raises them: bigger swing, deeper knee and elbow bend, shorter stride time. */
|
|
97
|
-
--nonla-a: 1;
|
|
98
|
-
--nonla-knee: 1;
|
|
99
|
-
--nonla-elbow: 1;
|
|
100
|
-
--nonla-fold: 1;
|
|
101
|
-
/* Front / back walk: how far a leg lengthens (toward the viewer) or shortens (away) on screen. */
|
|
102
|
-
--nonla-reach: 0.35;
|
|
103
|
-
|
|
104
|
-
/* +1 walks right, -1 walks left. Angles below are written as "forward" and flipped by this. */
|
|
105
|
-
--nonla-d: 1;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/* RPG speech bubble: thick ink outline, cream fill, pointed tail, types out `say`. */
|
|
109
|
-
.nonla-body-bubble {
|
|
110
|
-
position: absolute;
|
|
111
|
-
left: 50%;
|
|
112
|
-
bottom: calc(100% - 2%);
|
|
113
|
-
z-index: 1;
|
|
114
|
-
box-sizing: border-box;
|
|
115
|
-
width: max-content;
|
|
116
|
-
max-width: var(--nonla-body-bubble-max, 160px);
|
|
117
|
-
min-width: 2.75em;
|
|
118
|
-
padding: 0.42em 0.62em 0.48em;
|
|
119
|
-
border: 2.5px solid #1c1c1c;
|
|
120
|
-
border-radius: 0.95em;
|
|
121
|
-
background: #fffef6;
|
|
122
|
-
color: #1c1c1c;
|
|
123
|
-
font-family: var(--nonla-mono-font, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
|
|
124
|
-
font-size: var(--nonla-body-bubble-size, 11px);
|
|
125
|
-
font-weight: 400;
|
|
126
|
-
line-height: 1.3;
|
|
127
|
-
letter-spacing: 0.01em;
|
|
128
|
-
text-align: left;
|
|
129
|
-
white-space: normal;
|
|
130
|
-
overflow-wrap: anywhere;
|
|
131
|
-
word-break: break-word;
|
|
132
|
-
hyphens: auto;
|
|
133
|
-
box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
|
|
134
|
-
transform: translateX(-50%);
|
|
135
|
-
transform-origin: 50% 100%;
|
|
136
|
-
pointer-events: none;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/* Outer (ink) triangle, then the cream fill on top — classic game balloon tail. */
|
|
140
|
-
.nonla-body-bubble::before,
|
|
141
|
-
.nonla-body-bubble::after {
|
|
142
|
-
content: "";
|
|
143
|
-
position: absolute;
|
|
144
|
-
left: 50%;
|
|
145
|
-
top: 100%;
|
|
146
|
-
width: 0;
|
|
147
|
-
height: 0;
|
|
148
|
-
border-style: solid;
|
|
149
|
-
border-left-color: transparent;
|
|
150
|
-
border-right-color: transparent;
|
|
151
|
-
border-bottom: 0;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.nonla-body-bubble::before {
|
|
155
|
-
margin-left: -7px;
|
|
156
|
-
border-width: 9px 7px 0;
|
|
157
|
-
border-top-color: #1c1c1c;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
.nonla-body-bubble::after {
|
|
161
|
-
margin-left: -5px;
|
|
162
|
-
margin-top: -0.5px;
|
|
163
|
-
border-width: 6.5px 5px 0;
|
|
164
|
-
border-top-color: #fffef6;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.nonla-body-bubble-text {
|
|
168
|
-
display: block;
|
|
169
|
-
position: relative;
|
|
170
|
-
z-index: 1;
|
|
171
|
-
min-height: 1.3em;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
.nonla-body-bubble-caret {
|
|
175
|
-
display: inline-block;
|
|
176
|
-
width: 0.08em;
|
|
177
|
-
height: 0.95em;
|
|
178
|
-
margin-left: 0.08em;
|
|
179
|
-
vertical-align: -0.12em;
|
|
180
|
-
background: #1c1c1c;
|
|
181
|
-
animation: nonla-body-bubble-caret 0.55s steps(1, end) infinite;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
/* Classic RPG "more text" cue while waiting on the next page. */
|
|
185
|
-
.nonla-body-bubble-more {
|
|
186
|
-
display: block;
|
|
187
|
-
width: 0;
|
|
188
|
-
height: 0;
|
|
189
|
-
margin: 0.15em auto 0;
|
|
190
|
-
border-style: solid;
|
|
191
|
-
border-width: 0.42em 0.34em 0;
|
|
192
|
-
border-color: #1c1c1c transparent transparent;
|
|
193
|
-
animation: nonla-body-bubble-caret 0.7s steps(1, end) infinite;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
.nonla-body[data-say] .nonla-body-bubble {
|
|
197
|
-
animation: nonla-body-bubble-in 0.22s cubic-bezier(0.2, 1.4, 0.4, 1) both;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
@keyframes nonla-body-bubble-in {
|
|
201
|
-
from {
|
|
202
|
-
opacity: 0;
|
|
203
|
-
transform: translateX(-50%) translateY(6px) scale(0.86);
|
|
204
|
-
}
|
|
205
|
-
to {
|
|
206
|
-
opacity: 1;
|
|
207
|
-
transform: translateX(-50%) translateY(0) scale(1);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
@keyframes nonla-body-bubble-caret {
|
|
212
|
-
0%,
|
|
213
|
-
49% {
|
|
214
|
-
opacity: 1;
|
|
215
|
-
}
|
|
216
|
-
50%,
|
|
217
|
-
100% {
|
|
218
|
-
opacity: 0;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.nonla-body[data-dir="left"] {
|
|
223
|
-
--nonla-d: -1;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.nonla-body[data-gait="run"] {
|
|
227
|
-
--nonla-step: 0.38s;
|
|
228
|
-
--nonla-a: 1.45;
|
|
229
|
-
--nonla-knee: 1.7;
|
|
230
|
-
--nonla-elbow: 2.3;
|
|
231
|
-
--nonla-fold: 1.2;
|
|
232
|
-
--nonla-reach: 0.45;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
.nonla-body svg {
|
|
236
|
-
display: block;
|
|
237
|
-
overflow: visible;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
/*
|
|
241
|
-
* Joint pivots in viewBox units (80x108). Each limb sets its own x; hip y=72, knee y=85,
|
|
242
|
-
* shoulder y=53, elbow y=61.5. Children inherit x, so a shin pivots under its own thigh.
|
|
243
|
-
*/
|
|
244
|
-
.nonla-stick-leg {
|
|
245
|
-
transform-box: view-box;
|
|
246
|
-
transform-origin: var(--nonla-x) 72px;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
.nonla-stick-shin {
|
|
250
|
-
transform-box: view-box;
|
|
251
|
-
transform-origin: var(--nonla-x) 85px;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
.nonla-stick-arm {
|
|
255
|
-
transform-box: view-box;
|
|
256
|
-
transform-origin: var(--nonla-x) 53px;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
.nonla-stick-forearm {
|
|
260
|
-
transform-box: view-box;
|
|
261
|
-
transform-origin: var(--nonla-x) 61.5px;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/* Rest pose: a small natural splay, outward on each side. Left limbs lean left, right limbs lean right. */
|
|
265
|
-
.nonla-stick-leg-b {
|
|
266
|
-
--nonla-x: 35px;
|
|
267
|
-
--nonla-rest: 2deg;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.nonla-stick-leg-f {
|
|
271
|
-
--nonla-x: 45px;
|
|
272
|
-
--nonla-rest: -2deg;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/*
|
|
276
|
-
* Rest (still / idle / talk): one continuous stick — no knee joint, so the leg does not look bent.
|
|
277
|
-
* Walk: hide the full bone and show thigh + shin so the knee can fold.
|
|
278
|
-
*/
|
|
279
|
-
.nonla-stick-thigh,
|
|
280
|
-
.nonla-stick-shin {
|
|
281
|
-
opacity: 0;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.nonla-body[data-motion="walk"] .nonla-stick-leg-bone {
|
|
285
|
-
opacity: 0;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
.nonla-body[data-motion="walk"] .nonla-stick-thigh,
|
|
289
|
-
.nonla-body[data-motion="walk"] .nonla-stick-shin {
|
|
290
|
-
opacity: 1;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
.nonla-stick-arm-b {
|
|
294
|
-
--nonla-x: 25.5px;
|
|
295
|
-
--nonla-rest: 2deg;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
.nonla-stick-arm-f {
|
|
299
|
-
--nonla-x: 54.5px;
|
|
300
|
-
--nonla-rest: -2deg;
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
.nonla-stick-leg,
|
|
304
|
-
.nonla-stick-arm {
|
|
305
|
-
transform: rotate(var(--nonla-rest, 0deg));
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/* Talk: soft bob + a small near-arm gesture. After base limb selectors (specificity order). */
|
|
309
|
-
@keyframes nonla-body-talk-bob {
|
|
310
|
-
0%,
|
|
311
|
-
100% {
|
|
312
|
-
transform: translate3d(0, 0, 0);
|
|
313
|
-
}
|
|
314
|
-
40% {
|
|
315
|
-
transform: translate3d(0, -1.6%, 0);
|
|
316
|
-
}
|
|
317
|
-
70% {
|
|
318
|
-
transform: translate3d(0, 0.4%, 0);
|
|
319
|
-
}
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
@keyframes nonla-body-talk-arm {
|
|
323
|
-
0%,
|
|
324
|
-
100% {
|
|
325
|
-
transform: rotate(calc(var(--nonla-rest, 0deg) - 18deg));
|
|
326
|
-
}
|
|
327
|
-
45% {
|
|
328
|
-
transform: rotate(calc(var(--nonla-rest, 0deg) - 32deg));
|
|
329
|
-
}
|
|
330
|
-
70% {
|
|
331
|
-
transform: rotate(calc(var(--nonla-rest, 0deg) - 14deg));
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
@keyframes nonla-body-talk-forearm {
|
|
336
|
-
0%,
|
|
337
|
-
100% {
|
|
338
|
-
transform: rotate(-28deg);
|
|
339
|
-
}
|
|
340
|
-
45% {
|
|
341
|
-
transform: rotate(-42deg);
|
|
342
|
-
}
|
|
343
|
-
70% {
|
|
344
|
-
transform: rotate(-22deg);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.nonla-body[data-motion="talk"] svg {
|
|
349
|
-
animation: nonla-body-talk-bob 1.6s ease-in-out infinite;
|
|
350
|
-
animation-delay: var(--nonla-avatar-delay, 0s);
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
.nonla-body[data-motion="talk"] .nonla-stick-arm-f {
|
|
354
|
-
animation: nonla-body-talk-arm 1.6s ease-in-out infinite;
|
|
355
|
-
animation-delay: var(--nonla-avatar-delay, 0s);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
.nonla-body[data-motion="talk"] .nonla-stick-arm-f .nonla-stick-forearm {
|
|
359
|
-
animation: nonla-body-talk-forearm 1.6s ease-in-out infinite;
|
|
360
|
-
animation-delay: var(--nonla-avatar-delay, 0s);
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
.nonla-body[data-motion="talk"] .nonla-avatar-eyes {
|
|
364
|
-
animation: nonla-avatar-blink 6.4s ease-in-out infinite;
|
|
365
|
-
animation-delay: var(--nonla-avatar-delay, 0s);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
/*
|
|
369
|
-
* Side walk (left / right). Negative angle = limb reaches forward when walking right;
|
|
370
|
-
* --nonla-d flips it for walking left.
|
|
371
|
-
*
|
|
372
|
-
* Leg, one stride:
|
|
373
|
-
* 0% heel strike: leg forward, almost straight
|
|
374
|
-
* 0-50% stance: foot stays planted, so the thigh sweeps back at a steady rate (linear)
|
|
375
|
-
* 50% toe off: leg behind the hip
|
|
376
|
-
* 50-100% swing: thigh comes forward and the knee folds to clear the ground
|
|
377
|
-
*/
|
|
378
|
-
@keyframes nonla-stick-thigh {
|
|
379
|
-
0% {
|
|
380
|
-
transform: rotate(calc(var(--nonla-d) * -28deg * var(--nonla-a)));
|
|
381
|
-
animation-timing-function: linear;
|
|
382
|
-
}
|
|
383
|
-
50% {
|
|
384
|
-
transform: rotate(calc(var(--nonla-d) * 24deg * var(--nonla-a)));
|
|
385
|
-
animation-timing-function: ease-in-out;
|
|
386
|
-
}
|
|
387
|
-
100% {
|
|
388
|
-
transform: rotate(calc(var(--nonla-d) * -28deg * var(--nonla-a)));
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/* The shin folds backward (opposite to forward) and straightens before the next heel strike. */
|
|
393
|
-
@keyframes nonla-stick-knee {
|
|
394
|
-
0% {
|
|
395
|
-
transform: rotate(calc(var(--nonla-d) * 3deg * var(--nonla-knee)));
|
|
396
|
-
}
|
|
397
|
-
14% {
|
|
398
|
-
transform: rotate(calc(var(--nonla-d) * 12deg * var(--nonla-knee)));
|
|
399
|
-
}
|
|
400
|
-
50% {
|
|
401
|
-
transform: rotate(calc(var(--nonla-d) * 14deg * var(--nonla-knee)));
|
|
402
|
-
}
|
|
403
|
-
72% {
|
|
404
|
-
transform: rotate(calc(var(--nonla-d) * 50deg * var(--nonla-knee)));
|
|
405
|
-
}
|
|
406
|
-
90% {
|
|
407
|
-
transform: rotate(calc(var(--nonla-d) * 16deg * var(--nonla-knee)));
|
|
408
|
-
}
|
|
409
|
-
100% {
|
|
410
|
-
transform: rotate(calc(var(--nonla-d) * 3deg * var(--nonla-knee)));
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/* Arms swing opposite to the leg on the same side, with a looser elbow. */
|
|
415
|
-
@keyframes nonla-stick-arm-swing {
|
|
416
|
-
0% {
|
|
417
|
-
transform: rotate(calc(var(--nonla-d) * -22deg * var(--nonla-a)));
|
|
418
|
-
}
|
|
419
|
-
50% {
|
|
420
|
-
transform: rotate(calc(var(--nonla-d) * 16deg * var(--nonla-a)));
|
|
421
|
-
}
|
|
422
|
-
100% {
|
|
423
|
-
transform: rotate(calc(var(--nonla-d) * -22deg * var(--nonla-a)));
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
@keyframes nonla-stick-elbow {
|
|
428
|
-
0% {
|
|
429
|
-
transform: rotate(calc(var(--nonla-d) * -26deg * var(--nonla-elbow)));
|
|
430
|
-
}
|
|
431
|
-
50% {
|
|
432
|
-
transform: rotate(calc(var(--nonla-d) * -6deg * var(--nonla-elbow)));
|
|
433
|
-
}
|
|
434
|
-
100% {
|
|
435
|
-
transform: rotate(calc(var(--nonla-d) * -26deg * var(--nonla-elbow)));
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
|
|
439
|
-
.nonla-body[data-motion="walk"][data-dir="left"] .nonla-stick-leg,
|
|
440
|
-
.nonla-body[data-motion="walk"][data-dir="right"] .nonla-stick-leg {
|
|
441
|
-
animation: nonla-stick-thigh var(--nonla-step) linear infinite;
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.nonla-body[data-motion="walk"][data-dir="left"] .nonla-stick-shin,
|
|
445
|
-
.nonla-body[data-motion="walk"][data-dir="right"] .nonla-stick-shin {
|
|
446
|
-
animation: nonla-stick-knee var(--nonla-step) linear infinite;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
.nonla-body[data-motion="walk"][data-dir="left"] .nonla-stick-arm,
|
|
450
|
-
.nonla-body[data-motion="walk"][data-dir="right"] .nonla-stick-arm {
|
|
451
|
-
animation: nonla-stick-arm-swing var(--nonla-step) ease-in-out infinite;
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
.nonla-body[data-motion="walk"][data-dir="left"] .nonla-stick-forearm,
|
|
455
|
-
.nonla-body[data-motion="walk"][data-dir="right"] .nonla-stick-forearm {
|
|
456
|
-
animation: nonla-stick-elbow var(--nonla-step) ease-in-out infinite;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
/*
|
|
460
|
-
* Walking toward or away from the viewer. The legs stay under the hip, and depth shows as
|
|
461
|
-
* foreshortening: a leg reaching toward the viewer is longer on screen, one reaching away is shorter.
|
|
462
|
-
* Timing is the side walk's (planted 0-50%, swing 50-100% with the knee folding at 72%), and the
|
|
463
|
-
* planted foot must stand still on the floor. The body moves on screen while it is planted, so the
|
|
464
|
-
* foot slides the other way along the leg: toward the viewer the body goes down, the foot goes up
|
|
465
|
-
* (long to short), and away from the viewer the foot goes down (short to long). It moves linearly,
|
|
466
|
-
* by 0.7 of the leg when walking (about 18 units, --nonla-reach 0.35 each way). That is the floor
|
|
467
|
-
* distance one half-stride covers on screen, so the docs demo walks vertically at SPEED_Y = 70px/s,
|
|
468
|
-
* close to the 84px/s sideways. A foot closer to the viewer sits lower, which is also what depth
|
|
469
|
-
* looks like, so the legs may reach a little past the usual foot line.
|
|
470
|
-
*/
|
|
471
|
-
@keyframes nonla-stick-step-down {
|
|
472
|
-
0% {
|
|
473
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(calc(1 + var(--nonla-reach)));
|
|
474
|
-
animation-timing-function: linear;
|
|
475
|
-
}
|
|
476
|
-
50% {
|
|
477
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(calc(1 - var(--nonla-reach)));
|
|
478
|
-
animation-timing-function: ease-out;
|
|
479
|
-
}
|
|
480
|
-
72% {
|
|
481
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(calc(1 - 0.5 * var(--nonla-fold)));
|
|
482
|
-
animation-timing-function: ease-in;
|
|
483
|
-
}
|
|
484
|
-
100% {
|
|
485
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(calc(1 + var(--nonla-reach)));
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
@keyframes nonla-stick-step-up {
|
|
490
|
-
0% {
|
|
491
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(calc(1 - var(--nonla-reach)));
|
|
492
|
-
animation-timing-function: linear;
|
|
493
|
-
}
|
|
494
|
-
50% {
|
|
495
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(calc(1 + var(--nonla-reach)));
|
|
496
|
-
animation-timing-function: ease-out;
|
|
497
|
-
}
|
|
498
|
-
72% {
|
|
499
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(calc(1 - 0.5 * var(--nonla-fold)));
|
|
500
|
-
animation-timing-function: ease-in;
|
|
501
|
-
}
|
|
502
|
-
100% {
|
|
503
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(calc(1 - var(--nonla-reach)));
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
/*
|
|
508
|
-
* Arms keep the side-walk rhythm (same period, same ease-in-out, same phase) turned to face the
|
|
509
|
-
* viewer. The swing now goes toward and away from the screen, so an angle becomes a length:
|
|
510
|
-
* 0% arm reaches forward (side walk: -22deg) and the elbow bends most (-26deg), so both
|
|
511
|
-
* segments are foreshortened, the forearm more because its angle adds up (48deg)
|
|
512
|
-
* 50% arm swings back (+16deg) and the elbow nearly straightens (-6deg): almost full length
|
|
513
|
-
* The lengths are cos(angle), a little exaggerated so the perspective reads at 80px.
|
|
514
|
-
*/
|
|
515
|
-
@keyframes nonla-stick-arm-depth {
|
|
516
|
-
0%,
|
|
517
|
-
100% {
|
|
518
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(calc(1 - 0.12 * var(--nonla-a)));
|
|
519
|
-
}
|
|
520
|
-
50% {
|
|
521
|
-
transform: rotate(var(--nonla-rest, 0deg)) scaleY(1);
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
@keyframes nonla-stick-forearm-depth {
|
|
526
|
-
0%,
|
|
527
|
-
100% {
|
|
528
|
-
transform: scaleY(calc(1 - 0.28 * var(--nonla-fold)));
|
|
529
|
-
}
|
|
530
|
-
50% {
|
|
531
|
-
transform: scaleY(1);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
.nonla-body[data-motion="walk"][data-dir="down"] .nonla-stick-leg {
|
|
536
|
-
animation: nonla-stick-step-down var(--nonla-step) linear infinite;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
.nonla-body[data-motion="walk"][data-dir="up"] .nonla-stick-leg {
|
|
540
|
-
animation: nonla-stick-step-up var(--nonla-step) linear infinite;
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
/* Seen from the front or back the legs stay parallel: no outward splay while walking. */
|
|
544
|
-
.nonla-body[data-motion="walk"][data-dir="up"] .nonla-stick-leg-b,
|
|
545
|
-
.nonla-body[data-motion="walk"][data-dir="up"] .nonla-stick-leg-f,
|
|
546
|
-
.nonla-body[data-motion="walk"][data-dir="down"] .nonla-stick-leg-b,
|
|
547
|
-
.nonla-body[data-motion="walk"][data-dir="down"] .nonla-stick-leg-f {
|
|
548
|
-
--nonla-rest: 0deg;
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
.nonla-body[data-motion="walk"][data-dir="up"] .nonla-stick-arm,
|
|
552
|
-
.nonla-body[data-motion="walk"][data-dir="down"] .nonla-stick-arm {
|
|
553
|
-
animation: nonla-stick-arm-depth var(--nonla-step) ease-in-out infinite;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
/* The forearm shortens as the elbow bends toward the viewer. The shin stays straight. */
|
|
557
|
-
.nonla-body[data-motion="walk"][data-dir="up"] .nonla-stick-shin,
|
|
558
|
-
.nonla-body[data-motion="walk"][data-dir="down"] .nonla-stick-shin {
|
|
559
|
-
animation: none;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
.nonla-body[data-motion="walk"][data-dir="up"] .nonla-stick-forearm,
|
|
563
|
-
.nonla-body[data-motion="walk"][data-dir="down"] .nonla-stick-forearm {
|
|
564
|
-
animation: nonla-stick-forearm-depth var(--nonla-step) ease-in-out infinite;
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
/*
|
|
568
|
-
* Far leg and near leg are half a stride apart. A negative delay starts an animation midway,
|
|
569
|
-
* so both legs share one keyframe set and stay in step. An arm moves with the leg on the other side.
|
|
570
|
-
* Keep this after every `animation` shorthand above: the shorthand resets the delay.
|
|
571
|
-
*/
|
|
572
|
-
.nonla-body[data-motion="walk"][data-dir] .nonla-stick-leg-b,
|
|
573
|
-
.nonla-body[data-motion="walk"][data-dir] .nonla-stick-leg-b .nonla-stick-shin,
|
|
574
|
-
.nonla-body[data-motion="walk"][data-dir] .nonla-stick-arm-f,
|
|
575
|
-
.nonla-body[data-motion="walk"][data-dir] .nonla-stick-arm-f .nonla-stick-forearm {
|
|
576
|
-
animation-delay: calc(var(--nonla-step) * -0.5);
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
@media (prefers-reduced-motion: reduce) {
|
|
580
|
-
.nonla-body[data-motion][data-dir] .nonla-stick-leg,
|
|
581
|
-
.nonla-body[data-motion][data-dir] .nonla-stick-shin,
|
|
582
|
-
.nonla-body[data-motion][data-dir] .nonla-stick-arm,
|
|
583
|
-
.nonla-body[data-motion][data-dir] .nonla-stick-forearm,
|
|
584
|
-
.nonla-body[data-motion="talk"] svg,
|
|
585
|
-
.nonla-body[data-motion="talk"] .nonla-stick-arm-f,
|
|
586
|
-
.nonla-body[data-motion="talk"] .nonla-stick-arm-f .nonla-stick-forearm,
|
|
587
|
-
.nonla-body[data-motion] .nonla-avatar-gaze,
|
|
588
|
-
.nonla-body[data-motion] .nonla-avatar-eyes,
|
|
589
|
-
.nonla-body[data-say] .nonla-body-bubble,
|
|
590
|
-
.nonla-body-bubble-caret,
|
|
591
|
-
.nonla-body-bubble-more {
|
|
592
|
-
animation: none;
|
|
593
|
-
transition: none;
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
.nonla-body-bubble-caret,
|
|
597
|
-
.nonla-body-bubble-more {
|
|
598
|
-
opacity: 1;
|
|
599
|
-
}
|
|
600
|
-
}
|