@dotcraft/avatar 0.6.3 → 0.6.4

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.
Files changed (61) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +46 -43
  3. package/dist/accessories.css +14 -14
  4. package/dist/avatar.css +62 -62
  5. package/dist/composer/ComposerMascot.d.ts +1 -1
  6. package/dist/composer/ComposerMascot.d.ts.map +1 -1
  7. package/dist/composer/ComposerMascot.js +2 -2
  8. package/dist/composer/ComposerMascot.js.map +1 -1
  9. package/dist/composer/styles/energy.css +99 -99
  10. package/dist/composer/styles/expressions.css +20 -20
  11. package/dist/composer/styles/feedback.css +188 -188
  12. package/dist/composer/styles/focus.css +72 -72
  13. package/dist/composer/styles/foundation.css +301 -287
  14. package/dist/composer/styles/idle.css +438 -438
  15. package/dist/composer/styles/overdrive.css +264 -264
  16. package/dist/composer/styles/props.css +21 -21
  17. package/dist/composer/types.d.ts +1 -0
  18. package/dist/composer/types.d.ts.map +1 -1
  19. package/dist/rig.css +265 -265
  20. package/dist/styles.css +13 -13
  21. package/package.json +56 -55
  22. package/src/AnimatedDecoration.tsx +43 -0
  23. package/src/AppearanceRig.tsx +15 -0
  24. package/src/Avatar.tsx +85 -0
  25. package/src/DecorationShapes.tsx +8 -0
  26. package/src/Decorations.tsx +31 -0
  27. package/src/Faces.tsx +37 -0
  28. package/src/HatDecorations.tsx +75 -0
  29. package/src/HeldDecorations.tsx +48 -0
  30. package/src/MascotRig.tsx +191 -0
  31. package/src/ObjectDecorations.tsx +55 -0
  32. package/src/accessories.css +14 -0
  33. package/src/appearanceModel.ts +65 -0
  34. package/src/avatar.css +62 -0
  35. package/src/characters.ts +5 -0
  36. package/src/composer/ComposerMascot.tsx +521 -0
  37. package/src/composer/ComposerMascotShadow.tsx +5 -0
  38. package/src/composer/constants.ts +68 -0
  39. package/src/composer/mascotHandoff.ts +19 -0
  40. package/src/composer/styles/energy.css +99 -0
  41. package/src/composer/styles/expressions.css +20 -0
  42. package/src/composer/styles/feedback.css +188 -0
  43. package/src/composer/styles/focus.css +72 -0
  44. package/src/composer/styles/foundation.css +301 -0
  45. package/src/composer/styles/idle.css +438 -0
  46. package/src/composer/styles/overdrive.css +264 -0
  47. package/src/composer/styles/props.css +21 -0
  48. package/src/composer/types.ts +32 -0
  49. package/src/composer/useComposerAvatarBehavior.ts +97 -0
  50. package/src/composer/useComposerMotion.ts +15 -0
  51. package/src/composer/useComposerProfile.ts +50 -0
  52. package/src/decorationCatalog.ts +45 -0
  53. package/src/decorationMotion.ts +68 -0
  54. package/src/environment.ts +46 -0
  55. package/src/index.ts +5 -0
  56. package/src/palette.ts +52 -0
  57. package/src/react.ts +6 -0
  58. package/src/rig.css +265 -0
  59. package/src/styles.css +13 -0
  60. package/src/useEventReplay.ts +13 -0
  61. package/src/useGesture.ts +51 -0
@@ -0,0 +1,301 @@
1
+ [data-mascot-theme='dark'] {
2
+ --dca-theme-surface: #141515;
3
+ --dca-theme-ink: #eeeeec;
4
+ --dca-theme-dimmed: color-mix(in srgb, var(--dca-theme-ink) 42%, var(--dca-theme-surface));
5
+ --dca-theme-success: #22c55e;
6
+ }
7
+
8
+ [data-mascot-theme='light'] {
9
+ --dca-theme-surface: #ffffff;
10
+ --dca-theme-ink: #1a1c1f;
11
+ --dca-theme-dimmed: color-mix(in srgb, var(--dca-theme-ink) 50%, var(--dca-theme-surface));
12
+ --dca-theme-success: #16a34a;
13
+ }
14
+
15
+ @keyframes composer-mascot-breathe {
16
+ 0%,
17
+ 100% {
18
+ transform: scale(1);
19
+ }
20
+ 50% {
21
+ transform: scale(1.035);
22
+ }
23
+ }
24
+
25
+ .composer-mascot-breathe {
26
+ animation: composer-mascot-breathe 4s ease-in-out infinite;
27
+ transform-origin: bottom center;
28
+ will-change: transform;
29
+ }
30
+
31
+ .composer-mascot-motion {
32
+ position: relative;
33
+ }
34
+
35
+ .composer-mascot-motion > div:first-child {
36
+ position: relative;
37
+ z-index: 2;
38
+ }
39
+
40
+ .composer-mascot-fast-echo {
41
+ display: grid;
42
+ line-height: 0;
43
+ transform-origin: bottom center;
44
+ }
45
+
46
+ .composer-mascot-character-stage {
47
+ display: grid;
48
+ width: 58px;
49
+ height: 58px;
50
+ overflow: visible;
51
+ }
52
+
53
+
54
+ [data-mascot-speed='fast'] .composer-mascot-motion {
55
+ --mascot-fast-shift-base: oklch(from var(--mascot-energy-accent)
56
+ clamp(0.5, calc(l + 0.22), 0.96) clamp(0.06, calc(c * 0.88), 0.27) calc(h + 92));
57
+ --mascot-fast-echo-left: color-mix(in oklab, var(--mascot-energy-accent) 68%, var(--dca-theme-ink));
58
+ --mascot-fast-echo-right: color-mix(in oklab, var(--mascot-fast-shift-base) 78%, var(--dca-theme-ink));
59
+ }
60
+
61
+ [data-mascot-speed='fast'] .composer-mascot-fast-echo {
62
+ animation: composer-mascot-fast-soft-echo 5.8s cubic-bezier(0.45, 0, 0.55, 1) infinite;
63
+ will-change: filter;
64
+ }
65
+
66
+ @keyframes composer-mascot-fast-soft-echo {
67
+ 0%, 100% {
68
+ filter:
69
+ drop-shadow(-2.1px 0 0.18px rgb(from var(--mascot-fast-echo-left) r g b / 0.58))
70
+ drop-shadow(-4px 0 0.25px rgb(from var(--mascot-fast-echo-left) r g b / 0.22))
71
+ drop-shadow(1.3px 0 0.2px rgb(from var(--mascot-fast-echo-right) r g b / 0.28))
72
+ drop-shadow(2.7px 0 0.25px rgb(from var(--mascot-fast-echo-right) r g b / 0.1));
73
+ }
74
+ 50% {
75
+ filter:
76
+ drop-shadow(-1.3px 0 0.2px rgb(from var(--mascot-fast-echo-left) r g b / 0.28))
77
+ drop-shadow(-2.7px 0 0.25px rgb(from var(--mascot-fast-echo-left) r g b / 0.1))
78
+ drop-shadow(2.1px 0 0.18px rgb(from var(--mascot-fast-echo-right) r g b / 0.58))
79
+ drop-shadow(4px 0 0.25px rgb(from var(--mascot-fast-echo-right) r g b / 0.22));
80
+ }
81
+ }
82
+
83
+ [data-mascot-theme='light'][data-mascot-speed='fast'] .composer-mascot-motion {
84
+ --mascot-fast-light-edge-base: oklch(from var(--mascot-energy-accent)
85
+ clamp(0.38, calc(l + 0.12), 0.94) clamp(0.05, calc(c * 0.92), 0.28) calc(h + 8));
86
+ --mascot-fast-light-echo-left: color-mix(in oklab, var(--mascot-fast-light-edge-base) 58%, var(--dca-theme-surface));
87
+ --mascot-fast-light-echo-right: color-mix(in oklab, var(--mascot-fast-shift-base) 54%, var(--dca-theme-surface));
88
+ }
89
+
90
+ [data-mascot-theme='light'][data-mascot-speed='fast'] .composer-mascot-fast-echo {
91
+ animation-name: composer-mascot-fast-soft-echo-light;
92
+ }
93
+
94
+ @keyframes composer-mascot-fast-soft-echo-light {
95
+ 0%, 100% {
96
+ filter:
97
+ drop-shadow(-1.55px 0 1.25px rgb(from var(--mascot-fast-light-echo-left) r g b / 0.3))
98
+ drop-shadow(-3px 0 2.8px rgb(from var(--mascot-fast-light-echo-left) r g b / 0.09))
99
+ drop-shadow(1.1px 0 1.35px rgb(from var(--mascot-fast-light-echo-right) r g b / 0.16))
100
+ drop-shadow(2.5px 0 2.8px rgb(from var(--mascot-fast-light-echo-right) r g b / 0.05));
101
+ }
102
+ 50% {
103
+ filter:
104
+ drop-shadow(-1.1px 0 1.35px rgb(from var(--mascot-fast-light-echo-left) r g b / 0.16))
105
+ drop-shadow(-2.5px 0 2.8px rgb(from var(--mascot-fast-light-echo-left) r g b / 0.05))
106
+ drop-shadow(1.55px 0 1.25px rgb(from var(--mascot-fast-light-echo-right) r g b / 0.3))
107
+ drop-shadow(3px 0 2.8px rgb(from var(--mascot-fast-light-echo-right) r g b / 0.09));
108
+ }
109
+ }
110
+
111
+ @keyframes composer-mascot-energy-medium-dark {
112
+ 0%, 38%, 100% { stop-color: var(--mascot-body-dark); }
113
+ 14% {
114
+ stop-color: oklch(from var(--mascot-body-dark)
115
+ clamp(0.28, calc(l + 0.0573), 0.96)
116
+ clamp(0, calc(c * 0.909), 0.3)
117
+ calc(h - 0.1));
118
+ }
119
+ }
120
+
121
+ @keyframes composer-mascot-energy-medium-mid {
122
+ 0%, 24%, 70%, 100% { stop-color: var(--mascot-body-mid); }
123
+ 46% {
124
+ stop-color: oklch(from var(--mascot-body-mid)
125
+ clamp(0.28, calc(l + 0.0796), 0.96)
126
+ clamp(0, calc(c * 0.814), 0.3)
127
+ calc(h - 0.56));
128
+ }
129
+ }
130
+
131
+ @keyframes composer-mascot-energy-medium-light {
132
+ 0%, 50%, 94%, 100% { stop-color: var(--mascot-body-light); }
133
+ 72% {
134
+ stop-color: oklch(from var(--mascot-body-light)
135
+ clamp(0.28, calc(l + 0.1052), 0.96)
136
+ clamp(0, calc(c * 0.569), 0.3)
137
+ calc(h + 1.57));
138
+ }
139
+ }
140
+
141
+ @keyframes composer-mascot-energy-high-dark {
142
+ 0%, 32%, 100% {
143
+ stop-color: oklch(from var(--mascot-body-dark)
144
+ clamp(0.28, calc(l - 0.0373), 0.96)
145
+ clamp(0, calc(c * 0.987), 0.3)
146
+ calc(h - 0.32));
147
+ }
148
+ 12% {
149
+ stop-color: oklch(from var(--mascot-body-dark)
150
+ clamp(0.28, calc(l + 0.0829), 0.96)
151
+ clamp(0, calc(c * 0.846), 0.3)
152
+ calc(h - 2.77));
153
+ }
154
+ }
155
+
156
+ @keyframes composer-mascot-energy-high-mid {
157
+ 0%, 22%, 60%, 100% {
158
+ stop-color: oklch(from var(--mascot-body-mid)
159
+ clamp(0.28, calc(l - 0.0386), 0.96)
160
+ clamp(0, calc(c * 1.211), 0.3)
161
+ calc(h - 3.62));
162
+ }
163
+ 40% {
164
+ stop-color: oklch(from var(--mascot-body-mid)
165
+ clamp(0.28, calc(l + 0.1298), 0.96)
166
+ clamp(0, calc(c * 0.662), 0.3)
167
+ calc(h - 9.24));
168
+ }
169
+ }
170
+
171
+ @keyframes composer-mascot-energy-high-light {
172
+ 0%, 48%, 86%, 100% {
173
+ stop-color: oklch(from var(--mascot-body-light)
174
+ clamp(0.28, calc(l - 0.0112), 0.96)
175
+ clamp(0, calc(c * 1.047), 0.3)
176
+ calc(h - 9.36));
177
+ }
178
+ 66% {
179
+ stop-color: oklch(from var(--mascot-body-light)
180
+ clamp(0.28, calc(l + 0.1713), 0.96)
181
+ clamp(0, calc(c * 0.314), 0.3)
182
+ calc(h - 9.37));
183
+ }
184
+ }
185
+
186
+ @keyframes composer-mascot-energy-high-mark-dark {
187
+ 0%, 44%, 100% {
188
+ stop-color: oklch(from var(--mascot-mark-dark)
189
+ clamp(0.28, calc(l + 0.0017), 0.96)
190
+ clamp(0, calc(c * 0.995), 0.3)
191
+ calc(h - 0.12));
192
+ }
193
+ 22% {
194
+ stop-color: oklch(from var(--mascot-mark-dark)
195
+ clamp(0.28, calc(l + 0.1236), 0.96)
196
+ clamp(0, calc(c * 0.758), 0.3)
197
+ calc(h - 3.57));
198
+ }
199
+ }
200
+
201
+ @keyframes composer-mascot-energy-high-mark-light {
202
+ 0%, 42%, 86%, 100% {
203
+ stop-color: oklch(from var(--mascot-mark-energy)
204
+ clamp(0.28, calc(l + 0.05), 0.96)
205
+ clamp(0, calc(c * 0.913), 0.3)
206
+ calc(h - 1.66));
207
+ }
208
+ 64% {
209
+ stop-color: oklch(from var(--mascot-mark-energy)
210
+ clamp(0.28, calc(l + 0.2226), 0.96)
211
+ clamp(0, calc(c * 0.409), 0.3)
212
+ calc(h - 12.45));
213
+ }
214
+ }
215
+
216
+ @keyframes composer-mascot-energy-extra-dark {
217
+ 0%, 36%, 100% {
218
+ stop-color: oklch(from var(--mascot-body-dark)
219
+ clamp(0.28, calc(l - 0.0021), 0.96)
220
+ clamp(0, calc(c * 0.983), 0.3)
221
+ calc(h + 2.19));
222
+ }
223
+ 16% {
224
+ stop-color: oklch(from var(--mascot-body-dark)
225
+ clamp(0.28, calc(l + 0.0559), 0.96)
226
+ clamp(0, calc(c * 1.002), 0.3)
227
+ calc(h + 40.24));
228
+ }
229
+ }
230
+
231
+ @keyframes composer-mascot-energy-extra-mid {
232
+ 0%, 24%, 64%, 100% {
233
+ stop-color: oklch(from var(--mascot-body-mid)
234
+ clamp(0.28, calc(l - 0.0159), 0.96)
235
+ clamp(0, calc(c * 1.133), 0.3)
236
+ calc(h + 1.9));
237
+ }
238
+ 44% {
239
+ stop-color: oklch(from var(--mascot-body-mid)
240
+ clamp(0.28, calc(l + 0.0032), 0.96)
241
+ clamp(0, calc(c * 1.303), 0.3)
242
+ calc(h + 41.78));
243
+ }
244
+ }
245
+
246
+ @keyframes composer-mascot-energy-extra-light {
247
+ 0%, 50%, 90%, 100% {
248
+ stop-color: oklch(from var(--mascot-body-light)
249
+ clamp(0.28, calc(l + 0.0239), 0.96)
250
+ clamp(0, calc(c * 0.896), 0.3)
251
+ calc(h - 2.67));
252
+ }
253
+ 70% {
254
+ stop-color: oklch(from var(--mascot-body-light)
255
+ clamp(0.28, calc(l + 0.0668), 0.96)
256
+ clamp(0, calc(c * 1.057), 0.3)
257
+ calc(h + 42.19));
258
+ }
259
+ }
260
+
261
+ @keyframes composer-mascot-energy-extra-mark-dark {
262
+ 0%, 46%, 100% {
263
+ stop-color: oklch(from var(--mascot-mark-dark)
264
+ clamp(0.28, calc(l + 0.0159), 0.96)
265
+ clamp(0, calc(c * 0.965), 0.3)
266
+ calc(h + 1.45));
267
+ }
268
+ 24% {
269
+ stop-color: oklch(from var(--mascot-mark-dark)
270
+ clamp(0.28, calc(l + 0.0437), 0.96)
271
+ clamp(0, calc(c * 0.993), 0.3)
272
+ calc(h + 36.73));
273
+ }
274
+ }
275
+
276
+ @keyframes composer-mascot-energy-extra-mark-light {
277
+ 0%, 46%, 90%, 100% {
278
+ stop-color: oklch(from var(--mascot-mark-energy)
279
+ clamp(0.28, calc(l + 0.0697), 0.96)
280
+ clamp(0, calc(c * 0.851), 0.3)
281
+ calc(h + 0.49));
282
+ }
283
+ 68% {
284
+ stop-color: oklch(from var(--mascot-mark-energy)
285
+ clamp(0.28, calc(l + 0.1058), 0.96)
286
+ clamp(0, calc(c * 0.995), 0.3)
287
+ calc(h + 45.19));
288
+ }
289
+ }
290
+
291
+ .composer-mascot-contact-shadow {
292
+ position: absolute;
293
+ right: 68px;
294
+ top: 1px;
295
+ width: 72px;
296
+ height: 24px;
297
+ transform: translateX(50%);
298
+ border-radius: 50%;
299
+ filter: blur(2px);
300
+ pointer-events: none;
301
+ }