@jjlmoya/utils-pets 1.17.0 → 1.19.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/package.json +1 -1
- package/src/category/index.ts +3 -1
- package/src/data.ts +4 -0
- package/src/entries.ts +5 -1
- package/src/index.ts +3 -2
- package/src/layouts/PreviewLayout.astro +2 -0
- package/src/pages/[locale]/[slug].astro +14 -5
- package/src/tests/diacritics_density.test.ts +1 -1
- package/src/tests/faq_count.test.ts +1 -1
- package/src/tests/inverted_punctuation.test.ts +1 -1
- package/src/tests/locale_completeness.test.ts +1 -2
- package/src/tests/script_density.test.ts +1 -1
- package/src/tests/seo_translation_completeness.test.ts +69 -0
- package/src/tests/title_quality.test.ts +1 -0
- package/src/tests/tool_validation.test.ts +4 -4
- package/src/tests/translation_copy.test.ts +14 -15
- package/src/tool/petAge/index.ts +1 -0
- package/src/tool/petGestation/bibliography.astro +6 -0
- package/src/tool/petGestation/bibliography.ts +12 -0
- package/src/tool/petGestation/component.astro +68 -0
- package/src/tool/petGestation/controller.ts +69 -0
- package/src/tool/petGestation/dom-views.ts +60 -0
- package/src/tool/petGestation/entry.ts +31 -0
- package/src/tool/petGestation/evaluator.ts +28 -0
- package/src/tool/petGestation/i18n/de.ts +209 -0
- package/src/tool/petGestation/i18n/en.ts +198 -0
- package/src/tool/petGestation/i18n/es.ts +198 -0
- package/src/tool/petGestation/i18n/fr.ts +209 -0
- package/src/tool/petGestation/i18n/id.ts +209 -0
- package/src/tool/petGestation/i18n/it.ts +209 -0
- package/src/tool/petGestation/i18n/ja.ts +209 -0
- package/src/tool/petGestation/i18n/ko.ts +209 -0
- package/src/tool/petGestation/i18n/nl.ts +209 -0
- package/src/tool/petGestation/i18n/pl.ts +209 -0
- package/src/tool/petGestation/i18n/pt.ts +209 -0
- package/src/tool/petGestation/i18n/ru.ts +209 -0
- package/src/tool/petGestation/i18n/sv.ts +209 -0
- package/src/tool/petGestation/i18n/tr.ts +209 -0
- package/src/tool/petGestation/i18n/zh.ts +209 -0
- package/src/tool/petGestation/index.ts +11 -0
- package/src/tool/petGestation/logic.test.ts +44 -0
- package/src/tool/petGestation/logic.ts +103 -0
- package/src/tool/petGestation/pet-gestation-calculator.css +401 -0
- package/src/tool/petGestation/seo.astro +15 -0
- package/src/tool/petGestation/storage.ts +25 -0
- package/src/tool/petGestation/ui.ts +42 -0
- package/src/tool/petRation/component.astro +1 -1
- package/src/tool/petRation/handlers.ts +1 -1
- package/src/tool/petRation/index.ts +1 -0
- package/src/tool/petToxicity/bibliography.astro +6 -0
- package/src/tool/petToxicity/bibliography.ts +16 -0
- package/src/tool/petToxicity/component.astro +53 -0
- package/src/tool/petToxicity/controller.ts +117 -0
- package/src/tool/petToxicity/dom-views.ts +61 -0
- package/src/tool/petToxicity/entry.ts +33 -0
- package/src/tool/petToxicity/evaluator.ts +23 -0
- package/src/tool/petToxicity/i18n/de.ts +181 -0
- package/src/tool/petToxicity/i18n/en.ts +175 -0
- package/src/tool/petToxicity/i18n/es.ts +181 -0
- package/src/tool/petToxicity/i18n/fr.ts +181 -0
- package/src/tool/petToxicity/i18n/id.ts +182 -0
- package/src/tool/petToxicity/i18n/it.ts +181 -0
- package/src/tool/petToxicity/i18n/ja.ts +181 -0
- package/src/tool/petToxicity/i18n/ko.ts +181 -0
- package/src/tool/petToxicity/i18n/nl.ts +182 -0
- package/src/tool/petToxicity/i18n/pl.ts +182 -0
- package/src/tool/petToxicity/i18n/pt.ts +181 -0
- package/src/tool/petToxicity/i18n/ru.ts +182 -0
- package/src/tool/petToxicity/i18n/sv.ts +182 -0
- package/src/tool/petToxicity/i18n/tr.ts +182 -0
- package/src/tool/petToxicity/i18n/zh.ts +181 -0
- package/src/tool/petToxicity/index.ts +11 -0
- package/src/tool/petToxicity/logic.test.ts +32 -0
- package/src/tool/petToxicity/logic.ts +192 -0
- package/src/tool/petToxicity/pet-food-toxicity-checker.css +450 -0
- package/src/tool/petToxicity/seo.astro +15 -0
- package/src/tool/petToxicity/storage.ts +37 -0
- package/src/tool/petToxicity/ui.ts +33 -0
- package/src/tools.ts +6 -1
- package/src/types.ts +1 -1
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--n-paper: #f8f4ea;
|
|
3
|
+
--n-surface: #fffdf7;
|
|
4
|
+
--n-ink: #22241f;
|
|
5
|
+
--n-muted: #686c61;
|
|
6
|
+
--n-line: #d8d4c8;
|
|
7
|
+
--n-accent: #cb3d2f;
|
|
8
|
+
--n-accent-dark: #8e201b;
|
|
9
|
+
--n-yellow: #e5aa31;
|
|
10
|
+
--n-green: #3b7561;
|
|
11
|
+
--n-shadow: #b8b1a1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.theme-dark {
|
|
15
|
+
--n-paper: #20231f;
|
|
16
|
+
--n-surface: #2a2e28;
|
|
17
|
+
--n-ink: #f2eee3;
|
|
18
|
+
--n-muted: #b9b8aa;
|
|
19
|
+
--n-line: #52584e;
|
|
20
|
+
--n-accent: #f07c68;
|
|
21
|
+
--n-accent-dark: #ffad93;
|
|
22
|
+
--n-yellow: #edc35b;
|
|
23
|
+
--n-green: #84c8a7;
|
|
24
|
+
--n-shadow: #11130f;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.pet-toxicity {
|
|
28
|
+
--n-card: var(--n-surface);
|
|
29
|
+
--n-card-strong: var(--n-paper);
|
|
30
|
+
--n-danger-surface: #f7dfd6;
|
|
31
|
+
--n-caution-surface: #f5edcf;
|
|
32
|
+
--n-safe-surface: #dbece1;
|
|
33
|
+
|
|
34
|
+
background: var(--n-paper);
|
|
35
|
+
border: 1px solid var(--n-line);
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
border-radius: 1.25rem;
|
|
38
|
+
box-shadow: 0.4rem 0.4rem 0 var(--n-shadow);
|
|
39
|
+
color: var(--n-ink);
|
|
40
|
+
max-width: 70rem;
|
|
41
|
+
min-width: 0;
|
|
42
|
+
overflow: visible;
|
|
43
|
+
padding: clamp(1rem, 3vw, 2rem);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.theme-dark .pet-toxicity {
|
|
47
|
+
--n-danger-surface: #512d2a;
|
|
48
|
+
--n-caution-surface: #4d4021;
|
|
49
|
+
--n-safe-surface: #244035;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pet-toxicity-journey {
|
|
53
|
+
align-items: center;
|
|
54
|
+
border-bottom: 1px solid var(--n-line);
|
|
55
|
+
display: flex;
|
|
56
|
+
gap: 0.75rem;
|
|
57
|
+
margin-bottom: 1.25rem;
|
|
58
|
+
padding-bottom: 1.25rem;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.pet-toxicity-journey p {
|
|
62
|
+
margin: 0;
|
|
63
|
+
max-width: 52rem;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.pet-toxicity-journey-mark {
|
|
67
|
+
align-items: center;
|
|
68
|
+
background: var(--n-accent);
|
|
69
|
+
border: 2px solid var(--n-ink);
|
|
70
|
+
border-radius: 50%;
|
|
71
|
+
color: var(--n-surface);
|
|
72
|
+
display: inline-flex;
|
|
73
|
+
flex: 0 0 2rem;
|
|
74
|
+
font-size: 1.25rem;
|
|
75
|
+
font-weight: 800;
|
|
76
|
+
height: 2rem;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: 2rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.pet-toxicity-workbench {
|
|
82
|
+
align-items: stretch;
|
|
83
|
+
display: grid;
|
|
84
|
+
gap: 1rem;
|
|
85
|
+
grid-template-columns: minmax(15rem, 0.7fr) minmax(20rem, 1.3fr);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.pet-toxicity-controls {
|
|
89
|
+
background: var(--n-card);
|
|
90
|
+
border: 1px solid var(--n-line);
|
|
91
|
+
border-radius: 1rem;
|
|
92
|
+
display: grid;
|
|
93
|
+
gap: 1rem;
|
|
94
|
+
padding: 1rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.pet-toxicity-control {
|
|
98
|
+
display: grid;
|
|
99
|
+
gap: 0.45rem;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.pet-toxicity-label,
|
|
103
|
+
.pet-toxicity-eyebrow {
|
|
104
|
+
color: var(--n-muted);
|
|
105
|
+
display: block;
|
|
106
|
+
font-size: 0.72rem;
|
|
107
|
+
font-weight: 800;
|
|
108
|
+
letter-spacing: 0.08em;
|
|
109
|
+
text-transform: uppercase;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.pet-toxicity-select {
|
|
113
|
+
position: relative;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.pet-toxicity-select-trigger {
|
|
117
|
+
align-items: center;
|
|
118
|
+
background: var(--n-card-strong);
|
|
119
|
+
border: 1px solid var(--n-line);
|
|
120
|
+
border-radius: 0.7rem;
|
|
121
|
+
color: var(--n-ink);
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
display: flex;
|
|
124
|
+
font: inherit;
|
|
125
|
+
font-weight: 700;
|
|
126
|
+
justify-content: space-between;
|
|
127
|
+
min-height: 3.2rem;
|
|
128
|
+
padding: 0.7rem 0.8rem;
|
|
129
|
+
text-align: left;
|
|
130
|
+
width: 100%;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.pet-toxicity-select-trigger:focus-visible,
|
|
134
|
+
.pet-toxicity-menu-option:focus-visible {
|
|
135
|
+
outline: 3px solid var(--n-yellow);
|
|
136
|
+
outline-offset: 2px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.pet-toxicity-chevron {
|
|
140
|
+
border-bottom: 2px solid currentcolor;
|
|
141
|
+
border-right: 2px solid currentcolor;
|
|
142
|
+
height: 0.55rem;
|
|
143
|
+
transform: rotate(45deg) translateY(-0.15rem);
|
|
144
|
+
width: 0.55rem;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.pet-toxicity-menu {
|
|
148
|
+
background: var(--n-card);
|
|
149
|
+
border: 1px solid var(--n-line);
|
|
150
|
+
border-radius: 0.7rem;
|
|
151
|
+
box-shadow: 0.25rem 0.25rem 0 var(--n-shadow);
|
|
152
|
+
display: grid;
|
|
153
|
+
gap: 0.25rem;
|
|
154
|
+
left: 0;
|
|
155
|
+
max-height: 18rem;
|
|
156
|
+
overflow-y: auto;
|
|
157
|
+
padding: 0.35rem;
|
|
158
|
+
position: absolute;
|
|
159
|
+
right: 0;
|
|
160
|
+
top: calc(100% + 0.4rem);
|
|
161
|
+
z-index: 3;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.pet-toxicity-menu[hidden] {
|
|
165
|
+
display: none;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.pet-toxicity-menu-option {
|
|
169
|
+
background: transparent;
|
|
170
|
+
border: 0;
|
|
171
|
+
border-radius: 0.5rem;
|
|
172
|
+
color: var(--n-ink);
|
|
173
|
+
cursor: pointer;
|
|
174
|
+
display: grid;
|
|
175
|
+
gap: 0.2rem;
|
|
176
|
+
padding: 0.65rem;
|
|
177
|
+
text-align: left;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.pet-toxicity-menu-option:hover,
|
|
181
|
+
.pet-toxicity-menu-option[data-selected="true"] {
|
|
182
|
+
background: var(--n-danger-surface);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.pet-toxicity-menu-option small,
|
|
186
|
+
.pet-toxicity-hint {
|
|
187
|
+
color: var(--n-muted);
|
|
188
|
+
font-size: 0.78rem;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.pet-toxicity-hint {
|
|
192
|
+
line-height: 1.4;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.pet-toxicity-visual {
|
|
196
|
+
min-width: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.pet-toxicity-scene-card {
|
|
200
|
+
background: var(--n-card);
|
|
201
|
+
border: 1px solid var(--n-line);
|
|
202
|
+
border-radius: 1rem;
|
|
203
|
+
display: grid;
|
|
204
|
+
grid-template-rows: auto auto;
|
|
205
|
+
overflow: hidden;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.pet-toxicity-scene-copy {
|
|
209
|
+
display: grid;
|
|
210
|
+
gap: 0.3rem;
|
|
211
|
+
min-width: 0;
|
|
212
|
+
padding: 1rem 1rem 0.75rem;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.pet-toxicity-scene-copy strong {
|
|
216
|
+
font-size: clamp(1.3rem, 3vw, 2rem);
|
|
217
|
+
overflow-wrap: anywhere;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.pet-toxicity-scene-copy span:last-child {
|
|
221
|
+
color: var(--n-muted);
|
|
222
|
+
font-size: 0.85rem;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.pet-toxicity-scene {
|
|
226
|
+
display: block;
|
|
227
|
+
height: clamp(12rem, 23vw, 16rem);
|
|
228
|
+
width: 100%;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.pet-toxicity-scene-paper {
|
|
232
|
+
fill: var(--n-card-strong);
|
|
233
|
+
stroke: var(--n-line);
|
|
234
|
+
stroke-width: 1;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.pet-toxicity-scene-line {
|
|
238
|
+
fill: none;
|
|
239
|
+
stroke: var(--n-accent);
|
|
240
|
+
stroke-linecap: round;
|
|
241
|
+
stroke-width: 3;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.pet-toxicity-scene-line-thin {
|
|
245
|
+
opacity: 0.55;
|
|
246
|
+
stroke: var(--n-green);
|
|
247
|
+
stroke-width: 2;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.pet-toxicity-marker {
|
|
251
|
+
fill: var(--n-accent);
|
|
252
|
+
stroke: var(--n-card);
|
|
253
|
+
stroke-width: 3;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.pet-toxicity-marker-critical { fill: var(--n-accent-dark); }
|
|
257
|
+
.pet-toxicity-marker-caution { fill: var(--n-yellow); }
|
|
258
|
+
.pet-toxicity-marker-empty { fill: var(--n-line); }
|
|
259
|
+
|
|
260
|
+
.pet-toxicity-scene-seal {
|
|
261
|
+
fill: var(--n-accent);
|
|
262
|
+
stroke: var(--n-ink);
|
|
263
|
+
stroke-width: 2;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.pet-toxicity-scene-seal-mark {
|
|
267
|
+
fill: none;
|
|
268
|
+
stroke: var(--n-surface);
|
|
269
|
+
stroke-linecap: round;
|
|
270
|
+
stroke-width: 2;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.pet-toxicity-scene-seal-dot {
|
|
274
|
+
fill: var(--n-surface);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.pet-toxicity-result {
|
|
278
|
+
margin-top: 1rem;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.pet-toxicity-result-card,
|
|
282
|
+
.pet-toxicity-result-empty,
|
|
283
|
+
.pet-toxicity-emergency,
|
|
284
|
+
.pet-toxicity-sources {
|
|
285
|
+
background: var(--n-card);
|
|
286
|
+
border: 1px solid var(--n-line);
|
|
287
|
+
border-radius: 1rem;
|
|
288
|
+
padding: clamp(1rem, 2.5vw, 1.5rem);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.pet-toxicity-result-card-critical,
|
|
292
|
+
.pet-toxicity-result-card-high {
|
|
293
|
+
border-top: 0.35rem solid var(--n-accent);
|
|
294
|
+
}
|
|
295
|
+
.pet-toxicity-result-card-caution { border-top: 0.35rem solid var(--n-yellow); }
|
|
296
|
+
|
|
297
|
+
.pet-toxicity-result-head {
|
|
298
|
+
align-items: center;
|
|
299
|
+
display: flex;
|
|
300
|
+
gap: 0.75rem;
|
|
301
|
+
justify-content: space-between;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.pet-toxicity-risk-status {
|
|
305
|
+
align-items: end;
|
|
306
|
+
display: grid;
|
|
307
|
+
gap: 0.35rem;
|
|
308
|
+
justify-items: end;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.pet-toxicity-risk {
|
|
312
|
+
border-radius: 2rem;
|
|
313
|
+
font-size: 0.75rem;
|
|
314
|
+
font-weight: 800;
|
|
315
|
+
padding: 0.35rem 0.6rem;
|
|
316
|
+
text-transform: uppercase;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.pet-toxicity-risk-critical,
|
|
320
|
+
.pet-toxicity-risk-high {
|
|
321
|
+
background: var(--n-danger-surface);
|
|
322
|
+
color: var(--n-accent-dark);
|
|
323
|
+
}
|
|
324
|
+
.pet-toxicity-risk-caution {
|
|
325
|
+
background: var(--n-caution-surface);
|
|
326
|
+
color: var(--n-ink);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
.pet-toxicity-risk-meter {
|
|
330
|
+
display: flex;
|
|
331
|
+
gap: 0.2rem;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.pet-toxicity-risk-meter span {
|
|
335
|
+
background: var(--n-line);
|
|
336
|
+
border-radius: 99px;
|
|
337
|
+
height: 0.28rem;
|
|
338
|
+
width: 1.25rem;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.pet-toxicity-risk-meter span.is-active {
|
|
342
|
+
background: var(--n-accent);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.pet-toxicity-result-card-caution .pet-toxicity-risk-meter span.is-active {
|
|
346
|
+
background: var(--n-yellow);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
.pet-toxicity-result-card h3 {
|
|
350
|
+
font-size: clamp(1.4rem, 3vw, 2rem);
|
|
351
|
+
margin: 0.7rem 0 0.3rem;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.pet-toxicity-summary {
|
|
355
|
+
font-size: 1.05rem;
|
|
356
|
+
margin: 0;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.pet-toxicity-result-grid {
|
|
360
|
+
border-top: 1px solid var(--n-line);
|
|
361
|
+
display: grid;
|
|
362
|
+
gap: 1rem;
|
|
363
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
364
|
+
margin-top: 1.25rem;
|
|
365
|
+
padding-top: 1.25rem;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.pet-toxicity-result-grid p { margin: 0.45rem 0 0; }
|
|
369
|
+
|
|
370
|
+
.pet-toxicity-sign-list {
|
|
371
|
+
display: grid;
|
|
372
|
+
gap: 0.45rem;
|
|
373
|
+
list-style: none;
|
|
374
|
+
margin: 0.45rem 0 0;
|
|
375
|
+
padding: 0;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.pet-toxicity-sign-list li {
|
|
379
|
+
align-items: center;
|
|
380
|
+
background: var(--n-card-strong);
|
|
381
|
+
border: 1px solid var(--n-line);
|
|
382
|
+
border-radius: 0.65rem;
|
|
383
|
+
display: flex;
|
|
384
|
+
gap: 0.55rem;
|
|
385
|
+
min-height: 2.35rem;
|
|
386
|
+
padding: 0.4rem 0.55rem;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.pet-toxicity-sign-icon {
|
|
390
|
+
align-items: center;
|
|
391
|
+
background: var(--n-danger-surface);
|
|
392
|
+
border-radius: 50%;
|
|
393
|
+
color: var(--n-accent-dark);
|
|
394
|
+
display: inline-flex;
|
|
395
|
+
flex: 0 0 1.55rem;
|
|
396
|
+
height: 1.55rem;
|
|
397
|
+
justify-content: center;
|
|
398
|
+
width: 1.55rem;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.pet-toxicity-sign-icon svg {
|
|
402
|
+
fill: none;
|
|
403
|
+
height: 1rem;
|
|
404
|
+
stroke: currentcolor;
|
|
405
|
+
stroke-linecap: round;
|
|
406
|
+
stroke-linejoin: round;
|
|
407
|
+
stroke-width: 1.5;
|
|
408
|
+
width: 1rem;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.pet-toxicity-sign-icon circle {
|
|
412
|
+
fill: currentcolor;
|
|
413
|
+
stroke: none;
|
|
414
|
+
}
|
|
415
|
+
.pet-toxicity-action { grid-column: 1 / -1; }
|
|
416
|
+
|
|
417
|
+
.pet-toxicity-callout,
|
|
418
|
+
.pet-toxicity-emergency {
|
|
419
|
+
display: grid;
|
|
420
|
+
gap: 0.35rem;
|
|
421
|
+
margin-top: 1rem;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.pet-toxicity-callout {
|
|
425
|
+
background: var(--n-danger-surface);
|
|
426
|
+
border-radius: 0.7rem;
|
|
427
|
+
padding: 0.8rem;
|
|
428
|
+
}
|
|
429
|
+
.pet-toxicity-emergency {
|
|
430
|
+
background: var(--n-danger-surface);
|
|
431
|
+
border-color: var(--n-accent);
|
|
432
|
+
}
|
|
433
|
+
.pet-toxicity-emergency strong { color: var(--n-accent-dark); }
|
|
434
|
+
|
|
435
|
+
.pet-toxicity-sources { margin-top: 1rem; }
|
|
436
|
+
.pet-toxicity-sources p { margin: 0.45rem 0 0; }
|
|
437
|
+
|
|
438
|
+
@media (max-width: 48rem) {
|
|
439
|
+
.pet-toxicity {
|
|
440
|
+
max-width: calc(100vw - 3rem);
|
|
441
|
+
width: calc(100vw - 3rem);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
.pet-toxicity-workbench,
|
|
445
|
+
.pet-toxicity-result-grid { grid-template-columns: 1fr; }
|
|
446
|
+
.pet-toxicity-action { grid-column: auto; }
|
|
447
|
+
|
|
448
|
+
.pet-toxicity-result-head { align-items: start; }
|
|
449
|
+
.pet-toxicity-risk-status { flex: 0 0 auto; }
|
|
450
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { SEORenderer } from '@jjlmoya/utils-shared';
|
|
3
|
+
import { petToxicity } from './index';
|
|
4
|
+
import type { KnownLocale } from '../../types';
|
|
5
|
+
|
|
6
|
+
interface Props {
|
|
7
|
+
locale?: KnownLocale;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const { locale = 'en' } = Astro.props;
|
|
11
|
+
const content = await petToxicity.i18n[locale]?.();
|
|
12
|
+
if (!content) return null;
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
{content.seo?.length > 0 && <SEORenderer content={{ locale, sections: content.seo }} />}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FoodId, PetSpecies } from './logic';
|
|
2
|
+
|
|
3
|
+
interface SavedState {
|
|
4
|
+
species: PetSpecies;
|
|
5
|
+
foodId: FoodId;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const STORAGE_KEY = 'jjlmoya-pet-toxicity-state';
|
|
9
|
+
|
|
10
|
+
function isSpecies(value: unknown): value is PetSpecies {
|
|
11
|
+
return value === 'dog' || value === 'cat';
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function isSavedState(value: unknown): value is SavedState {
|
|
15
|
+
if (!value || typeof value !== 'object') return false;
|
|
16
|
+
const record = value as Record<string, unknown>;
|
|
17
|
+
return isSpecies(record.species) && typeof record.foodId === 'string';
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function loadSavedState(): SavedState | null {
|
|
21
|
+
try {
|
|
22
|
+
const raw = window.localStorage.getItem(STORAGE_KEY);
|
|
23
|
+
if (!raw) return null;
|
|
24
|
+
const parsed: unknown = JSON.parse(raw);
|
|
25
|
+
return isSavedState(parsed) ? parsed : null;
|
|
26
|
+
} catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function saveState(state: SavedState): void {
|
|
32
|
+
try {
|
|
33
|
+
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(state));
|
|
34
|
+
} catch {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface PetToxicityUI {
|
|
2
|
+
[key: string]: string;
|
|
3
|
+
journeyHint: string;
|
|
4
|
+
speciesLabel: string;
|
|
5
|
+
speciesDog: string;
|
|
6
|
+
speciesCat: string;
|
|
7
|
+
speciesDogMeta: string;
|
|
8
|
+
speciesCatMeta: string;
|
|
9
|
+
foodLabel: string;
|
|
10
|
+
foodPlaceholder: string;
|
|
11
|
+
foodMenuHint: string;
|
|
12
|
+
resultEyebrow: string;
|
|
13
|
+
resultEmpty: string;
|
|
14
|
+
sceneLabel: string;
|
|
15
|
+
sceneReady: string;
|
|
16
|
+
sceneSelected: string;
|
|
17
|
+
riskCritical: string;
|
|
18
|
+
riskHigh: string;
|
|
19
|
+
riskCaution: string;
|
|
20
|
+
riskUnknown: string;
|
|
21
|
+
riskLabel: string;
|
|
22
|
+
whyLabel: string;
|
|
23
|
+
signsLabel: string;
|
|
24
|
+
actionLabel: string;
|
|
25
|
+
callVetLabel: string;
|
|
26
|
+
callVetText: string;
|
|
27
|
+
sourceLabel: string;
|
|
28
|
+
sourceText: string;
|
|
29
|
+
emergencyTitle: string;
|
|
30
|
+
emergencyText: string;
|
|
31
|
+
openMenu: string;
|
|
32
|
+
closeMenu: string;
|
|
33
|
+
}
|
package/src/tools.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
export { ALL_ENTRIES } from './entries';
|
|
2
2
|
import { PET_AGE_TOOL } from './tool/petAge';
|
|
3
3
|
import { PET_RATION_TOOL } from './tool/petRation';
|
|
4
|
+
import { PET_GESTATION_TOOL } from './tool/petGestation';
|
|
5
|
+
import { PET_TOXICITY_TOOL } from './tool/petToxicity';
|
|
4
6
|
import type { ToolDefinition } from './types';
|
|
5
7
|
|
|
6
8
|
export const ALL_TOOLS: ToolDefinition[] = [
|
|
7
9
|
PET_AGE_TOOL,
|
|
8
10
|
PET_RATION_TOOL,
|
|
11
|
+
PET_GESTATION_TOOL,
|
|
12
|
+
PET_TOXICITY_TOOL,
|
|
9
13
|
];
|
|
10
14
|
|
|
11
15
|
export {
|
|
12
16
|
PET_AGE_TOOL,
|
|
13
17
|
PET_RATION_TOOL,
|
|
18
|
+
PET_GESTATION_TOOL,
|
|
19
|
+
PET_TOXICITY_TOOL,
|
|
14
20
|
};
|
|
15
|
-
|
package/src/types.ts
CHANGED
|
@@ -5,7 +5,7 @@ export type { SEOSection };
|
|
|
5
5
|
|
|
6
6
|
export type KnownLocale =
|
|
7
7
|
| 'ar' | 'da' | 'de' | 'en' | 'es' | 'fi'
|
|
8
|
-
| 'fr' | 'it' | 'ja' | 'ko' | 'nb' | 'nl'
|
|
8
|
+
| 'fr' | 'id' | 'it' | 'ja' | 'ko' | 'nb' | 'nl'
|
|
9
9
|
| 'pl' | 'pt' | 'ru' | 'sv' | 'tr' | 'zh';
|
|
10
10
|
|
|
11
11
|
export interface FAQItem {
|