@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.
Files changed (178) hide show
  1. package/README.md +4 -0
  2. package/assets/calico/calico-collapsing.apng +0 -0
  3. package/assets/calico/calico-dozing.apng +0 -0
  4. package/assets/calico/calico-error.apng +0 -0
  5. package/assets/calico/calico-happy.apng +0 -0
  6. package/assets/calico/calico-idle-follow.svg +324 -0
  7. package/assets/calico/calico-idle.apng +0 -0
  8. package/assets/calico/calico-mini-alert.apng +0 -0
  9. package/assets/calico/calico-mini-crabwalk.apng +0 -0
  10. package/assets/calico/calico-mini-enter.apng +0 -0
  11. package/assets/calico/calico-mini-happy.apng +0 -0
  12. package/assets/calico/calico-mini-idle.apng +0 -0
  13. package/assets/calico/calico-mini-peek.apng +0 -0
  14. package/assets/calico/calico-mini-sleep.apng +0 -0
  15. package/assets/calico/calico-notification.apng +0 -0
  16. package/assets/calico/calico-react-drag.apng +0 -0
  17. package/assets/calico/calico-react-left.apng +0 -0
  18. package/assets/calico/calico-react-poke.apng +0 -0
  19. package/assets/calico/calico-sleeping.apng +0 -0
  20. package/assets/calico/calico-thinking.apng +0 -0
  21. package/assets/calico/calico-waking.apng +0 -0
  22. package/assets/calico/calico-working-building.apng +0 -0
  23. package/assets/calico/calico-working-carrying.apng +0 -0
  24. package/assets/calico/calico-working-conducting.apng +0 -0
  25. package/assets/calico/calico-working-juggling.apng +0 -0
  26. package/assets/calico/calico-working-sweeping.apng +0 -0
  27. package/assets/calico/calico-working-typing.apng +0 -0
  28. package/assets/calico/calico-yawning.apng +0 -0
  29. package/assets/calico.svg +324 -0
  30. package/assets/clawd/LICENSE +22 -0
  31. package/assets/clawd/clawd-about-hero.svg +202 -0
  32. package/assets/clawd/clawd-collapse-sleep.svg +247 -0
  33. package/assets/clawd/clawd-error.svg +94 -0
  34. package/assets/clawd/clawd-happy.svg +161 -0
  35. package/assets/clawd/clawd-headphones-groove.svg +194 -0
  36. package/assets/clawd/clawd-idle-bubble.svg +180 -0
  37. package/assets/clawd/clawd-idle-collapse.svg +101 -0
  38. package/assets/clawd/clawd-idle-doze.svg +72 -0
  39. package/assets/clawd/clawd-idle-follow.svg +64 -0
  40. package/assets/clawd/clawd-idle-living.svg +196 -0
  41. package/assets/clawd/clawd-idle-look.svg +115 -0
  42. package/assets/clawd/clawd-idle-reading.svg +252 -0
  43. package/assets/clawd/clawd-idle-yawn.svg +158 -0
  44. package/assets/clawd/clawd-mini-alert.svg +129 -0
  45. package/assets/clawd/clawd-mini-crabwalk.svg +76 -0
  46. package/assets/clawd/clawd-mini-enter-sleep.svg +64 -0
  47. package/assets/clawd/clawd-mini-enter.svg +114 -0
  48. package/assets/clawd/clawd-mini-happy.svg +124 -0
  49. package/assets/clawd/clawd-mini-idle.svg +83 -0
  50. package/assets/clawd/clawd-mini-peek.svg +82 -0
  51. package/assets/clawd/clawd-mini-sleep.svg +112 -0
  52. package/assets/clawd/clawd-mini-typing.svg +153 -0
  53. package/assets/clawd/clawd-notification.svg +438 -0
  54. package/assets/clawd/clawd-react-annoyed.svg +167 -0
  55. package/assets/clawd/clawd-react-double-jump.svg +229 -0
  56. package/assets/clawd/clawd-react-double.svg +108 -0
  57. package/assets/clawd/clawd-react-drag.svg +102 -0
  58. package/assets/clawd/clawd-react-left.svg +102 -0
  59. package/assets/clawd/clawd-react-right.svg +102 -0
  60. package/assets/clawd/clawd-sleeping.svg +118 -0
  61. package/assets/clawd/clawd-static-base.svg +21 -0
  62. package/assets/clawd/clawd-wake.svg +277 -0
  63. package/assets/clawd/clawd-working-building.svg +329 -0
  64. package/assets/clawd/clawd-working-carrying.svg +178 -0
  65. package/assets/clawd/clawd-working-debugger.svg +245 -0
  66. package/assets/clawd/clawd-working-juggling.svg +183 -0
  67. package/assets/clawd/clawd-working-sweeping.svg +248 -0
  68. package/assets/clawd/clawd-working-thinking.svg +501 -0
  69. package/assets/clawd/clawd-working-typing-boss.svg +307 -0
  70. package/assets/clawd/clawd-working-typing.svg +273 -0
  71. package/assets/clawd/clawd-working-ultrathink.svg +166 -0
  72. package/assets/clawd/clawd-working-wizard.svg +356 -0
  73. package/assets/clawd.svg +64 -0
  74. package/assets/cloudling/cloudling/cloudling-attention.svg +380 -0
  75. package/assets/cloudling/cloudling/cloudling-building.svg +667 -0
  76. package/assets/cloudling/cloudling/cloudling-carrying.svg +604 -0
  77. package/assets/cloudling/cloudling/cloudling-conducting.svg +616 -0
  78. package/assets/cloudling/cloudling/cloudling-dozing-to-sleeping.svg +578 -0
  79. package/assets/cloudling/cloudling/cloudling-dozing.svg +358 -0
  80. package/assets/cloudling/cloudling/cloudling-error.svg +428 -0
  81. package/assets/cloudling/cloudling/cloudling-idle-reading.svg +658 -0
  82. package/assets/cloudling/cloudling/cloudling-idle-to-dozing.svg +568 -0
  83. package/assets/cloudling/cloudling/cloudling-idle-to-sleeping.svg +811 -0
  84. package/assets/cloudling/cloudling/cloudling-idle.svg +255 -0
  85. package/assets/cloudling/cloudling/cloudling-juggling.svg +648 -0
  86. package/assets/cloudling/cloudling/cloudling-mini-alert.svg +390 -0
  87. package/assets/cloudling/cloudling/cloudling-mini-crabwalk.svg +335 -0
  88. package/assets/cloudling/cloudling/cloudling-mini-enter-roll-in.svg +226 -0
  89. package/assets/cloudling/cloudling/cloudling-mini-enter-sleep.svg +232 -0
  90. package/assets/cloudling/cloudling/cloudling-mini-happy.svg +371 -0
  91. package/assets/cloudling/cloudling/cloudling-mini-idle.svg +279 -0
  92. package/assets/cloudling/cloudling/cloudling-mini-peek.svg +328 -0
  93. package/assets/cloudling/cloudling/cloudling-mini-sleep.svg +260 -0
  94. package/assets/cloudling/cloudling/cloudling-mini-typing.svg +692 -0
  95. package/assets/cloudling/cloudling/cloudling-notification.svg +494 -0
  96. package/assets/cloudling/cloudling/cloudling-react-drag.svg +83 -0
  97. package/assets/cloudling/cloudling/cloudling-sleeping-to-idle.svg +555 -0
  98. package/assets/cloudling/cloudling/cloudling-sleeping.svg +500 -0
  99. package/assets/cloudling/cloudling/cloudling-sweeping.svg +292 -0
  100. package/assets/cloudling/cloudling/cloudling-thinking.svg +720 -0
  101. package/assets/cloudling/cloudling/cloudling-typing.svg +354 -0
  102. package/assets/cloudling/cloudling-attention.svg +380 -0
  103. package/assets/cloudling/cloudling-building.svg +667 -0
  104. package/assets/cloudling/cloudling-carrying.svg +604 -0
  105. package/assets/cloudling/cloudling-conducting.svg +616 -0
  106. package/assets/cloudling/cloudling-dozing-to-sleeping.svg +578 -0
  107. package/assets/cloudling/cloudling-dozing.svg +358 -0
  108. package/assets/cloudling/cloudling-error.svg +428 -0
  109. package/assets/cloudling/cloudling-idle-reading.svg +658 -0
  110. package/assets/cloudling/cloudling-idle-to-dozing.svg +568 -0
  111. package/assets/cloudling/cloudling-idle-to-sleeping.svg +811 -0
  112. package/assets/cloudling/cloudling-idle.svg +255 -0
  113. package/assets/cloudling/cloudling-juggling.svg +648 -0
  114. package/assets/cloudling/cloudling-mini-alert.svg +390 -0
  115. package/assets/cloudling/cloudling-mini-crabwalk.svg +335 -0
  116. package/assets/cloudling/cloudling-mini-enter-roll-in.svg +226 -0
  117. package/assets/cloudling/cloudling-mini-enter-sleep.svg +232 -0
  118. package/assets/cloudling/cloudling-mini-happy.svg +371 -0
  119. package/assets/cloudling/cloudling-mini-idle.svg +279 -0
  120. package/assets/cloudling/cloudling-mini-peek.svg +328 -0
  121. package/assets/cloudling/cloudling-mini-sleep.svg +260 -0
  122. package/assets/cloudling/cloudling-mini-typing.svg +692 -0
  123. package/assets/cloudling/cloudling-notification.svg +494 -0
  124. package/assets/cloudling/cloudling-react-drag.svg +83 -0
  125. package/assets/cloudling/cloudling-sleeping-to-idle.svg +555 -0
  126. package/assets/cloudling/cloudling-sleeping.svg +500 -0
  127. package/assets/cloudling/cloudling-sweeping.svg +292 -0
  128. package/assets/cloudling/cloudling-thinking.svg +720 -0
  129. package/assets/cloudling/cloudling-typing.svg +354 -0
  130. package/assets/cloudling.svg +255 -0
  131. package/assets/ghost-attention.svg +19 -0
  132. package/assets/ghost-carrying.svg +19 -0
  133. package/assets/ghost-collapsing.svg +19 -0
  134. package/assets/ghost-dozing.svg +23 -0
  135. package/assets/ghost-error.svg +19 -0
  136. package/assets/ghost-happy.svg +23 -0
  137. package/assets/ghost-idle-action1.svg +19 -0
  138. package/assets/ghost-idle-action2.svg +19 -0
  139. package/assets/ghost-idle-action3.svg +19 -0
  140. package/assets/ghost-idle.svg +11 -0
  141. package/assets/ghost-juggling.svg +19 -0
  142. package/assets/ghost-notification.svg +19 -0
  143. package/assets/ghost-react-double.svg +23 -0
  144. package/assets/ghost-react-drag.svg +23 -0
  145. package/assets/ghost-react-left.svg +19 -0
  146. package/assets/ghost-react-right.svg +19 -0
  147. package/assets/ghost-sleeping.svg +19 -0
  148. package/assets/ghost-sweeping.svg +19 -0
  149. package/assets/ghost-thinking.svg +19 -0
  150. package/assets/ghost-waking.svg +19 -0
  151. package/assets/ghost-working.svg +19 -0
  152. package/assets/ghost-yawning.svg +23 -0
  153. package/assets/ghost.svg +11 -0
  154. package/assets/robot-attention.svg +19 -0
  155. package/assets/robot-carrying.svg +19 -0
  156. package/assets/robot-collapsing.svg +19 -0
  157. package/assets/robot-dozing.svg +23 -0
  158. package/assets/robot-error.svg +19 -0
  159. package/assets/robot-happy.svg +23 -0
  160. package/assets/robot-idle-action1.svg +19 -0
  161. package/assets/robot-idle-action2.svg +19 -0
  162. package/assets/robot-idle-action3.svg +19 -0
  163. package/assets/robot-idle.svg +11 -0
  164. package/assets/robot-juggling.svg +19 -0
  165. package/assets/robot-notification.svg +19 -0
  166. package/assets/robot-react-double.svg +23 -0
  167. package/assets/robot-react-drag.svg +23 -0
  168. package/assets/robot-react-left.svg +19 -0
  169. package/assets/robot-react-right.svg +19 -0
  170. package/assets/robot-sleeping.svg +19 -0
  171. package/assets/robot-sweeping.svg +19 -0
  172. package/assets/robot-thinking.svg +19 -0
  173. package/assets/robot-waking.svg +19 -0
  174. package/assets/robot-working.svg +19 -0
  175. package/assets/robot-yawning.svg +23 -0
  176. package/assets/robot.svg +11 -0
  177. package/manifest.json +889 -0
  178. package/package.json +18 -0
@@ -0,0 +1,260 @@
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
+ @media (prefers-color-scheme: light) {
12
+ .v { color: #3941FF; }
13
+ .edge-rim-tight { stroke-opacity: .75; }
14
+ .edge-rim-soft { stroke-opacity: .60; }
15
+ .edge-contact { stroke-opacity: .75; }
16
+ .cloud-drop-shadow { flood-opacity: .13; }
17
+ .food-cloud-shadow { flood-opacity: .28; flood-color: #5060FF; }
18
+ .food-cloud > path {
19
+ stroke: #5870E8 !important;
20
+ stroke-width: 1.2 !important;
21
+ stroke-opacity: .9 !important;
22
+ vector-effect: non-scaling-stroke !important;
23
+ }
24
+ }
25
+ ]]></style>
26
+ <defs>
27
+ <linearGradient id="body-grad" x1="12" y1="2" x2="12" y2="22" gradientUnits="userSpaceOnUse">
28
+ <stop offset="0" stop-color="#f0f9ff"/>
29
+ <stop offset="0.5" stop-color="#e0f2fe"/>
30
+ <stop offset="1" stop-color="#bae6fd"/>
31
+ </linearGradient>
32
+ <linearGradient id="eye-grad" x1="12" y1="3" x2="12" y2="21" gradientUnits="userSpaceOnUse">
33
+ <stop offset="0" stop-color="#B1A7FF"/>
34
+ <stop offset="0.5" stop-color="#7A9DFF"/>
35
+ <stop offset="1" stop-color="#3941FF"/>
36
+ </linearGradient>
37
+ <linearGradient id="zzz-grad" x1="0" y1="-2" x2="0" y2="3" gradientUnits="userSpaceOnUse">
38
+ <stop offset="0" stop-color="#B1A7FF"/>
39
+ <stop offset="0.55" stop-color="#7A9DFF"/>
40
+ <stop offset="1" stop-color="#3941FF"/>
41
+ </linearGradient>
42
+ <radialGradient id="hi-grad" cx="0.45" cy="0.25" r="0.55">
43
+ <stop offset="0" stop-color="#f0f9ff" stop-opacity="0.9"/>
44
+ <stop offset="1" stop-color="#f0f9ff" stop-opacity="0"/>
45
+ </radialGradient>
46
+ <filter id="drop" x="-40%" y="-40%" width="180%" height="180%">
47
+ <feDropShadow class="cloud-drop-shadow" dx="0" dy="0.55" stdDeviation="0.72" flood-color="#3941FF" flood-opacity="0.17"/>
48
+ </filter>
49
+ <filter id="edge-blur" x="-40%" y="-40%" width="180%" height="180%">
50
+ <feGaussianBlur stdDeviation="0.16"/>
51
+ </filter>
52
+ <filter id="zzz-glow" x="-80%" y="-80%" width="260%" height="260%">
53
+ <feDropShadow dx="0" dy="0.25" stdDeviation="0.26" flood-color="#7A9DFF" flood-opacity="0.38"/>
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-.740 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
+
63
+ <g id="zzz-js" fill="none" stroke="url(#zzz-grad)" stroke-linecap="round" stroke-linejoin="round" filter="url(#zzz-glow)" opacity="0.72">
64
+ <path id="z1" stroke-width="0.58"/>
65
+ <path id="z2" stroke-width="0.68"/>
66
+ <path id="z3" stroke-width="0.80"/>
67
+ </g>
68
+
69
+ <g id="body-js">
70
+ <g id="breath-js">
71
+ <g id="edge-system">
72
+ <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)"/>
73
+ <use class="edge-rim-soft" href="#cloud-shape" fill="none" stroke="#7A9DFF" stroke-width=".84" stroke-linejoin="round" filter="url(#edge-blur)"/>
74
+ <use class="edge-rim-tight" href="#cloud-shape" fill="none" stroke="#aab3c6" stroke-width=".38" stroke-linejoin="round"/>
75
+ </g>
76
+ <g filter="url(#drop)">
77
+ <use href="#cloud-shape" fill="url(#body-grad)"/>
78
+ <rect x="1" y="2" width="22" height="11" fill="url(#hi-grad)" clip-path="url(#cloud-clip)"/>
79
+ </g>
80
+ </g>
81
+ </g>
82
+ <g id="eyes-js">
83
+ <path id="eye-l" class="eye" fill="none" stroke="url(#eye-grad)" stroke-width="0.72" stroke-linecap="round" stroke-linejoin="round"/>
84
+ <path id="eye-r" class="eye" fill="none" stroke="url(#eye-grad)" stroke-width="0.72" stroke-linecap="round" stroke-linejoin="round"/>
85
+ </g>
86
+ <g id="__cloudling-export-shims" opacity="0" pointer-events="none" style="display:none">
87
+ <g id="phase-readout"></g>
88
+ <g id="pose-readout"></g>
89
+ </g>
90
+
91
+ <script type="application/ecmascript"><![CDATA[
92
+ const body = document.getElementById("breath-js");
93
+ const eyes = document.getElementById("eyes-js");
94
+ const zzz = document.getElementById("zzz-js");
95
+ const zEls = [
96
+ document.getElementById("z1"),
97
+ document.getElementById("z2"),
98
+ document.getElementById("z3"),
99
+ ];
100
+ const eyeL = document.getElementById("eye-l");
101
+ const eyeR = document.getElementById("eye-r");
102
+ const eyeGrad = document.getElementById("eye-grad");
103
+ const phaseReadout = document.getElementById("phase-readout");
104
+ const poseReadout = document.getElementById("pose-readout");
105
+
106
+ const EYE_BASE = {
107
+ l: { cx: 7.75, cy: 12.02, w: 2.58, h: 1.18, tilt: -6.0 },
108
+ r: { cx: 12.15, cy: 12.02, w: 2.58, h: 1.18, tilt: 6.0 },
109
+ };
110
+ const params = {
111
+ period: 6.4,
112
+ breath: 0.050,
113
+ nodDepth: 0.40,
114
+ nodRot: -0.55,
115
+ eyeDrop: 0.12,
116
+ eyeSoft: 0.10,
117
+ flowAmp: 2.4,
118
+ eyeStroke: 0.72,
119
+ zInterval: 2.05,
120
+ zLifetime: 3.15,
121
+ zStartX: 1.40,
122
+ zStartY: 9.25,
123
+ zRiseDist: 5.35,
124
+ zDriftX: -1.35,
125
+ zMaxSize: 1.90,
126
+ zMinSize: 1.43,
127
+ zMaxOpacity: 0.68,
128
+ };
129
+
130
+ let startT = performance.now();
131
+ let paused = false;
132
+ let pausedAt = 0;
133
+ let pauseOffset = 0;
134
+ let lastState = null;
135
+ let glyphFlipCompensation = false;
136
+
137
+ function clamp(v, min, max) {
138
+ return Math.max(min, Math.min(max, v));
139
+ }
140
+
141
+ function smoothstep01(x) {
142
+ const t = clamp(x, 0, 1);
143
+ return t * t * (3 - 2 * t);
144
+ }
145
+
146
+ function loopDistance(a, b) {
147
+ return Math.abs(((a - b + 0.5) % 1 + 1) % 1 - 0.5);
148
+ }
149
+
150
+ function loopBump(phase, center, width) {
151
+ const d = loopDistance(phase, center);
152
+ if (d >= width) return 0;
153
+ return 1 - smoothstep01(d / width);
154
+ }
155
+
156
+ function sleepyEyePath(base, drop, soft) {
157
+ const x1 = base.cx - base.w / 2;
158
+ const x2 = base.cx + base.w / 2;
159
+ const cy = base.cy + drop;
160
+ const mid = cy + base.h * 0.48 + soft;
161
+ const c1x = base.cx - base.w * 0.17;
162
+ const c2x = base.cx + base.w * 0.17;
163
+ const tilt = base.tilt * 0.018;
164
+ return `M ${x1.toFixed(2)} ${(cy - tilt).toFixed(2)} C ${c1x.toFixed(2)} ${mid.toFixed(2)} ${c2x.toFixed(2)} ${mid.toFixed(2)} ${x2.toFixed(2)} ${(cy + tilt).toFixed(2)}`;
165
+ }
166
+
167
+ function zPath(scale) {
168
+ const w = 1.55 * scale;
169
+ const h = 1.20 * scale;
170
+ const x0 = glyphFlipCompensation ? w / 2 : -w / 2;
171
+ const x1 = -x0;
172
+ return `M ${x0.toFixed(2)} ${(-h / 2).toFixed(2)} L ${x1.toFixed(2)} ${(-h / 2).toFixed(2)} L ${x0.toFixed(2)} ${(h / 2).toFixed(2)} L ${x1.toFixed(2)} ${(h / 2).toFixed(2)}`;
173
+ }
174
+
175
+ function frameAt(seconds) {
176
+ const phase = (seconds / params.period) % 1;
177
+ const inhale = (1 - Math.cos(phase * Math.PI * 2)) / 2;
178
+ const nod = loopBump(phase, 0.68, 0.15);
179
+ const micro = Math.sin(phase * Math.PI * 2) * 0.012;
180
+ const sx = 1 + inhale * params.breath * 0.62 + nod * 0.006;
181
+ const sy = 1 + inhale * params.breath * 1.00 - nod * 0.008;
182
+ const ty = -inhale * params.breath * 2.9 + nod * params.nodDepth + micro;
183
+ const rot = nod * params.nodRot + inhale * 0.06;
184
+ const eyeDrop = params.eyeDrop - inhale * 0.045 + nod * 0.075;
185
+ const eyeSoft = params.eyeSoft + inhale * 0.055 + nod * 0.055;
186
+ const eyeStroke = params.eyeStroke + inhale * 0.025 + nod * 0.02;
187
+ const flowOffset = Math.sin(2 * Math.PI * phase) * params.flowAmp;
188
+ return { phase, inhale, nod, sx, sy, ty, rot, eyeDrop, eyeSoft, eyeStroke, flowOffset };
189
+ }
190
+
191
+ function renderZzz(seconds) {
192
+ params.zMinSize = params.zMaxSize * 0.75;
193
+ const slotCount = zEls.length;
194
+ for (let i = 0; i < slotCount; i++) {
195
+ const bornAt = i * params.zInterval;
196
+ const cycle = params.zInterval * slotCount;
197
+ const age = ((seconds - bornAt) % cycle + cycle) % cycle;
198
+ const el = zEls[i];
199
+ if (age > params.zLifetime) {
200
+ el.setAttribute("opacity", "0");
201
+ continue;
202
+ }
203
+ const u = age / params.zLifetime;
204
+ const x = params.zStartX + params.zDriftX * u + Math.sin(u * Math.PI * 2) * 0.16;
205
+ const y = params.zStartY - params.zRiseDist * u;
206
+ const size = params.zMaxSize + (params.zMinSize - params.zMaxSize) * u;
207
+ let opacity;
208
+ if (u < 0.18) {
209
+ opacity = (u / 0.18) * params.zMaxOpacity;
210
+ } else if (u < 0.68) {
211
+ opacity = params.zMaxOpacity;
212
+ } else {
213
+ opacity = params.zMaxOpacity * (1 - (u - 0.68) / 0.32);
214
+ }
215
+ el.setAttribute("d", zPath(size));
216
+ el.setAttribute("transform", `translate(${x.toFixed(2)} ${y.toFixed(2)}) rotate(-7)`);
217
+ el.setAttribute("opacity", Math.max(0, opacity).toFixed(3));
218
+ }
219
+ zzz.setAttribute("opacity", "0.82");
220
+ }
221
+
222
+ function renderFrame(seconds) {
223
+ const s = frameAt(seconds);
224
+ body.setAttribute(
225
+ "transform",
226
+ `translate(12 12) translate(0 ${s.ty.toFixed(3)}) rotate(${s.rot.toFixed(3)}) scale(${s.sx.toFixed(4)} ${s.sy.toFixed(4)}) translate(-12 -12)`
227
+ );
228
+ eyeL.setAttribute("d", sleepyEyePath(EYE_BASE.l, s.eyeDrop, s.eyeSoft));
229
+ eyeR.setAttribute("d", sleepyEyePath(EYE_BASE.r, s.eyeDrop, s.eyeSoft));
230
+ eyeL.setAttribute("stroke-width", s.eyeStroke.toFixed(3));
231
+ eyeR.setAttribute("stroke-width", s.eyeStroke.toFixed(3));
232
+ eyes.setAttribute("opacity", (0.92 + s.inhale * 0.05 - s.nod * 0.03).toFixed(3));
233
+ eyeGrad.setAttribute("y1", (3 + s.flowOffset).toFixed(2));
234
+ eyeGrad.setAttribute("y2", (21 + s.flowOffset).toFixed(2));
235
+ renderZzz(seconds);
236
+ phaseReadout.textContent = `phase: ${s.phase.toFixed(2)}, inhale: ${s.inhale.toFixed(2)}, nod: ${s.nod.toFixed(2)}`;
237
+ poseReadout.textContent = `scale: ${s.sx.toFixed(3)} ${s.sy.toFixed(3)}, ty: ${s.ty.toFixed(2)}, rot: ${s.rot.toFixed(2)}deg`;
238
+ lastState = s;
239
+ return s;
240
+ }
241
+
242
+ window.__clawdSetGlyphFlipCompensation = enabled => {
243
+ const next = !!enabled;
244
+ if (next === glyphFlipCompensation) return;
245
+ glyphFlipCompensation = next;
246
+ renderFrame(currentSeconds(performance.now()));
247
+ };
248
+
249
+ function currentSeconds(now) {
250
+ if (paused) return (pausedAt - startT - pauseOffset) / 1000;
251
+ return (now - startT - pauseOffset) / 1000;
252
+ }
253
+
254
+ function tick(now) {
255
+ renderFrame(currentSeconds(now));
256
+ requestAnimationFrame(tick);
257
+ }
258
+ requestAnimationFrame(tick);
259
+ ]]></script>
260
+ </svg>