@mumulinya167/ccm-pet-assets 2.0.0 → 2.0.2

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 (141) hide show
  1. package/assets/calico/calico-idle-follow.svg +324 -324
  2. package/assets/calico.svg +324 -324
  3. package/assets/clawd/LICENSE +22 -22
  4. package/assets/clawd/clawd-about-hero.svg +202 -202
  5. package/assets/clawd/clawd-collapse-sleep.svg +247 -247
  6. package/assets/clawd/clawd-error.svg +94 -94
  7. package/assets/clawd/clawd-happy.svg +160 -160
  8. package/assets/clawd/clawd-headphones-groove.svg +194 -194
  9. package/assets/clawd/clawd-idle-bubble.svg +180 -180
  10. package/assets/clawd/clawd-idle-collapse.svg +101 -101
  11. package/assets/clawd/clawd-idle-doze.svg +72 -72
  12. package/assets/clawd/clawd-idle-follow.svg +64 -64
  13. package/assets/clawd/clawd-idle-living.svg +195 -195
  14. package/assets/clawd/clawd-idle-look.svg +115 -115
  15. package/assets/clawd/clawd-idle-reading.svg +252 -252
  16. package/assets/clawd/clawd-idle-yawn.svg +158 -158
  17. package/assets/clawd/clawd-mini-alert.svg +129 -129
  18. package/assets/clawd/clawd-mini-crabwalk.svg +76 -76
  19. package/assets/clawd/clawd-mini-enter-sleep.svg +64 -64
  20. package/assets/clawd/clawd-mini-enter.svg +114 -114
  21. package/assets/clawd/clawd-mini-happy.svg +124 -124
  22. package/assets/clawd/clawd-mini-idle.svg +83 -83
  23. package/assets/clawd/clawd-mini-peek.svg +82 -82
  24. package/assets/clawd/clawd-mini-sleep.svg +112 -112
  25. package/assets/clawd/clawd-mini-typing.svg +153 -153
  26. package/assets/clawd/clawd-notification.svg +438 -438
  27. package/assets/clawd/clawd-react-annoyed.svg +167 -167
  28. package/assets/clawd/clawd-react-double-jump.svg +229 -229
  29. package/assets/clawd/clawd-react-double.svg +108 -108
  30. package/assets/clawd/clawd-react-drag.svg +102 -102
  31. package/assets/clawd/clawd-react-left.svg +102 -102
  32. package/assets/clawd/clawd-react-right.svg +102 -102
  33. package/assets/clawd/clawd-sleeping.svg +117 -117
  34. package/assets/clawd/clawd-static-base.svg +20 -20
  35. package/assets/clawd/clawd-wake.svg +277 -277
  36. package/assets/clawd/clawd-working-building.svg +329 -329
  37. package/assets/clawd/clawd-working-carrying.svg +178 -178
  38. package/assets/clawd/clawd-working-debugger.svg +245 -245
  39. package/assets/clawd/clawd-working-juggling.svg +183 -183
  40. package/assets/clawd/clawd-working-sweeping.svg +248 -248
  41. package/assets/clawd/clawd-working-thinking.svg +501 -501
  42. package/assets/clawd/clawd-working-typing-boss.svg +307 -307
  43. package/assets/clawd/clawd-working-typing.svg +273 -273
  44. package/assets/clawd/clawd-working-ultrathink.svg +166 -166
  45. package/assets/clawd/clawd-working-wizard.svg +356 -356
  46. package/assets/clawd.svg +64 -64
  47. package/assets/cloudling/cloudling/cloudling-attention.svg +379 -379
  48. package/assets/cloudling/cloudling/cloudling-building.svg +667 -667
  49. package/assets/cloudling/cloudling/cloudling-carrying.svg +604 -604
  50. package/assets/cloudling/cloudling/cloudling-conducting.svg +616 -616
  51. package/assets/cloudling/cloudling/cloudling-dozing-to-sleeping.svg +578 -578
  52. package/assets/cloudling/cloudling/cloudling-dozing.svg +358 -358
  53. package/assets/cloudling/cloudling/cloudling-error.svg +428 -428
  54. package/assets/cloudling/cloudling/cloudling-idle-reading.svg +658 -658
  55. package/assets/cloudling/cloudling/cloudling-idle-to-dozing.svg +568 -568
  56. package/assets/cloudling/cloudling/cloudling-idle-to-sleeping.svg +811 -811
  57. package/assets/cloudling/cloudling/cloudling-idle.svg +255 -255
  58. package/assets/cloudling/cloudling/cloudling-juggling.svg +648 -648
  59. package/assets/cloudling/cloudling/cloudling-mini-alert.svg +389 -389
  60. package/assets/cloudling/cloudling/cloudling-mini-crabwalk.svg +335 -335
  61. package/assets/cloudling/cloudling/cloudling-mini-enter-roll-in.svg +225 -225
  62. package/assets/cloudling/cloudling/cloudling-mini-enter-sleep.svg +231 -231
  63. package/assets/cloudling/cloudling/cloudling-mini-happy.svg +370 -370
  64. package/assets/cloudling/cloudling/cloudling-mini-idle.svg +279 -279
  65. package/assets/cloudling/cloudling/cloudling-mini-peek.svg +327 -327
  66. package/assets/cloudling/cloudling/cloudling-mini-sleep.svg +260 -260
  67. package/assets/cloudling/cloudling/cloudling-mini-typing.svg +691 -691
  68. package/assets/cloudling/cloudling/cloudling-notification.svg +493 -493
  69. package/assets/cloudling/cloudling/cloudling-react-drag.svg +83 -83
  70. package/assets/cloudling/cloudling/cloudling-sleeping-to-idle.svg +555 -555
  71. package/assets/cloudling/cloudling/cloudling-sleeping.svg +500 -500
  72. package/assets/cloudling/cloudling/cloudling-sweeping.svg +292 -292
  73. package/assets/cloudling/cloudling/cloudling-thinking.svg +719 -719
  74. package/assets/cloudling/cloudling/cloudling-typing.svg +354 -354
  75. package/assets/cloudling/cloudling-attention.svg +379 -379
  76. package/assets/cloudling/cloudling-building.svg +667 -667
  77. package/assets/cloudling/cloudling-carrying.svg +604 -604
  78. package/assets/cloudling/cloudling-conducting.svg +616 -616
  79. package/assets/cloudling/cloudling-dozing-to-sleeping.svg +578 -578
  80. package/assets/cloudling/cloudling-dozing.svg +358 -358
  81. package/assets/cloudling/cloudling-error.svg +428 -428
  82. package/assets/cloudling/cloudling-idle-reading.svg +658 -658
  83. package/assets/cloudling/cloudling-idle-to-dozing.svg +568 -568
  84. package/assets/cloudling/cloudling-idle-to-sleeping.svg +811 -811
  85. package/assets/cloudling/cloudling-idle.svg +255 -255
  86. package/assets/cloudling/cloudling-juggling.svg +648 -648
  87. package/assets/cloudling/cloudling-mini-alert.svg +389 -389
  88. package/assets/cloudling/cloudling-mini-crabwalk.svg +335 -335
  89. package/assets/cloudling/cloudling-mini-enter-roll-in.svg +225 -225
  90. package/assets/cloudling/cloudling-mini-enter-sleep.svg +231 -231
  91. package/assets/cloudling/cloudling-mini-happy.svg +370 -370
  92. package/assets/cloudling/cloudling-mini-idle.svg +279 -279
  93. package/assets/cloudling/cloudling-mini-peek.svg +327 -327
  94. package/assets/cloudling/cloudling-mini-sleep.svg +260 -260
  95. package/assets/cloudling/cloudling-mini-typing.svg +691 -691
  96. package/assets/cloudling/cloudling-notification.svg +493 -493
  97. package/assets/cloudling/cloudling-react-drag.svg +83 -83
  98. package/assets/cloudling/cloudling-sleeping-to-idle.svg +555 -555
  99. package/assets/cloudling/cloudling-sleeping.svg +500 -500
  100. package/assets/cloudling/cloudling-sweeping.svg +292 -292
  101. package/assets/cloudling/cloudling-thinking.svg +719 -719
  102. package/assets/cloudling/cloudling-typing.svg +354 -354
  103. package/assets/cloudling.svg +255 -255
  104. package/assets/ghost-attention.svg +19 -19
  105. package/assets/ghost-carrying.svg +19 -19
  106. package/assets/ghost-collapsing.svg +19 -19
  107. package/assets/ghost-dozing.svg +23 -23
  108. package/assets/ghost-error.svg +19 -19
  109. package/assets/ghost-happy.svg +23 -23
  110. package/assets/ghost-idle.svg +11 -11
  111. package/assets/ghost-juggling.svg +19 -19
  112. package/assets/ghost-notification.svg +19 -19
  113. package/assets/ghost-react-double.svg +23 -23
  114. package/assets/ghost-react-drag.svg +23 -23
  115. package/assets/ghost-react-left.svg +19 -19
  116. package/assets/ghost-react-right.svg +19 -19
  117. package/assets/ghost-sleeping.svg +19 -19
  118. package/assets/ghost-sweeping.svg +19 -19
  119. package/assets/ghost-waking.svg +19 -19
  120. package/assets/ghost-yawning.svg +23 -23
  121. package/assets/ghost.svg +11 -11
  122. package/assets/robot-attention.svg +19 -19
  123. package/assets/robot-carrying.svg +19 -19
  124. package/assets/robot-collapsing.svg +19 -19
  125. package/assets/robot-dozing.svg +23 -23
  126. package/assets/robot-error.svg +19 -19
  127. package/assets/robot-happy.svg +23 -23
  128. package/assets/robot-idle.svg +11 -11
  129. package/assets/robot-juggling.svg +19 -19
  130. package/assets/robot-notification.svg +19 -19
  131. package/assets/robot-react-double.svg +23 -23
  132. package/assets/robot-react-drag.svg +23 -23
  133. package/assets/robot-react-left.svg +19 -19
  134. package/assets/robot-react-right.svg +19 -19
  135. package/assets/robot-sleeping.svg +19 -19
  136. package/assets/robot-sweeping.svg +19 -19
  137. package/assets/robot-waking.svg +19 -19
  138. package/assets/robot-yawning.svg +23 -23
  139. package/assets/robot.svg +11 -11
  140. package/manifest.json +280 -280
  141. package/package.json +1 -1
@@ -1,335 +1,335 @@
1
- <svg id="cloudling" xmlns="http://www.w3.org/2000/svg" viewBox="-6 -6 36 36" 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: .9; }
40
- .edge-rim-soft { stroke-opacity: .75; }
41
- .edge-contact { stroke-opacity: .9; }
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: .95; }
48
- .edge-rim-soft { stroke-opacity: .85; }
49
- .edge-contact { stroke-opacity: .95; }
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="#93c5fd"/>
78
- <stop offset="0.5" stop-color="#60a5fa"/>
79
- <stop offset="1" stop-color="#3b82f6"/>
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="#93c5fd" stop-opacity="0.9"/>
88
- <stop offset="1" stop-color="#93c5fd" 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.35"/>
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.4" stroke-linejoin="round" filter="url(#edge-blur)"/>
131
- <path id="edge-soft" class="edge-rim-soft" fill="none" stroke="#7A9DFF" stroke-width="1.2" stroke-linejoin="round" filter="url(#edge-blur)"/>
132
- <path id="edge-tight" class="edge-rim-tight" fill="none" stroke="#aab3c6" stroke-width="0.8" 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>
1
+ <svg id="cloudling" xmlns="http://www.w3.org/2000/svg" viewBox="-6 -6 36 36" 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: .9; }
40
+ .edge-rim-soft { stroke-opacity: .75; }
41
+ .edge-contact { stroke-opacity: .9; }
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: .95; }
48
+ .edge-rim-soft { stroke-opacity: .85; }
49
+ .edge-contact { stroke-opacity: .95; }
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="#93c5fd"/>
78
+ <stop offset="0.5" stop-color="#60a5fa"/>
79
+ <stop offset="1" stop-color="#3b82f6"/>
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="#93c5fd" stop-opacity="0.9"/>
88
+ <stop offset="1" stop-color="#93c5fd" 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.35"/>
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.4" stroke-linejoin="round" filter="url(#edge-blur)"/>
131
+ <path id="edge-soft" class="edge-rim-soft" fill="none" stroke="#7A9DFF" stroke-width="1.2" stroke-linejoin="round" filter="url(#edge-blur)"/>
132
+ <path id="edge-tight" class="edge-rim-tight" fill="none" stroke="#aab3c6" stroke-width="0.8" 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>