@mumulinya167/ccm-pet-assets 2.0.0
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/README.md +4 -0
- package/assets/calico/calico-collapsing.apng +0 -0
- package/assets/calico/calico-dozing.apng +0 -0
- package/assets/calico/calico-error.apng +0 -0
- package/assets/calico/calico-happy.apng +0 -0
- package/assets/calico/calico-idle-follow.svg +324 -0
- package/assets/calico/calico-idle.apng +0 -0
- package/assets/calico/calico-mini-alert.apng +0 -0
- package/assets/calico/calico-mini-crabwalk.apng +0 -0
- package/assets/calico/calico-mini-enter.apng +0 -0
- package/assets/calico/calico-mini-happy.apng +0 -0
- package/assets/calico/calico-mini-idle.apng +0 -0
- package/assets/calico/calico-mini-peek.apng +0 -0
- package/assets/calico/calico-mini-sleep.apng +0 -0
- package/assets/calico/calico-notification.apng +0 -0
- package/assets/calico/calico-react-drag.apng +0 -0
- package/assets/calico/calico-react-left.apng +0 -0
- package/assets/calico/calico-react-poke.apng +0 -0
- package/assets/calico/calico-sleeping.apng +0 -0
- package/assets/calico/calico-thinking.apng +0 -0
- package/assets/calico/calico-waking.apng +0 -0
- package/assets/calico/calico-working-building.apng +0 -0
- package/assets/calico/calico-working-carrying.apng +0 -0
- package/assets/calico/calico-working-conducting.apng +0 -0
- package/assets/calico/calico-working-juggling.apng +0 -0
- package/assets/calico/calico-working-sweeping.apng +0 -0
- package/assets/calico/calico-working-typing.apng +0 -0
- package/assets/calico/calico-yawning.apng +0 -0
- package/assets/calico.svg +324 -0
- package/assets/clawd/LICENSE +22 -0
- package/assets/clawd/clawd-about-hero.svg +202 -0
- package/assets/clawd/clawd-collapse-sleep.svg +247 -0
- package/assets/clawd/clawd-error.svg +94 -0
- package/assets/clawd/clawd-happy.svg +161 -0
- package/assets/clawd/clawd-headphones-groove.svg +194 -0
- package/assets/clawd/clawd-idle-bubble.svg +180 -0
- package/assets/clawd/clawd-idle-collapse.svg +101 -0
- package/assets/clawd/clawd-idle-doze.svg +72 -0
- package/assets/clawd/clawd-idle-follow.svg +64 -0
- package/assets/clawd/clawd-idle-living.svg +196 -0
- package/assets/clawd/clawd-idle-look.svg +115 -0
- package/assets/clawd/clawd-idle-reading.svg +252 -0
- package/assets/clawd/clawd-idle-yawn.svg +158 -0
- package/assets/clawd/clawd-mini-alert.svg +129 -0
- package/assets/clawd/clawd-mini-crabwalk.svg +76 -0
- package/assets/clawd/clawd-mini-enter-sleep.svg +64 -0
- package/assets/clawd/clawd-mini-enter.svg +114 -0
- package/assets/clawd/clawd-mini-happy.svg +124 -0
- package/assets/clawd/clawd-mini-idle.svg +83 -0
- package/assets/clawd/clawd-mini-peek.svg +82 -0
- package/assets/clawd/clawd-mini-sleep.svg +112 -0
- package/assets/clawd/clawd-mini-typing.svg +153 -0
- package/assets/clawd/clawd-notification.svg +438 -0
- package/assets/clawd/clawd-react-annoyed.svg +167 -0
- package/assets/clawd/clawd-react-double-jump.svg +229 -0
- package/assets/clawd/clawd-react-double.svg +108 -0
- package/assets/clawd/clawd-react-drag.svg +102 -0
- package/assets/clawd/clawd-react-left.svg +102 -0
- package/assets/clawd/clawd-react-right.svg +102 -0
- package/assets/clawd/clawd-sleeping.svg +118 -0
- package/assets/clawd/clawd-static-base.svg +21 -0
- package/assets/clawd/clawd-wake.svg +277 -0
- package/assets/clawd/clawd-working-building.svg +329 -0
- package/assets/clawd/clawd-working-carrying.svg +178 -0
- package/assets/clawd/clawd-working-debugger.svg +245 -0
- package/assets/clawd/clawd-working-juggling.svg +183 -0
- package/assets/clawd/clawd-working-sweeping.svg +248 -0
- package/assets/clawd/clawd-working-thinking.svg +501 -0
- package/assets/clawd/clawd-working-typing-boss.svg +307 -0
- package/assets/clawd/clawd-working-typing.svg +273 -0
- package/assets/clawd/clawd-working-ultrathink.svg +166 -0
- package/assets/clawd/clawd-working-wizard.svg +356 -0
- package/assets/clawd.svg +64 -0
- package/assets/cloudling/cloudling/cloudling-attention.svg +380 -0
- package/assets/cloudling/cloudling/cloudling-building.svg +667 -0
- package/assets/cloudling/cloudling/cloudling-carrying.svg +604 -0
- package/assets/cloudling/cloudling/cloudling-conducting.svg +616 -0
- package/assets/cloudling/cloudling/cloudling-dozing-to-sleeping.svg +578 -0
- package/assets/cloudling/cloudling/cloudling-dozing.svg +358 -0
- package/assets/cloudling/cloudling/cloudling-error.svg +428 -0
- package/assets/cloudling/cloudling/cloudling-idle-reading.svg +658 -0
- package/assets/cloudling/cloudling/cloudling-idle-to-dozing.svg +568 -0
- package/assets/cloudling/cloudling/cloudling-idle-to-sleeping.svg +811 -0
- package/assets/cloudling/cloudling/cloudling-idle.svg +255 -0
- package/assets/cloudling/cloudling/cloudling-juggling.svg +648 -0
- package/assets/cloudling/cloudling/cloudling-mini-alert.svg +390 -0
- package/assets/cloudling/cloudling/cloudling-mini-crabwalk.svg +335 -0
- package/assets/cloudling/cloudling/cloudling-mini-enter-roll-in.svg +226 -0
- package/assets/cloudling/cloudling/cloudling-mini-enter-sleep.svg +232 -0
- package/assets/cloudling/cloudling/cloudling-mini-happy.svg +371 -0
- package/assets/cloudling/cloudling/cloudling-mini-idle.svg +279 -0
- package/assets/cloudling/cloudling/cloudling-mini-peek.svg +328 -0
- package/assets/cloudling/cloudling/cloudling-mini-sleep.svg +260 -0
- package/assets/cloudling/cloudling/cloudling-mini-typing.svg +692 -0
- package/assets/cloudling/cloudling/cloudling-notification.svg +494 -0
- package/assets/cloudling/cloudling/cloudling-react-drag.svg +83 -0
- package/assets/cloudling/cloudling/cloudling-sleeping-to-idle.svg +555 -0
- package/assets/cloudling/cloudling/cloudling-sleeping.svg +500 -0
- package/assets/cloudling/cloudling/cloudling-sweeping.svg +292 -0
- package/assets/cloudling/cloudling/cloudling-thinking.svg +720 -0
- package/assets/cloudling/cloudling/cloudling-typing.svg +354 -0
- package/assets/cloudling/cloudling-attention.svg +380 -0
- package/assets/cloudling/cloudling-building.svg +667 -0
- package/assets/cloudling/cloudling-carrying.svg +604 -0
- package/assets/cloudling/cloudling-conducting.svg +616 -0
- package/assets/cloudling/cloudling-dozing-to-sleeping.svg +578 -0
- package/assets/cloudling/cloudling-dozing.svg +358 -0
- package/assets/cloudling/cloudling-error.svg +428 -0
- package/assets/cloudling/cloudling-idle-reading.svg +658 -0
- package/assets/cloudling/cloudling-idle-to-dozing.svg +568 -0
- package/assets/cloudling/cloudling-idle-to-sleeping.svg +811 -0
- package/assets/cloudling/cloudling-idle.svg +255 -0
- package/assets/cloudling/cloudling-juggling.svg +648 -0
- package/assets/cloudling/cloudling-mini-alert.svg +390 -0
- package/assets/cloudling/cloudling-mini-crabwalk.svg +335 -0
- package/assets/cloudling/cloudling-mini-enter-roll-in.svg +226 -0
- package/assets/cloudling/cloudling-mini-enter-sleep.svg +232 -0
- package/assets/cloudling/cloudling-mini-happy.svg +371 -0
- package/assets/cloudling/cloudling-mini-idle.svg +279 -0
- package/assets/cloudling/cloudling-mini-peek.svg +328 -0
- package/assets/cloudling/cloudling-mini-sleep.svg +260 -0
- package/assets/cloudling/cloudling-mini-typing.svg +692 -0
- package/assets/cloudling/cloudling-notification.svg +494 -0
- package/assets/cloudling/cloudling-react-drag.svg +83 -0
- package/assets/cloudling/cloudling-sleeping-to-idle.svg +555 -0
- package/assets/cloudling/cloudling-sleeping.svg +500 -0
- package/assets/cloudling/cloudling-sweeping.svg +292 -0
- package/assets/cloudling/cloudling-thinking.svg +720 -0
- package/assets/cloudling/cloudling-typing.svg +354 -0
- package/assets/cloudling.svg +255 -0
- package/assets/ghost-attention.svg +19 -0
- package/assets/ghost-carrying.svg +19 -0
- package/assets/ghost-collapsing.svg +19 -0
- package/assets/ghost-dozing.svg +23 -0
- package/assets/ghost-error.svg +19 -0
- package/assets/ghost-happy.svg +23 -0
- package/assets/ghost-idle-action1.svg +19 -0
- package/assets/ghost-idle-action2.svg +19 -0
- package/assets/ghost-idle-action3.svg +19 -0
- package/assets/ghost-idle.svg +11 -0
- package/assets/ghost-juggling.svg +19 -0
- package/assets/ghost-notification.svg +19 -0
- package/assets/ghost-react-double.svg +23 -0
- package/assets/ghost-react-drag.svg +23 -0
- package/assets/ghost-react-left.svg +19 -0
- package/assets/ghost-react-right.svg +19 -0
- package/assets/ghost-sleeping.svg +19 -0
- package/assets/ghost-sweeping.svg +19 -0
- package/assets/ghost-thinking.svg +19 -0
- package/assets/ghost-waking.svg +19 -0
- package/assets/ghost-working.svg +19 -0
- package/assets/ghost-yawning.svg +23 -0
- package/assets/ghost.svg +11 -0
- package/assets/robot-attention.svg +19 -0
- package/assets/robot-carrying.svg +19 -0
- package/assets/robot-collapsing.svg +19 -0
- package/assets/robot-dozing.svg +23 -0
- package/assets/robot-error.svg +19 -0
- package/assets/robot-happy.svg +23 -0
- package/assets/robot-idle-action1.svg +19 -0
- package/assets/robot-idle-action2.svg +19 -0
- package/assets/robot-idle-action3.svg +19 -0
- package/assets/robot-idle.svg +11 -0
- package/assets/robot-juggling.svg +19 -0
- package/assets/robot-notification.svg +19 -0
- package/assets/robot-react-double.svg +23 -0
- package/assets/robot-react-drag.svg +23 -0
- package/assets/robot-react-left.svg +19 -0
- package/assets/robot-react-right.svg +19 -0
- package/assets/robot-sleeping.svg +19 -0
- package/assets/robot-sweeping.svg +19 -0
- package/assets/robot-thinking.svg +19 -0
- package/assets/robot-waking.svg +19 -0
- package/assets/robot-working.svg +19 -0
- package/assets/robot-yawning.svg +23 -0
- package/assets/robot.svg +11 -0
- package/manifest.json +889 -0
- package/package.json +18 -0
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
<svg id="cloudling" xmlns="http://www.w3.org/2000/svg" width="880" height="720" viewBox="-32 -24 88 72" preserveAspectRatio="xMidYMid meet">
|
|
2
|
+
<style><![CDATA[
|
|
3
|
+
.runtime {
|
|
4
|
+
position: relative;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
border-radius: 14px;
|
|
7
|
+
background: #0f0f14;
|
|
8
|
+
box-shadow: 0 18px 60px rgba(0,0,0,.4);
|
|
9
|
+
}
|
|
10
|
+
.runtime svg { display: block; }
|
|
11
|
+
.runtime {
|
|
12
|
+
height: 640px;
|
|
13
|
+
}
|
|
14
|
+
.edge-line {
|
|
15
|
+
position: absolute;
|
|
16
|
+
top: 0;
|
|
17
|
+
right: 26px;
|
|
18
|
+
width: 1px;
|
|
19
|
+
height: 100%;
|
|
20
|
+
background: linear-gradient(to bottom, transparent, rgba(122,157,255,.50), transparent);
|
|
21
|
+
}
|
|
22
|
+
.runtime-shell {
|
|
23
|
+
position: absolute;
|
|
24
|
+
left: 10px;
|
|
25
|
+
top: 135px;
|
|
26
|
+
width: 170px;
|
|
27
|
+
height: 170px;
|
|
28
|
+
animation: runtime-walk var(--runtime-duration, 4.6s) linear infinite;
|
|
29
|
+
}
|
|
30
|
+
.runtime-shell svg {
|
|
31
|
+
width: 170px;
|
|
32
|
+
height: 170px;
|
|
33
|
+
}
|
|
34
|
+
@keyframes runtime-walk {
|
|
35
|
+
0% { transform: translateX(-6px); }
|
|
36
|
+
100% { transform: translateX(120px); }
|
|
37
|
+
}
|
|
38
|
+
.runtime.paused .runtime-shell { animation-play-state: paused; }
|
|
39
|
+
.edge-rim-tight { stroke-opacity: .65; }
|
|
40
|
+
.edge-rim-soft { stroke-opacity: .50; }
|
|
41
|
+
.edge-contact { stroke-opacity: .65; }
|
|
42
|
+
@media (prefers-color-scheme: light) {
|
|
43
|
+
.runtime {
|
|
44
|
+
background: #fff;
|
|
45
|
+
box-shadow: 0 18px 60px -20px rgba(57,65,255,.18), 0 4px 12px rgba(0,0,0,.04);
|
|
46
|
+
}
|
|
47
|
+
.edge-rim-tight { stroke-opacity: .75; }
|
|
48
|
+
.edge-rim-soft { stroke-opacity: .60; }
|
|
49
|
+
.edge-contact { stroke-opacity: .75; }
|
|
50
|
+
.cloud-drop-shadow { flood-opacity: .13; }
|
|
51
|
+
#puff-a *, #puff-b *, #puff-c *, #rt-puff-a *, #rt-puff-b *, #rt-puff-c * {
|
|
52
|
+
stroke: #6f8dff;
|
|
53
|
+
stroke-width: .14px;
|
|
54
|
+
stroke-opacity: .44;
|
|
55
|
+
vector-effect: non-scaling-stroke;
|
|
56
|
+
}
|
|
57
|
+
#puff-a ellipse, #puff-b ellipse, #puff-c ellipse, #rt-puff-a ellipse, #rt-puff-b ellipse, #rt-puff-c ellipse {
|
|
58
|
+
fill: #e8eeff;
|
|
59
|
+
}
|
|
60
|
+
#puff-a circle, #puff-b circle, #puff-c circle, #rt-puff-a circle, #rt-puff-b circle, #rt-puff-c circle {
|
|
61
|
+
fill: #f6f8ff;
|
|
62
|
+
}
|
|
63
|
+
#puff-a, #puff-b, #puff-c, #rt-puff-a, #rt-puff-b, #rt-puff-c {
|
|
64
|
+
filter: drop-shadow(0 0 .22px rgba(57,65,255,.46));
|
|
65
|
+
}
|
|
66
|
+
.food-cloud-shadow { flood-opacity: .28; flood-color: #5060FF; }
|
|
67
|
+
.food-cloud > path {
|
|
68
|
+
stroke: #5870E8 !important;
|
|
69
|
+
stroke-width: 1.2 !important;
|
|
70
|
+
stroke-opacity: .9 !important;
|
|
71
|
+
vector-effect: non-scaling-stroke !important;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
]]></style>
|
|
75
|
+
<defs>
|
|
76
|
+
<linearGradient id="body-grad" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse">
|
|
77
|
+
<stop offset="0" stop-color="#f0f9ff"/>
|
|
78
|
+
<stop offset="0.5" stop-color="#e0f2fe"/>
|
|
79
|
+
<stop offset="1" stop-color="#bae6fd"/>
|
|
80
|
+
</linearGradient>
|
|
81
|
+
<linearGradient id="eye-grad" x1="12" y1="3" x2="12" y2="21" gradientUnits="userSpaceOnUse">
|
|
82
|
+
<stop offset="0" stop-color="#B1A7FF"/>
|
|
83
|
+
<stop offset="0.5" stop-color="#7A9DFF"/>
|
|
84
|
+
<stop offset="1" stop-color="#3941FF"/>
|
|
85
|
+
</linearGradient>
|
|
86
|
+
<radialGradient id="hi-grad" cx="0.45" cy="0.25" r="0.55">
|
|
87
|
+
<stop offset="0" stop-color="#f0f9ff" stop-opacity="0.9"/>
|
|
88
|
+
<stop offset="1" stop-color="#f0f9ff" stop-opacity="0"/>
|
|
89
|
+
</radialGradient>
|
|
90
|
+
<filter id="drop" x="-40%" y="-40%" width="180%" height="180%">
|
|
91
|
+
<feDropShadow class="cloud-drop-shadow" dx="0" dy="0.6" stdDeviation="0.8" flood-color="#3941FF" flood-opacity="0.18"/>
|
|
92
|
+
</filter>
|
|
93
|
+
<filter id="edge-blur" x="-40%" y="-40%" width="180%" height="180%">
|
|
94
|
+
<feGaussianBlur stdDeviation="0.16"/>
|
|
95
|
+
</filter>
|
|
96
|
+
<filter id="shadow-blur" x="-80%" y="-120%" width="260%" height="320%">
|
|
97
|
+
<feGaussianBlur stdDeviation="0.55"/>
|
|
98
|
+
</filter>
|
|
99
|
+
<filter id="puff-blur" x="-80%" y="-100%" width="260%" height="280%">
|
|
100
|
+
<feGaussianBlur stdDeviation="0.08"/>
|
|
101
|
+
</filter>
|
|
102
|
+
<clipPath id="cloud-clip">
|
|
103
|
+
<path id="clip-shape"/>
|
|
104
|
+
</clipPath>
|
|
105
|
+
</defs>
|
|
106
|
+
|
|
107
|
+
<g id="asset-layer">
|
|
108
|
+
<ellipse id="ground-shadow" cx="12" cy="20.45" rx="7.6" ry="1.05" fill="#3941FF" opacity=".085" filter="url(#shadow-blur)"/>
|
|
109
|
+
<g id="puff-layer" filter="url(#puff-blur)">
|
|
110
|
+
<g id="puff-a" opacity="0">
|
|
111
|
+
<ellipse cx="5.55" cy="18.84" rx="1.22" ry=".56" fill="url(#body-grad)" opacity=".92"/>
|
|
112
|
+
<circle cx="4.68" cy="18.60" r=".46" fill="#ffffff" opacity=".86"/>
|
|
113
|
+
<circle cx="6.30" cy="18.54" r=".52" fill="#eef2ff" opacity=".84"/>
|
|
114
|
+
<ellipse cx="5.48" cy="18.28" rx=".62" ry=".35" fill="#ffffff" opacity=".88"/>
|
|
115
|
+
</g>
|
|
116
|
+
<g id="puff-b" opacity="0">
|
|
117
|
+
<ellipse cx="3.85" cy="19.28" rx=".86" ry=".39" fill="url(#body-grad)" opacity=".78"/>
|
|
118
|
+
<circle cx="3.22" cy="19.08" r=".31" fill="#ffffff" opacity=".74"/>
|
|
119
|
+
<circle cx="4.43" cy="19.06" r=".34" fill="#eef2ff" opacity=".72"/>
|
|
120
|
+
</g>
|
|
121
|
+
<g id="puff-c" opacity="0">
|
|
122
|
+
<ellipse cx="2.45" cy="19.58" rx=".58" ry=".26" fill="url(#body-grad)" opacity=".62"/>
|
|
123
|
+
<circle cx="2.05" cy="19.44" r=".20" fill="#ffffff" opacity=".62"/>
|
|
124
|
+
<circle cx="2.83" cy="19.42" r=".22" fill="#eef2ff" opacity=".58"/>
|
|
125
|
+
</g>
|
|
126
|
+
</g>
|
|
127
|
+
|
|
128
|
+
<g id="body-layer">
|
|
129
|
+
<g id="edge-system">
|
|
130
|
+
<path id="edge-contact" class="edge-contact" fill="none" stroke="#7d8aa7" stroke-width="1.05" stroke-linejoin="round" filter="url(#edge-blur)"/>
|
|
131
|
+
<path id="edge-soft" class="edge-rim-soft" fill="none" stroke="#7A9DFF" stroke-width="0.90" stroke-linejoin="round" filter="url(#edge-blur)"/>
|
|
132
|
+
<path id="edge-tight" class="edge-rim-tight" fill="none" stroke="#aab3c6" stroke-width="0.42" stroke-linejoin="round"/>
|
|
133
|
+
</g>
|
|
134
|
+
<g filter="url(#drop)">
|
|
135
|
+
<path id="cloud-shape" fill="url(#body-grad)"/>
|
|
136
|
+
<rect x="1" y="2" width="22" height="11" fill="url(#hi-grad)" clip-path="url(#cloud-clip)"/>
|
|
137
|
+
</g>
|
|
138
|
+
</g>
|
|
139
|
+
|
|
140
|
+
<g id="eye-layer">
|
|
141
|
+
<rect id="eye-l" x="7.7" y="9.5" width="2.6" height="5" rx="1.3" ry="1.3" fill="url(#eye-grad)" stroke="#ffffff" stroke-width="0.08" stroke-opacity="0.7"/>
|
|
142
|
+
<rect id="eye-r" x="13.7" y="9.5" width="2.6" height="5" rx="1.3" ry="1.3" fill="url(#eye-grad)" stroke="#ffffff" stroke-width="0.08" stroke-opacity="0.7"/>
|
|
143
|
+
</g>
|
|
144
|
+
</g>
|
|
145
|
+
|
|
146
|
+
<script type="application/ecmascript"><![CDATA[
|
|
147
|
+
const CLOUD_D = "M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388z";
|
|
148
|
+
const CENTER = { x: 12, y: 12 };
|
|
149
|
+
const EYE_BASE = {
|
|
150
|
+
l: { x: 7.7, y: 9.5, w: 2.6, h: 5, rx: 1.3 },
|
|
151
|
+
r: { x: 13.7, y: 9.5, w: 2.6, h: 5, rx: 1.3 }
|
|
152
|
+
};
|
|
153
|
+
const P = {
|
|
154
|
+
period: 1.16,
|
|
155
|
+
scoot: 2.1,
|
|
156
|
+
hop: 0.85,
|
|
157
|
+
squash: 0.105,
|
|
158
|
+
roll: 17,
|
|
159
|
+
round: 0.28,
|
|
160
|
+
breath: 0.018,
|
|
161
|
+
eyeStable: 0.86,
|
|
162
|
+
gaze: 0.58,
|
|
163
|
+
eyeWiden: 0.19,
|
|
164
|
+
puffStrength: 0.90,
|
|
165
|
+
puffs: true
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const els = {
|
|
169
|
+
cloud: document.getElementById('cloud-shape'),
|
|
170
|
+
clip: document.getElementById('clip-shape'),
|
|
171
|
+
edgeContact: document.getElementById('edge-contact'),
|
|
172
|
+
edgeSoft: document.getElementById('edge-soft'),
|
|
173
|
+
edgeTight: document.getElementById('edge-tight'),
|
|
174
|
+
body: document.getElementById('body-layer'),
|
|
175
|
+
eyes: document.getElementById('eye-layer'),
|
|
176
|
+
eyeL: document.getElementById('eye-l'),
|
|
177
|
+
eyeR: document.getElementById('eye-r'),
|
|
178
|
+
shadow: document.getElementById('ground-shadow'),
|
|
179
|
+
puffA: document.getElementById('puff-a'),
|
|
180
|
+
puffB: document.getElementById('puff-b'),
|
|
181
|
+
puffC: document.getElementById('puff-c')
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
function samplePath(d, n) {
|
|
185
|
+
const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
|
|
186
|
+
path.setAttribute('d', d);
|
|
187
|
+
const len = path.getTotalLength();
|
|
188
|
+
return Array.from({ length: n }, (_, i) => {
|
|
189
|
+
const p = path.getPointAtLength(i / n * len);
|
|
190
|
+
return { x: p.x, y: p.y };
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function pointsToSmoothPath(pts) {
|
|
195
|
+
const n = pts.length;
|
|
196
|
+
let d = `M ${pts[0].x.toFixed(3)} ${pts[0].y.toFixed(3)}`;
|
|
197
|
+
for (let i = 0; i < n; i++) {
|
|
198
|
+
const p0 = pts[(i - 1 + n) % n];
|
|
199
|
+
const p1 = pts[i];
|
|
200
|
+
const p2 = pts[(i + 1) % n];
|
|
201
|
+
const p3 = pts[(i + 2) % n];
|
|
202
|
+
const c1x = p1.x + (p2.x - p0.x) / 6;
|
|
203
|
+
const c1y = p1.y + (p2.y - p0.y) / 6;
|
|
204
|
+
const c2x = p2.x - (p3.x - p1.x) / 6;
|
|
205
|
+
const c2y = p2.y - (p3.y - p1.y) / 6;
|
|
206
|
+
d += ` C ${c1x.toFixed(3)} ${c1y.toFixed(3)}, ${c2x.toFixed(3)} ${c2y.toFixed(3)}, ${p2.x.toFixed(3)} ${p2.y.toFixed(3)}`;
|
|
207
|
+
}
|
|
208
|
+
return d + ' Z';
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function morphCloud(t) {
|
|
212
|
+
const r = 7.1;
|
|
213
|
+
const pts = basePoints.map(p => {
|
|
214
|
+
const dx = p.x - CENTER.x;
|
|
215
|
+
const dy = p.y - CENTER.y;
|
|
216
|
+
const a = Math.atan2(dy, dx);
|
|
217
|
+
const tx = CENTER.x + Math.cos(a) * r;
|
|
218
|
+
const ty = CENTER.y + Math.sin(a) * r;
|
|
219
|
+
return { x: p.x + (tx - p.x) * t, y: p.y + (ty - p.y) * t };
|
|
220
|
+
});
|
|
221
|
+
return pointsToSmoothPath(pts);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function clamp01(v) { return Math.max(0, Math.min(1, v)); }
|
|
225
|
+
function smoothstep(a, b, x) {
|
|
226
|
+
const t = clamp01((x - a) / (b - a));
|
|
227
|
+
return t * t * (3 - 2 * t);
|
|
228
|
+
}
|
|
229
|
+
function pulse(q, center, width) {
|
|
230
|
+
const d = Math.abs((((q - center + 0.5) % 1) + 1) % 1 - 0.5);
|
|
231
|
+
return Math.max(0, 1 - d / width) ** 2;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
const basePoints = samplePath(CLOUD_D, 72);
|
|
235
|
+
const startT = performance.now();
|
|
236
|
+
|
|
237
|
+
function frameFor(now) {
|
|
238
|
+
const t = (now - startT) / 1000;
|
|
239
|
+
const q = (t / P.period) % 1;
|
|
240
|
+
const wave = Math.sin(Math.PI * 2 * q);
|
|
241
|
+
const wave2 = Math.sin(Math.PI * 2 * (q - .17));
|
|
242
|
+
const contact = Math.max(pulse(q, .12, .18), pulse(q, .72, .16));
|
|
243
|
+
const launch = smoothstep(.14, .34, q) * (1 - smoothstep(.54, .78, q));
|
|
244
|
+
const breath = Math.sin(Math.PI * 2 * t / 4.4) * P.breath;
|
|
245
|
+
const tx = P.scoot * wave2;
|
|
246
|
+
const ty = -P.hop * Math.max(0, Math.sin(Math.PI * q)) + contact * .46;
|
|
247
|
+
const sx = 1 + contact * P.squash - launch * .025 + breath;
|
|
248
|
+
const sy = 1 - contact * P.squash * 1.12 + launch * .035 - breath * .55;
|
|
249
|
+
const roll = (wave * .72 + pulse(q, .31, .22) * .35 - pulse(q, .70, .18) * .25) * P.roll;
|
|
250
|
+
const round = P.round * (launch * .75 + contact * .25);
|
|
251
|
+
const eyeRot = roll * (1 - P.eyeStable);
|
|
252
|
+
const gaze = P.gaze + launch * .16 - contact * .10;
|
|
253
|
+
const blink = Math.max(pulse(q, .47, .055), pulse(q, .93, .035) * .25);
|
|
254
|
+
const shadowScale = 1 + contact * .20 - launch * .16;
|
|
255
|
+
const eyeWide = 1 + P.eyeWiden * clamp01(contact * .86 + launch * .20);
|
|
256
|
+
const puffSeed = P.puffs ? P.puffStrength : 0;
|
|
257
|
+
const puffA = puffSeed * pulse(q, .15, .20);
|
|
258
|
+
const puffB = puffSeed * pulse(q, .28, .22);
|
|
259
|
+
const puffC = puffSeed * pulse(q, .43, .24);
|
|
260
|
+
return { q, tx, ty, sx, sy, roll, round, eyeRot, gaze, blink, shadowScale, puffA, puffB, puffC, eyeWide };
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
function applyFrame(target, f) {
|
|
264
|
+
const d = morphCloud(f.round);
|
|
265
|
+
target.cloud.setAttribute('d', d);
|
|
266
|
+
target.clip.setAttribute('d', d);
|
|
267
|
+
target.edgeContact.setAttribute('d', d);
|
|
268
|
+
target.edgeSoft.setAttribute('d', d);
|
|
269
|
+
target.edgeTight.setAttribute('d', d);
|
|
270
|
+
target.edgeContact.setAttribute('transform', 'translate(0 0.18)');
|
|
271
|
+
|
|
272
|
+
target.body.setAttribute(
|
|
273
|
+
'transform',
|
|
274
|
+
`translate(${(12 + f.tx).toFixed(3)} ${(12 + f.ty).toFixed(3)}) rotate(${f.roll.toFixed(3)}) scale(${f.sx.toFixed(4)} ${f.sy.toFixed(4)}) translate(-12 -12)`
|
|
275
|
+
);
|
|
276
|
+
|
|
277
|
+
const eyeSx = 1 + (f.sx - 1) * .24;
|
|
278
|
+
const eyeSy = 1 + (f.sy - 1) * .20;
|
|
279
|
+
target.eyes.setAttribute(
|
|
280
|
+
'transform',
|
|
281
|
+
`translate(${(12 + f.tx).toFixed(3)} ${(12 + f.ty).toFixed(3)}) rotate(${f.eyeRot.toFixed(3)}) scale(${eyeSx.toFixed(4)} ${eyeSy.toFixed(4)}) translate(-12 -12) translate(${f.gaze.toFixed(3)} 0)`
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
applyBlink(target.eyeL, EYE_BASE.l, f.blink, f.eyeWide);
|
|
285
|
+
applyBlink(target.eyeR, EYE_BASE.r, f.blink, f.eyeWide);
|
|
286
|
+
|
|
287
|
+
target.shadow.setAttribute('transform', `translate(${(f.tx * .28).toFixed(3)} 0) scale(${f.shadowScale.toFixed(3)} 1)`);
|
|
288
|
+
target.shadow.setAttribute('opacity', (.07 + f.puffA * .045).toFixed(3));
|
|
289
|
+
|
|
290
|
+
setTrailPuff(target.puffA, f.puffA, -0.95, -0.16, 1.00);
|
|
291
|
+
setTrailPuff(target.puffB, f.puffB, -1.55, 0.06, 0.82);
|
|
292
|
+
setTrailPuff(target.puffC, f.puffC, -2.05, 0.16, 0.66);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function applyBlink(rect, base, amount, widen = 1) {
|
|
296
|
+
const scale = 1 - amount * .88;
|
|
297
|
+
const cx = base.x + base.w / 2;
|
|
298
|
+
const w = base.w * widen * (1 + amount * .06);
|
|
299
|
+
const h = Math.max(base.h * scale, .24);
|
|
300
|
+
const y = base.y + (base.h - h) / 2;
|
|
301
|
+
const rx = Math.min(w / 2, h / 2, 1.35);
|
|
302
|
+
rect.setAttribute('width', w.toFixed(3));
|
|
303
|
+
rect.setAttribute('x', (cx - w / 2).toFixed(3));
|
|
304
|
+
rect.setAttribute('height', h.toFixed(3));
|
|
305
|
+
rect.setAttribute('y', y.toFixed(3));
|
|
306
|
+
rect.setAttribute('rx', rx.toFixed(3));
|
|
307
|
+
rect.setAttribute('ry', rx.toFixed(3));
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function setPuff(el, opacity, dx, dy, scale) {
|
|
311
|
+
el.setAttribute('opacity', opacity.toFixed(3));
|
|
312
|
+
el.setAttribute('transform', `translate(${dx.toFixed(3)} ${dy.toFixed(3)}) scale(${scale.toFixed(3)})`);
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function setTrailPuff(el, amount, driftX, driftY, baseScale) {
|
|
316
|
+
const a = clamp01(amount);
|
|
317
|
+
const isLight = window.matchMedia('(prefers-color-scheme: light)').matches;
|
|
318
|
+
const fade = isLight ? a : Math.sin(a * Math.PI);
|
|
319
|
+
const dx = driftX * a;
|
|
320
|
+
const dy = driftY * a;
|
|
321
|
+
const scale = baseScale * (0.82 + a * 0.32);
|
|
322
|
+
const opacityBase = isLight ? 0.86 : 0.62;
|
|
323
|
+
el.setAttribute('opacity', Math.min(fade * opacityBase, 0.90).toFixed(3));
|
|
324
|
+
el.setAttribute('transform', `translate(${dx.toFixed(3)} ${dy.toFixed(3)}) scale(${scale.toFixed(3)})`);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
function tick(now) {
|
|
328
|
+
const f = frameFor(now);
|
|
329
|
+
applyFrame(els, f);
|
|
330
|
+
requestAnimationFrame(tick);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
requestAnimationFrame(tick);
|
|
334
|
+
]]></script>
|
|
335
|
+
</svg>
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
<svg id="cloudling" xmlns="http://www.w3.org/2000/svg" width="480" height="480" viewBox="-12 -12 48 48" preserveAspectRatio="xMidYMid meet">
|
|
2
|
+
<style><![CDATA[
|
|
3
|
+
.v {
|
|
4
|
+
text-align: right;
|
|
5
|
+
font: 600 10px ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
6
|
+
color: #7A9DFF;
|
|
7
|
+
}
|
|
8
|
+
.edge-rim-tight { stroke-opacity: .65; }
|
|
9
|
+
.edge-rim-soft { stroke-opacity: .50; }
|
|
10
|
+
.edge-contact { stroke-opacity: .65; }
|
|
11
|
+
.duration-probe {
|
|
12
|
+
opacity: 0;
|
|
13
|
+
animation: mini-enter-duration-probe 1.25s linear 1 both;
|
|
14
|
+
}
|
|
15
|
+
@keyframes mini-enter-duration-probe {
|
|
16
|
+
from { transform: translateX(0); }
|
|
17
|
+
to { transform: translateX(0); }
|
|
18
|
+
}
|
|
19
|
+
@media (prefers-color-scheme: light) {
|
|
20
|
+
.v { color: #3941FF; }
|
|
21
|
+
.edge-rim-tight { stroke-opacity: .75; }
|
|
22
|
+
.edge-rim-soft { stroke-opacity: .60; }
|
|
23
|
+
.edge-contact { stroke-opacity: .75; }
|
|
24
|
+
.cloud-drop-shadow { flood-opacity: .13; }
|
|
25
|
+
.food-cloud-shadow { flood-opacity: .28; flood-color: #5060FF; }
|
|
26
|
+
.food-cloud > path {
|
|
27
|
+
stroke: #5870E8 !important;
|
|
28
|
+
stroke-width: 1.2 !important;
|
|
29
|
+
stroke-opacity: .9 !important;
|
|
30
|
+
vector-effect: non-scaling-stroke !important;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
]]></style>
|
|
34
|
+
<defs>
|
|
35
|
+
<linearGradient id="body-grad" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse">
|
|
36
|
+
<stop offset="0" stop-color="#f0f9ff"/>
|
|
37
|
+
<stop offset="0.5" stop-color="#e0f2fe"/>
|
|
38
|
+
<stop offset="1" stop-color="#bae6fd"/>
|
|
39
|
+
</linearGradient>
|
|
40
|
+
<linearGradient id="eye-grad" x1="12" y1="3" x2="12" y2="21" gradientUnits="userSpaceOnUse">
|
|
41
|
+
<stop offset="0" stop-color="#B1A7FF"/>
|
|
42
|
+
<stop offset="0.5" stop-color="#7A9DFF"/>
|
|
43
|
+
<stop offset="1" stop-color="#3941FF"/>
|
|
44
|
+
</linearGradient>
|
|
45
|
+
<radialGradient id="hi-grad" cx="0.45" cy="0.25" r="0.55">
|
|
46
|
+
<stop offset="0" stop-color="#f0f9ff" stop-opacity="0.9"/>
|
|
47
|
+
<stop offset="1" stop-color="#f0f9ff" stop-opacity="0"/>
|
|
48
|
+
</radialGradient>
|
|
49
|
+
<filter id="drop" x="-40%" y="-40%" width="180%" height="180%">
|
|
50
|
+
<feDropShadow class="cloud-drop-shadow" dx="0" dy="0.55" stdDeviation="0.72" flood-color="#3941FF" flood-opacity="0.17"/>
|
|
51
|
+
</filter>
|
|
52
|
+
<filter id="edge-blur" x="-40%" y="-40%" width="180%" height="180%">
|
|
53
|
+
<feGaussianBlur stdDeviation="0.16"/>
|
|
54
|
+
</filter>
|
|
55
|
+
<path id="cloud-shape" d="M9.064 3.344a4.578 4.578 0 012.285-.312c1 .115 1.891.54 2.673 1.275.01.01.024.017.037.021a.09.09 0 00.043 0 4.55 4.55 0 013.046.275l.047.022.116.057a4.581 4.581 0 012.188 2.399c.209.51.313 1.041.315 1.595a4.24 4.24 0 01-.134 1.223.123.123 0 00.03.115c.594.607.988 1.33 1.183 2.17.289 1.425-.007 2.71-.887 3.854l-.136.166a4.548 4.548 0 01-2.201 1.388.123.123 0 00-.081.076c-.191.551-.383 1.023-.74 1.494-.9 1.187-2.222 1.846-3.711 1.838-1.187-.006-2.239-.44-3.157-1.302a.107.107 0 00-.105-.024c-.388.125-.78.143-1.204.138a4.441 4.441 0 01-1.945-.466 4.544 4.544 0 01-1.61-1.335c-.152-.202-.303-.392-.414-.617a5.81 5.81 0 01-.37-.961 4.582 4.582 0 01-.014-2.298.124.124 0 00.006-.056.085.085 0 00-.027-.048 4.467 4.467 0 01-1.034-1.651 3.896 3.896 0 01-.251-1.192 5.189 5.189 0 01.141-1.6c.337-1.112.982-1.985 1.933-2.618.212-.141.413-.251.601-.33.215-.089.43-.164.646-.227a.098.098 0 00.065-.066 4.51 4.51 0 01.829-1.615 4.535 4.535 0 011.837-1.388z"/>
|
|
56
|
+
<clipPath id="cloud-clip">
|
|
57
|
+
<use href="#cloud-shape"/>
|
|
58
|
+
</clipPath>
|
|
59
|
+
</defs>
|
|
60
|
+
|
|
61
|
+
<rect x="-12" y="-12" width="48" height="48" fill="transparent"/>
|
|
62
|
+
<rect class="duration-probe" x="-12" y="-12" width="0.01" height="0.01" fill="transparent"/>
|
|
63
|
+
|
|
64
|
+
<g id="enter-js">
|
|
65
|
+
<g id="body-js">
|
|
66
|
+
<g id="breath-js">
|
|
67
|
+
<g id="edge-system">
|
|
68
|
+
<use class="edge-contact" href="#cloud-shape" fill="none" stroke="#7d8aa7" stroke-width="1.00" stroke-linejoin="round" transform="translate(0 .18)" filter="url(#edge-blur)"/>
|
|
69
|
+
<use class="edge-rim-soft" href="#cloud-shape" fill="none" stroke="#7A9DFF" stroke-width=".84" stroke-linejoin="round" filter="url(#edge-blur)"/>
|
|
70
|
+
<use class="edge-rim-tight" href="#cloud-shape" fill="none" stroke="#aab3c6" stroke-width=".38" stroke-linejoin="round"/>
|
|
71
|
+
</g>
|
|
72
|
+
<g filter="url(#drop)">
|
|
73
|
+
<use href="#cloud-shape" fill="url(#body-grad)"/>
|
|
74
|
+
<rect x="1" y="2" width="22" height="11" fill="url(#hi-grad)" clip-path="url(#cloud-clip)"/>
|
|
75
|
+
</g>
|
|
76
|
+
</g>
|
|
77
|
+
</g>
|
|
78
|
+
<g id="eyes-js">
|
|
79
|
+
<g id="blink-js">
|
|
80
|
+
<rect id="eye-l" class="eye" x="6.65" y="9.65" width="2.2" height="4.65" rx="1.1" ry="1.1" fill="url(#eye-grad)" stroke="#ffffff" stroke-width="0.08" stroke-opacity="0.7"/>
|
|
81
|
+
<rect id="eye-r" class="eye" x="11.05" y="9.65" width="2.2" height="4.65" rx="1.1" ry="1.1" fill="url(#eye-grad)" stroke="#ffffff" stroke-width="0.08" stroke-opacity="0.7"/>
|
|
82
|
+
</g>
|
|
83
|
+
</g>
|
|
84
|
+
</g>
|
|
85
|
+
<g id="__cloudling-export-shims" opacity="0" pointer-events="none" style="display:none">
|
|
86
|
+
<g id="pose-readout"></g>
|
|
87
|
+
<g id="progress-readout"></g>
|
|
88
|
+
</g>
|
|
89
|
+
|
|
90
|
+
<script type="application/ecmascript"><![CDATA[
|
|
91
|
+
const svg = document.getElementById("cloudling");
|
|
92
|
+
const enter = document.getElementById("enter-js");
|
|
93
|
+
const eyeGrad = document.getElementById("eye-grad");
|
|
94
|
+
const eyeL = document.getElementById("eye-l");
|
|
95
|
+
const eyeR = document.getElementById("eye-r");
|
|
96
|
+
const progressReadout = document.getElementById("progress-readout");
|
|
97
|
+
const poseReadout = document.getElementById("pose-readout");
|
|
98
|
+
|
|
99
|
+
const EYE_BASE = {
|
|
100
|
+
l: { x: 6.65, y: 9.65, h: 4.65, rx: 1.1 },
|
|
101
|
+
r: { x: 11.05, y: 9.65, h: 4.65, rx: 1.1 },
|
|
102
|
+
};
|
|
103
|
+
const params = {
|
|
104
|
+
duration: 1.25,
|
|
105
|
+
startX: 15.8,
|
|
106
|
+
rollDeg: 28,
|
|
107
|
+
overshoot: 1.2,
|
|
108
|
+
squash: 0.07,
|
|
109
|
+
eyeOpen: 0.64,
|
|
110
|
+
};
|
|
111
|
+
let startT = performance.now();
|
|
112
|
+
let playing = true;
|
|
113
|
+
let heldProgress = 0;
|
|
114
|
+
let lastState = null;
|
|
115
|
+
|
|
116
|
+
function clamp(v, min, max) {
|
|
117
|
+
return Math.max(min, Math.min(max, v));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function lerp(a, b, t) {
|
|
121
|
+
return a + (b - a) * t;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function smoothstep(edge0, edge1, x) {
|
|
125
|
+
const t = clamp((x - edge0) / Math.max(edge1 - edge0, 0.0001), 0, 1);
|
|
126
|
+
return t * t * (3 - 2 * t);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function easeOutCubic(t) {
|
|
130
|
+
return 1 - Math.pow(1 - t, 3);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function sampleKeyframes(p, frames) {
|
|
134
|
+
if (p <= frames[0].p) return frames[0].v;
|
|
135
|
+
for (let i = 1; i < frames.length; i++) {
|
|
136
|
+
const prev = frames[i - 1];
|
|
137
|
+
const next = frames[i];
|
|
138
|
+
if (p <= next.p) {
|
|
139
|
+
const t = smoothstep(prev.p, next.p, p);
|
|
140
|
+
return lerp(prev.v, next.v, t);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return frames[frames.length - 1].v;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function stateAt(p) {
|
|
147
|
+
const bodyP = smoothstep(0.08, 1.0, p);
|
|
148
|
+
const tx = sampleKeyframes(p, [
|
|
149
|
+
{ p: 0.00, v: params.startX },
|
|
150
|
+
{ p: 0.08, v: params.startX },
|
|
151
|
+
{ p: 0.47, v: -params.overshoot },
|
|
152
|
+
{ p: 0.62, v: params.overshoot * 0.42 },
|
|
153
|
+
{ p: 0.78, v: -params.overshoot * 0.14 },
|
|
154
|
+
{ p: 1.00, v: 0 },
|
|
155
|
+
]);
|
|
156
|
+
const rot = sampleKeyframes(p, [
|
|
157
|
+
{ p: 0.00, v: params.rollDeg },
|
|
158
|
+
{ p: 0.08, v: params.rollDeg },
|
|
159
|
+
{ p: 0.47, v: -params.rollDeg * 0.32 },
|
|
160
|
+
{ p: 0.62, v: params.rollDeg * 0.13 },
|
|
161
|
+
{ p: 0.78, v: -params.rollDeg * 0.05 },
|
|
162
|
+
{ p: 1.00, v: 0 },
|
|
163
|
+
]);
|
|
164
|
+
const ty = sampleKeyframes(p, [
|
|
165
|
+
{ p: 0.00, v: 0 },
|
|
166
|
+
{ p: 0.40, v: 0.18 },
|
|
167
|
+
{ p: 0.60, v: -0.12 },
|
|
168
|
+
{ p: 0.82, v: 0.04 },
|
|
169
|
+
{ p: 1.00, v: 0 },
|
|
170
|
+
]);
|
|
171
|
+
const impact = Math.sin(Math.PI * smoothstep(0.34, 0.62, p));
|
|
172
|
+
const settle = Math.sin(Math.PI * smoothstep(0.58, 0.86, p)) * 0.45;
|
|
173
|
+
const squash = params.squash * (impact - settle);
|
|
174
|
+
const sx = 1 - squash;
|
|
175
|
+
const sy = 1 + squash * 0.85;
|
|
176
|
+
const eyeOpenBase = smoothstep(params.eyeOpen, params.eyeOpen + 0.20, p);
|
|
177
|
+
const eyePop = Math.sin(Math.PI * smoothstep(params.eyeOpen + 0.12, params.eyeOpen + 0.26, p)) * 0.08;
|
|
178
|
+
const eyeScale = p < params.eyeOpen ? 0.07 : clamp(eyeOpenBase + eyePop, 0.07, 1.08);
|
|
179
|
+
const flowOffset = Math.sin(2 * Math.PI * easeOutCubic(bodyP)) * 2.2;
|
|
180
|
+
return { p, tx, ty, rot, sx, sy, eyeScale, flowOffset };
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function setEyeRect(rect, base, scale) {
|
|
184
|
+
const h = Math.max(base.h * scale, 0.16);
|
|
185
|
+
const y = base.y + (base.h - h) / 2;
|
|
186
|
+
const rx = Math.min(base.rx, h / 2);
|
|
187
|
+
rect.setAttribute("height", h.toFixed(3));
|
|
188
|
+
rect.setAttribute("y", y.toFixed(3));
|
|
189
|
+
rect.setAttribute("rx", rx.toFixed(3));
|
|
190
|
+
rect.setAttribute("ry", rx.toFixed(3));
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function renderProgress(p) {
|
|
194
|
+
const s = stateAt(clamp(p, 0, 1));
|
|
195
|
+
enter.setAttribute(
|
|
196
|
+
"transform",
|
|
197
|
+
`translate(${s.tx.toFixed(3)} ${s.ty.toFixed(3)}) translate(12 12) rotate(${s.rot.toFixed(3)}) scale(${s.sx.toFixed(4)} ${s.sy.toFixed(4)}) translate(-12 -12)`
|
|
198
|
+
);
|
|
199
|
+
setEyeRect(eyeL, EYE_BASE.l, s.eyeScale);
|
|
200
|
+
setEyeRect(eyeR, EYE_BASE.r, s.eyeScale);
|
|
201
|
+
eyeGrad.setAttribute("y1", (3 + s.flowOffset).toFixed(2));
|
|
202
|
+
eyeGrad.setAttribute("y2", (21 + s.flowOffset).toFixed(2));
|
|
203
|
+
progressReadout.textContent = `progress: ${s.p.toFixed(2)}`;
|
|
204
|
+
poseReadout.textContent = `tx: ${s.tx.toFixed(2)}, rot: ${s.rot.toFixed(1)}deg, scale: ${s.sx.toFixed(2)} ${s.sy.toFixed(2)}`;
|
|
205
|
+
lastState = s;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function tick(now) {
|
|
209
|
+
if (playing) {
|
|
210
|
+
const p = (now - startT) / (params.duration * 1000);
|
|
211
|
+
heldProgress = clamp(p, 0, 1);
|
|
212
|
+
renderProgress(heldProgress);
|
|
213
|
+
if (p >= 1) playing = false;
|
|
214
|
+
}
|
|
215
|
+
requestAnimationFrame(tick);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function replay() {
|
|
219
|
+
startT = performance.now();
|
|
220
|
+
heldProgress = 0;
|
|
221
|
+
playing = true;
|
|
222
|
+
renderProgress(0);
|
|
223
|
+
}
|
|
224
|
+
requestAnimationFrame(tick);
|
|
225
|
+
]]></script>
|
|
226
|
+
</svg>
|