lilgotchi 0.0.0-stage → 3.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.
- package/LICENSE.md +21 -0
- package/README.md +69 -3
- package/dist/LICENSE.md +21 -0
- package/dist/README.md +69 -0
- package/dist/design/evolution/README.md +7 -0
- package/dist/design/evolution/cypunk.js +3 -0
- package/dist/design/evolution/cypunk.md +20 -0
- package/dist/design/evolution/index.html +20 -0
- package/dist/design/evolution/lilgotchi.js +3 -0
- package/dist/design/evolution/lilgotchi.md +20 -0
- package/dist/design/evolution/preview.css +3 -0
- package/dist/design/evolution/preview.js +47 -0
- package/dist/design/evolution/slice.js +3 -0
- package/dist/design/evolution/slice.md +14 -0
- package/dist/design/games/README.md +52 -0
- package/dist/design/games/bump.md +23 -0
- package/dist/design/games/catalog.md +24 -0
- package/dist/design/games/flag.md +19 -0
- package/dist/design/games/get.md +21 -0
- package/dist/design/games/heading.md +23 -0
- package/dist/design/games/hoops.md +17 -0
- package/dist/design/games/left-right.md +30 -0
- package/dist/design/games/memory.md +21 -0
- package/dist/design/games/polish-review.md +11 -0
- package/dist/design/games/release-checklist.md +52 -0
- package/dist/design/games/sprint.md +21 -0
- package/dist/docs/README.md +14 -0
- package/dist/docs/care.md +51 -0
- package/dist/docs/characters.md +51 -0
- package/dist/docs/credits.md +17 -0
- package/dist/docs/development.md +87 -0
- package/dist/docs/frame-contract.md +38 -0
- package/dist/docs/images/cypunk-family.jpg +0 -0
- package/dist/docs/images/lilgotchi-family.jpg +0 -0
- package/dist/docs/images/original-family.jpg +0 -0
- package/dist/docs/images/slice-family.jpg +0 -0
- package/dist/docs/install.md +41 -0
- package/dist/docs/release-review.md +47 -0
- package/dist/embed.js +21 -0
- package/dist/examples/cross-origin.html +7 -0
- package/dist/examples/curated.html +12 -0
- package/dist/examples/duplicate.html +3 -0
- package/dist/examples/install.html +11 -0
- package/dist/examples/launcher-review.html +23 -0
- package/dist/examples/launchers.html +10 -0
- package/dist/examples/nested/index.html +6 -0
- package/dist/examples/one-line.html +9 -0
- package/dist/index.html +100 -0
- package/dist/lilgotchi.js +437 -0
- package/dist/pets/NOTICE.md +19 -0
- package/dist/pets/README.md +7 -0
- package/dist/pets/arcade-catalog.js +52 -0
- package/dist/pets/arcade-geometry.js +18 -0
- package/dist/pets/arcade-opponents.js +16 -0
- package/dist/pets/arcade-renderer.js +116 -0
- package/dist/pets/arcade-sprites.js +64 -0
- package/dist/pets/arcade.js +393 -0
- package/dist/pets/away.js +20 -0
- package/dist/pets/boot.js +161 -0
- package/dist/pets/catalog.js +32 -0
- package/dist/pets/celebrations.js +54 -0
- package/dist/pets/classic-sprites.js +672 -0
- package/dist/pets/clock.js +3 -0
- package/dist/pets/colors.js +38 -0
- package/dist/pets/constants.js +20 -0
- package/dist/pets/custom-themes.css +80 -0
- package/dist/pets/cyberpunk-sprites.js +68 -0
- package/dist/pets/cypunk-original.js +2 -0
- package/dist/pets/embed.css +130 -0
- package/dist/pets/engine.js +38 -0
- package/dist/pets/evolution.js +46 -0
- package/dist/pets/focus.js +27 -0
- package/dist/pets/font.js +185 -0
- package/dist/pets/game.css +275 -0
- package/dist/pets/game.html +148 -0
- package/dist/pets/game.js +626 -0
- package/dist/pets/layout.js +53 -0
- package/dist/pets/lilgotchi-sprites.js +62 -0
- package/dist/pets/minigames/bump.js +52 -0
- package/dist/pets/minigames/flag.js +87 -0
- package/dist/pets/minigames/get.js +59 -0
- package/dist/pets/minigames/heading.js +117 -0
- package/dist/pets/minigames/hoops.js +96 -0
- package/dist/pets/minigames/memory.js +81 -0
- package/dist/pets/minigames/model.js +40 -0
- package/dist/pets/minigames/sprint.js +103 -0
- package/dist/pets/original-roster.js +46 -0
- package/dist/pets/original-sprites.js +3861 -0
- package/dist/pets/overlay-size.js +13 -0
- package/dist/pets/pixel-size.js +6 -0
- package/dist/pets/presentation.js +80 -0
- package/dist/pets/renderer.js +100 -0
- package/dist/pets/scenery.css +24 -0
- package/dist/pets/simulation.js +185 -0
- package/dist/pets/skins.js +14 -0
- package/dist/pets/slice-sprites.js +38 -0
- package/dist/pets/sound.js +33 -0
- package/dist/pets/status.js +28 -0
- package/dist/pets/storage.js +49 -0
- package/dist/pets/valid-state.js +26 -0
- package/dist/pets/wellbeing.js +73 -0
- package/dist/reference/source.json +8 -0
- package/dist/version.json +5 -0
- package/dist/widget/care-guide.js +50 -0
- package/dist/widget/care-monitor.js +52 -0
- package/dist/widget/color-controls.js +15 -0
- package/dist/widget/configurator.js +24 -0
- package/dist/widget/egg.svg +1 -0
- package/dist/widget/focus.js +6 -0
- package/dist/widget/gallery.js +17 -0
- package/dist/widget/inactive.js +24 -0
- package/dist/widget/install-snippet.js +14 -0
- package/dist/widget/launcher.js +63 -0
- package/dist/widget/pet-history.js +57 -0
- package/dist/widget/pet-label.js +12 -0
- package/dist/widget/save-store.js +198 -0
- package/dist/widget/scroll-lock.js +11 -0
- package/dist/widget/settings.js +48 -0
- package/dist/widget/shell.css +63 -0
- package/package.json +43 -6
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
// Classic sprites from plateaukao/tamagochi (MIT). See NOTICE.md.
|
|
2
|
+
export const classicSprites = {
|
|
3
|
+
egg: {
|
|
4
|
+
idle1: [
|
|
5
|
+
[0,0,0,1,1,0,0,0],
|
|
6
|
+
[0,0,1,0,0,1,0,0],
|
|
7
|
+
[0,1,0,1,0,0,1,0],
|
|
8
|
+
[0,1,0,0,1,0,1,0],
|
|
9
|
+
[1,0,0,0,0,0,0,1],
|
|
10
|
+
[1,0,1,0,0,1,0,1],
|
|
11
|
+
[0,1,0,0,0,0,1,0],
|
|
12
|
+
[0,0,1,1,1,1,0,0],
|
|
13
|
+
],
|
|
14
|
+
idle2: [
|
|
15
|
+
[0,0,0,1,1,0,0,0],
|
|
16
|
+
[0,0,1,0,0,1,0,0],
|
|
17
|
+
[0,1,0,0,1,0,1,0],
|
|
18
|
+
[0,1,1,0,0,1,1,0],
|
|
19
|
+
[1,0,0,1,0,0,0,1],
|
|
20
|
+
[1,0,0,0,1,0,0,1],
|
|
21
|
+
[0,1,0,0,0,0,1,0],
|
|
22
|
+
[0,0,1,1,1,1,0,0],
|
|
23
|
+
],
|
|
24
|
+
},
|
|
25
|
+
babytchi: {
|
|
26
|
+
idle1: [
|
|
27
|
+
[0,0,1,1,1,1,0,0],
|
|
28
|
+
[0,1,0,0,0,0,1,0],
|
|
29
|
+
[1,0,1,0,0,1,0,1],
|
|
30
|
+
[1,0,0,0,0,0,0,1],
|
|
31
|
+
[1,0,0,1,1,0,0,1],
|
|
32
|
+
[0,1,0,0,0,0,1,0],
|
|
33
|
+
[0,0,1,1,1,1,0,0],
|
|
34
|
+
[0,0,0,1,1,0,0,0],
|
|
35
|
+
],
|
|
36
|
+
idle2: [
|
|
37
|
+
[0,0,0,0,0,0,0,0],
|
|
38
|
+
[0,0,1,1,1,1,0,0],
|
|
39
|
+
[0,1,0,0,0,0,1,0],
|
|
40
|
+
[1,0,1,0,0,1,0,1],
|
|
41
|
+
[1,0,0,0,0,0,0,1],
|
|
42
|
+
[1,0,0,1,1,0,0,1],
|
|
43
|
+
[0,1,0,0,0,0,1,0],
|
|
44
|
+
[0,0,1,1,1,1,0,0],
|
|
45
|
+
],
|
|
46
|
+
happy: [
|
|
47
|
+
[0,0,1,1,1,1,0,0],
|
|
48
|
+
[0,1,0,0,0,0,1,0],
|
|
49
|
+
[1,0,1,0,0,1,0,1],
|
|
50
|
+
[1,0,0,0,0,0,0,1],
|
|
51
|
+
[1,0,1,0,0,1,0,1],
|
|
52
|
+
[0,1,0,1,1,0,1,0],
|
|
53
|
+
[0,0,1,1,1,1,0,0],
|
|
54
|
+
[0,1,0,0,0,0,1,0],
|
|
55
|
+
],
|
|
56
|
+
sad: [
|
|
57
|
+
[0,0,1,1,1,1,0,0],
|
|
58
|
+
[0,1,0,0,0,0,1,0],
|
|
59
|
+
[1,0,1,0,0,1,0,1],
|
|
60
|
+
[1,0,0,0,0,0,0,1],
|
|
61
|
+
[1,0,0,0,0,0,0,1],
|
|
62
|
+
[0,1,0,1,1,0,1,0],
|
|
63
|
+
[0,0,1,1,1,1,0,0],
|
|
64
|
+
[0,0,0,1,1,0,0,0],
|
|
65
|
+
],
|
|
66
|
+
eat: [
|
|
67
|
+
[0,0,1,1,1,1,0,0],
|
|
68
|
+
[0,1,0,0,0,0,1,0],
|
|
69
|
+
[1,0,1,0,0,1,0,1],
|
|
70
|
+
[1,0,0,0,0,0,0,1],
|
|
71
|
+
[1,0,0,1,1,0,0,1],
|
|
72
|
+
[0,1,0,1,1,0,1,0],
|
|
73
|
+
[0,0,1,1,1,1,0,0],
|
|
74
|
+
[0,0,0,1,1,0,0,0],
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
marutchi: {
|
|
78
|
+
idle1: [
|
|
79
|
+
[0,0,1,1,1,1,0,0],
|
|
80
|
+
[0,1,1,1,1,1,1,0],
|
|
81
|
+
[1,1,0,1,1,0,1,1],
|
|
82
|
+
[1,1,1,1,1,1,1,1],
|
|
83
|
+
[1,0,1,1,1,1,0,1],
|
|
84
|
+
[1,1,0,0,0,0,1,1],
|
|
85
|
+
[0,1,1,1,1,1,1,0],
|
|
86
|
+
[0,0,1,1,1,1,0,0],
|
|
87
|
+
],
|
|
88
|
+
idle2: [
|
|
89
|
+
[0,0,0,0,0,0,0,0],
|
|
90
|
+
[0,0,1,1,1,1,0,0],
|
|
91
|
+
[0,1,1,1,1,1,1,0],
|
|
92
|
+
[1,1,0,1,1,0,1,1],
|
|
93
|
+
[1,1,1,1,1,1,1,1],
|
|
94
|
+
[1,0,1,1,1,1,0,1],
|
|
95
|
+
[0,1,0,0,0,0,1,0],
|
|
96
|
+
[0,0,1,1,1,1,0,0],
|
|
97
|
+
],
|
|
98
|
+
happy: [
|
|
99
|
+
[0,0,1,1,1,1,0,0],
|
|
100
|
+
[0,1,1,1,1,1,1,0],
|
|
101
|
+
[1,1,0,1,1,0,1,1],
|
|
102
|
+
[1,1,1,1,1,1,1,1],
|
|
103
|
+
[1,0,1,0,0,1,0,1],
|
|
104
|
+
[1,1,0,1,1,0,1,1],
|
|
105
|
+
[0,1,1,1,1,1,1,0],
|
|
106
|
+
[1,0,1,1,1,1,0,1],
|
|
107
|
+
],
|
|
108
|
+
sad: [
|
|
109
|
+
[0,0,1,1,1,1,0,0],
|
|
110
|
+
[0,1,1,1,1,1,1,0],
|
|
111
|
+
[1,1,0,1,1,0,1,1],
|
|
112
|
+
[1,1,1,1,1,1,1,1],
|
|
113
|
+
[1,1,1,0,0,1,1,1],
|
|
114
|
+
[1,1,0,1,1,0,1,1],
|
|
115
|
+
[0,1,1,1,1,1,1,0],
|
|
116
|
+
[0,0,1,1,1,1,0,0],
|
|
117
|
+
],
|
|
118
|
+
eat: [
|
|
119
|
+
[0,0,1,1,1,1,0,0],
|
|
120
|
+
[0,1,1,1,1,1,1,0],
|
|
121
|
+
[1,1,0,1,1,0,1,1],
|
|
122
|
+
[1,1,1,1,1,1,1,1],
|
|
123
|
+
[1,1,0,1,1,0,1,1],
|
|
124
|
+
[1,1,1,0,0,1,1,1],
|
|
125
|
+
[0,1,1,1,1,1,1,0],
|
|
126
|
+
[0,0,1,1,1,1,0,0],
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
tamatchi: {
|
|
130
|
+
idle1: [
|
|
131
|
+
[0,0,0,1,1,0,0,0],
|
|
132
|
+
[0,0,1,1,1,1,0,0],
|
|
133
|
+
[0,1,0,1,1,0,1,0],
|
|
134
|
+
[0,1,1,1,1,1,1,0],
|
|
135
|
+
[0,1,0,1,1,0,1,0],
|
|
136
|
+
[0,0,1,0,0,1,0,0],
|
|
137
|
+
[0,0,0,1,1,0,0,0],
|
|
138
|
+
[0,0,1,0,0,1,0,0],
|
|
139
|
+
],
|
|
140
|
+
idle2: [
|
|
141
|
+
[0,0,0,0,0,0,0,0],
|
|
142
|
+
[0,0,0,1,1,0,0,0],
|
|
143
|
+
[0,0,1,1,1,1,0,0],
|
|
144
|
+
[0,1,0,1,1,0,1,0],
|
|
145
|
+
[0,1,1,1,1,1,1,0],
|
|
146
|
+
[0,1,0,1,1,0,1,0],
|
|
147
|
+
[0,0,1,0,0,1,0,0],
|
|
148
|
+
[0,0,1,0,0,1,0,0],
|
|
149
|
+
],
|
|
150
|
+
happy: [
|
|
151
|
+
[0,0,0,1,1,0,0,0],
|
|
152
|
+
[0,0,1,1,1,1,0,0],
|
|
153
|
+
[0,1,0,1,1,0,1,0],
|
|
154
|
+
[0,1,1,1,1,1,1,0],
|
|
155
|
+
[0,1,1,0,0,1,1,0],
|
|
156
|
+
[0,0,1,1,1,1,0,0],
|
|
157
|
+
[0,0,0,1,1,0,0,0],
|
|
158
|
+
[0,1,0,0,0,0,1,0],
|
|
159
|
+
],
|
|
160
|
+
sad: [
|
|
161
|
+
[0,0,0,1,1,0,0,0],
|
|
162
|
+
[0,0,1,1,1,1,0,0],
|
|
163
|
+
[0,1,0,1,1,0,1,0],
|
|
164
|
+
[0,1,1,1,1,1,1,0],
|
|
165
|
+
[0,1,1,1,1,1,1,0],
|
|
166
|
+
[0,0,1,0,0,1,0,0],
|
|
167
|
+
[0,0,0,1,1,0,0,0],
|
|
168
|
+
[0,0,1,0,0,1,0,0],
|
|
169
|
+
],
|
|
170
|
+
eat: [
|
|
171
|
+
[0,0,0,1,1,0,0,0],
|
|
172
|
+
[0,0,1,1,1,1,0,0],
|
|
173
|
+
[0,1,0,1,1,0,1,0],
|
|
174
|
+
[0,1,1,1,1,1,1,0],
|
|
175
|
+
[0,1,0,1,1,0,1,0],
|
|
176
|
+
[0,0,1,1,1,1,0,0],
|
|
177
|
+
[0,0,0,1,1,0,0,0],
|
|
178
|
+
[0,0,1,0,0,1,0,0],
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
kuchitamatchi: {
|
|
182
|
+
idle1: [
|
|
183
|
+
[0,0,1,1,1,1,0,0],
|
|
184
|
+
[0,1,0,0,0,0,1,0],
|
|
185
|
+
[1,0,1,0,0,1,0,1],
|
|
186
|
+
[1,0,0,0,0,0,0,1],
|
|
187
|
+
[0,1,1,1,1,1,1,0],
|
|
188
|
+
[0,0,0,1,1,0,0,0],
|
|
189
|
+
[0,0,1,1,1,1,0,0],
|
|
190
|
+
[0,0,1,0,0,1,0,0],
|
|
191
|
+
],
|
|
192
|
+
idle2: [
|
|
193
|
+
[0,0,0,0,0,0,0,0],
|
|
194
|
+
[0,0,1,1,1,1,0,0],
|
|
195
|
+
[0,1,0,0,0,0,1,0],
|
|
196
|
+
[1,0,1,0,0,1,0,1],
|
|
197
|
+
[1,0,0,0,0,0,0,1],
|
|
198
|
+
[0,1,1,1,1,1,1,0],
|
|
199
|
+
[0,0,1,1,1,1,0,0],
|
|
200
|
+
[0,0,1,0,0,1,0,0],
|
|
201
|
+
],
|
|
202
|
+
happy: [
|
|
203
|
+
[0,0,1,1,1,1,0,0],
|
|
204
|
+
[0,1,0,0,0,0,1,0],
|
|
205
|
+
[1,0,1,0,0,1,0,1],
|
|
206
|
+
[1,0,0,0,0,0,0,1],
|
|
207
|
+
[0,1,0,1,1,0,1,0],
|
|
208
|
+
[0,0,1,0,0,1,0,0],
|
|
209
|
+
[0,0,1,1,1,1,0,0],
|
|
210
|
+
[0,1,0,0,0,0,1,0],
|
|
211
|
+
],
|
|
212
|
+
sad: [
|
|
213
|
+
[0,0,1,1,1,1,0,0],
|
|
214
|
+
[0,1,0,0,0,0,1,0],
|
|
215
|
+
[1,0,1,0,0,1,0,1],
|
|
216
|
+
[1,0,0,0,0,0,0,1],
|
|
217
|
+
[0,1,1,1,1,1,1,0],
|
|
218
|
+
[0,0,0,1,1,0,0,0],
|
|
219
|
+
[0,0,0,1,1,0,0,0],
|
|
220
|
+
[0,0,1,0,0,1,0,0],
|
|
221
|
+
],
|
|
222
|
+
eat: [
|
|
223
|
+
[0,0,1,1,1,1,0,0],
|
|
224
|
+
[0,1,0,0,0,0,1,0],
|
|
225
|
+
[1,0,1,0,0,1,0,1],
|
|
226
|
+
[1,0,0,0,0,0,0,1],
|
|
227
|
+
[0,1,1,0,0,1,1,0],
|
|
228
|
+
[0,0,1,1,1,1,0,0],
|
|
229
|
+
[0,0,1,1,1,1,0,0],
|
|
230
|
+
[0,0,1,0,0,1,0,0],
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
mametchi: {
|
|
234
|
+
idle1: [
|
|
235
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
236
|
+
[1,0,1,1,1,1,0,1,0,0],
|
|
237
|
+
[1,0,0,0,0,0,0,1,0,0],
|
|
238
|
+
[0,1,0,1,0,1,1,0,0,0],
|
|
239
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
240
|
+
[0,1,0,1,0,1,1,0,0,0],
|
|
241
|
+
[0,0,1,0,0,0,0,1,0,0],
|
|
242
|
+
[0,0,0,1,1,1,0,0,0,0],
|
|
243
|
+
[0,0,0,1,0,1,0,0,0,0],
|
|
244
|
+
],
|
|
245
|
+
idle2: [
|
|
246
|
+
[0,0,0,0,0,0,0,0,0,0],
|
|
247
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
248
|
+
[1,0,1,1,1,1,0,1,0,0],
|
|
249
|
+
[1,0,0,0,0,0,0,1,0,0],
|
|
250
|
+
[0,1,0,1,0,1,1,0,0,0],
|
|
251
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
252
|
+
[0,0,1,1,0,1,1,0,0,0],
|
|
253
|
+
[0,0,0,1,1,1,0,0,0,0],
|
|
254
|
+
[0,0,1,0,0,0,1,0,0,0],
|
|
255
|
+
],
|
|
256
|
+
happy: [
|
|
257
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
258
|
+
[1,0,1,1,1,1,0,1,0,0],
|
|
259
|
+
[1,0,0,0,0,0,0,1,0,0],
|
|
260
|
+
[0,1,0,1,0,1,1,0,0,0],
|
|
261
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
262
|
+
[0,1,1,0,0,1,1,0,0,0],
|
|
263
|
+
[0,0,1,1,1,1,0,0,0,0],
|
|
264
|
+
[0,0,0,1,1,0,0,0,0,0],
|
|
265
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
266
|
+
],
|
|
267
|
+
sad: [
|
|
268
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
269
|
+
[1,0,1,1,1,1,0,1,0,0],
|
|
270
|
+
[1,0,0,0,0,0,0,1,0,0],
|
|
271
|
+
[0,1,0,1,0,1,1,0,0,0],
|
|
272
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
273
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
274
|
+
[0,0,1,0,1,0,0,1,0,0],
|
|
275
|
+
[0,0,0,1,1,1,0,0,0,0],
|
|
276
|
+
[0,0,0,1,0,1,0,0,0,0],
|
|
277
|
+
],
|
|
278
|
+
eat: [
|
|
279
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
280
|
+
[1,0,1,1,1,1,0,1,0,0],
|
|
281
|
+
[1,0,0,0,0,0,0,1,0,0],
|
|
282
|
+
[0,1,0,1,0,1,1,0,0,0],
|
|
283
|
+
[0,1,0,0,0,0,1,0,0,0],
|
|
284
|
+
[0,1,0,1,1,0,1,0,0,0],
|
|
285
|
+
[0,0,1,1,1,1,0,0,0,0],
|
|
286
|
+
[0,0,0,1,1,0,0,0,0,0],
|
|
287
|
+
[0,0,0,1,0,1,0,0,0,0],
|
|
288
|
+
],
|
|
289
|
+
},
|
|
290
|
+
ginjirotchi: {
|
|
291
|
+
idle1: [
|
|
292
|
+
[0,0,1,1,1,1,0,0],
|
|
293
|
+
[0,1,1,1,1,1,1,0],
|
|
294
|
+
[1,0,1,1,1,0,1,1],
|
|
295
|
+
[1,1,1,1,1,1,1,1],
|
|
296
|
+
[1,0,1,1,1,1,0,1],
|
|
297
|
+
[1,1,0,0,0,0,1,1],
|
|
298
|
+
[0,1,1,1,1,1,1,0],
|
|
299
|
+
[0,0,0,1,1,0,0,0],
|
|
300
|
+
[0,0,1,0,0,1,0,0],
|
|
301
|
+
],
|
|
302
|
+
idle2: [
|
|
303
|
+
[0,0,0,0,0,0,0,0],
|
|
304
|
+
[0,0,1,1,1,1,0,0],
|
|
305
|
+
[0,1,1,1,1,1,1,0],
|
|
306
|
+
[1,0,1,1,1,0,1,1],
|
|
307
|
+
[1,1,1,1,1,1,1,1],
|
|
308
|
+
[1,0,1,1,1,1,0,1],
|
|
309
|
+
[0,1,0,0,0,0,1,0],
|
|
310
|
+
[0,0,1,1,1,1,0,0],
|
|
311
|
+
[0,0,1,0,0,1,0,0],
|
|
312
|
+
],
|
|
313
|
+
happy: [
|
|
314
|
+
[0,0,1,1,1,1,0,0],
|
|
315
|
+
[0,1,1,1,1,1,1,0],
|
|
316
|
+
[1,0,1,1,1,0,1,1],
|
|
317
|
+
[1,1,1,1,1,1,1,1],
|
|
318
|
+
[1,0,1,0,0,1,0,1],
|
|
319
|
+
[1,1,0,1,1,0,1,1],
|
|
320
|
+
[0,1,1,1,1,1,1,0],
|
|
321
|
+
[0,0,0,1,1,0,0,0],
|
|
322
|
+
[0,1,0,0,0,0,1,0],
|
|
323
|
+
],
|
|
324
|
+
sad: [
|
|
325
|
+
[0,0,1,1,1,1,0,0],
|
|
326
|
+
[0,1,1,1,1,1,1,0],
|
|
327
|
+
[1,0,1,1,1,0,1,1],
|
|
328
|
+
[1,1,1,1,1,1,1,1],
|
|
329
|
+
[1,1,1,0,0,1,1,1],
|
|
330
|
+
[1,0,0,1,1,0,0,1],
|
|
331
|
+
[0,1,1,1,1,1,1,0],
|
|
332
|
+
[0,0,0,1,1,0,0,0],
|
|
333
|
+
[0,0,1,0,0,1,0,0],
|
|
334
|
+
],
|
|
335
|
+
eat: [
|
|
336
|
+
[0,0,1,1,1,1,0,0],
|
|
337
|
+
[0,1,1,1,1,1,1,0],
|
|
338
|
+
[1,0,1,1,1,0,1,1],
|
|
339
|
+
[1,1,1,1,1,1,1,1],
|
|
340
|
+
[1,0,1,1,1,1,0,1],
|
|
341
|
+
[1,1,0,1,1,0,1,1],
|
|
342
|
+
[0,1,1,1,1,1,1,0],
|
|
343
|
+
[0,0,0,1,1,0,0,0],
|
|
344
|
+
[0,0,1,0,0,1,0,0],
|
|
345
|
+
],
|
|
346
|
+
},
|
|
347
|
+
maskutchi: {
|
|
348
|
+
idle1: [
|
|
349
|
+
[0,0,1,1,1,1,0,0],
|
|
350
|
+
[0,1,0,0,0,0,1,0],
|
|
351
|
+
[1,1,0,1,1,0,1,1],
|
|
352
|
+
[1,0,0,0,0,0,0,1],
|
|
353
|
+
[1,0,1,0,0,1,0,1],
|
|
354
|
+
[0,1,0,1,1,0,1,0],
|
|
355
|
+
[0,0,1,0,0,1,0,0],
|
|
356
|
+
[0,0,1,0,0,1,0,0],
|
|
357
|
+
[0,0,1,1,1,1,0,0],
|
|
358
|
+
],
|
|
359
|
+
idle2: [
|
|
360
|
+
[0,0,0,0,0,0,0,0],
|
|
361
|
+
[0,0,1,1,1,1,0,0],
|
|
362
|
+
[0,1,0,0,0,0,1,0],
|
|
363
|
+
[1,1,0,1,1,0,1,1],
|
|
364
|
+
[1,0,0,0,0,0,0,1],
|
|
365
|
+
[1,0,1,0,0,1,0,1],
|
|
366
|
+
[0,1,0,1,1,0,1,0],
|
|
367
|
+
[0,0,1,0,0,1,0,0],
|
|
368
|
+
[0,0,1,1,1,1,0,0],
|
|
369
|
+
],
|
|
370
|
+
happy: [
|
|
371
|
+
[0,0,1,1,1,1,0,0],
|
|
372
|
+
[0,1,0,0,0,0,1,0],
|
|
373
|
+
[1,1,0,1,1,0,1,1],
|
|
374
|
+
[1,0,0,0,0,0,0,1],
|
|
375
|
+
[1,0,1,0,0,1,0,1],
|
|
376
|
+
[0,1,0,0,0,0,1,0],
|
|
377
|
+
[0,0,1,1,1,1,0,0],
|
|
378
|
+
[0,1,0,0,0,0,1,0],
|
|
379
|
+
[0,0,1,1,1,1,0,0],
|
|
380
|
+
],
|
|
381
|
+
sad: [
|
|
382
|
+
[0,0,1,1,1,1,0,0],
|
|
383
|
+
[0,1,0,0,0,0,1,0],
|
|
384
|
+
[1,1,0,1,1,0,1,1],
|
|
385
|
+
[1,0,0,0,0,0,0,1],
|
|
386
|
+
[1,0,0,0,0,0,0,1],
|
|
387
|
+
[0,1,0,1,1,0,1,0],
|
|
388
|
+
[0,0,1,0,0,1,0,0],
|
|
389
|
+
[0,0,1,0,0,1,0,0],
|
|
390
|
+
[0,0,1,1,1,1,0,0],
|
|
391
|
+
],
|
|
392
|
+
eat: [
|
|
393
|
+
[0,0,1,1,1,1,0,0],
|
|
394
|
+
[0,1,0,0,0,0,1,0],
|
|
395
|
+
[1,1,0,1,1,0,1,1],
|
|
396
|
+
[1,0,0,0,0,0,0,1],
|
|
397
|
+
[1,0,1,0,0,1,0,1],
|
|
398
|
+
[0,1,0,1,1,0,1,0],
|
|
399
|
+
[0,0,1,0,0,1,0,0],
|
|
400
|
+
[0,0,1,0,0,1,0,0],
|
|
401
|
+
[0,0,1,1,1,1,0,0],
|
|
402
|
+
],
|
|
403
|
+
},
|
|
404
|
+
kuchipatchi: {
|
|
405
|
+
idle1: [
|
|
406
|
+
[0,0,1,1,1,1,0,0],
|
|
407
|
+
[0,1,0,0,0,0,1,0],
|
|
408
|
+
[1,0,1,0,0,1,0,1],
|
|
409
|
+
[1,0,0,0,0,0,0,1],
|
|
410
|
+
[1,0,0,0,0,0,0,1],
|
|
411
|
+
[0,1,1,1,1,1,1,0],
|
|
412
|
+
[0,0,1,1,1,1,0,0],
|
|
413
|
+
[0,1,0,0,0,0,1,0],
|
|
414
|
+
[0,1,0,0,0,0,1,0],
|
|
415
|
+
],
|
|
416
|
+
idle2: [
|
|
417
|
+
[0,0,0,0,0,0,0,0],
|
|
418
|
+
[0,0,1,1,1,1,0,0],
|
|
419
|
+
[0,1,0,0,0,0,1,0],
|
|
420
|
+
[1,0,1,0,0,1,0,1],
|
|
421
|
+
[1,0,0,0,0,0,0,1],
|
|
422
|
+
[0,1,1,1,1,1,1,0],
|
|
423
|
+
[0,0,1,1,1,1,0,0],
|
|
424
|
+
[0,0,1,0,0,1,0,0],
|
|
425
|
+
[0,1,0,0,0,0,1,0],
|
|
426
|
+
],
|
|
427
|
+
happy: [
|
|
428
|
+
[0,0,1,1,1,1,0,0],
|
|
429
|
+
[0,1,0,0,0,0,1,0],
|
|
430
|
+
[1,0,1,0,0,1,0,1],
|
|
431
|
+
[1,0,0,0,0,0,0,1],
|
|
432
|
+
[1,0,1,0,0,1,0,1],
|
|
433
|
+
[0,1,0,1,1,0,1,0],
|
|
434
|
+
[0,0,1,1,1,1,0,0],
|
|
435
|
+
[0,1,0,0,0,0,1,0],
|
|
436
|
+
[1,0,0,0,0,0,0,1],
|
|
437
|
+
],
|
|
438
|
+
sad: [
|
|
439
|
+
[0,0,1,1,1,1,0,0],
|
|
440
|
+
[0,1,0,0,0,0,1,0],
|
|
441
|
+
[1,0,1,0,0,1,0,1],
|
|
442
|
+
[1,0,0,0,0,0,0,1],
|
|
443
|
+
[1,0,0,1,1,0,0,1],
|
|
444
|
+
[0,1,0,0,0,0,1,0],
|
|
445
|
+
[0,0,1,1,1,1,0,0],
|
|
446
|
+
[0,0,1,0,0,1,0,0],
|
|
447
|
+
[0,1,0,0,0,0,1,0],
|
|
448
|
+
],
|
|
449
|
+
eat: [
|
|
450
|
+
[0,0,1,1,1,1,0,0],
|
|
451
|
+
[0,1,0,0,0,0,1,0],
|
|
452
|
+
[1,0,1,0,0,1,0,1],
|
|
453
|
+
[1,0,0,0,0,0,0,1],
|
|
454
|
+
[1,0,0,1,1,0,0,1],
|
|
455
|
+
[0,1,0,1,1,0,1,0],
|
|
456
|
+
[0,0,1,1,1,1,0,0],
|
|
457
|
+
[0,0,1,0,0,1,0,0],
|
|
458
|
+
[0,1,0,0,0,0,1,0],
|
|
459
|
+
],
|
|
460
|
+
},
|
|
461
|
+
nyorotchi: {
|
|
462
|
+
idle1: [
|
|
463
|
+
[0,0,0,0,0,0,0,0],
|
|
464
|
+
[0,1,1,1,1,1,0,0],
|
|
465
|
+
[1,0,0,0,0,0,1,0],
|
|
466
|
+
[1,0,1,0,1,0,1,0],
|
|
467
|
+
[1,0,0,0,0,0,1,0],
|
|
468
|
+
[1,0,0,1,0,0,1,0],
|
|
469
|
+
[0,1,1,1,1,1,0,0],
|
|
470
|
+
[0,0,1,0,0,0,0,0],
|
|
471
|
+
[0,0,0,1,1,1,0,0],
|
|
472
|
+
],
|
|
473
|
+
idle2: [
|
|
474
|
+
[0,0,0,0,0,0,0,0],
|
|
475
|
+
[0,0,1,1,1,1,0,0],
|
|
476
|
+
[0,1,0,0,0,0,1,0],
|
|
477
|
+
[0,1,0,1,0,1,0,1],
|
|
478
|
+
[0,1,0,0,0,0,0,1],
|
|
479
|
+
[0,1,0,0,1,0,0,1],
|
|
480
|
+
[0,0,1,1,1,1,1,0],
|
|
481
|
+
[0,0,0,0,0,1,0,0],
|
|
482
|
+
[0,0,1,1,1,0,0,0],
|
|
483
|
+
],
|
|
484
|
+
happy: [
|
|
485
|
+
[0,0,0,0,0,0,0,0],
|
|
486
|
+
[0,1,1,1,1,1,0,0],
|
|
487
|
+
[1,0,0,0,0,0,1,0],
|
|
488
|
+
[1,0,1,0,1,0,1,0],
|
|
489
|
+
[1,0,0,0,0,0,1,0],
|
|
490
|
+
[1,0,1,0,0,1,1,0],
|
|
491
|
+
[0,1,0,1,1,0,0,0],
|
|
492
|
+
[0,0,1,0,0,0,0,0],
|
|
493
|
+
[0,0,0,1,1,1,0,0],
|
|
494
|
+
],
|
|
495
|
+
sad: [
|
|
496
|
+
[0,0,0,0,0,0,0,0],
|
|
497
|
+
[0,1,1,1,1,1,0,0],
|
|
498
|
+
[1,0,0,0,0,0,1,0],
|
|
499
|
+
[1,0,1,0,1,0,1,0],
|
|
500
|
+
[1,0,0,0,0,0,1,0],
|
|
501
|
+
[1,0,0,0,0,0,1,0],
|
|
502
|
+
[0,1,1,1,1,1,0,0],
|
|
503
|
+
[0,0,1,0,0,0,0,0],
|
|
504
|
+
[0,0,0,1,1,1,0,0],
|
|
505
|
+
],
|
|
506
|
+
eat: [
|
|
507
|
+
[0,0,0,0,0,0,0,0],
|
|
508
|
+
[0,1,1,1,1,1,0,0],
|
|
509
|
+
[1,0,0,0,0,0,1,0],
|
|
510
|
+
[1,0,1,0,1,0,1,0],
|
|
511
|
+
[1,0,0,0,0,0,1,0],
|
|
512
|
+
[1,0,0,1,1,0,1,0],
|
|
513
|
+
[0,1,1,1,1,1,0,0],
|
|
514
|
+
[0,0,1,0,0,0,0,0],
|
|
515
|
+
[0,0,0,1,1,1,0,0],
|
|
516
|
+
],
|
|
517
|
+
},
|
|
518
|
+
tarakotchi: {
|
|
519
|
+
idle1: [
|
|
520
|
+
[0,1,0,0,0,0,1,0],
|
|
521
|
+
[0,0,1,1,1,1,0,0],
|
|
522
|
+
[0,1,0,0,0,0,1,0],
|
|
523
|
+
[1,0,1,0,0,1,0,1],
|
|
524
|
+
[1,0,0,0,0,0,0,1],
|
|
525
|
+
[1,0,1,1,1,1,0,1],
|
|
526
|
+
[0,1,0,0,0,0,1,0],
|
|
527
|
+
[0,0,1,1,1,1,0,0],
|
|
528
|
+
[0,0,1,0,0,1,0,0],
|
|
529
|
+
],
|
|
530
|
+
idle2: [
|
|
531
|
+
[0,0,0,0,0,0,0,0],
|
|
532
|
+
[0,1,0,0,0,0,1,0],
|
|
533
|
+
[0,0,1,1,1,1,0,0],
|
|
534
|
+
[0,1,0,0,0,0,1,0],
|
|
535
|
+
[1,0,1,0,0,1,0,1],
|
|
536
|
+
[1,0,0,0,0,0,0,1],
|
|
537
|
+
[0,1,1,1,1,1,1,0],
|
|
538
|
+
[0,0,1,1,1,1,0,0],
|
|
539
|
+
[0,0,1,0,0,1,0,0],
|
|
540
|
+
],
|
|
541
|
+
happy: [
|
|
542
|
+
[0,1,0,0,0,0,1,0],
|
|
543
|
+
[0,0,1,1,1,1,0,0],
|
|
544
|
+
[0,1,0,0,0,0,1,0],
|
|
545
|
+
[1,0,1,0,0,1,0,1],
|
|
546
|
+
[1,0,0,0,0,0,0,1],
|
|
547
|
+
[1,0,0,1,1,0,0,1],
|
|
548
|
+
[0,1,0,0,0,0,1,0],
|
|
549
|
+
[0,0,1,1,1,1,0,0],
|
|
550
|
+
[0,1,0,0,0,0,1,0],
|
|
551
|
+
],
|
|
552
|
+
sad: [
|
|
553
|
+
[0,1,0,0,0,0,1,0],
|
|
554
|
+
[0,0,1,1,1,1,0,0],
|
|
555
|
+
[0,1,0,0,0,0,1,0],
|
|
556
|
+
[1,0,1,0,0,1,0,1],
|
|
557
|
+
[1,0,0,0,0,0,0,1],
|
|
558
|
+
[1,0,0,0,0,0,0,1],
|
|
559
|
+
[0,1,0,1,1,0,1,0],
|
|
560
|
+
[0,0,1,1,1,1,0,0],
|
|
561
|
+
[0,0,1,0,0,1,0,0],
|
|
562
|
+
],
|
|
563
|
+
eat: [
|
|
564
|
+
[0,1,0,0,0,0,1,0],
|
|
565
|
+
[0,0,1,1,1,1,0,0],
|
|
566
|
+
[0,1,0,0,0,0,1,0],
|
|
567
|
+
[1,0,1,0,0,1,0,1],
|
|
568
|
+
[1,0,0,0,0,0,0,1],
|
|
569
|
+
[1,0,0,1,1,0,0,1],
|
|
570
|
+
[0,1,0,1,1,0,1,0],
|
|
571
|
+
[0,0,1,1,1,1,0,0],
|
|
572
|
+
[0,0,1,0,0,1,0,0],
|
|
573
|
+
],
|
|
574
|
+
},
|
|
575
|
+
oyajitchi: {
|
|
576
|
+
idle1: [
|
|
577
|
+
[0,0,0,1,1,0,0,0],
|
|
578
|
+
[0,0,1,1,1,1,0,0],
|
|
579
|
+
[0,1,0,1,1,0,1,0],
|
|
580
|
+
[0,1,0,0,0,0,1,0],
|
|
581
|
+
[1,1,1,1,1,1,1,1],
|
|
582
|
+
[0,1,0,1,1,0,1,0],
|
|
583
|
+
[0,0,1,0,0,1,0,0],
|
|
584
|
+
[0,0,0,1,1,0,0,0],
|
|
585
|
+
[0,0,1,0,0,1,0,0],
|
|
586
|
+
],
|
|
587
|
+
idle2: [
|
|
588
|
+
[0,0,0,0,0,0,0,0],
|
|
589
|
+
[0,0,0,1,1,0,0,0],
|
|
590
|
+
[0,0,1,1,1,1,0,0],
|
|
591
|
+
[0,1,0,1,1,0,1,0],
|
|
592
|
+
[0,1,0,0,0,0,1,0],
|
|
593
|
+
[1,1,1,1,1,1,1,1],
|
|
594
|
+
[0,1,0,1,1,0,1,0],
|
|
595
|
+
[0,0,1,0,0,1,0,0],
|
|
596
|
+
[0,0,1,0,0,1,0,0],
|
|
597
|
+
],
|
|
598
|
+
happy: [
|
|
599
|
+
[0,0,0,1,1,0,0,0],
|
|
600
|
+
[0,0,1,1,1,1,0,0],
|
|
601
|
+
[0,1,0,1,1,0,1,0],
|
|
602
|
+
[0,1,0,0,0,0,1,0],
|
|
603
|
+
[1,1,1,1,1,1,1,1],
|
|
604
|
+
[0,1,1,0,0,1,1,0],
|
|
605
|
+
[0,0,1,1,1,1,0,0],
|
|
606
|
+
[0,0,0,1,1,0,0,0],
|
|
607
|
+
[0,1,0,0,0,0,1,0],
|
|
608
|
+
],
|
|
609
|
+
sad: [
|
|
610
|
+
[0,0,0,1,1,0,0,0],
|
|
611
|
+
[0,0,1,1,1,1,0,0],
|
|
612
|
+
[0,1,0,1,1,0,1,0],
|
|
613
|
+
[0,1,0,0,0,0,1,0],
|
|
614
|
+
[1,1,1,1,1,1,1,1],
|
|
615
|
+
[0,1,0,0,0,0,1,0],
|
|
616
|
+
[0,0,1,0,1,0,0,0],
|
|
617
|
+
[0,0,0,1,1,0,0,0],
|
|
618
|
+
[0,0,1,0,0,1,0,0],
|
|
619
|
+
],
|
|
620
|
+
eat: [
|
|
621
|
+
[0,0,0,1,1,0,0,0],
|
|
622
|
+
[0,0,1,1,1,1,0,0],
|
|
623
|
+
[0,1,0,1,1,0,1,0],
|
|
624
|
+
[0,1,0,0,0,0,1,0],
|
|
625
|
+
[1,1,1,1,1,1,1,1],
|
|
626
|
+
[0,1,0,1,1,0,1,0],
|
|
627
|
+
[0,0,1,1,1,1,0,0],
|
|
628
|
+
[0,0,0,1,1,0,0,0],
|
|
629
|
+
[0,0,1,0,0,1,0,0],
|
|
630
|
+
],
|
|
631
|
+
},
|
|
632
|
+
// Shared sprites
|
|
633
|
+
poop: [[0,1,0,0],[1,0,1,0],[0,1,0,1],[1,1,1,1]],
|
|
634
|
+
skull: [[0,1,1,1,0],[1,0,1,0,1],[1,1,1,1,1],[0,1,0,1,0],[0,0,1,0,0]],
|
|
635
|
+
zzz: [[1,1,0],[0,1,0],[1,1,0]],
|
|
636
|
+
heart: [[0,1,0,1,0],[1,1,1,1,1],[1,1,1,1,1],[0,1,1,1,0],[0,0,1,0,0]],
|
|
637
|
+
heartEmpty: [[0,1,0,1,0],[1,0,1,0,1],[1,0,0,0,1],[0,1,0,1,0],[0,0,1,0,0]],
|
|
638
|
+
meal: [[0,0,1,0,0],[0,1,1,1,0],[1,1,1,1,1],[0,1,1,1,0],[0,0,1,0,0]],
|
|
639
|
+
snack: [[0,0,1,0,0],[0,1,0,1,0],[0,0,1,0,0],[0,1,0,1,0],[0,0,1,0,0]],
|
|
640
|
+
grave: [[0,0,1,1,1,0,0],[0,1,0,1,0,1,0],[0,1,0,1,0,1,0],[0,1,1,1,1,1,0],[0,1,0,0,0,1,0],[0,1,0,0,0,1,0],[1,1,1,1,1,1,1]],
|
|
641
|
+
angel: [[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,1,0,1,0,1,0],[1,0,0,0,0,0,1],[0,1,1,1,1,1,0]],
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
// Side glances change the face rather than mirroring the whole character.
|
|
645
|
+
const glanceFaces={
|
|
646
|
+
babytchi:[1,2,6,0],marutchi:[1,2,6,1],tamatchi:[2,2,4,1],
|
|
647
|
+
kuchitamatchi:[1,2,6,0],mametchi:[2,3,4,0],ginjirotchi:[1,2,6,1],
|
|
648
|
+
maskutchi:[1,2,6,0],kuchipatchi:[1,2,6,0],nyorotchi:[1,3,5,0],
|
|
649
|
+
tarakotchi:[1,3,6,0],oyajitchi:[2,2,4,0],
|
|
650
|
+
};
|
|
651
|
+
for(const [id,[x,y,width,background]] of Object.entries(glanceFaces)){
|
|
652
|
+
for(const [name,left] of [['lookLeft',true],['lookRight',false]]){
|
|
653
|
+
const frame=classicSprites[id].idle1.map(row=>[...row]);
|
|
654
|
+
for(let dx=0;dx<width;dx++)frame[y][x+dx]=background;
|
|
655
|
+
const eye=x+(left?0:width-3);
|
|
656
|
+
frame[y][eye]=1-background;frame[y][eye+2]=1-background;
|
|
657
|
+
// The cheek points toward the answer while the body remains in place.
|
|
658
|
+
for(let dx=0;dx<width;dx++)frame[y+1][x+dx]=background;
|
|
659
|
+
frame[y+1][left?x:x+width-1]=1-background;
|
|
660
|
+
classicSprites[id][name]=frame;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
// An upward glance moves the same authored eyes, without shifting the body.
|
|
665
|
+
for(const [id,[x,y,width,background]] of Object.entries(glanceFaces)){
|
|
666
|
+
const frame=classicSprites[id].idle1.map(row=>[...row]);
|
|
667
|
+
for(let dx=0;dx<width;dx++){frame[y][x+dx]=background;frame[y+1][x+dx]=background;}
|
|
668
|
+
const eye=x+Math.floor((width-3)/2);
|
|
669
|
+
frame[y-1][eye]=1-background;frame[y-1][eye+2]=1-background;
|
|
670
|
+
frame[y][eye+1]=1-background;
|
|
671
|
+
classicSprites[id].lookUp=frame;
|
|
672
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export const petColors=Object.freeze({
|
|
2
|
+
default:{shell:'#8b9d82',screen:'#cbdca6'},
|
|
3
|
+
original2:{shell:'#697ec2',screen:'#c0dce6'},
|
|
4
|
+
slice:{shell:'#839c98',screen:'#648e97'},
|
|
5
|
+
cyberpunk:{shell:'#304e59',screen:'#0b1c24'},
|
|
6
|
+
lilgotchi:{shell:'#fff0cc',screen:'#20281d'},
|
|
7
|
+
});
|
|
8
|
+
export const validColor=value=>typeof value==='string'&&/^#[0-9a-f]{6}$/i.test(value);
|
|
9
|
+
export function cleanColors(value){
|
|
10
|
+
const result={};
|
|
11
|
+
for(const key of ['shell','screen'])if(validColor(value?.[key]))result[key]=value[key].toLowerCase();
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
export function cleanColorMap(value){
|
|
15
|
+
const result={};
|
|
16
|
+
for(const family of Object.keys(petColors)){
|
|
17
|
+
const colors=cleanColors(value?.[family]);
|
|
18
|
+
if(Object.keys(colors).length)result[family]=colors;
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
export function readColorMap(value){try{return cleanColorMap(JSON.parse(value));}catch{return {};}}
|
|
23
|
+
export function resolvedColors(family,overrides={}){return {...petColors[family]||petColors.default,...cleanColors(overrides)};}
|
|
24
|
+
export function shade(color,amount){
|
|
25
|
+
return '#'+[1,3,5].map(i=>Math.max(0,Math.min(255,parseInt(color.slice(i,i+2),16)+amount)).toString(16).padStart(2,'0')).join('');
|
|
26
|
+
}
|
|
27
|
+
export function screenInk(color){
|
|
28
|
+
const rgb=[1,3,5].map(i=>parseInt(color.slice(i,i+2),16)/255).map(v=>v<=.04045?v/12.92:((v+.055)/1.055)**2.4);
|
|
29
|
+
return .2126*rgb[0]+.7152*rgb[1]+.0722*rgb[2]>.179?'#142019':'#f4f7ee';
|
|
30
|
+
}
|
|
31
|
+
export function applyPetColors(root,family,overrides={}){
|
|
32
|
+
const custom=cleanColors(overrides),colors=resolvedColors(family,custom);
|
|
33
|
+
const classic=family==='default'||family==='original2';
|
|
34
|
+
for(const property of ['--device-bg','--lcd-bg','--lcd-fg'])root.style.removeProperty(property);
|
|
35
|
+
if(root.classList.contains('eink'))return;
|
|
36
|
+
if(classic||custom.shell)root.style.setProperty('--device-bg',`linear-gradient(145deg,${shade(colors.shell,22)},${shade(colors.shell,-24)})`);
|
|
37
|
+
if(classic||custom.screen){root.style.setProperty('--lcd-bg',colors.screen);root.style.setProperty('--lcd-fg',screenInk(colors.screen));}
|
|
38
|
+
}
|