@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,390 @@
|
|
|
1
|
+
<svg id="cloudling" xmlns="http://www.w3.org/2000/svg" viewBox="-6 -6 36 36" 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: .9; }
|
|
9
|
+
.edge-rim-soft { stroke-opacity: .75; }
|
|
10
|
+
.edge-contact { stroke-opacity: .9; }
|
|
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: .95; }
|
|
22
|
+
.edge-rim-soft { stroke-opacity: .85; }
|
|
23
|
+
.edge-contact { stroke-opacity: .95; }
|
|
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="#93c5fd"/>
|
|
37
|
+
<stop offset="0.5" stop-color="#60a5fa"/>
|
|
38
|
+
<stop offset="1" stop-color="#3b82f6"/>
|
|
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="#93c5fd" stop-opacity="0.9"/>
|
|
59
|
+
<stop offset="1" stop-color="#93c5fd" 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>
|