@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,390 @@
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-alert-duration-probe 2.6s linear 1 both;
14
+ }
15
+ @keyframes mini-alert-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
+ <linearGradient id="signal-grad" x1="-2" y1="12" x2="26" y2="12" gradientUnits="userSpaceOnUse">
46
+ <stop offset="0" stop-color="#B1A7FF" stop-opacity="0.08"/>
47
+ <stop offset="0.22" stop-color="#8EA7FF" stop-opacity="0.92"/>
48
+ <stop offset="0.78" stop-color="#7A9DFF" stop-opacity="0.92"/>
49
+ <stop offset="1" stop-color="#3941FF" stop-opacity="0.08"/>
50
+ </linearGradient>
51
+ <linearGradient id="alert-grad" x1="19" y1="4" x2="5" y2="22" gradientUnits="userSpaceOnUse">
52
+ <stop offset="0" stop-color="#FFD36E" stop-opacity="0.98"/>
53
+ <stop offset="0.36" stop-color="#FFA56B" stop-opacity="0.94"/>
54
+ <stop offset="0.72" stop-color="#8EA7FF" stop-opacity="0.74"/>
55
+ <stop offset="1" stop-color="#3941FF" stop-opacity="0.16"/>
56
+ </linearGradient>
57
+ <radialGradient id="hi-grad" cx="0.45" cy="0.25" r="0.55">
58
+ <stop offset="0" stop-color="#f0f9ff" stop-opacity="0.9"/>
59
+ <stop offset="1" stop-color="#f0f9ff" stop-opacity="0"/>
60
+ </radialGradient>
61
+ <filter id="drop" x="-40%" y="-40%" width="180%" height="180%">
62
+ <feDropShadow class="cloud-drop-shadow" dx="0" dy="0.55" stdDeviation="0.72" flood-color="#3941FF" flood-opacity="0.17"/>
63
+ </filter>
64
+ <filter id="edge-blur" x="-40%" y="-40%" width="180%" height="180%">
65
+ <feGaussianBlur stdDeviation="0.16"/>
66
+ </filter>
67
+ <filter id="pulse-glow" x="-70%" y="-70%" width="240%" height="240%">
68
+ <feGaussianBlur id="pulse-blur" stdDeviation="0.42" result="b"/>
69
+ <feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge>
70
+ </filter>
71
+ <filter id="alert-glow" x="-80%" y="-80%" width="260%" height="260%">
72
+ <feGaussianBlur stdDeviation="0.44" result="b"/>
73
+ <feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge>
74
+ </filter>
75
+ <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"/>
76
+ <clipPath id="cloud-clip">
77
+ <use href="#cloud-shape"/>
78
+ </clipPath>
79
+ </defs>
80
+
81
+ <rect x="-12" y="-12" width="48" height="48" fill="transparent"/>
82
+ <rect class="duration-probe" x="-12" y="-12" width="0.01" height="0.01" fill="transparent"/>
83
+
84
+ <g id="runtime-layer">
85
+ <g id="pulses-layer"></g>
86
+ <g id="g-translate">
87
+ <g id="g-rotate">
88
+ <g id="g-squash">
89
+ <g id="edge-system">
90
+ <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)"/>
91
+ <use class="edge-rim-soft" href="#cloud-shape" fill="none" stroke="#7A9DFF" stroke-width=".84" stroke-linejoin="round" filter="url(#edge-blur)"/>
92
+ <use class="edge-rim-tight" href="#cloud-shape" fill="none" stroke="#aab3c6" stroke-width=".38" stroke-linejoin="round"/>
93
+ </g>
94
+ <g filter="url(#drop)">
95
+ <use href="#cloud-shape" fill="url(#body-grad)"/>
96
+ <rect x="1" y="2" width="22" height="11" fill="url(#hi-grad)" clip-path="url(#cloud-clip)"/>
97
+ </g>
98
+ <g id="rim-flash-layer"></g>
99
+ <g id="eyes-counter">
100
+ <g id="eyes-js">
101
+ <rect id="eye-l" x="6.65" y="9.65" width="2.2" height="4.65" rx="1.1" fill="url(#eye-grad)" stroke="#ffffff" stroke-width="0.08" stroke-opacity="0.7"/>
102
+ <rect id="eye-r" x="11.05" y="9.65" width="2.2" height="4.65" rx="1.1" fill="url(#eye-grad)" stroke="#ffffff" stroke-width="0.08" stroke-opacity="0.7"/>
103
+ </g>
104
+ </g>
105
+ </g>
106
+ </g>
107
+ </g>
108
+ </g>
109
+
110
+ <g id="__cloudling-export-shims" opacity="0" pointer-events="none" style="display:none">
111
+ <g id="phase-readout"></g>
112
+ <g id="time-readout"></g>
113
+ </g>
114
+
115
+ <script type="application/ecmascript"><![CDATA[
116
+ const gTrans = document.getElementById("g-translate");
117
+ const gRotate = document.getElementById("g-rotate");
118
+ const gSquash = document.getElementById("g-squash");
119
+ const eyesCounter = document.getElementById("eyes-counter");
120
+ const eyeL = document.getElementById("eye-l");
121
+ const eyeR = document.getElementById("eye-r");
122
+ const pulsesLayer = document.getElementById("pulses-layer");
123
+ const rimFlashLayer = document.getElementById("rim-flash-layer");
124
+ const pulseBlur = document.getElementById("pulse-blur");
125
+ const phaseReadout = document.getElementById("phase-readout");
126
+ const timeReadout = document.getElementById("time-readout");
127
+
128
+ const CLOUD_D = document.getElementById("cloud-shape").getAttribute("d");
129
+ const EYE_BASE = {
130
+ l: { x: 6.65, y: 9.65, w: 2.20, h: 4.65, rx: 1.10 },
131
+ r: { x: 11.05, y: 9.65, w: 2.20, h: 4.65, rx: 1.10 },
132
+ };
133
+
134
+ const params = {
135
+ totalPeriod: 2600,
136
+ ratioA: .22,
137
+ ratioB: .50,
138
+ shakeAngle: 16,
139
+ shakeFreqHz: 7,
140
+ jumpY: .52,
141
+ squash: .046,
142
+ scaleMicro: .040,
143
+ scaleMacro: .070,
144
+ idleBreathAmp: .018,
145
+ idleBreathPeriod: 5000,
146
+ pulseLifetimeA: 720,
147
+ pulseLifetimeB: 520,
148
+ pulseScaleEnd: 1.62,
149
+ pulseStrokeWidth: .82,
150
+ pulseGlow: .42,
151
+ pulseStartRadius: 8.7,
152
+ pulseFadeIn: 35,
153
+ eyeWiden: .26,
154
+ rimPower: 1.12,
155
+ };
156
+
157
+ let startT = performance.now();
158
+ let heldT = 0;
159
+ let paused = false;
160
+ let pulses = [];
161
+ let pulseId = 0;
162
+ let lastCycleT = -1;
163
+ let emittedA = false;
164
+ let emittedBPeaks = 0;
165
+ let lastRender = null;
166
+
167
+ function clamp(x, lo, hi) { return Math.max(lo, Math.min(hi, x)); }
168
+ function easeOutCubic(x) { return 1 - Math.pow(1 - x, 3); }
169
+ function easeInOutCubic(x) {
170
+ return x < .5 ? 4 * x * x * x : 1 - Math.pow(-2 * x + 2, 3) / 2;
171
+ }
172
+ function expPulse(x, center, width) {
173
+ const d = (x - center) / width;
174
+ return Math.exp(-d * d);
175
+ }
176
+ function polarPoint(cx, cy, r, deg) {
177
+ const a = deg * Math.PI / 180;
178
+ return [cx + Math.cos(a) * r, cy + Math.sin(a) * r];
179
+ }
180
+ function arcPath(cx, cy, r, startDeg, endDeg) {
181
+ const [x0, y0] = polarPoint(cx, cy, r, startDeg);
182
+ const [x1, y1] = polarPoint(cx, cy, r, endDeg);
183
+ const largeArc = Math.abs(endDeg - startDeg) > 180 ? 1 : 0;
184
+ const sweep = endDeg >= startDeg ? 1 : 0;
185
+ return `M${x0.toFixed(3)} ${y0.toFixed(3)} A${r.toFixed(3)} ${r.toFixed(3)} 0 ${largeArc} ${sweep} ${x1.toFixed(3)} ${y1.toFixed(3)}`;
186
+ }
187
+ function emitPulse(type, nowMs) {
188
+ pulses.push({
189
+ id: ++pulseId,
190
+ bornT: nowMs,
191
+ lifetime: type === "A" ? params.pulseLifetimeA : params.pulseLifetimeB,
192
+ type,
193
+ });
194
+ }
195
+ function renderPulses(nowMs) {
196
+ pulses = pulses.filter(p => nowMs - p.bornT < p.lifetime);
197
+ pulseBlur.setAttribute("stdDeviation", params.pulseGlow.toFixed(3));
198
+ let html = "";
199
+ for (const p of pulses) {
200
+ const ageMs = nowMs - p.bornT;
201
+ const t = clamp(ageMs / p.lifetime, 0, 1);
202
+ const scale = 1 + (params.pulseScaleEnd - 1) * easeOutCubic(t);
203
+ const r = params.pulseStartRadius * scale;
204
+ const baseOp = p.type === "A" ? .36 : .86;
205
+ const fadeIn = params.pulseFadeIn > 0 ? Math.min(1, ageMs / params.pulseFadeIn) : 1;
206
+ const fadeOut = Math.pow(1 - t, p.type === "A" ? 1.20 : 1.48);
207
+ const opacity = baseOp * fadeIn * fadeOut;
208
+ const wobble = p.type === "B" ? ((p.id % 3) - 1) * 7 : 0;
209
+ const strokeW = params.pulseStrokeWidth * (p.type === "A" ? .62 : 1);
210
+ const segments = p.type === "A"
211
+ ? [[-72, -34], [-10, 20], [36, 58]]
212
+ : [[-136, -96], [-54, 16], [42, 82], [130, 170], [190, 218]];
213
+ for (let i = 0; i < segments.length; i++) {
214
+ const [a0, a1] = segments[i];
215
+ const d = arcPath(12, 12, r + (i % 2) * .26, a0 + wobble, a1 + wobble);
216
+ const segOp = opacity * (1 - i * .08);
217
+ const stroke = (p.type === "B" && i < 2) ? "url(#alert-grad)" : "url(#signal-grad)";
218
+ html += `<path d="${d}" fill="none" stroke="${stroke}" stroke-width="${strokeW.toFixed(3)}" stroke-linecap="round" stroke-opacity="${segOp.toFixed(3)}" filter="url(#pulse-glow)"/>`;
219
+ }
220
+ }
221
+ pulsesLayer.innerHTML = html;
222
+ }
223
+ function setEye(rect, base, widenFactor, heightFactor, tilt) {
224
+ const w = base.w * widenFactor;
225
+ const h = base.h * heightFactor;
226
+ const x = base.x + (base.w - w) / 2;
227
+ const y = base.y + (base.h - h) / 2;
228
+ rect.setAttribute("x", x.toFixed(3));
229
+ rect.setAttribute("y", y.toFixed(3));
230
+ rect.setAttribute("width", w.toFixed(3));
231
+ rect.setAttribute("height", h.toFixed(3));
232
+ rect.setAttribute("rx", Math.min(w / 2, base.rx * widenFactor).toFixed(3));
233
+ rect.setAttribute("transform", `rotate(${tilt.toFixed(3)} ${(base.x + base.w / 2).toFixed(3)} ${(base.y + base.h / 2).toFixed(3)})`);
234
+ }
235
+ function renderAlertLayer(phase, phaseTms, tA, tB, tC, shakePeak, bEnvelope) {
236
+ let prep = 0;
237
+ let ping = 0;
238
+ if (phase === "A") {
239
+ prep = easeInOutCubic(clamp(phaseTms / tA, 0, 1));
240
+ } else if (phase === "B") {
241
+ const b = clamp(phaseTms / tB, 0, 1);
242
+ const ping1 = expPulse(b, .10, .055);
243
+ const ping2 = expPulse(b, .54, .070);
244
+ ping = Math.max(ping1, ping2, shakePeak * bEnvelope * .38);
245
+ } else {
246
+ const c = clamp(phaseTms / tC, 0, 1);
247
+ ping = (1 - easeOutCubic(c)) * .36;
248
+ }
249
+ const rimOp = clamp((ping * .64 + prep * .13) * params.rimPower, 0, .86);
250
+ const rimW = .30 + ping * .50;
251
+ rimFlashLayer.innerHTML = rimOp > .015
252
+ ? `<use href="#cloud-shape" fill="none" stroke="url(#alert-grad)" stroke-width="${rimW.toFixed(3)}" stroke-linejoin="round" stroke-opacity="${rimOp.toFixed(3)}" filter="url(#alert-glow)"/>`
253
+ : "";
254
+ }
255
+ function phaseAt(tMs) {
256
+ const total = params.totalPeriod;
257
+ const tA = total * params.ratioA;
258
+ const tB = total * params.ratioB;
259
+ const tC = total - tA - tB;
260
+ let phase = "A";
261
+ let phaseTms = tMs;
262
+ if (tMs >= tA && tMs < tA + tB) {
263
+ phase = "B";
264
+ phaseTms = tMs - tA;
265
+ } else if (tMs >= tA + tB) {
266
+ phase = "C";
267
+ phaseTms = tMs - tA - tB;
268
+ }
269
+ return { phase, phaseTms, tA, tB, tC };
270
+ }
271
+ function render(tMs, nowMs = performance.now(), allowEmit = false) {
272
+ const total = params.totalPeriod;
273
+ const tInCycle = ((tMs % total) + total) % total;
274
+ if (allowEmit && tInCycle < lastCycleT) {
275
+ emittedA = false;
276
+ emittedBPeaks = 0;
277
+ }
278
+ lastCycleT = tInCycle;
279
+
280
+ const { phase, phaseTms, tA, tB, tC } = phaseAt(tInCycle);
281
+
282
+ if (allowEmit && phase === "A" && !emittedA) {
283
+ emitPulse("A", nowMs);
284
+ emittedA = true;
285
+ }
286
+ if (allowEmit && phase === "B") {
287
+ const tBSec = phaseTms / 1000;
288
+ const peakInterval = 1 / (2 * params.shakeFreqHz);
289
+ const expectedPeaks = Math.floor((tBSec - peakInterval / 2) / peakInterval) + 1;
290
+ while (emittedBPeaks < expectedPeaks && emittedBPeaks * peakInterval + peakInterval / 2 < (tB / 1000)) {
291
+ if (emittedBPeaks % 2 === 0) emitPulse("B", nowMs);
292
+ emittedBPeaks++;
293
+ }
294
+ }
295
+
296
+ let rotate = 0;
297
+ let jumpY = 0;
298
+ let burstX = 1;
299
+ let burstY = 1;
300
+ let shakePeak = 0;
301
+ let bEnvelope = 0;
302
+
303
+ if (phase === "B") {
304
+ const tBSec = phaseTms / 1000;
305
+ const tBTotal = tB / 1000;
306
+ const envIn = Math.min(1, tBSec / .15);
307
+ const envOut = Math.min(1, (tBTotal - tBSec) / .20);
308
+ const env = Math.min(envIn, envOut);
309
+ const angularFreq = 2 * Math.PI * params.shakeFreqHz;
310
+ const sinV = Math.sin(angularFreq * tBSec);
311
+ const absSin = Math.abs(sinV);
312
+ shakePeak = absSin;
313
+ bEnvelope = env;
314
+ rotate = params.shakeAngle * sinV * env;
315
+ jumpY = -params.jumpY * Math.abs(Math.sin(angularFreq * tBSec / 2 + Math.PI / 4)) * env;
316
+ const micro = 1 + params.scaleMicro * absSin * env;
317
+ const macro = 1 + params.scaleMacro * Math.sin(Math.PI * clamp(tBSec / tBTotal, 0, 1));
318
+ const squash = 1 - params.squash * absSin * env;
319
+ burstX = micro * macro;
320
+ burstY = micro * macro * squash;
321
+ } else if (phase === "C") {
322
+ const tCSec = phaseTms / 1000;
323
+ const decay = Math.max(0, 1 - tCSec / (tC / 1000));
324
+ const angularFreq = 2 * Math.PI * params.shakeFreqHz * .70;
325
+ rotate = params.shakeAngle * decay * decay * .55 * Math.sin(angularFreq * (tB / 1000 + tCSec));
326
+ } else {
327
+ const p = clamp(phaseTms / tA, 0, 1);
328
+ rotate = 1.4 * Math.sin(Math.PI * p);
329
+ }
330
+
331
+ const breathPhase = (nowMs / params.idleBreathPeriod) * 2 * Math.PI;
332
+ const baseBreath = (1 - params.idleBreathAmp) + params.idleBreathAmp * Math.sin(breathPhase);
333
+ const sx = baseBreath * burstX;
334
+ const sy = baseBreath * burstY;
335
+
336
+ gTrans.setAttribute("transform", `translate(0 ${jumpY.toFixed(3)})`);
337
+ gRotate.setAttribute("transform", `rotate(${rotate.toFixed(3)} 12 12)`);
338
+ gSquash.setAttribute("transform", `translate(12 12) scale(${sx.toFixed(4)} ${sy.toFixed(4)}) translate(-12 -12)`);
339
+ eyesCounter.setAttribute("transform", `rotate(${(-rotate).toFixed(3)} 12 12)`);
340
+
341
+ let widen = 1;
342
+ let height = 1;
343
+ let tiltL = 0;
344
+ let tiltR = 0;
345
+ if (phase === "A") {
346
+ const p = clamp(phaseTms / tA, 0, 1);
347
+ widen = 1 + params.eyeWiden * easeInOutCubic(p) * .55;
348
+ } else if (phase === "B") {
349
+ widen = 1 + params.eyeWiden * .95 + shakePeak * bEnvelope * .09;
350
+ height = 1.02 + shakePeak * bEnvelope * .045;
351
+ tiltL = -3.2 * bEnvelope;
352
+ tiltR = 3.2 * bEnvelope;
353
+ } else {
354
+ const p = clamp(phaseTms / 150, 0, 1);
355
+ widen = 1 + params.eyeWiden * (1 - p) * .45;
356
+ }
357
+ setEye(eyeL, EYE_BASE.l, widen, height, tiltL);
358
+ setEye(eyeR, EYE_BASE.r, widen, height, tiltR);
359
+
360
+ renderPulses(nowMs);
361
+ renderAlertLayer(phase, phaseTms, tA, tB, tC, shakePeak, bEnvelope);
362
+ phaseReadout.textContent = `phase: ${phase}`;
363
+ timeReadout.textContent = `time: ${Math.round(tInCycle)}ms / ${Math.round(total)}ms`;
364
+ lastRender = { t: tInCycle, phase, rotate, jumpY, sx, sy, pulses: pulses.length };
365
+ return lastRender;
366
+ }
367
+ function tick(now) {
368
+ if (!paused) {
369
+ heldT = now - startT;
370
+ render(heldT, now, true);
371
+ }
372
+ requestAnimationFrame(tick);
373
+ }
374
+ function syncControls() {
375
+ setControl("duration", params.totalPeriod / 1000, 1);
376
+ setControl("shake-angle", params.shakeAngle, 0);
377
+ setControl("jump-y", params.jumpY, 2);
378
+ setControl("squash", params.squash, 3);
379
+ setControl("pulse-scale", params.pulseScaleEnd, 2);
380
+ setControl("rim-power", params.rimPower, 2);
381
+ }
382
+ function setControl(id, value, digits) {
383
+ const input = document.getElementById(id);
384
+ const out = document.getElementById(`${id}-v`);
385
+ input.value = String(value);
386
+ out.textContent = Number(value).toFixed(digits);
387
+ }
388
+ requestAnimationFrame(tick);
389
+ ]]></script>
390
+ </svg>