@nice2dev/ui-graphics 1.3.15 → 1.3.16
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/CHANGELOG.md +9 -0
- package/dist/cjs/animation/AnimatedPerson.js +470 -143
- package/dist/cjs/animation/AnimationEditor.js +289 -101
- package/dist/cjs/animation/Audience.js +83 -61
- package/dist/cjs/animation/BodyRenderer.js +69 -28
- package/dist/cjs/animation/animationHelper.js +281 -288
- package/dist/cjs/animation/characterTypes.js +200 -203
- package/dist/cjs/animation/choreoDSL.js +205 -219
- package/dist/cjs/animation/choreography.js +4 -32
- package/dist/cjs/animation/karaokeIntegration.js +68 -77
- package/dist/cjs/animation/lottieExport.js +108 -114
- package/dist/cjs/animation/motionPath.js +225 -248
- package/dist/cjs/animation/physics.js +227 -254
- package/dist/cjs/animation/rig/RigPlayer.js +53 -56
- package/dist/cjs/animation/rig/RiggedBody.js +71 -26
- package/dist/cjs/animation/rig/choreoRigBridge.js +72 -77
- package/dist/cjs/animation/rig/ik.js +13 -18
- package/dist/cjs/animation/rig/poseOps.js +34 -41
- package/dist/cjs/animation/rig/presets.js +64 -72
- package/dist/cjs/animation/rig/rigMath.js +25 -32
- package/dist/cjs/animation/rig/rigTypes.js +59 -63
- package/dist/cjs/animation/shapes/arms.js +31 -13
- package/dist/cjs/animation/shapes/eyes.js +129 -47
- package/dist/cjs/animation/shapes/hair.js +72 -45
- package/dist/cjs/animation/shapes/heads.js +131 -57
- package/dist/cjs/animation/shapes/headwear.js +47 -38
- package/dist/cjs/animation/shapes/legs.js +31 -13
- package/dist/cjs/animation/shapes/mouths.js +120 -44
- package/dist/cjs/animation/shapes/noses.js +80 -25
- package/dist/cjs/animation/shapes/outfits.js +101 -39
- package/dist/cjs/animation/shapes/torsos.js +15 -11
- package/dist/cjs/animation/spineExport.js +103 -121
- package/dist/cjs/core/LocalUI.js +108 -43
- package/dist/cjs/core/NiceBrushEngine.js +758 -552
- package/dist/cjs/core/collaboration.js +249 -251
- package/dist/cjs/core/colorBlindness.js +100 -115
- package/dist/cjs/core/dragDrop.js +155 -158
- package/dist/cjs/core/editorAsk.js +51 -41
- package/dist/cjs/core/fixes.js +140 -171
- package/dist/cjs/core/gridGuides.js +166 -201
- package/dist/cjs/core/historyVisual.js +156 -135
- package/dist/cjs/core/i18n.js +13 -14
- package/dist/cjs/core/integrations.js +238 -249
- package/dist/cjs/core/minimap.js +149 -151
- package/dist/cjs/core/plugins.js +98 -113
- package/dist/cjs/core/rtl.js +71 -83
- package/dist/cjs/core/shortcuts.js +196 -225
- package/dist/cjs/core/theme.js +142 -149
- package/dist/cjs/core/yjsCollaboration.js +232 -293
- package/dist/cjs/design/design-tools.js +12 -22
- package/dist/cjs/font/NiceFontEditor.js +877 -316
- package/dist/cjs/font/fontFormatUtils.js +388 -448
- package/dist/cjs/game/GameAsset2dEditor.js +1201 -392
- package/dist/cjs/game/GameAsset2dEditor.module.css.js +146 -5
- package/dist/cjs/game/gameAssetTypes.js +7 -16
- package/dist/cjs/game/gameAssetUtils.js +390 -413
- package/dist/cjs/game/useGameAssetEditor.js +820 -763
- package/dist/cjs/index.js +81 -84
- package/dist/cjs/nice2dev-ui-graphics.css +1 -1
- package/dist/cjs/node_modules/lib0/array.js +8 -70
- package/dist/cjs/node_modules/lib0/binary.js +3 -20
- package/dist/cjs/node_modules/lib0/broadcastchannel.js +24 -86
- package/dist/cjs/node_modules/lib0/buffer.js +15 -82
- package/dist/cjs/node_modules/lib0/conditions.js +3 -16
- package/dist/cjs/node_modules/lib0/decoding.js +108 -287
- package/dist/cjs/node_modules/lib0/dom.js +14 -44
- package/dist/cjs/node_modules/lib0/encoding.js +68 -418
- package/dist/cjs/node_modules/lib0/environment.js +26 -92
- package/dist/cjs/node_modules/lib0/error.js +5 -29
- package/dist/cjs/node_modules/lib0/function.js +27 -66
- package/dist/cjs/node_modules/lib0/iterator.js +8 -33
- package/dist/cjs/node_modules/lib0/logging.common.js +12 -22
- package/dist/cjs/node_modules/lib0/logging.js +32 -71
- package/dist/cjs/node_modules/lib0/map.js +16 -86
- package/dist/cjs/node_modules/lib0/math.js +3 -32
- package/dist/cjs/node_modules/lib0/number.js +4 -15
- package/dist/cjs/node_modules/lib0/object.js +14 -88
- package/dist/cjs/node_modules/lib0/observable.js +38 -78
- package/dist/cjs/node_modules/lib0/pair.js +3 -20
- package/dist/cjs/node_modules/lib0/prng.js +8 -77
- package/dist/cjs/node_modules/lib0/promise.js +6 -30
- package/dist/cjs/node_modules/lib0/random.js +8 -23
- package/dist/cjs/node_modules/lib0/schema.js +313 -687
- package/dist/cjs/node_modules/lib0/set.js +3 -10
- package/dist/cjs/node_modules/lib0/storage.js +20 -55
- package/dist/cjs/node_modules/lib0/string.js +17 -72
- package/dist/cjs/node_modules/lib0/symbol.js +2 -12
- package/dist/cjs/node_modules/lib0/time.js +2 -15
- package/dist/cjs/node_modules/lib0/trait/equality.js +3 -28
- package/dist/cjs/node_modules/lib0/url.js +4 -18
- package/dist/cjs/node_modules/lib0/webcrypto.js +2 -5
- package/dist/cjs/node_modules/y-protocols/auth.js +5 -19
- package/dist/cjs/node_modules/y-protocols/awareness.js +53 -116
- package/dist/cjs/node_modules/y-protocols/sync.js +16 -103
- package/dist/cjs/node_modules/y-websocket/src/y-websocket.js +77 -219
- package/dist/cjs/node_modules/yjs/dist/yjs.js +2128 -4868
- package/dist/cjs/photo/FilterThumb.js +37 -25
- package/dist/cjs/photo/NiceAITools.js +679 -467
- package/dist/cjs/photo/PhotoEditor.js +34 -20
- package/dist/cjs/photo/PhotoEditor.module.css.js +296 -5
- package/dist/cjs/photo/PhotoEditorCanvas.js +250 -91
- package/dist/cjs/photo/PhotoEditorLeftPanel.js +1086 -224
- package/dist/cjs/photo/PhotoEditorToolbar.js +135 -19
- package/dist/cjs/photo/photoEditorActions.js +89 -72
- package/dist/cjs/photo/photoEditorTypes.js +29 -32
- package/dist/cjs/photo/photoFilters.js +959 -985
- package/dist/cjs/photo/photoOverlays.js +899 -945
- package/dist/cjs/photo/photoSelection.js +427 -499
- package/dist/cjs/photo/usePhotoEditor.js +739 -741
- package/dist/cjs/pixel/HSVPicker.js +191 -175
- package/dist/cjs/pixel/PixelEditor.js +159 -48
- package/dist/cjs/pixel/PixelEditor.module.css.js +209 -5
- package/dist/cjs/pixel/PixelEditorCanvas.js +29 -16
- package/dist/cjs/pixel/PixelEditorMenuBar.js +160 -162
- package/dist/cjs/pixel/PixelEditorRightPanel.js +377 -45
- package/dist/cjs/pixel/PixelEditorStatusBar.js +47 -20
- package/dist/cjs/pixel/PixelEditorTimeline.js +106 -23
- package/dist/cjs/pixel/PixelEditorToolbar.js +99 -21
- package/dist/cjs/pixel/SpriteGeneratorPanel.js +483 -303
- package/dist/cjs/pixel/animalGeneratorPresets.js +776 -601
- package/dist/cjs/pixel/asepriteFormat.js +511 -560
- package/dist/cjs/pixel/buildingGeneratorPresets.js +693 -520
- package/dist/cjs/pixel/characterGeneratorPresets.js +644 -544
- package/dist/cjs/pixel/pixel-pro.js +52 -63
- package/dist/cjs/pixel/pixelEditorExports.js +388 -428
- package/dist/cjs/pixel/pixelEditorTypes.js +91 -108
- package/dist/cjs/pixel/pixelEditorUtils.js +519 -561
- package/dist/cjs/pixel/spriteGeneratorCore.js +206 -257
- package/dist/cjs/pixel/usePixelEditor.js +1321 -1343
- package/dist/cjs/texture/Nice3DTexturePainter.js +707 -440
- package/dist/cjs/ui/NiceUIDesigner.js +954 -527
- package/dist/cjs/vector/NiceSvgToCode.js +586 -446
- package/dist/cjs/vector/VectorEditor.js +290 -117
- package/dist/cjs/vector/VectorEditor.module.css.js +86 -5
- package/dist/cjs/vector/VectorEditorMenuBar.js +333 -275
- package/dist/cjs/vector/VectorEditorRightPanel.js +1094 -371
- package/dist/cjs/vector/VectorEditorShapeRenderer.js +198 -60
- package/dist/cjs/vector/VectorEditorStatusBar.js +39 -13
- package/dist/cjs/vector/useVectorEditor.js +848 -889
- package/dist/cjs/vector/vectorAnimation.js +110 -137
- package/dist/cjs/vector/vectorBooleanOps.js +398 -485
- package/dist/cjs/vector/vectorEditorExport.js +201 -203
- package/dist/cjs/vector/vectorEditorImport.js +173 -189
- package/dist/cjs/vector/vectorEditorTypes.js +42 -49
- package/dist/cjs/vector/vectorGradients.js +151 -174
- package/dist/cjs/vector/vectorIconExport.js +52 -59
- package/dist/cjs/vector/vectorIconImport.js +169 -219
- package/dist/esm/animation/AnimatedPerson.js +470 -141
- package/dist/esm/animation/AnimationEditor.js +290 -100
- package/dist/esm/animation/Audience.js +83 -59
- package/dist/esm/animation/BodyRenderer.js +71 -25
- package/dist/esm/animation/animationHelper.js +284 -287
- package/dist/esm/animation/characterTypes.js +204 -202
- package/dist/esm/animation/choreoDSL.js +212 -218
- package/dist/esm/animation/choreography.js +8 -31
- package/dist/esm/animation/karaokeIntegration.js +74 -76
- package/dist/esm/animation/lottieExport.js +112 -113
- package/dist/esm/animation/motionPath.js +235 -247
- package/dist/esm/animation/physics.js +235 -253
- package/dist/esm/animation/rig/RigPlayer.js +53 -54
- package/dist/esm/animation/rig/RiggedBody.js +71 -24
- package/dist/esm/animation/rig/choreoRigBridge.js +74 -76
- package/dist/esm/animation/rig/ik.js +14 -17
- package/dist/esm/animation/rig/poseOps.js +37 -40
- package/dist/esm/animation/rig/presets.js +70 -71
- package/dist/esm/animation/rig/rigMath.js +28 -31
- package/dist/esm/animation/rig/rigTypes.js +62 -62
- package/dist/esm/animation/shapes/arms.js +32 -12
- package/dist/esm/animation/shapes/eyes.js +135 -46
- package/dist/esm/animation/shapes/hair.js +80 -44
- package/dist/esm/animation/shapes/heads.js +140 -56
- package/dist/esm/animation/shapes/headwear.js +54 -37
- package/dist/esm/animation/shapes/legs.js +32 -12
- package/dist/esm/animation/shapes/mouths.js +127 -43
- package/dist/esm/animation/shapes/noses.js +87 -24
- package/dist/esm/animation/shapes/outfits.js +106 -38
- package/dist/esm/animation/shapes/torsos.js +16 -10
- package/dist/esm/animation/spineExport.js +106 -120
- package/dist/esm/core/LocalUI.js +111 -42
- package/dist/esm/core/NiceBrushEngine.js +761 -551
- package/dist/esm/core/collaboration.js +255 -250
- package/dist/esm/core/colorBlindness.js +106 -114
- package/dist/esm/core/dragDrop.js +157 -157
- package/dist/esm/core/editorAsk.js +53 -40
- package/dist/esm/core/fixes.js +145 -170
- package/dist/esm/core/gridGuides.js +178 -200
- package/dist/esm/core/historyVisual.js +158 -134
- package/dist/esm/core/i18n.js +15 -13
- package/dist/esm/core/integrations.js +244 -248
- package/dist/esm/core/minimap.js +151 -150
- package/dist/esm/core/plugins.js +102 -112
- package/dist/esm/core/rtl.js +77 -82
- package/dist/esm/core/shortcuts.js +200 -224
- package/dist/esm/core/theme.js +150 -148
- package/dist/esm/core/yjsCollaboration.js +240 -292
- package/dist/esm/design/design-tools.js +13 -21
- package/dist/esm/font/NiceFontEditor.js +880 -315
- package/dist/esm/font/fontFormatUtils.js +394 -447
- package/dist/esm/game/GameAsset2dEditor.js +1202 -391
- package/dist/esm/game/GameAsset2dEditor.module.css.js +146 -3
- package/dist/esm/game/gameAssetTypes.js +8 -15
- package/dist/esm/game/gameAssetUtils.js +408 -412
- package/dist/esm/game/useGameAssetEditor.js +821 -762
- package/dist/esm/index.js +332 -69
- package/dist/esm/nice2dev-ui-graphics.css +1 -1
- package/dist/esm/node_modules/lib0/array.js +15 -69
- package/dist/esm/node_modules/lib0/binary.js +14 -19
- package/dist/esm/node_modules/lib0/broadcastchannel.js +27 -85
- package/dist/esm/node_modules/lib0/buffer.js +20 -80
- package/dist/esm/node_modules/lib0/conditions.js +4 -15
- package/dist/esm/node_modules/lib0/decoding.js +128 -286
- package/dist/esm/node_modules/lib0/dom.js +20 -43
- package/dist/esm/node_modules/lib0/encoding.js +90 -415
- package/dist/esm/node_modules/lib0/environment.js +33 -91
- package/dist/esm/node_modules/lib0/error.js +8 -28
- package/dist/esm/node_modules/lib0/function.js +31 -65
- package/dist/esm/node_modules/lib0/iterator.js +11 -32
- package/dist/esm/node_modules/lib0/logging.common.js +22 -21
- package/dist/esm/node_modules/lib0/logging.js +44 -70
- package/dist/esm/node_modules/lib0/map.js +21 -85
- package/dist/esm/node_modules/lib0/math.js +9 -31
- package/dist/esm/node_modules/lib0/number.js +7 -14
- package/dist/esm/node_modules/lib0/object.js +26 -87
- package/dist/esm/node_modules/lib0/observable.js +40 -77
- package/dist/esm/node_modules/lib0/pair.js +5 -19
- package/dist/esm/node_modules/lib0/prng.js +15 -76
- package/dist/esm/node_modules/lib0/promise.js +7 -29
- package/dist/esm/node_modules/lib0/random.js +10 -22
- package/dist/esm/node_modules/lib0/schema.js +367 -686
- package/dist/esm/node_modules/lib0/set.js +4 -9
- package/dist/esm/node_modules/lib0/storage.js +23 -54
- package/dist/esm/node_modules/lib0/string.js +26 -71
- package/dist/esm/node_modules/lib0/symbol.js +3 -11
- package/dist/esm/node_modules/lib0/time.js +3 -14
- package/dist/esm/node_modules/lib0/trait/equality.js +5 -27
- package/dist/esm/node_modules/lib0/url.js +5 -17
- package/dist/esm/node_modules/lib0/webcrypto.js +3 -4
- package/dist/esm/node_modules/y-protocols/auth.js +7 -18
- package/dist/esm/node_modules/y-protocols/awareness.js +58 -115
- package/dist/esm/node_modules/y-protocols/sync.js +26 -102
- package/dist/esm/node_modules/y-websocket/src/y-websocket.js +82 -218
- package/dist/esm/node_modules/yjs/dist/yjs.js +2263 -4899
- package/dist/esm/photo/FilterThumb.js +37 -23
- package/dist/esm/photo/NiceAITools.js +685 -466
- package/dist/esm/photo/PhotoEditor.js +34 -18
- package/dist/esm/photo/PhotoEditor.module.css.js +296 -3
- package/dist/esm/photo/PhotoEditorCanvas.js +250 -89
- package/dist/esm/photo/PhotoEditorLeftPanel.js +1086 -222
- package/dist/esm/photo/PhotoEditorToolbar.js +135 -17
- package/dist/esm/photo/photoEditorActions.js +93 -71
- package/dist/esm/photo/photoEditorTypes.js +32 -31
- package/dist/esm/photo/photoFilters.js +967 -984
- package/dist/esm/photo/photoOverlays.js +913 -944
- package/dist/esm/photo/photoSelection.js +438 -498
- package/dist/esm/photo/usePhotoEditor.js +740 -740
- package/dist/esm/pixel/HSVPicker.js +192 -174
- package/dist/esm/pixel/PixelEditor.js +160 -47
- package/dist/esm/pixel/PixelEditor.module.css.js +209 -3
- package/dist/esm/pixel/PixelEditorCanvas.js +29 -14
- package/dist/esm/pixel/PixelEditorMenuBar.js +160 -160
- package/dist/esm/pixel/PixelEditorRightPanel.js +377 -43
- package/dist/esm/pixel/PixelEditorStatusBar.js +47 -18
- package/dist/esm/pixel/PixelEditorTimeline.js +106 -21
- package/dist/esm/pixel/PixelEditorToolbar.js +99 -19
- package/dist/esm/pixel/SpriteGeneratorPanel.js +483 -301
- package/dist/esm/pixel/animalGeneratorPresets.js +782 -600
- package/dist/esm/pixel/asepriteFormat.js +517 -559
- package/dist/esm/pixel/buildingGeneratorPresets.js +699 -519
- package/dist/esm/pixel/characterGeneratorPresets.js +650 -543
- package/dist/esm/pixel/pixel-pro.js +53 -62
- package/dist/esm/pixel/pixelEditorExports.js +397 -427
- package/dist/esm/pixel/pixelEditorTypes.js +103 -107
- package/dist/esm/pixel/pixelEditorUtils.js +551 -560
- package/dist/esm/pixel/spriteGeneratorCore.js +223 -256
- package/dist/esm/pixel/usePixelEditor.js +1322 -1342
- package/dist/esm/texture/Nice3DTexturePainter.js +709 -439
- package/dist/esm/ui/NiceUIDesigner.js +957 -526
- package/dist/esm/vector/NiceSvgToCode.js +589 -445
- package/dist/esm/vector/VectorEditor.js +291 -116
- package/dist/esm/vector/VectorEditor.module.css.js +86 -3
- package/dist/esm/vector/VectorEditorMenuBar.js +333 -273
- package/dist/esm/vector/VectorEditorRightPanel.js +1094 -369
- package/dist/esm/vector/VectorEditorShapeRenderer.js +199 -59
- package/dist/esm/vector/VectorEditorStatusBar.js +39 -11
- package/dist/esm/vector/useVectorEditor.js +849 -888
- package/dist/esm/vector/vectorAnimation.js +115 -136
- package/dist/esm/vector/vectorBooleanOps.js +401 -484
- package/dist/esm/vector/vectorEditorExport.js +207 -202
- package/dist/esm/vector/vectorEditorImport.js +174 -188
- package/dist/esm/vector/vectorEditorTypes.js +50 -48
- package/dist/esm/vector/vectorGradients.js +158 -173
- package/dist/esm/vector/vectorIconExport.js +53 -58
- package/dist/esm/vector/vectorIconImport.js +171 -218
- package/package.json +9 -15
|
@@ -1,160 +1,487 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const framerMotion = require("framer-motion");
|
|
5
|
+
const React = require("react");
|
|
6
|
+
const i18n = require("../core/i18n.js");
|
|
7
|
+
const animationHelper = require("./animationHelper.js");
|
|
8
|
+
const characterTypes = require("./characterTypes.js");
|
|
9
|
+
const NiceAnimatedPerson = ({
|
|
10
|
+
id,
|
|
11
|
+
name,
|
|
12
|
+
size,
|
|
13
|
+
score = 10,
|
|
14
|
+
startPose = "idle",
|
|
15
|
+
onReady,
|
|
16
|
+
character,
|
|
17
|
+
config,
|
|
18
|
+
pose,
|
|
19
|
+
width
|
|
20
|
+
// height intentionally ignored — kept on the type for API symmetry.
|
|
21
|
+
// colors prop is destructured for API completeness but not yet fully wired into character defaults.
|
|
22
|
+
}) => {
|
|
23
|
+
const { t } = i18n.useNiceTranslation();
|
|
24
|
+
const fx = animationHelper.usePersonControls();
|
|
25
|
+
const effectiveStartPose = pose ?? startPose;
|
|
26
|
+
const effectiveCharacter = character ?? config;
|
|
27
|
+
const effectiveSize = width ?? size;
|
|
28
|
+
const cfg = React.useMemo(
|
|
29
|
+
() => ({ ...characterTypes.DEFAULT_CHARACTER, ...effectiveCharacter ?? {} }),
|
|
30
|
+
[effectiveCharacter]
|
|
31
|
+
);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
onReady?.(fx);
|
|
34
|
+
void animationHelper.playPose(fx, effectiveStartPose, {});
|
|
35
|
+
}, [fx, onReady, effectiveStartPose]);
|
|
36
|
+
const W = cfg.size ?? effectiveSize ?? characterTypes.DEFAULT_CHARACTER.size ?? 180;
|
|
37
|
+
const skin = characterTypes.pick(cfg.face.colors, 0, "var(--anim-skin, #FFD2B3)");
|
|
38
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
+
framerMotion.motion.div,
|
|
40
|
+
{
|
|
41
|
+
id,
|
|
42
|
+
style: { width: W, height: W * 1.35, overflow: "visible" },
|
|
43
|
+
animate: fx.root,
|
|
44
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
45
|
+
"svg",
|
|
46
|
+
{
|
|
47
|
+
viewBox: "0 0 180 240",
|
|
48
|
+
width: "100%",
|
|
49
|
+
height: "100%",
|
|
50
|
+
role: "img",
|
|
51
|
+
"aria-label": cfg.name ?? name ?? t("animatedPerson.juror", "Juror"),
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.body, children: [
|
|
54
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
+
"rect",
|
|
56
|
+
{
|
|
57
|
+
x: "68",
|
|
58
|
+
y: "158",
|
|
59
|
+
width: "14",
|
|
60
|
+
height: "46",
|
|
61
|
+
rx: "6",
|
|
62
|
+
fill: characterTypes.pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg, #334155)")
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
66
|
+
"ellipse",
|
|
67
|
+
{
|
|
68
|
+
cx: "75",
|
|
69
|
+
cy: "204",
|
|
70
|
+
rx: "10",
|
|
71
|
+
ry: "5",
|
|
72
|
+
fill: characterTypes.pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg-shadow, #1E293B)")
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
76
|
+
"rect",
|
|
77
|
+
{
|
|
78
|
+
x: "98",
|
|
79
|
+
y: "158",
|
|
80
|
+
width: "14",
|
|
81
|
+
height: "46",
|
|
82
|
+
rx: "6",
|
|
83
|
+
fill: characterTypes.pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg, #334155)")
|
|
84
|
+
}
|
|
85
|
+
),
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
87
|
+
"ellipse",
|
|
88
|
+
{
|
|
89
|
+
cx: "105",
|
|
90
|
+
cy: "204",
|
|
91
|
+
rx: "10",
|
|
92
|
+
ry: "5",
|
|
93
|
+
fill: characterTypes.pick(cfg.outfit.colors, 1, "var(--anim-outfit-leg-shadow, #1E293B)")
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }),
|
|
97
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.g, { animate: fx.body, children: renderOutfit(cfg.outfit) }),
|
|
98
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "84", y: "82", width: "12", height: "12", rx: "4", fill: skin }),
|
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.leftArm, style: { transformOrigin: "64px 96px" }, children: [
|
|
100
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "36", y: "96", width: "16", height: "36", rx: "7", fill: skin }),
|
|
101
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "44", cy: "136", r: "7", fill: skin })
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.rightArm, style: { transformOrigin: "116px 96px" }, children: [
|
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "128", y: "96", width: "16", height: "36", rx: "7", fill: skin }),
|
|
105
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "136", cy: "136", r: "7", fill: skin }),
|
|
106
|
+
/* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.card, children: [
|
|
107
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
108
|
+
"rect",
|
|
109
|
+
{
|
|
110
|
+
x: "126",
|
|
111
|
+
y: "50",
|
|
112
|
+
width: "42",
|
|
113
|
+
height: "30",
|
|
114
|
+
rx: "4",
|
|
115
|
+
fill: "var(--nice-color-surface, #fff)",
|
|
116
|
+
stroke: "var(--nice-text-primary, #111)",
|
|
117
|
+
strokeWidth: 1.2
|
|
118
|
+
}
|
|
119
|
+
),
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
121
|
+
"text",
|
|
122
|
+
{
|
|
123
|
+
x: "147",
|
|
124
|
+
y: "70",
|
|
125
|
+
textAnchor: "middle",
|
|
126
|
+
fontSize: "16",
|
|
127
|
+
fontWeight: 700,
|
|
128
|
+
fill: "var(--nice-text-primary, #111)",
|
|
129
|
+
children: String(score)
|
|
130
|
+
}
|
|
131
|
+
)
|
|
132
|
+
] }),
|
|
133
|
+
renderProp(cfg.prop)
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.head, children: [
|
|
136
|
+
renderHairBack(cfg.hair),
|
|
137
|
+
renderFace(cfg.face),
|
|
138
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.g, { animate: fx.eyes, children: renderEyes(cfg.eyes) }),
|
|
139
|
+
renderNose(cfg.nose),
|
|
140
|
+
/* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.g, { animate: fx.mouth, children: renderMouth(cfg.mouth) }),
|
|
141
|
+
renderHeadwear(cfg.headwear)
|
|
142
|
+
] }),
|
|
143
|
+
/* @__PURE__ */ jsxRuntime.jsxs(framerMotion.motion.g, { animate: fx.curse, initial: { opacity: 0 }, children: [
|
|
144
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "62", y: "10", width: "56", height: "22", rx: "8", fill: "var(--nice-text-primary, #111)" }),
|
|
145
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
146
|
+
"text",
|
|
147
|
+
{
|
|
148
|
+
x: "90",
|
|
149
|
+
y: "26",
|
|
150
|
+
textAnchor: "middle",
|
|
151
|
+
fontSize: "12",
|
|
152
|
+
fill: "var(--nice-text-inverse, #fff)",
|
|
153
|
+
children: "#!%&*"
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M82 32 l4 8 l4 -8", fill: "var(--nice-text-primary, #111)" })
|
|
157
|
+
] })
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
);
|
|
28
163
|
};
|
|
29
|
-
/* ---------------- RENDERERS (redesigned proportions) ---------------- */
|
|
30
164
|
function renderOutfit(cfg) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
165
|
+
const base = characterTypes.pick(cfg.colors, 0, "var(--anim-shirt, #3B82F6)");
|
|
166
|
+
const accent = characterTypes.pick(cfg.colors, 1, base);
|
|
167
|
+
const stroke = characterTypes.pick(cfg.colors, 2, "var(--anim-stroke, #111)");
|
|
168
|
+
switch (cfg.variant) {
|
|
169
|
+
case "hoodie":
|
|
170
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
171
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
172
|
+
"rect",
|
|
173
|
+
{
|
|
174
|
+
x: "52",
|
|
175
|
+
y: "92",
|
|
176
|
+
width: "76",
|
|
177
|
+
height: "66",
|
|
178
|
+
rx: "16",
|
|
179
|
+
fill: base,
|
|
180
|
+
stroke,
|
|
181
|
+
strokeWidth: 1
|
|
182
|
+
}
|
|
183
|
+
),
|
|
184
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M52 102 Q90 72 128 102", fill: accent, opacity: 0.2 }),
|
|
185
|
+
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "94", rx: "18", ry: "6", fill: accent, opacity: 0.3 })
|
|
186
|
+
] });
|
|
187
|
+
case "suit":
|
|
188
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
189
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
190
|
+
"rect",
|
|
191
|
+
{
|
|
192
|
+
x: "52",
|
|
193
|
+
y: "92",
|
|
194
|
+
width: "76",
|
|
195
|
+
height: "66",
|
|
196
|
+
rx: "12",
|
|
197
|
+
fill: base,
|
|
198
|
+
stroke,
|
|
199
|
+
strokeWidth: 1
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M90 92 L72 118 L90 110 L108 118 Z", fill: accent, opacity: 0.75 }),
|
|
203
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "88", y: "110", width: "4", height: "48", fill: "#fff", opacity: 0.8 }),
|
|
204
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "120", r: "2", fill: stroke }),
|
|
205
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "134", r: "2", fill: stroke })
|
|
206
|
+
] });
|
|
207
|
+
case "dress":
|
|
208
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
209
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
210
|
+
"rect",
|
|
211
|
+
{
|
|
212
|
+
x: "52",
|
|
213
|
+
y: "92",
|
|
214
|
+
width: "76",
|
|
215
|
+
height: "56",
|
|
216
|
+
rx: "14",
|
|
217
|
+
fill: base,
|
|
218
|
+
stroke,
|
|
219
|
+
strokeWidth: 1
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M52 148 L128 148 L136 168 L44 168 Z", fill: accent })
|
|
223
|
+
] });
|
|
224
|
+
case "tee":
|
|
225
|
+
default:
|
|
226
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
227
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
228
|
+
"rect",
|
|
229
|
+
{
|
|
230
|
+
x: "52",
|
|
231
|
+
y: "92",
|
|
232
|
+
width: "76",
|
|
233
|
+
height: "66",
|
|
234
|
+
rx: "14",
|
|
235
|
+
fill: base,
|
|
236
|
+
stroke,
|
|
237
|
+
strokeWidth: 1
|
|
238
|
+
}
|
|
239
|
+
),
|
|
240
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
241
|
+
"path",
|
|
242
|
+
{
|
|
243
|
+
d: "M82 92 L90 100 L98 92",
|
|
244
|
+
fill: "none",
|
|
245
|
+
stroke,
|
|
246
|
+
strokeWidth: 1,
|
|
247
|
+
opacity: 0.4
|
|
248
|
+
}
|
|
249
|
+
)
|
|
250
|
+
] });
|
|
251
|
+
}
|
|
45
252
|
}
|
|
46
253
|
function renderHairBack(cfg) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
254
|
+
const base = characterTypes.pick(cfg.colors, 0, "var(--anim-hair, #1F2937)");
|
|
255
|
+
const hi = characterTypes.pick(cfg.colors, 1, base);
|
|
256
|
+
switch (cfg.variant) {
|
|
257
|
+
case "long":
|
|
258
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
259
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M60 46 Q90 22 120 46 L120 76 Q90 92 60 76 Z", fill: base }),
|
|
260
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M90 46 Q92 56 102 62", stroke: hi, strokeWidth: 2.5, opacity: 0.35 })
|
|
261
|
+
] });
|
|
262
|
+
case "curly":
|
|
263
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
264
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M66 40 q10 -14 22 0 q10 -14 22 0 l0 12 q-32 12 -64 0 Z", fill: base }),
|
|
265
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "66", cy: "44", r: "5", fill: base }),
|
|
266
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "114", cy: "44", r: "5", fill: base })
|
|
267
|
+
] });
|
|
268
|
+
case "mohawk":
|
|
269
|
+
return /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M82 28 L98 28 L100 50 L80 50 Z", fill: base });
|
|
270
|
+
case "short":
|
|
271
|
+
return /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M68 47 C78 24, 102 24, 112 47 L68 47 Z", fill: base });
|
|
272
|
+
case "none":
|
|
273
|
+
default:
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
62
276
|
}
|
|
63
277
|
function renderFace(cfg) {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
278
|
+
const skin = characterTypes.pick(cfg.colors, 0, "var(--anim-skin, #FFD2B3)");
|
|
279
|
+
const shadow = characterTypes.pick(cfg.colors, 1, skin);
|
|
280
|
+
const stroke = characterTypes.pick(cfg.colors, 2, "var(--anim-stroke, #111)");
|
|
281
|
+
switch (cfg.variant) {
|
|
282
|
+
case "oval":
|
|
283
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
284
|
+
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "60", rx: "26", ry: "28", fill: skin, stroke, strokeWidth: 1 }),
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
|
|
286
|
+
] });
|
|
287
|
+
case "square":
|
|
288
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
289
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
290
|
+
"rect",
|
|
291
|
+
{
|
|
292
|
+
x: "64",
|
|
293
|
+
y: "36",
|
|
294
|
+
width: "52",
|
|
295
|
+
height: "48",
|
|
296
|
+
rx: "12",
|
|
297
|
+
fill: skin,
|
|
298
|
+
stroke,
|
|
299
|
+
strokeWidth: 1
|
|
300
|
+
}
|
|
301
|
+
),
|
|
302
|
+
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
|
|
303
|
+
] });
|
|
304
|
+
case "heart":
|
|
305
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
306
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
307
|
+
"path",
|
|
308
|
+
{
|
|
309
|
+
d: "M90 36 q-18 10 -18 26 q0 16 18 26 q18 -10 18 -26 q0 -16 -18 -26 Z",
|
|
310
|
+
fill: skin,
|
|
311
|
+
stroke,
|
|
312
|
+
strokeWidth: 1
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
|
|
316
|
+
] });
|
|
317
|
+
case "round":
|
|
318
|
+
default:
|
|
319
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
320
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "60", r: "26", fill: skin, stroke, strokeWidth: 1 }),
|
|
321
|
+
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "16", ry: "5", fill: shadow, opacity: 0.08 })
|
|
322
|
+
] });
|
|
323
|
+
}
|
|
78
324
|
}
|
|
79
325
|
function renderEyes(cfg) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
326
|
+
const base = characterTypes.pick(cfg.colors, 0, "var(--anim-eye-base, #111)");
|
|
327
|
+
switch (cfg.variant) {
|
|
328
|
+
case "oval":
|
|
329
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
330
|
+
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "80", cy: "56", rx: "4.5", ry: "3.5", fill: base }),
|
|
331
|
+
/* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "100", cy: "56", rx: "4.5", ry: "3.5", fill: base }),
|
|
332
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "81.5", cy: "55", r: "1.2", fill: "#fff", opacity: 0.7 }),
|
|
333
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "101.5", cy: "55", r: "1.2", fill: "#fff", opacity: 0.7 })
|
|
334
|
+
] });
|
|
335
|
+
case "laugh":
|
|
336
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
337
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
338
|
+
"path",
|
|
339
|
+
{
|
|
340
|
+
d: "M76 56 q4 -4 8 0",
|
|
341
|
+
stroke: base,
|
|
342
|
+
strokeWidth: 2.5,
|
|
343
|
+
fill: "none",
|
|
344
|
+
strokeLinecap: "round"
|
|
345
|
+
}
|
|
346
|
+
),
|
|
347
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
348
|
+
"path",
|
|
349
|
+
{
|
|
350
|
+
d: "M96 56 q4 -4 8 0",
|
|
351
|
+
stroke: base,
|
|
352
|
+
strokeWidth: 2.5,
|
|
353
|
+
fill: "none",
|
|
354
|
+
strokeLinecap: "round"
|
|
355
|
+
}
|
|
356
|
+
)
|
|
357
|
+
] });
|
|
358
|
+
case "wink":
|
|
359
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
360
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }),
|
|
361
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: "#fff", opacity: 0.7 }),
|
|
362
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })
|
|
363
|
+
] });
|
|
364
|
+
case "sleepy":
|
|
365
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
366
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M76 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" }),
|
|
367
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M96 56 l8 0", stroke: base, strokeWidth: 2.5, strokeLinecap: "round" })
|
|
368
|
+
] });
|
|
369
|
+
case "dot":
|
|
370
|
+
default:
|
|
371
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
372
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "80", cy: "56", r: "3.5", fill: base }),
|
|
373
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "100", cy: "56", r: "3.5", fill: base }),
|
|
374
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "81.5", cy: "55", r: "1", fill: "#fff", opacity: 0.7 }),
|
|
375
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "101.5", cy: "55", r: "1", fill: "#fff", opacity: 0.7 })
|
|
376
|
+
] });
|
|
377
|
+
}
|
|
94
378
|
}
|
|
95
379
|
function renderNose(cfg) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
380
|
+
const base = characterTypes.pick(cfg.colors, 0, "var(--anim-nose, #111)");
|
|
381
|
+
switch (cfg.variant) {
|
|
382
|
+
case "triangle":
|
|
383
|
+
return /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M90 62 l-4 8 h8 Z", fill: base, opacity: 0.6 });
|
|
384
|
+
case "round":
|
|
385
|
+
return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "66", r: "3", fill: base, opacity: 0.6 });
|
|
386
|
+
case "line":
|
|
387
|
+
default:
|
|
388
|
+
return /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "89", y: "62", width: "2", height: "8", fill: base, rx: "1", opacity: 0.5 });
|
|
389
|
+
}
|
|
106
390
|
}
|
|
107
391
|
function renderMouth(cfg) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
392
|
+
const base = characterTypes.pick(cfg.colors, 0, "var(--anim-mouth-base, #111)");
|
|
393
|
+
const tooth = characterTypes.pick(cfg.colors, 1, "var(--white, #fff)");
|
|
394
|
+
switch (cfg.variant) {
|
|
395
|
+
case "frown":
|
|
396
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
397
|
+
"path",
|
|
398
|
+
{
|
|
399
|
+
d: "M80 76 q10 -6 20 0",
|
|
400
|
+
stroke: base,
|
|
401
|
+
strokeWidth: 2.5,
|
|
402
|
+
fill: "none",
|
|
403
|
+
strokeLinecap: "round"
|
|
404
|
+
}
|
|
405
|
+
);
|
|
406
|
+
case "open":
|
|
407
|
+
return /* @__PURE__ */ jsxRuntime.jsx("ellipse", { cx: "90", cy: "76", rx: "7", ry: "5", fill: base });
|
|
408
|
+
case "flat":
|
|
409
|
+
return /* @__PURE__ */ jsxRuntime.jsx("rect", { x: "82", y: "75", width: "16", height: "2.5", rx: "1.25", fill: base });
|
|
410
|
+
case "o":
|
|
411
|
+
return /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "90", cy: "76", r: "4", fill: base });
|
|
412
|
+
case "teeth":
|
|
413
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
414
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "82", y: "74", width: "16", height: "7", rx: "3", fill: base }),
|
|
415
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "84", y: "75", width: "12", height: "3", rx: "1", fill: tooth })
|
|
416
|
+
] });
|
|
417
|
+
case "smile":
|
|
418
|
+
default:
|
|
419
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
420
|
+
"path",
|
|
421
|
+
{
|
|
422
|
+
d: "M80 76 q10 8 20 0",
|
|
423
|
+
stroke: base,
|
|
424
|
+
strokeWidth: 2.5,
|
|
425
|
+
fill: "none",
|
|
426
|
+
strokeLinecap: "round"
|
|
427
|
+
}
|
|
428
|
+
);
|
|
429
|
+
}
|
|
125
430
|
}
|
|
126
431
|
function renderHeadwear(cfg) {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
432
|
+
const base = characterTypes.pick(cfg.colors, 0, "var(--anim-headwear-base, #111)");
|
|
433
|
+
const accent = characterTypes.pick(cfg.colors, 1, base);
|
|
434
|
+
switch (cfg.variant) {
|
|
435
|
+
case "cap":
|
|
436
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
437
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M68 44 q22 -18 44 0 l-6 4 q-18 -10 -28 0 Z", fill: base }),
|
|
438
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "60", y: "44", width: "52", height: "5", rx: "2", fill: base })
|
|
439
|
+
] });
|
|
440
|
+
case "headphones":
|
|
441
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
442
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M66 56 q0 -24 24 -24 q24 0 24 24", stroke: base, strokeWidth: 5, fill: "none" }),
|
|
443
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "58", y: "52", width: "12", height: "16", rx: "4", fill: accent }),
|
|
444
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "110", y: "52", width: "12", height: "16", rx: "4", fill: accent })
|
|
445
|
+
] });
|
|
446
|
+
case "hat":
|
|
447
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
448
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "62", y: "38", width: "56", height: "8", rx: "3", fill: base }),
|
|
449
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "72", y: "30", width: "36", height: "10", rx: "3", fill: base })
|
|
450
|
+
] });
|
|
451
|
+
case "crown":
|
|
452
|
+
return /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M72 42 l6 12 l6 -10 l6 10 l6 -10 l6 12 v6 h-30 Z", fill: base });
|
|
453
|
+
case "none":
|
|
454
|
+
default:
|
|
455
|
+
return null;
|
|
456
|
+
}
|
|
142
457
|
}
|
|
143
458
|
function renderProp(cfg) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
459
|
+
const base = characterTypes.pick(cfg.colors, 0, "var(--anim-prop-base, #111)");
|
|
460
|
+
const accent = characterTypes.pick(cfg.colors, 1, "var(--anim-prop-accent, #666)");
|
|
461
|
+
const light = characterTypes.pick(cfg.colors, 2, "var(--anim-prop-light, #CCC)");
|
|
462
|
+
switch (cfg.variant) {
|
|
463
|
+
case "mic":
|
|
464
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(140,90)", children: [
|
|
465
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0", y: "0", width: "4", height: "16", rx: "2", fill: accent }),
|
|
466
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "2", cy: "-2", r: "6", fill: base, stroke: light, strokeWidth: 1 })
|
|
467
|
+
] });
|
|
468
|
+
case "clipboard":
|
|
469
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("g", { transform: "translate(140,86)", children: [
|
|
470
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "-6", y: "-2", width: "20", height: "26", rx: "3", fill: light, stroke: base }),
|
|
471
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0", y: "-6", width: "8", height: "6", rx: "2", fill: base })
|
|
472
|
+
] });
|
|
473
|
+
case "star":
|
|
474
|
+
return /* @__PURE__ */ jsxRuntime.jsx("g", { transform: "translate(140,86)", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
475
|
+
"path",
|
|
476
|
+
{
|
|
477
|
+
d: "M8 0 L10 6 L16 6 L11 10 L13 16 L8 12 L3 16 L5 10 L0 6 L6 6 Z",
|
|
478
|
+
fill: accent,
|
|
479
|
+
stroke: base
|
|
480
|
+
}
|
|
481
|
+
) });
|
|
482
|
+
case "none":
|
|
483
|
+
default:
|
|
484
|
+
return null;
|
|
485
|
+
}
|
|
158
486
|
}
|
|
159
|
-
|
|
160
|
-
module.exports = NiceAnimatedPerson;
|
|
487
|
+
exports.default = NiceAnimatedPerson;
|