dinofyi-embed 1.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/LICENSE +21 -0
- package/README.md +184 -0
- package/dist/embed.esm.js +2348 -0
- package/dist/embed.min.js +1159 -0
- package/dist/index.d.ts +27 -0
- package/package.json +42 -0
|
@@ -0,0 +1,1159 @@
|
|
|
1
|
+
/* dinofyi-embed v1.0.0 | MIT | https://widget.dinofyi.com */
|
|
2
|
+
"use strict";(()=>{function me(){return`
|
|
3
|
+
/* Modern: gradient accent header */
|
|
4
|
+
.naturefyi-header {
|
|
5
|
+
background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000));
|
|
6
|
+
border-radius: 12px 12px 0 0;
|
|
7
|
+
padding: 16px 20px;
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: flex-start;
|
|
10
|
+
gap: 14px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.naturefyi-header-title {
|
|
14
|
+
font-size: 15px;
|
|
15
|
+
font-weight: 700;
|
|
16
|
+
color: #fff;
|
|
17
|
+
margin: 0 0 4px 0;
|
|
18
|
+
line-height: 1.3;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.naturefyi-header-subtitle {
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
color: rgba(255, 255, 255, 0.8);
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Image/preview area \u2014 for species photos, bird images, plant illustrations */
|
|
28
|
+
.naturefyi-img {
|
|
29
|
+
width: 56px;
|
|
30
|
+
height: 56px;
|
|
31
|
+
border-radius: 8px;
|
|
32
|
+
object-fit: cover;
|
|
33
|
+
background: rgba(255, 255, 255, 0.15);
|
|
34
|
+
flex-shrink: 0;
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.naturefyi-img img {
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
object-fit: cover;
|
|
45
|
+
border-radius: 8px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Body area */
|
|
49
|
+
.naturefyi-body {
|
|
50
|
+
padding: 16px 20px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Key-value rows \u2014 spacious */
|
|
54
|
+
.naturefyi-row {
|
|
55
|
+
display: flex;
|
|
56
|
+
justify-content: space-between;
|
|
57
|
+
align-items: flex-start;
|
|
58
|
+
gap: 12px;
|
|
59
|
+
padding: 8px 0;
|
|
60
|
+
border-bottom: 1px solid var(--border);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.naturefyi-row:last-child {
|
|
64
|
+
border-bottom: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.naturefyi-label {
|
|
68
|
+
font-size: 12px;
|
|
69
|
+
font-weight: 500;
|
|
70
|
+
color: var(--muted);
|
|
71
|
+
white-space: nowrap;
|
|
72
|
+
flex-shrink: 0;
|
|
73
|
+
min-width: 30%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.naturefyi-value {
|
|
77
|
+
font-size: 13px;
|
|
78
|
+
color: var(--text);
|
|
79
|
+
text-align: right;
|
|
80
|
+
word-break: break-word;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Section title */
|
|
84
|
+
.naturefyi-section-title {
|
|
85
|
+
font-size: 11px;
|
|
86
|
+
font-weight: 600;
|
|
87
|
+
color: var(--muted);
|
|
88
|
+
text-transform: uppercase;
|
|
89
|
+
letter-spacing: 0.06em;
|
|
90
|
+
margin: 0 0 10px 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Tags \u2014 colored rounded badges */
|
|
94
|
+
.naturefyi-tag {
|
|
95
|
+
display: inline-block;
|
|
96
|
+
font-size: 11px;
|
|
97
|
+
font-weight: 600;
|
|
98
|
+
padding: 3px 10px;
|
|
99
|
+
border-radius: 12px;
|
|
100
|
+
background: color-mix(in srgb, var(--accent) 12%, transparent);
|
|
101
|
+
color: var(--accent);
|
|
102
|
+
margin: 2px 3px 2px 0;
|
|
103
|
+
letter-spacing: 0.02em;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* Link */
|
|
107
|
+
.naturefyi-link {
|
|
108
|
+
font-size: 13px;
|
|
109
|
+
font-weight: 500;
|
|
110
|
+
color: var(--link);
|
|
111
|
+
text-decoration: none;
|
|
112
|
+
display: inline-flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
gap: 4px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.naturefyi-link:hover {
|
|
118
|
+
opacity: 0.8;
|
|
119
|
+
text-decoration: underline;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.naturefyi-link svg {
|
|
123
|
+
width: 12px;
|
|
124
|
+
height: 12px;
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Footer link row */
|
|
129
|
+
.naturefyi-footer-link {
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
padding: 12px 20px;
|
|
134
|
+
border-top: 1px solid var(--border);
|
|
135
|
+
gap: 8px;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
139
|
+
Card shared: stats row (horizontal flex)
|
|
140
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
141
|
+
.naturefyi-stats-row { display:flex; gap:12px; padding:10px 18px; border-bottom:1px solid var(--border); }
|
|
142
|
+
.naturefyi-stat { text-align:center; flex:1; }
|
|
143
|
+
.naturefyi-stat-value { font-size:18px; font-weight:700; color:var(--accent); }
|
|
144
|
+
.naturefyi-stat-label { font-size:9px; color:var(--muted); text-transform:uppercase; letter-spacing:0.03em; }
|
|
145
|
+
|
|
146
|
+
/* Card shared: stats grid (2x2 boxes) */
|
|
147
|
+
.naturefyi-stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:10px 18px; border-bottom:1px solid var(--border); }
|
|
148
|
+
.naturefyi-stat-box { padding:6px 8px; background:color-mix(in srgb, var(--accent) 8%, var(--bg)); border-radius:8px; }
|
|
149
|
+
.naturefyi-stat-box-label { font-size:9px; color:color-mix(in srgb, var(--accent) 80%, var(--text)); text-transform:uppercase; }
|
|
150
|
+
.naturefyi-stat-box-value { font-size:13px; font-weight:700; color:var(--text); margin-top:1px; }
|
|
151
|
+
|
|
152
|
+
/* Card shared: key-value dotted rows */
|
|
153
|
+
.naturefyi-kv-rows { padding:10px 18px; border-bottom:1px solid var(--border); }
|
|
154
|
+
.naturefyi-kv-row { display:flex; justify-content:space-between; align-items:baseline; padding:4px 0; border-bottom:1px dotted var(--border); }
|
|
155
|
+
.naturefyi-kv-row:last-child { border-bottom:none; }
|
|
156
|
+
.naturefyi-kv-label { font-size:11px; color:var(--muted); }
|
|
157
|
+
.naturefyi-kv-value { font-size:11px; font-weight:600; color:var(--text); }
|
|
158
|
+
|
|
159
|
+
/* Card shared: pill tags */
|
|
160
|
+
.naturefyi-pills { display:flex; flex-wrap:wrap; gap:4px; padding:10px 18px; border-bottom:1px solid var(--border); }
|
|
161
|
+
.naturefyi-pill { padding:2px 8px; border-radius:10px; font-size:11px; font-weight:500; background:color-mix(in srgb, var(--accent) 10%, var(--bg)); color:var(--accent); }
|
|
162
|
+
|
|
163
|
+
/* Card shared: section label */
|
|
164
|
+
.naturefyi-section-label { font-size:10px; text-transform:uppercase; letter-spacing:0.05em; color:var(--accent); font-weight:600; margin-bottom:3px; }
|
|
165
|
+
|
|
166
|
+
/* Card shared: description */
|
|
167
|
+
.naturefyi-desc { padding:10px 18px; font-size:14px; color:var(--muted); line-height:1.5; border-bottom:1px solid var(--border); }
|
|
168
|
+
|
|
169
|
+
/* Card shared: view link */
|
|
170
|
+
.naturefyi-view-link { display:block; text-align:center; padding:10px 18px; border-bottom:1px solid var(--border); }
|
|
171
|
+
.naturefyi-view-link a { color:var(--link); text-decoration:none; font-size:12px; font-weight:500; display:inline-flex; align-items:center; gap:4px; }
|
|
172
|
+
.naturefyi-view-link a:hover { text-decoration:underline; }
|
|
173
|
+
.naturefyi-view-link svg { width:12px; height:12px; }
|
|
174
|
+
|
|
175
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
176
|
+
Card domain: species taxonomy (speciesfyi)
|
|
177
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
178
|
+
.naturefyi-taxonomy-row { width:100%; padding:14px 18px; display:flex; align-items:center; gap:16px; border-bottom:1px solid var(--border); }
|
|
179
|
+
.naturefyi-taxonomy-icon { width:72px; height:72px; border-radius:8px; background:color-mix(in srgb, var(--accent) 15%, var(--bg)); border:2px solid var(--accent); display:flex; flex-direction:column; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
|
|
180
|
+
.naturefyi-taxonomy-icon img { width:100%; height:100%; object-fit:cover; }
|
|
181
|
+
.naturefyi-taxonomy-rank { font-size:11px; color:var(--muted); font-weight:600; }
|
|
182
|
+
.naturefyi-taxonomy-name { font-size:16px; font-weight:700; color:var(--accent); line-height:1; }
|
|
183
|
+
.naturefyi-taxonomy-common { font-size:10px; color:var(--muted); }
|
|
184
|
+
.naturefyi-taxonomy-info { flex:1; }
|
|
185
|
+
.naturefyi-taxonomy-title { font-size:16px; font-weight:700; color:var(--text); margin-bottom:2px; }
|
|
186
|
+
.naturefyi-taxonomy-scientific { font-size:11px; color:var(--muted); font-style:italic; }
|
|
187
|
+
|
|
188
|
+
/* Card domain: conservation status badge */
|
|
189
|
+
.naturefyi-conservation-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 8px; border-radius:4px; font-size:11px; font-weight:600; background:color-mix(in srgb, var(--accent) 10%, var(--bg)); color:var(--accent); border:1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
|
|
190
|
+
|
|
191
|
+
/* Card domain: population/size display */
|
|
192
|
+
.naturefyi-population { padding:10px 18px; border-bottom:1px solid var(--border); display:flex; align-items:baseline; gap:8px; }
|
|
193
|
+
.naturefyi-population-val { font-size:28px; font-weight:800; color:var(--accent); line-height:1; }
|
|
194
|
+
.naturefyi-population-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.04em; }
|
|
195
|
+
|
|
196
|
+
/* Card domain: color swatch (plumage, flower color) */
|
|
197
|
+
.naturefyi-color-swatch-row { display:flex; gap:4px; padding:8px 18px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
|
|
198
|
+
.naturefyi-color-swatch { width:20px; height:20px; border-radius:50%; border:2px solid var(--border); flex-shrink:0; }
|
|
199
|
+
|
|
200
|
+
/* Card domain: property bar (size, weight, wingspan comparisons) */
|
|
201
|
+
.naturefyi-prop-bar-row { padding:6px 18px; border-bottom:1px dotted var(--border); display:flex; align-items:center; gap:10px; }
|
|
202
|
+
.naturefyi-prop-bar-row:last-child { border-bottom:none; }
|
|
203
|
+
.naturefyi-prop-bar-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.04em; width:80px; flex-shrink:0; }
|
|
204
|
+
.naturefyi-prop-bar-track { flex:1; height:6px; background:var(--surface); border-radius:3px; overflow:hidden; }
|
|
205
|
+
.naturefyi-prop-bar-fill { height:100%; background:var(--accent); border-radius:3px; transition:width 0.4s ease; }
|
|
206
|
+
.naturefyi-prop-bar-val { font-size:10px; font-weight:600; color:var(--text); width:36px; text-align:right; flex-shrink:0; }
|
|
207
|
+
|
|
208
|
+
/* Inline widget host \u2014 for badge-style inline rendering */
|
|
209
|
+
:host([data-inline]) {
|
|
210
|
+
display: inline-flex;
|
|
211
|
+
align-items: center;
|
|
212
|
+
gap: 4px;
|
|
213
|
+
}
|
|
214
|
+
`}function ye(){return`
|
|
215
|
+
/* Organic: lighter gradient header with softer corners */
|
|
216
|
+
.naturefyi-header {
|
|
217
|
+
background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #fff), var(--accent));
|
|
218
|
+
border-radius: 16px 16px 0 0;
|
|
219
|
+
padding: 16px 20px;
|
|
220
|
+
display: flex;
|
|
221
|
+
align-items: flex-start;
|
|
222
|
+
gap: 14px;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
.naturefyi-header-title {
|
|
226
|
+
font-size: 15px;
|
|
227
|
+
font-weight: 700;
|
|
228
|
+
color: #fff;
|
|
229
|
+
margin: 0 0 4px 0;
|
|
230
|
+
line-height: 1.3;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.naturefyi-header-subtitle {
|
|
234
|
+
font-size: 12px;
|
|
235
|
+
color: rgba(255, 255, 255, 0.85);
|
|
236
|
+
margin: 0;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/* Image/preview area \u2014 softer corners for organic feel */
|
|
240
|
+
.naturefyi-img {
|
|
241
|
+
width: 56px;
|
|
242
|
+
height: 56px;
|
|
243
|
+
border-radius: 12px;
|
|
244
|
+
object-fit: cover;
|
|
245
|
+
background: rgba(255, 255, 255, 0.2);
|
|
246
|
+
flex-shrink: 0;
|
|
247
|
+
display: flex;
|
|
248
|
+
align-items: center;
|
|
249
|
+
justify-content: center;
|
|
250
|
+
overflow: hidden;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.naturefyi-img img {
|
|
254
|
+
width: 100%;
|
|
255
|
+
height: 100%;
|
|
256
|
+
object-fit: cover;
|
|
257
|
+
border-radius: 12px;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/* Body area \u2014 warmer surface */
|
|
261
|
+
.naturefyi-body {
|
|
262
|
+
padding: 16px 20px;
|
|
263
|
+
background: color-mix(in srgb, var(--accent) 5%, var(--surface));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/* Key-value rows \u2014 spacious */
|
|
267
|
+
.naturefyi-row {
|
|
268
|
+
display: flex;
|
|
269
|
+
justify-content: space-between;
|
|
270
|
+
align-items: flex-start;
|
|
271
|
+
gap: 12px;
|
|
272
|
+
padding: 8px 0;
|
|
273
|
+
border-bottom: 1px solid var(--border);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.naturefyi-row:last-child {
|
|
277
|
+
border-bottom: none;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.naturefyi-label {
|
|
281
|
+
font-size: 12px;
|
|
282
|
+
font-weight: 500;
|
|
283
|
+
color: var(--muted);
|
|
284
|
+
white-space: nowrap;
|
|
285
|
+
flex-shrink: 0;
|
|
286
|
+
min-width: 30%;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.naturefyi-value {
|
|
290
|
+
font-size: 14px;
|
|
291
|
+
color: var(--text);
|
|
292
|
+
text-align: right;
|
|
293
|
+
word-break: break-word;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/* Section title */
|
|
297
|
+
.naturefyi-section-title {
|
|
298
|
+
font-size: 11px;
|
|
299
|
+
font-weight: 600;
|
|
300
|
+
color: var(--muted);
|
|
301
|
+
text-transform: uppercase;
|
|
302
|
+
letter-spacing: 0.06em;
|
|
303
|
+
margin: 0 0 10px 0;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/* Tags \u2014 colored rounded badges with extra rounding for organic feel */
|
|
307
|
+
.naturefyi-tag {
|
|
308
|
+
display: inline-block;
|
|
309
|
+
font-size: 11px;
|
|
310
|
+
font-weight: 600;
|
|
311
|
+
padding: 3px 10px;
|
|
312
|
+
border-radius: 16px;
|
|
313
|
+
background: color-mix(in srgb, var(--accent) 12%, transparent);
|
|
314
|
+
color: var(--accent);
|
|
315
|
+
margin: 2px 3px 2px 0;
|
|
316
|
+
letter-spacing: 0.02em;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/* Link */
|
|
320
|
+
.naturefyi-link {
|
|
321
|
+
font-size: 13px;
|
|
322
|
+
font-weight: 500;
|
|
323
|
+
color: var(--link);
|
|
324
|
+
text-decoration: none;
|
|
325
|
+
display: inline-flex;
|
|
326
|
+
align-items: center;
|
|
327
|
+
gap: 4px;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.naturefyi-link:hover {
|
|
331
|
+
opacity: 0.8;
|
|
332
|
+
text-decoration: underline;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.naturefyi-link svg {
|
|
336
|
+
width: 12px;
|
|
337
|
+
height: 12px;
|
|
338
|
+
flex-shrink: 0;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/* Footer link row */
|
|
342
|
+
.naturefyi-footer-link {
|
|
343
|
+
display: flex;
|
|
344
|
+
align-items: center;
|
|
345
|
+
justify-content: space-between;
|
|
346
|
+
padding: 12px 20px;
|
|
347
|
+
border-top: 1px solid var(--border);
|
|
348
|
+
gap: 8px;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
352
|
+
Card shared: stats row (horizontal flex)
|
|
353
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
354
|
+
.naturefyi-stats-row { display:flex; gap:12px; padding:10px 18px; border-bottom:1px solid var(--border); background:color-mix(in srgb, var(--accent) 5%, var(--surface)); }
|
|
355
|
+
.naturefyi-stat { text-align:center; flex:1; }
|
|
356
|
+
.naturefyi-stat-value { font-size:18px; font-weight:700; color:var(--accent); }
|
|
357
|
+
.naturefyi-stat-label { font-size:9px; color:var(--muted); text-transform:uppercase; letter-spacing:0.03em; }
|
|
358
|
+
|
|
359
|
+
/* Card shared: stats grid (2x2 boxes) \u2014 warmer tint */
|
|
360
|
+
.naturefyi-stats-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; padding:10px 18px; border-bottom:1px solid var(--border); }
|
|
361
|
+
.naturefyi-stat-box { padding:6px 8px; background:color-mix(in srgb, var(--accent) 8%, var(--bg)); border-radius:12px; }
|
|
362
|
+
.naturefyi-stat-box-label { font-size:9px; color:color-mix(in srgb, var(--accent) 80%, var(--text)); text-transform:uppercase; }
|
|
363
|
+
.naturefyi-stat-box-value { font-size:13px; font-weight:700; color:var(--text); margin-top:1px; }
|
|
364
|
+
|
|
365
|
+
/* Card shared: key-value dotted rows */
|
|
366
|
+
.naturefyi-kv-rows { padding:10px 18px; border-bottom:1px solid var(--border); }
|
|
367
|
+
.naturefyi-kv-row { display:flex; justify-content:space-between; align-items:baseline; padding:4px 0; border-bottom:1px dotted var(--border); }
|
|
368
|
+
.naturefyi-kv-row:last-child { border-bottom:none; }
|
|
369
|
+
.naturefyi-kv-label { font-size:11px; color:var(--muted); }
|
|
370
|
+
.naturefyi-kv-value { font-size:11px; font-weight:600; color:var(--text); }
|
|
371
|
+
|
|
372
|
+
/* Card shared: pill tags \u2014 rounder for organic feel */
|
|
373
|
+
.naturefyi-pills { display:flex; flex-wrap:wrap; gap:4px; padding:10px 18px; border-bottom:1px solid var(--border); }
|
|
374
|
+
.naturefyi-pill { padding:2px 10px; border-radius:14px; font-size:11px; font-weight:500; background:color-mix(in srgb, var(--accent) 10%, var(--bg)); color:var(--accent); }
|
|
375
|
+
|
|
376
|
+
/* Card shared: section label */
|
|
377
|
+
.naturefyi-section-label { font-size:10px; text-transform:uppercase; letter-spacing:0.05em; color:var(--accent); font-weight:600; margin-bottom:3px; }
|
|
378
|
+
|
|
379
|
+
/* Card shared: description */
|
|
380
|
+
.naturefyi-desc { padding:10px 18px; font-size:14px; color:var(--muted); line-height:1.5; border-bottom:1px solid var(--border); }
|
|
381
|
+
|
|
382
|
+
/* Card shared: view link */
|
|
383
|
+
.naturefyi-view-link { display:block; text-align:center; padding:10px 18px; border-bottom:1px solid var(--border); }
|
|
384
|
+
.naturefyi-view-link a { color:var(--link); text-decoration:none; font-size:12px; font-weight:500; display:inline-flex; align-items:center; gap:4px; }
|
|
385
|
+
.naturefyi-view-link a:hover { text-decoration:underline; }
|
|
386
|
+
.naturefyi-view-link svg { width:12px; height:12px; }
|
|
387
|
+
|
|
388
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
389
|
+
Card domain: species taxonomy (speciesfyi)
|
|
390
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
391
|
+
.naturefyi-taxonomy-row { width:100%; padding:14px 18px; display:flex; align-items:center; gap:16px; border-bottom:1px solid var(--border); }
|
|
392
|
+
.naturefyi-taxonomy-icon { width:72px; height:72px; border-radius:16px; background:color-mix(in srgb, var(--accent) 15%, var(--bg)); border:2px solid var(--accent); display:flex; flex-direction:column; align-items:center; justify-content:center; flex-shrink:0; overflow:hidden; }
|
|
393
|
+
.naturefyi-taxonomy-icon img { width:100%; height:100%; object-fit:cover; }
|
|
394
|
+
.naturefyi-taxonomy-rank { font-size:11px; color:var(--muted); font-weight:600; }
|
|
395
|
+
.naturefyi-taxonomy-name { font-size:16px; font-weight:700; color:var(--accent); line-height:1; }
|
|
396
|
+
.naturefyi-taxonomy-common { font-size:10px; color:var(--muted); }
|
|
397
|
+
.naturefyi-taxonomy-info { flex:1; }
|
|
398
|
+
.naturefyi-taxonomy-title { font-size:16px; font-weight:700; color:var(--text); margin-bottom:2px; }
|
|
399
|
+
.naturefyi-taxonomy-scientific { font-size:11px; color:var(--muted); font-style:italic; }
|
|
400
|
+
|
|
401
|
+
/* Card domain: conservation status badge \u2014 rounded for organic */
|
|
402
|
+
.naturefyi-conservation-badge { display:inline-flex; align-items:center; gap:4px; padding:3px 10px; border-radius:12px; font-size:11px; font-weight:600; background:color-mix(in srgb, var(--accent) 10%, var(--bg)); color:var(--accent); border:1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
|
|
403
|
+
|
|
404
|
+
/* Card domain: population/size display */
|
|
405
|
+
.naturefyi-population { padding:10px 18px; border-bottom:1px solid var(--border); display:flex; align-items:baseline; gap:8px; }
|
|
406
|
+
.naturefyi-population-val { font-size:28px; font-weight:800; color:var(--accent); line-height:1; }
|
|
407
|
+
.naturefyi-population-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.04em; }
|
|
408
|
+
|
|
409
|
+
/* Card domain: color swatch (plumage, flower color) */
|
|
410
|
+
.naturefyi-color-swatch-row { display:flex; gap:4px; padding:8px 18px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
|
|
411
|
+
.naturefyi-color-swatch { width:20px; height:20px; border-radius:50%; border:2px solid var(--border); flex-shrink:0; }
|
|
412
|
+
|
|
413
|
+
/* Card domain: property bar (size, weight, wingspan comparisons) \u2014 rounded */
|
|
414
|
+
.naturefyi-prop-bar-row { padding:6px 18px; border-bottom:1px dotted var(--border); display:flex; align-items:center; gap:10px; }
|
|
415
|
+
.naturefyi-prop-bar-row:last-child { border-bottom:none; }
|
|
416
|
+
.naturefyi-prop-bar-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.04em; width:80px; flex-shrink:0; }
|
|
417
|
+
.naturefyi-prop-bar-track { flex:1; height:7px; background:color-mix(in srgb, var(--accent) 5%, var(--surface)); border-radius:4px; overflow:hidden; }
|
|
418
|
+
.naturefyi-prop-bar-fill { height:100%; background:var(--accent); border-radius:4px; transition:width 0.4s ease; }
|
|
419
|
+
.naturefyi-prop-bar-val { font-size:10px; font-weight:600; color:var(--text); width:36px; text-align:right; flex-shrink:0; }
|
|
420
|
+
|
|
421
|
+
/* Organic: copy button \u2014 softer style */
|
|
422
|
+
.naturefyi-copy-btn {
|
|
423
|
+
background: color-mix(in srgb, var(--accent) 8%, var(--copy-bg));
|
|
424
|
+
color: var(--text);
|
|
425
|
+
border: none;
|
|
426
|
+
border-radius: 8px;
|
|
427
|
+
padding: 4px 10px;
|
|
428
|
+
font-size: 11px;
|
|
429
|
+
cursor: pointer;
|
|
430
|
+
display: inline-flex;
|
|
431
|
+
align-items: center;
|
|
432
|
+
gap: 4px;
|
|
433
|
+
transition: background 0.15s;
|
|
434
|
+
font-family: inherit;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
.naturefyi-copy-btn:hover {
|
|
438
|
+
background: color-mix(in srgb, var(--accent) 15%, var(--copy-hover));
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.naturefyi-copy-btn svg {
|
|
442
|
+
width: 11px;
|
|
443
|
+
height: 11px;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
/* Inline widget host \u2014 for badge-style inline rendering */
|
|
447
|
+
:host([data-inline]) {
|
|
448
|
+
display: inline-flex;
|
|
449
|
+
align-items: center;
|
|
450
|
+
gap: 4px;
|
|
451
|
+
}
|
|
452
|
+
`}function Ye(e){switch(e){case"organic":return ye();case"modern":default:return me()}}function xe(e,t="modern"){return`
|
|
453
|
+
:host {
|
|
454
|
+
display: block;
|
|
455
|
+
--site-accent: ${e};
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
459
|
+
Size variants
|
|
460
|
+
compact=280px, default=420px, large=720px
|
|
461
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
462
|
+
.naturefyi-widget {
|
|
463
|
+
box-sizing: border-box;
|
|
464
|
+
min-width: 240px;
|
|
465
|
+
max-width: 420px;
|
|
466
|
+
border-radius: 8px;
|
|
467
|
+
overflow: hidden;
|
|
468
|
+
border: 1px solid var(--border);
|
|
469
|
+
background: var(--bg);
|
|
470
|
+
color: var(--text);
|
|
471
|
+
font-size: 14px;
|
|
472
|
+
line-height: 1.6;
|
|
473
|
+
transition: border-color 0.2s;
|
|
474
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.naturefyi-widget:hover {
|
|
478
|
+
border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
.naturefyi-widget[data-size="compact"] {
|
|
482
|
+
max-width: 280px;
|
|
483
|
+
font-size: 13px;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.naturefyi-widget[data-size="default"] {
|
|
487
|
+
max-width: 420px;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.naturefyi-widget[data-size="large"] {
|
|
491
|
+
max-width: 720px;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
495
|
+
Light theme (default)
|
|
496
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
497
|
+
.naturefyi-widget[data-theme="light"] {
|
|
498
|
+
--bg: #fff;
|
|
499
|
+
--text: #1e293b;
|
|
500
|
+
--border: #e2e8f0;
|
|
501
|
+
--accent: var(--site-accent);
|
|
502
|
+
--muted: #64748b;
|
|
503
|
+
--surface: #f8fafc;
|
|
504
|
+
--badge-bg: #f1f5f9;
|
|
505
|
+
--badge-text: #374151;
|
|
506
|
+
--link: var(--site-accent);
|
|
507
|
+
--copy-bg: #f3f4f6;
|
|
508
|
+
--copy-hover: #e5e7eb;
|
|
509
|
+
--input-bg: #ffffff;
|
|
510
|
+
--input-border: #d1d5db;
|
|
511
|
+
--input-focus: var(--site-accent);
|
|
512
|
+
--shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
516
|
+
Dark theme
|
|
517
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
518
|
+
.naturefyi-widget[data-theme="dark"] {
|
|
519
|
+
--bg: #1a1a1a;
|
|
520
|
+
--text: #f3f4f6;
|
|
521
|
+
--border: #374151;
|
|
522
|
+
--accent: var(--site-accent);
|
|
523
|
+
--muted: #9ca3af;
|
|
524
|
+
--surface: #111827;
|
|
525
|
+
--badge-bg: #374151;
|
|
526
|
+
--badge-text: #d1d5db;
|
|
527
|
+
--link: color-mix(in srgb, var(--site-accent) 80%, #fff);
|
|
528
|
+
--copy-bg: #374151;
|
|
529
|
+
--copy-hover: #4b5563;
|
|
530
|
+
--input-bg: #111111;
|
|
531
|
+
--input-border: #4b5563;
|
|
532
|
+
--input-focus: var(--site-accent);
|
|
533
|
+
--shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
537
|
+
Sepia theme
|
|
538
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
539
|
+
.naturefyi-widget[data-theme="sepia"] {
|
|
540
|
+
--bg: #f5f0e8;
|
|
541
|
+
--text: #3d3529;
|
|
542
|
+
--border: #d4c5a9;
|
|
543
|
+
--accent: var(--site-accent);
|
|
544
|
+
--muted: #8b7d6b;
|
|
545
|
+
--surface: #ede8df;
|
|
546
|
+
--badge-bg: #e8e0d0;
|
|
547
|
+
--badge-text: #5c4f3d;
|
|
548
|
+
--link: color-mix(in srgb, var(--site-accent) 70%, #3d3529);
|
|
549
|
+
--copy-bg: #e8e0d0;
|
|
550
|
+
--copy-hover: #ddd4c0;
|
|
551
|
+
--input-bg: #f5f0e8;
|
|
552
|
+
--input-border: #c4b49a;
|
|
553
|
+
--input-focus: var(--site-accent);
|
|
554
|
+
--shadow: 0 1px 3px rgba(61, 53, 41, 0.12);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.naturefyi-widget *, .naturefyi-widget *::before, .naturefyi-widget *::after {
|
|
558
|
+
box-sizing: border-box;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
562
|
+
Loading state
|
|
563
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
564
|
+
.naturefyi-loading {
|
|
565
|
+
padding: 20px 16px;
|
|
566
|
+
text-align: center;
|
|
567
|
+
color: var(--muted);
|
|
568
|
+
font-size: 13px;
|
|
569
|
+
display: flex;
|
|
570
|
+
align-items: center;
|
|
571
|
+
justify-content: center;
|
|
572
|
+
gap: 8px;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
.naturefyi-spinner {
|
|
576
|
+
width: 16px;
|
|
577
|
+
height: 16px;
|
|
578
|
+
border: 2px solid var(--border);
|
|
579
|
+
border-top-color: var(--accent);
|
|
580
|
+
border-radius: 50%;
|
|
581
|
+
animation: naturefyi-spin 0.7s linear infinite;
|
|
582
|
+
display: inline-block;
|
|
583
|
+
flex-shrink: 0;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
@keyframes naturefyi-spin {
|
|
587
|
+
to { transform: rotate(360deg); }
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
591
|
+
Error state
|
|
592
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
593
|
+
.naturefyi-error {
|
|
594
|
+
padding: 16px;
|
|
595
|
+
color: var(--muted);
|
|
596
|
+
font-size: 13px;
|
|
597
|
+
text-align: center;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.naturefyi-error p {
|
|
601
|
+
margin: 0 0 8px 0;
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.naturefyi-error a {
|
|
605
|
+
color: var(--link);
|
|
606
|
+
text-decoration: none;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.naturefyi-error a:hover {
|
|
610
|
+
text-decoration: underline;
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
614
|
+
Badge (generic)
|
|
615
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
616
|
+
.naturefyi-badge {
|
|
617
|
+
display: inline-block;
|
|
618
|
+
font-size: 10px;
|
|
619
|
+
font-weight: 600;
|
|
620
|
+
padding: 2px 7px;
|
|
621
|
+
border-radius: 4px;
|
|
622
|
+
background: var(--badge-bg);
|
|
623
|
+
color: var(--badge-text);
|
|
624
|
+
text-transform: uppercase;
|
|
625
|
+
letter-spacing: 0.04em;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
629
|
+
Search inputs
|
|
630
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
631
|
+
.naturefyi-search-wrap {
|
|
632
|
+
padding: 12px 16px;
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
.naturefyi-search-form {
|
|
636
|
+
display: flex;
|
|
637
|
+
gap: 8px;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.naturefyi-search-input {
|
|
641
|
+
flex: 1;
|
|
642
|
+
padding: 8px 12px;
|
|
643
|
+
border: 1px solid var(--input-border);
|
|
644
|
+
border-radius: 6px;
|
|
645
|
+
background: var(--input-bg);
|
|
646
|
+
color: var(--text);
|
|
647
|
+
font-size: 13px;
|
|
648
|
+
font-family: inherit;
|
|
649
|
+
outline: none;
|
|
650
|
+
transition: border-color 0.15s;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
.naturefyi-search-input:focus {
|
|
654
|
+
border-color: var(--input-focus);
|
|
655
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.naturefyi-search-input::placeholder {
|
|
659
|
+
color: var(--muted);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
.naturefyi-search-btn {
|
|
663
|
+
background: var(--accent);
|
|
664
|
+
color: #fff;
|
|
665
|
+
border: none;
|
|
666
|
+
border-radius: 6px;
|
|
667
|
+
padding: 8px 14px;
|
|
668
|
+
font-size: 13px;
|
|
669
|
+
font-weight: 500;
|
|
670
|
+
cursor: pointer;
|
|
671
|
+
font-family: inherit;
|
|
672
|
+
transition: opacity 0.15s;
|
|
673
|
+
white-space: nowrap;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.naturefyi-search-btn:hover {
|
|
677
|
+
opacity: 0.9;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/* Search results list */
|
|
681
|
+
.naturefyi-search-results {
|
|
682
|
+
padding: 0 16px 12px;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.naturefyi-result-item {
|
|
686
|
+
padding: 8px 0;
|
|
687
|
+
border-bottom: 1px solid var(--border);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.naturefyi-result-item:last-child {
|
|
691
|
+
border-bottom: none;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
.naturefyi-result-title {
|
|
695
|
+
font-size: 13px;
|
|
696
|
+
font-weight: 600;
|
|
697
|
+
color: var(--text);
|
|
698
|
+
margin: 0 0 3px 0;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.naturefyi-result-meta {
|
|
702
|
+
font-size: 11px;
|
|
703
|
+
color: var(--muted);
|
|
704
|
+
display: flex;
|
|
705
|
+
align-items: center;
|
|
706
|
+
gap: 6px;
|
|
707
|
+
flex-wrap: wrap;
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
711
|
+
Powered by footer
|
|
712
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
713
|
+
.naturefyi-powered {
|
|
714
|
+
display: block;
|
|
715
|
+
text-align: center;
|
|
716
|
+
padding: 8px 16px;
|
|
717
|
+
font-size: 11px;
|
|
718
|
+
color: var(--muted);
|
|
719
|
+
border-top: 1px solid var(--border);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.naturefyi-powered a {
|
|
723
|
+
color: var(--link);
|
|
724
|
+
text-decoration: none;
|
|
725
|
+
font-weight: 500;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.naturefyi-powered a:hover {
|
|
729
|
+
text-decoration: underline;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
733
|
+
Copy button (base \u2014 overridden in organic)
|
|
734
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
735
|
+
.naturefyi-copy-btn {
|
|
736
|
+
background: var(--copy-bg);
|
|
737
|
+
color: var(--text);
|
|
738
|
+
border: none;
|
|
739
|
+
border-radius: 5px;
|
|
740
|
+
padding: 4px 9px;
|
|
741
|
+
font-size: 11px;
|
|
742
|
+
cursor: pointer;
|
|
743
|
+
display: inline-flex;
|
|
744
|
+
align-items: center;
|
|
745
|
+
gap: 4px;
|
|
746
|
+
transition: background 0.15s;
|
|
747
|
+
font-family: inherit;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.naturefyi-copy-btn:hover {
|
|
751
|
+
background: var(--copy-hover);
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.naturefyi-copy-btn svg {
|
|
755
|
+
width: 11px;
|
|
756
|
+
height: 11px;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
${Ye(t)}
|
|
760
|
+
`}function C(e,t){let i=e.dataset.style||"modern",o=e.attachShadow({mode:"open"}),a=document.createElement("style");return a.textContent=xe(t.accent,i),o.appendChild(a),o}function Qe(e){let t=e.dataset.theme||"light";return t==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":t}function M(e,t,i){let o=Qe(t),a=t.dataset.size||"default",s=document.createElement("div");return s.className=["naturefyi-widget",i].filter(Boolean).join(" "),s.setAttribute("data-theme",o),s.setAttribute("data-size",a),e.appendChild(s),t.dataset.theme==="auto"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",n=>{s.setAttribute("data-theme",n.matches?"dark":"light")}),s}function W(e){e.innerHTML=`
|
|
761
|
+
<div class="naturefyi-loading">
|
|
762
|
+
<span class="naturefyi-spinner"></span>
|
|
763
|
+
Loading\u2026
|
|
764
|
+
</div>
|
|
765
|
+
`}function I(e,t,i){e.innerHTML=`
|
|
766
|
+
<div class="naturefyi-error">
|
|
767
|
+
<p>${t}</p>
|
|
768
|
+
<a href="https://${i.domain}" target="_blank" rel="noopener">
|
|
769
|
+
Visit ${i.name}
|
|
770
|
+
</a>
|
|
771
|
+
</div>
|
|
772
|
+
`}var q='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg>';function S(e){return`<span class="naturefyi-powered">Powered by <a href="https://${e.domain}" target="_blank" rel="noopener">${e.name}</a></span>`}function re(e){return`naturefyi_embed_${e}`}function et(e){try{let t=sessionStorage.getItem(re(e));if(!t)return null;let i=JSON.parse(t);return Date.now()-i.ts>3e5?(sessionStorage.removeItem(re(e)),null):i.data}catch(t){return null}}function tt(e,t){try{let i={data:t,ts:Date.now()};sessionStorage.setItem(re(e),JSON.stringify(i))}catch(i){}}async function B(e,t,i){let o=e.endsWith("/")?e:e+"/",a=t.startsWith("/")?t.slice(1):t,s=new URL(a,o);i&&Object.entries(i).forEach(([g,u])=>s.searchParams.set(g,u));let n=s.toString(),r=et(n);if(r!==null)return r;let l=await fetch(n,{headers:{Accept:"application/json"}});if(!l.ok)throw new Error(`API error ${l.status}: ${n}`);let c=await l.json();return tt(n,c),c}function p(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}function w(e,t){return t==null||t===""?"":`<div class="naturefyi-kv-row"><span class="naturefyi-kv-label">${p(e)}</span><span class="naturefyi-kv-value">${p(String(t))}</span></div>`}function Q(e){return!e||!e.length?"":`<div class="naturefyi-pills">${e.map(t=>`<span class="naturefyi-pill">${p(t)}</span>`).join("")}</div>`}function D(e,t,i){return`<a href="${p(e)}" target="_blank" rel="noopener" class="naturefyi-view-link" style="color:${i.accent}">${p(t)} \u2197</a>`}function G(e,t,i="#fff"){return`<span class="naturefyi-badge" style="background:${t};color:${i}">${p(e)}</span>`}function be(e,t=200){if(!e)return"";let i=e.length>t?e.slice(0,t)+"...":e;return`<p class="naturefyi-desc">${p(i)}</p>`}function he(e,t,i,o=""){let s=`<div class="naturefyi-value-bar"><div class="naturefyi-bar-fill" style="width:${e/t*100}%;background:${i}"></div></div>`;return`<div class="naturefyi-bar-wrapper">${o?`<span class="naturefyi-bar-label">${p(o)}</span>`:""}${s}</div>`}function N(e,t=""){return e==null?"":`${e.toLocaleString()}${t?" "+t:""}`}var we={LC:{bg:"#22c55e",text:"#fff",label:"Least Concern"},NT:{bg:"#84cc16",text:"#fff",label:"Near Threatened"},VU:{bg:"#eab308",text:"#fff",label:"Vulnerable"},EN:{bg:"#f97316",text:"#fff",label:"Endangered"},CR:{bg:"#dc2626",text:"#fff",label:"Critically Endangered"},EW:{bg:"#7f1d1d",text:"#fff",label:"Extinct in Wild"},EX:{bg:"#1e293b",text:"#fff",label:"Extinct"},DD:{bg:"#64748b",text:"#fff",label:"Data Deficient"},NE:{bg:"#94a3b8",text:"#fff",label:"Not Evaluated"}},ve={bg:"#94a3b8",text:"#fff",label:"Unknown"};function j(e){let t=we[e.toUpperCase()];return t?{bg:t.bg,text:t.text}:{bg:ve.bg,text:ve.text}}function P(e){var t,i;return(i=(t=we[e.toUpperCase()])==null?void 0:t.label)!=null?i:"Unknown"}function rt(e){if(!e)return"";let t=String(e).toLowerCase();return t==="increasing"?'<span style="color:#22c55e" title="Increasing">\u2191</span>':t==="stable"?'<span style="color:#eab308" title="Stable">\u2192</span>':t==="declining"||t==="decreasing"?'<span style="color:#ef4444" title="Declining">\u2193</span>':'<span style="color:#94a3b8" title="Unknown">?</span>'}function $e(e,t){var L,E,_,f,b,h,k,T,v,H,R;let i=p(String((E=(L=e.common_name)!=null?L:e.name)!=null?E:"")),o=p(String((f=(_=e.genus&&typeof e.genus=="object"?e.genus.name:null)!=null?_:e.scientific_name)!=null?f:"")),a=String((b=e.slug)!=null?b:""),s=typeof e.url=="string"&&e.url?e.url.startsWith("http")?e.url:`https://${t.domain}${e.url}`:`https://${t.domain}/species/${p(a)}/`,n=String((k=(h=e.conservation_status)!=null?h:e.iucn_status)!=null?k:""),r=n?j(n):null,l=n?P(n):"",c=e.average_lifespan_years!=null?N(Number(e.average_lifespan_years),"years"):"",g=e.average_length_m!=null?N(Number(e.average_length_m),"m"):"",u=e.average_weight_kg!=null?N(Number(e.average_weight_kg),"kg"):"",d=e.population_estimate!=null?String(e.population_estimate):"",m=String((T=e.population_trend)!=null?T:""),y=p(String((v=e.diet)!=null?v:"")),x=String((R=(H=e.habitat)!=null?H:e.habitat_description)!=null?R:""),$=r?`<span class="naturefyi-badge" style="background:${r.bg};color:${r.text}">${p(n)} ${p(l)}</span>`:"";return`
|
|
773
|
+
<div class="naturefyi-species-card">
|
|
774
|
+
<div class="naturefyi-card-header" style="border-left:3px solid ${t.accent};padding-left:10px;margin-bottom:8px;">
|
|
775
|
+
<div style="font-size:1rem;font-weight:600;">${i}</div>
|
|
776
|
+
${o?`<div style="font-size:0.85rem;color:#64748b;font-style:italic;">${o}</div>`:""}
|
|
777
|
+
</div>
|
|
778
|
+
|
|
779
|
+
<div class="naturefyi-badges" style="margin:8px 0;display:flex;flex-wrap:wrap;gap:4px;">
|
|
780
|
+
${$}
|
|
781
|
+
${y?G(y,"#6b7280"):""}
|
|
782
|
+
</div>
|
|
783
|
+
|
|
784
|
+
${c?w("Lifespan",c):""}
|
|
785
|
+
${g?w("Length",g):""}
|
|
786
|
+
${u?w("Weight",u):""}
|
|
787
|
+
|
|
788
|
+
${d?`<div class="naturefyi-kv-row">
|
|
789
|
+
<span class="naturefyi-kv-label">Population</span>
|
|
790
|
+
<span class="naturefyi-kv-value">${p(d)} ${rt(m)}</span>
|
|
791
|
+
</div>`:""}
|
|
792
|
+
|
|
793
|
+
${x?be(x,200):""}
|
|
794
|
+
|
|
795
|
+
<div class="naturefyi-actions" style="margin-top:8px;">
|
|
796
|
+
${D(s,`View on ${t.name}`,t)}
|
|
797
|
+
</div>
|
|
798
|
+
</div>
|
|
799
|
+
${S(t)}
|
|
800
|
+
`}function nt(e){if(!e)return"";let t=String(e).toLowerCase();return t==="increasing"?'<span style="color:#22c55e" title="Increasing">\u2191</span>':t==="stable"?'<span style="color:#eab308" title="Stable">\u2192</span>':t==="declining"||t==="decreasing"?'<span style="color:#ef4444" title="Declining">\u2193</span>':'<span style="color:#94a3b8" title="Unknown">?</span>'}function ke(e,t){var _,f,b,h,k,T,v,H;let i=p(String((f=(_=e.common_name)!=null?_:e.name)!=null?f:"")),o=p(String((b=e.scientific_name)!=null?b:"")),a=String((h=e.slug)!=null?h:""),s=typeof e.url=="string"&&e.url?e.url.startsWith("http")?e.url:`https://${t.domain}${e.url}`:`https://${t.domain}/bird/${p(a)}/`,n=String((T=(k=e.conservation_status)!=null?k:e.iucn_status)!=null?T:""),r=n?j(n):null,l=n?P(n):"",c=e.wingspan_cm!=null?N(Number(e.wingspan_cm),"cm"):"",g=e.weight_g!=null?N(Number(e.weight_g),"g"):"",u=e.length_cm!=null?N(Number(e.length_cm),"cm"):"",d=p(String((v=e.habitat)!=null?v:"")),m=e.geographic_range,y=Array.isArray(m)?m:typeof m=="string"&&m?[m]:[],x=e.xeno_canto_id!=null?String(e.xeno_canto_id):"",$=e.population_estimate!=null?String(e.population_estimate):"",L=String((H=e.population_trend)!=null?H:""),E=r?`<span class="naturefyi-badge" style="background:${r.bg};color:${r.text}">${p(n)} ${p(l)}</span>`:"";return`
|
|
801
|
+
<div class="naturefyi-bird-card">
|
|
802
|
+
<div class="naturefyi-card-header" style="border-left:3px solid ${t.accent};padding-left:10px;margin-bottom:8px;">
|
|
803
|
+
<div style="font-size:1rem;font-weight:600;">${i}</div>
|
|
804
|
+
${o?`<div style="font-size:0.85rem;color:#64748b;font-style:italic;">${o}</div>`:""}
|
|
805
|
+
</div>
|
|
806
|
+
|
|
807
|
+
<div class="naturefyi-badges" style="margin:8px 0;display:flex;flex-wrap:wrap;gap:4px;">
|
|
808
|
+
${E}
|
|
809
|
+
</div>
|
|
810
|
+
|
|
811
|
+
${c?w("Wingspan",c):""}
|
|
812
|
+
${g?w("Weight",g):""}
|
|
813
|
+
${u?w("Length",u):""}
|
|
814
|
+
|
|
815
|
+
${d?w("Habitat",d):""}
|
|
816
|
+
${y.length>0?`<div style="margin:6px 0;">${Q(y)}</div>`:""}
|
|
817
|
+
|
|
818
|
+
${x?`<div style="margin:6px 0;">
|
|
819
|
+
<a href="https://xeno-canto.org/${p(x)}" target="_blank" rel="noopener"
|
|
820
|
+
class="naturefyi-view-link" style="color:${t.accent};font-size:0.85rem;">
|
|
821
|
+
\u{1F50A} Listen on Xeno-canto \u2197
|
|
822
|
+
</a>
|
|
823
|
+
</div>`:""}
|
|
824
|
+
|
|
825
|
+
${$?`<div class="naturefyi-kv-row">
|
|
826
|
+
<span class="naturefyi-kv-label">Population</span>
|
|
827
|
+
<span class="naturefyi-kv-value">${p($)} ${nt(L)}</span>
|
|
828
|
+
</div>`:""}
|
|
829
|
+
|
|
830
|
+
<div class="naturefyi-actions" style="margin-top:8px;">
|
|
831
|
+
${D(s,`View on ${t.name}`,t)}
|
|
832
|
+
</div>
|
|
833
|
+
</div>
|
|
834
|
+
${S(t)}
|
|
835
|
+
`}var Se={freshwater:{color:"#3b82f6",label:"Freshwater",icon:"\u{1F4A7}"},saltwater:{color:"#06b6d4",label:"Saltwater",icon:"\u{1F30A}"},brackish:{color:"#14b8a6",label:"Brackish",icon:"\u{1FAE7}"}},Ce={color:"#94a3b8",label:"Unknown",icon:"\u2753"};function Te(e){let t=e.toLowerCase().trim();return t==="freshwater"||t==="fresh"?"freshwater":t==="saltwater"||t==="marine"||t==="ocean"||t==="sea"?"saltwater":t==="brackish"||t==="estuarine"||t==="estuary"?"brackish":null}function _e(e){let t=Te(e);return t?Se[t].color:Ce.color}function Le(e){let t=Te(e);return t?Se[t].label:Ce.label}function it(e){let t=(e||"").toLowerCase();return t==="easy"||t==="beginner"?"#22c55e":t==="moderate"||t==="intermediate"?"#eab308":t==="difficult"||t==="expert"||t==="advanced"?"#ef4444":"#6b7280"}function Ee(e,t){var L,E,_,f,b,h,k,T,v,H,R,F,Z;let i=p(String((E=(L=e.common_name)!=null?L:e.name)!=null?E:"")),o=p(String((_=e.scientific_name)!=null?_:"")),a=String((f=e.slug)!=null?f:""),s=typeof e.url=="string"&&e.url?e.url.startsWith("http")?e.url:`https://${t.domain}${e.url}`:`https://${t.domain}/fish/${p(a)}/`,n=String((b=e.water_type)!=null?b:""),r=n?_e(n):"",l=n?Le(n):"",c=String((k=(h=e.conservation_status)!=null?h:e.iucn_status)!=null?k:""),g=c?j(c):null,u=c?P(c):"",d=e.is_game_fish===!0,m=p(String((T=e.mercury_level)!=null?T:"")),y=g?`<span class="naturefyi-badge" style="background:${g.bg};color:${g.text}">${p(c)} ${p(u)}</span>`:"",x=n?`<span class="naturefyi-badge" style="background:${r};color:#fff">\u{1F30A} ${p(l)}</span>`:"",$="";if(d){let U=e.fight_rating!=null?Number(e.fight_rating):null,A=p(String((v=e.world_record)!=null?v:"")),K=Array.isArray(e.best_bait)?e.best_bait:[],X=Array.isArray(e.fishing_methods)?e.fishing_methods:[];$=`
|
|
836
|
+
${U!=null?he(U,10,t.accent,`Fight Rating: ${U}/10`):""}
|
|
837
|
+
${A?w("World Record",A):""}
|
|
838
|
+
${K.length>0?`<div style="margin:6px 0;"><span class="naturefyi-kv-label" style="display:block;margin-bottom:4px;">Best Bait</span>${Q(K)}</div>`:""}
|
|
839
|
+
${X.length>0?`<div style="margin:6px 0;"><span class="naturefyi-kv-label" style="display:block;margin-bottom:4px;">Fishing Methods</span>${Q(X)}</div>`:""}
|
|
840
|
+
`}else{let U=e.min_tank_liters!=null?`${Number(e.min_tank_liters)} L`:"",A=p(String((H=e.temperature_range)!=null?H:"")),K=p(String((R=e.ph_range)!=null?R:"")),X=String((F=e.care_level)!=null?F:""),fe=p(String((Z=e.temperament)!=null?Z:""));$=`
|
|
841
|
+
${U?w("Min Tank Size",U):""}
|
|
842
|
+
${A?w("Temperature",A):""}
|
|
843
|
+
${K?w("pH Range",K):""}
|
|
844
|
+
${X?`<div class="naturefyi-kv-row"><span class="naturefyi-kv-label">Care Level</span><span class="naturefyi-kv-value">${G(p(X),it(X))}</span></div>`:""}
|
|
845
|
+
${fe?w("Temperament",fe):""}
|
|
846
|
+
`}return`
|
|
847
|
+
<div class="naturefyi-fish-card">
|
|
848
|
+
<div class="naturefyi-card-header" style="border-left:3px solid ${t.accent};padding-left:10px;margin-bottom:8px;">
|
|
849
|
+
<div style="font-size:1rem;font-weight:600;">${i}</div>
|
|
850
|
+
${o?`<div style="font-size:0.85rem;color:#64748b;font-style:italic;">${o}</div>`:""}
|
|
851
|
+
</div>
|
|
852
|
+
|
|
853
|
+
<div class="naturefyi-badges" style="margin:8px 0;display:flex;flex-wrap:wrap;gap:4px;">
|
|
854
|
+
${x}
|
|
855
|
+
${y}
|
|
856
|
+
${m?G(`Mercury: ${m}`,"#78716c"):""}
|
|
857
|
+
</div>
|
|
858
|
+
|
|
859
|
+
${$}
|
|
860
|
+
|
|
861
|
+
<div class="naturefyi-actions" style="margin-top:8px;">
|
|
862
|
+
${D(s,`View on ${t.name}`,t)}
|
|
863
|
+
</div>
|
|
864
|
+
</div>
|
|
865
|
+
${S(t)}
|
|
866
|
+
`}var ot=[{zone:1,color:"#6366f1",minF:-60,maxF:-50,tempRange:"-60 to -50 \xB0F"},{zone:2,color:"#818cf8",minF:-50,maxF:-40,tempRange:"-50 to -40 \xB0F"},{zone:3,color:"#60a5fa",minF:-40,maxF:-30,tempRange:"-40 to -30 \xB0F"},{zone:4,color:"#38bdf8",minF:-30,maxF:-20,tempRange:"-30 to -20 \xB0F"},{zone:5,color:"#34d399",minF:-20,maxF:-10,tempRange:"-20 to -10 \xB0F"},{zone:6,color:"#4ade80",minF:-10,maxF:0,tempRange:"-10 to 0 \xB0F"},{zone:7,color:"#a3e635",minF:0,maxF:10,tempRange:"0 to 10 \xB0F"},{zone:8,color:"#facc15",minF:10,maxF:20,tempRange:"10 to 20 \xB0F"},{zone:9,color:"#fb923c",minF:20,maxF:30,tempRange:"20 to 30 \xB0F"},{zone:10,color:"#f97316",minF:30,maxF:40,tempRange:"30 to 40 \xB0F"},{zone:11,color:"#ef4444",minF:40,maxF:50,tempRange:"40 to 50 \xB0F"},{zone:12,color:"#dc2626",minF:50,maxF:60,tempRange:"50 to 60 \xB0F"},{zone:13,color:"#b91c1c",minF:60,maxF:70,tempRange:"60 to 70 \xB0F"}],ze=new Map(ot.map(e=>[e.zone,e]));function Me(e){if(typeof e=="number")return Number.isInteger(e)?e:Math.floor(e);let o=String(e).trim().toLowerCase().replace(/[ab]$/,"").split("-")[0],a=parseInt(o,10);return isNaN(a)?null:a}function He(e){var i,o;let t=Me(e);return t===null?"#94a3b8":(o=(i=ze.get(t))==null?void 0:i.color)!=null?o:"#94a3b8"}function Ie(e){let t=Me(e);if(t===null)return null;let i=ze.get(t);return i?{minF:i.minF,maxF:i.maxF,tempRange:i.tempRange}:null}var at=["January","February","March","April","May","June","July","August","September","October","November","December"],st=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Re(e){let t=new Set(e);return at.map((i,o)=>{let a=o+1;return{month:a,name:i,short:st[o],active:t.has(a)}})}function lt(e){let t=(e||"").toLowerCase();return t.includes("full")?'<span title="Full Sun">\u2600\uFE0F</span>':t.includes("partial")||t.includes("part")?'<span title="Partial Sun">\u{1F324}\uFE0F</span>':t.includes("shade")||t.includes("low")?'<span title="Shade">\u{1F311}</span>':""}function ct(e){let t=(e||"").toLowerCase();return t.includes("high")||t.includes("moist")?'<span title="High Water">\u{1F4A7}\u{1F4A7}\u{1F4A7}</span>':t.includes("moderate")||t.includes("medium")?'<span title="Moderate Water">\u{1F4A7}\u{1F4A7}</span>':t.includes("low")||t.includes("drought")?'<span title="Low Water">\u{1F4A7}</span>':'<span title="Water">\u{1F4A7}</span>'}function pt(e,t){return`<div style="display:flex;gap:2px;flex-wrap:wrap;">${Re(e).map(a=>{let s=a.active?t:"#e2e8f0",n=a.active?"#fff":"#94a3b8";return`<span title="${p(a.name)}" style="display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:${s};color:${n};font-size:0.6rem;font-weight:600;">${p(a.short.charAt(0))}</span>`}).join("")}</div>`}function Ne(e,t){var _,f,b,h,k,T,v,H,R,F,Z;let i=p(String((_=e.scientific_name)!=null?_:"")),o=p(String((b=(f=e.common_name)!=null?f:e.name)!=null?b:"")),a=String((h=e.slug)!=null?h:""),s=typeof e.url=="string"&&e.url?e.url.startsWith("http")?e.url:`https://${t.domain}${e.url}`:`https://${t.domain}/plant/${p(a)}/`,n=p(String((k=e.growth_form)!=null?k:"")),r=String((T=e.hardiness_zone)!=null?T:""),l=r?He(r):"",c=r?Ie(r):null,g=String((v=e.sun_requirement)!=null?v:""),u=String((H=e.water_requirement)!=null?H:""),d=e.bloom_season,m=Array.isArray(e.bloom_months)?e.bloom_months:typeof d=="string"&&d?[]:[],y=p(String((R=e.flower_color)!=null?R:"")),x=e.max_height_m!=null?Number(e.max_height_m):null,$=e.max_spread_m!=null?Number(e.max_spread_m):null,L=p(String((F=e.edibility)!=null?F:"")),E=p(String((Z=e.medicinal_uses)!=null?Z:""));return`
|
|
867
|
+
<div class="naturefyi-plant-card">
|
|
868
|
+
<div class="naturefyi-card-header" style="border-left:3px solid ${t.accent};padding-left:10px;margin-bottom:8px;">
|
|
869
|
+
${i?`<div style="font-size:1rem;font-weight:600;font-style:italic;">${i}</div>`:""}
|
|
870
|
+
${o?`<div style="font-size:0.85rem;color:#64748b;">${o}</div>`:""}
|
|
871
|
+
</div>
|
|
872
|
+
|
|
873
|
+
<div class="naturefyi-badges" style="margin:8px 0;display:flex;flex-wrap:wrap;gap:4px;">
|
|
874
|
+
${n?G(n,"#6b7280"):""}
|
|
875
|
+
${r?`<span class="naturefyi-badge" style="background:${l};color:#fff" title="${c?p(c.tempRange):""}">Zone ${p(r)}</span>`:""}
|
|
876
|
+
</div>
|
|
877
|
+
|
|
878
|
+
<div style="margin:6px 0;display:flex;gap:12px;align-items:center;font-size:0.85rem;">
|
|
879
|
+
${g?`<span>${lt(g)} ${p(g)}</span>`:""}
|
|
880
|
+
${u?`<span>${ct(u)} ${p(u)}</span>`:""}
|
|
881
|
+
</div>
|
|
882
|
+
|
|
883
|
+
${m.length>0?`<div style="margin:8px 0;">
|
|
884
|
+
<span class="naturefyi-kv-label" style="display:block;margin-bottom:4px;">Bloom Season</span>
|
|
885
|
+
${pt(m,t.accent)}
|
|
886
|
+
</div>`:typeof d=="string"&&d?w("Bloom Season",d):""}
|
|
887
|
+
|
|
888
|
+
${y?`<div class="naturefyi-kv-row">
|
|
889
|
+
<span class="naturefyi-kv-label">Flower Color</span>
|
|
890
|
+
<span class="naturefyi-kv-value">
|
|
891
|
+
<span style="display:inline-block;width:12px;height:12px;border-radius:50%;background:${p(y)};border:1px solid rgba(0,0,0,0.15);vertical-align:middle;margin-right:4px;"></span>
|
|
892
|
+
${y}
|
|
893
|
+
</span>
|
|
894
|
+
</div>`:""}
|
|
895
|
+
|
|
896
|
+
${x!=null||$!=null?w("Size",`${x!=null?x+" m tall":""}${x!=null&&$!=null?" \xD7 ":""}${$!=null?$+" m spread":""}`):""}
|
|
897
|
+
|
|
898
|
+
${L?w("Edibility",L):""}
|
|
899
|
+
${E?w("Medicinal Uses",E):""}
|
|
900
|
+
|
|
901
|
+
<div class="naturefyi-actions" style="margin-top:8px;">
|
|
902
|
+
${D(s,`View on ${t.name}`,t)}
|
|
903
|
+
</div>
|
|
904
|
+
</div>
|
|
905
|
+
${S(t)}
|
|
906
|
+
`}var Fe=[{name:"Triassic",start:252,end:201,color:"#ef4444",era:"Mesozoic"},{name:"Jurassic",start:201,end:145,color:"#3b82f6",era:"Mesozoic"},{name:"Cretaceous",start:145,end:66,color:"#22c55e",era:"Mesozoic"}],ne=252,We=66,dt=ne-We;function ee(e){var i;let t=Fe.find(o=>o.name.toLowerCase()===e.toLowerCase());return(i=t==null?void 0:t.color)!=null?i:"#94a3b8"}function Ae(e){let t=Math.min(ne,Math.max(We,e));return(ne-t)/dt}function te(){return Fe.map(e=>({...e,posStart:Ae(e.start),posEnd:Ae(e.end)}))}function ut(e){let t=(e||"").toLowerCase();return t.includes("herbi")?'<span class="naturefyi-badge" style="background:#22c55e;color:#fff">\u{1F33F} Herbivore</span>':t.includes("carni")?'<span class="naturefyi-badge" style="background:#ef4444;color:#fff">\u{1F9B7} Carnivore</span>':t.includes("omni")?'<span class="naturefyi-badge" style="background:#f59e0b;color:#fff">\u{1F37D}\uFE0F Omnivore</span>':e?G(e,"#6b7280"):""}function gt(e){let t=te(),i=t.map(n=>{let r=(n.posEnd-n.posStart)*100,c=n.name.toLowerCase()===(e||"").toLowerCase()?"1":"0.4";return`<div style="width:${r}%;height:12px;background:${n.color};opacity:${c};position:relative;" title="${n.name} (${n.start}\u2013${n.end} Ma)"></div>`}).join(""),o="",a=t.find(n=>n.name.toLowerCase()===(e||"").toLowerCase());a&&(o=`<div style="position:absolute;left:${(a.posStart+a.posEnd)/2*100}%;top:-3px;width:8px;height:8px;border-radius:50%;background:#1e293b;border:2px solid #fff;transform:translateX(-50%);box-shadow:0 1px 3px rgba(0,0,0,0.3);"></div>`);let s=t.map(n=>`<span style="width:${(n.posEnd-n.posStart)*100}%;text-align:center;font-size:0.6rem;color:#64748b;">${n.name}<br>${n.start}\u2013${n.end} Ma</span>`).join("");return`
|
|
907
|
+
<div style="margin:8px 0;">
|
|
908
|
+
<div style="display:flex;border-radius:4px;overflow:hidden;position:relative;">
|
|
909
|
+
${i}
|
|
910
|
+
${o}
|
|
911
|
+
</div>
|
|
912
|
+
<div style="display:flex;margin-top:2px;">${s}</div>
|
|
913
|
+
</div>
|
|
914
|
+
`}function Be(e,t){var y,x,$,L,E,_;let i=p(String((y=e.name)!=null?y:"")),o=String((x=e.slug)!=null?x:""),a=typeof e.url=="string"&&e.url?e.url.startsWith("http")?e.url:`https://${t.domain}${e.url}`:`https://${t.domain}/dinosaur/${p(o)}/`,s=String(($=e.period)!=null?$:""),n=s?ee(s.split(" ")[0]):"#94a3b8",r=String((L=e.diet)!=null?L:""),l=e.length_m!=null?N(Number(e.length_m),"m"):"",c=e.weight_kg!=null?N(Number(e.weight_kg),"kg"):"",g=e.height_m!=null?N(Number(e.height_m),"m"):"",u=e.discovery_year!=null?String(e.discovery_year):"",d=p(String((E=e.discovery_location)!=null?E:"")),m=p(String((_=e.named_by)!=null?_:""));return`
|
|
915
|
+
<div class="naturefyi-dino-card">
|
|
916
|
+
<div class="naturefyi-card-header" style="border-left:3px solid ${t.accent};padding-left:10px;margin-bottom:8px;">
|
|
917
|
+
<div style="font-size:1rem;font-weight:600;">${i}</div>
|
|
918
|
+
</div>
|
|
919
|
+
|
|
920
|
+
<div class="naturefyi-badges" style="margin:8px 0;display:flex;flex-wrap:wrap;gap:4px;">
|
|
921
|
+
${s?`<span class="naturefyi-badge" style="background:${n};color:#fff">${p(s)}</span>`:""}
|
|
922
|
+
${ut(r)}
|
|
923
|
+
</div>
|
|
924
|
+
|
|
925
|
+
${l?w("Length",l):""}
|
|
926
|
+
${c?w("Weight",c):""}
|
|
927
|
+
${g?w("Height",g):""}
|
|
928
|
+
|
|
929
|
+
${s?gt(s.split(" ")[0]):""}
|
|
930
|
+
|
|
931
|
+
${u?w("Discovered",u):""}
|
|
932
|
+
${d?w("Location",d):""}
|
|
933
|
+
${m?w("Named by",m):""}
|
|
934
|
+
|
|
935
|
+
<div class="naturefyi-actions" style="margin-top:8px;">
|
|
936
|
+
${D(a,`View on ${t.name}`,t)}
|
|
937
|
+
</div>
|
|
938
|
+
</div>
|
|
939
|
+
${S(t)}
|
|
940
|
+
`}function Y(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ie(e,t){var n;let o=(n=e.dataset.slug)!=null?n:"";if(!o){let r=C(e,t),l=M(r,e,"naturefyi-entity-widget");I(l,"Missing data-slug attribute.",t);return}let a=C(e,t),s=M(a,e,"naturefyi-entity-widget");W(s),B(t.apiBase,`${t.entitySlug}/${o}/`).then(r=>{var c;let l;switch(t.site){case"speciesfyi":l=$e(r,t);break;case"birdfyi":l=ke(r,t);break;case"fishfyi":l=Ee(r,t);break;case"plantfyi":l=Ne(r,t);break;case"dinofyi":l=Be(r,t);break;default:{let g=String((c=r.name)!=null?c:o),u=typeof r.url=="string"&&r.url?r.url.startsWith("http")?r.url:`https://${t.domain}${r.url}`:`https://${t.domain}/${t.entitySlug}/${Y(o)}/`;l=`
|
|
941
|
+
<div class="naturefyi-entity-fallback">
|
|
942
|
+
<div style="font-size:1rem;font-weight:600;margin-bottom:8px;">${Y(g)}</div>
|
|
943
|
+
<a href="${Y(u)}" target="_blank" rel="noopener"
|
|
944
|
+
class="naturefyi-view-link" style="color:${t.accent}">
|
|
945
|
+
View on ${Y(t.name)} \u2197
|
|
946
|
+
</a>
|
|
947
|
+
</div>
|
|
948
|
+
`}break}s.innerHTML=l}).catch(()=>{I(s,`${Y(t.entityName.slice(0,-1))} "${Y(o)}" not found.`,t)})}function z(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function De(e){return e==null||e===""?"\u2014":z(String(e))}var ft=new Set(["speciesfyi","birdfyi","plantfyi","dinofyi"]);function oe(e,t){var n;let o=(n=e.dataset.slug)!=null?n:"",a=C(e,t),s=M(a,e,"naturefyi-compare-widget");if(!ft.has(t.site)){let r=`https://${t.domain}`;s.innerHTML=`
|
|
949
|
+
<div class="naturefyi-compare-unavailable" style="padding:12px;text-align:center;">
|
|
950
|
+
<div style="font-size:0.9rem;color:#64748b;margin-bottom:8px;">
|
|
951
|
+
Comparison not available for fish. Try the compatibility checker at ${z(t.domain)}
|
|
952
|
+
</div>
|
|
953
|
+
<a class="naturefyi-view-link" href="${z(r)}" target="_blank" rel="noopener"
|
|
954
|
+
style="color:${t.accent}">
|
|
955
|
+
View on ${z(t.name)} ${q}
|
|
956
|
+
</a>
|
|
957
|
+
</div>
|
|
958
|
+
${S(t)}
|
|
959
|
+
`;return}if(!o){s.innerHTML=`
|
|
960
|
+
<div class="naturefyi-error">
|
|
961
|
+
<p>Missing data-slug attribute.</p>
|
|
962
|
+
<a href="https://${t.domain}" target="_blank" rel="noopener">Visit ${z(t.name)}</a>
|
|
963
|
+
</div>
|
|
964
|
+
`;return}W(s),B(t.apiBase,`comparisons/${o}/`).then(r=>{var L,E,_,f,b,h,k,T,v,H,R,F,Z,U;let l=(_=(E=(L=r.entity_a)==null?void 0:L.name)!=null?E:r.name_a)!=null?_:"Item A",c=(h=(b=(f=r.entity_b)==null?void 0:f.name)!=null?b:r.name_b)!=null?h:"Item B",g=(k=r.title)!=null?k:`${l} vs ${c}`,u=(T=r.rows)!=null?T:[],d=(v=r.key_differences)!=null?v:[],m=(H=r.summary)!=null?H:"",y=r.url?r.url.startsWith("http")?r.url:`https://${t.domain}${r.url}`:`https://${t.domain}/compare/${z(o)}/`,x=(R=r.entity_a)!=null&&R.url?r.entity_a.url.startsWith("http")?r.entity_a.url:`https://${t.domain}${r.entity_a.url}`:(F=r.entity_a)!=null&&F.slug?`https://${t.domain}/${t.entitySlug}/${z(r.entity_a.slug)}/`:`https://${t.domain}`,$=(Z=r.entity_b)!=null&&Z.url?r.entity_b.url.startsWith("http")?r.entity_b.url:`https://${t.domain}${r.entity_b.url}`:(U=r.entity_b)!=null&&U.slug?`https://${t.domain}/${t.entitySlug}/${z(r.entity_b.slug)}/`:`https://${t.domain}`;s.innerHTML=`
|
|
965
|
+
<div class="naturefyi-compare-card">
|
|
966
|
+
<div class="naturefyi-compare-title" style="font-size:1rem;font-weight:600;margin-bottom:10px;">
|
|
967
|
+
${z(g)}
|
|
968
|
+
</div>
|
|
969
|
+
|
|
970
|
+
${m?`<div class="naturefyi-compare-summary" style="font-size:0.85rem;color:#475569;margin-bottom:10px;line-height:1.4;">
|
|
971
|
+
${z(m)}
|
|
972
|
+
</div>`:""}
|
|
973
|
+
|
|
974
|
+
<div class="naturefyi-compare-scroll" style="overflow-x:auto;">
|
|
975
|
+
<table style="width:100%;border-collapse:collapse;font-size:0.85rem;">
|
|
976
|
+
<thead>
|
|
977
|
+
<tr>
|
|
978
|
+
<th style="text-align:left;padding:6px 8px;border-bottom:2px solid ${t.accent};color:#64748b;font-weight:600;width:35%;">Property</th>
|
|
979
|
+
<th style="text-align:left;padding:6px 8px;border-bottom:2px solid ${t.accent};font-weight:600;width:32.5%;">
|
|
980
|
+
<a href="${z(x)}" target="_blank" rel="noopener"
|
|
981
|
+
style="color:${t.accent};text-decoration:none;">${z(l)} \u2197</a>
|
|
982
|
+
</th>
|
|
983
|
+
<th style="text-align:left;padding:6px 8px;border-bottom:2px solid ${t.accent};font-weight:600;width:32.5%;">
|
|
984
|
+
<a href="${z($)}" target="_blank" rel="noopener"
|
|
985
|
+
style="color:${t.accent};text-decoration:none;">${z(c)} \u2197</a>
|
|
986
|
+
</th>
|
|
987
|
+
</tr>
|
|
988
|
+
</thead>
|
|
989
|
+
<tbody>
|
|
990
|
+
${u.map((A,K)=>`
|
|
991
|
+
<tr style="background:${K%2===0?"transparent":"#f8fafc"};">
|
|
992
|
+
<td style="padding:5px 8px;color:#64748b;font-weight:500;">${z(A.label)}</td>
|
|
993
|
+
<td style="padding:5px 8px;">${De(A.value_a)}</td>
|
|
994
|
+
<td style="padding:5px 8px;">${De(A.value_b)}</td>
|
|
995
|
+
</tr>`).join("")}
|
|
996
|
+
</tbody>
|
|
997
|
+
</table>
|
|
998
|
+
</div>
|
|
999
|
+
|
|
1000
|
+
${d.length>0?`<div class="naturefyi-key-diffs" style="margin-top:10px;padding:8px;background:#f0fdf4;border-radius:6px;border-left:3px solid #10b981;">
|
|
1001
|
+
<div style="font-size:0.75rem;font-weight:600;color:#059669;margin-bottom:4px;text-transform:uppercase;letter-spacing:0.05em;">Key Differences</div>
|
|
1002
|
+
<ul style="margin:0;padding-left:16px;font-size:0.8rem;color:#374151;">
|
|
1003
|
+
${d.map(A=>`<li style="margin:2px 0;">${z(A)}</li>`).join("")}
|
|
1004
|
+
</ul>
|
|
1005
|
+
</div>`:""}
|
|
1006
|
+
|
|
1007
|
+
<div class="naturefyi-actions" style="margin-top:10px;">
|
|
1008
|
+
<a class="naturefyi-view-link" href="${z(y)}" target="_blank" rel="noopener"
|
|
1009
|
+
style="color:${t.accent}">
|
|
1010
|
+
Full comparison on ${z(t.name)} ${q}
|
|
1011
|
+
</a>
|
|
1012
|
+
</div>
|
|
1013
|
+
</div>
|
|
1014
|
+
${S(t)}
|
|
1015
|
+
`}).catch(()=>{let r=`https://${t.domain}`;s.innerHTML=`
|
|
1016
|
+
<div class="naturefyi-compare-unavailable" style="padding:12px;text-align:center;">
|
|
1017
|
+
<div style="font-size:0.9rem;color:#64748b;margin-bottom:8px;">
|
|
1018
|
+
Comparison not available via API. View on ${z(t.name)}.
|
|
1019
|
+
</div>
|
|
1020
|
+
<a class="naturefyi-view-link" href="${z(r)}" target="_blank" rel="noopener"
|
|
1021
|
+
style="color:${t.accent}">
|
|
1022
|
+
Visit ${z(t.name)} ${q}
|
|
1023
|
+
</a>
|
|
1024
|
+
</div>
|
|
1025
|
+
${S(t)}
|
|
1026
|
+
`})}function je(e,t,i){if(document.querySelector('script[data-naturefyi-snippet="term"]'))return;let o={"@context":"https://schema.org","@type":"DefinedTerm",name:e.name,description:e.definition,inDefinedTermSet:{"@type":"DefinedTermSet",name:`${i} Glossary`,url:`https://${t}/glossary/`}},a=document.createElement("script");a.type="application/ld+json",a.setAttribute("data-naturefyi-snippet","term"),a.textContent=JSON.stringify(o),document.head.appendChild(a)}function Pe(e,t,i){if(document.querySelector('script[data-naturefyi-snippet="article"]'))return;let o={"@context":"https://schema.org","@type":"Article",headline:e.name,description:e.description,url:e.url||`https://${t}/`,publisher:{"@type":"Organization",name:i,url:`https://${t}/`}};e.datePublished&&(o.datePublished=e.datePublished);let a=document.createElement("script");a.type="application/ld+json",a.setAttribute("data-naturefyi-snippet","article"),a.textContent=JSON.stringify(o),document.head.appendChild(a)}function O(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function mt(e,t,i){var c,g,u,d,m,y;let o=(g=(c=t.name)!=null?c:t.term)!=null?g:t.slug,a=(d=(u=t.category_name)!=null?u:t.category)!=null?d:"",s=(y=(m=t.extended_definition)!=null?m:t.extended_description)!=null?y:"",n=`https://${i.domain}/glossary/${O(t.slug)}/`,r=`https://${i.domain}/glossary/`,l=t.related_terms&&t.related_terms.length>0?t.related_terms.map(x=>`<a class="naturefyi-pill naturefyi-pill--link"
|
|
1027
|
+
href="https://${i.domain}/glossary/${O(x.slug)}/"
|
|
1028
|
+
target="_blank" rel="noopener">${O(x.name)}</a>`).join(""):"";e.innerHTML=`
|
|
1029
|
+
<div class="naturefyi-glossary-card">
|
|
1030
|
+
<div class="naturefyi-glossary-header">
|
|
1031
|
+
<div style="font-size:1rem;font-weight:600;">${O(o)}</div>
|
|
1032
|
+
${a?`<span class="naturefyi-badge" style="background:${i.accent};color:#fff;margin-top:4px;display:inline-block;">
|
|
1033
|
+
${O(a)}
|
|
1034
|
+
</span>`:""}
|
|
1035
|
+
</div>
|
|
1036
|
+
|
|
1037
|
+
<div class="naturefyi-glossary-definition" style="margin:10px 0;font-size:0.9rem;line-height:1.5;">
|
|
1038
|
+
${O(t.definition)}
|
|
1039
|
+
</div>
|
|
1040
|
+
|
|
1041
|
+
${s?`<div class="naturefyi-glossary-extended" style="margin-bottom:8px;font-size:0.85rem;color:#64748b;line-height:1.5;">
|
|
1042
|
+
${O(s)}
|
|
1043
|
+
</div>`:""}
|
|
1044
|
+
|
|
1045
|
+
${l?`<div class="naturefyi-pills" style="margin:8px 0;">
|
|
1046
|
+
${l}
|
|
1047
|
+
</div>`:""}
|
|
1048
|
+
|
|
1049
|
+
<div class="naturefyi-actions" style="margin-top:10px;display:flex;flex-wrap:wrap;gap:8px;">
|
|
1050
|
+
<a class="naturefyi-view-link" href="${n}" target="_blank" rel="noopener"
|
|
1051
|
+
style="color:${i.accent}">
|
|
1052
|
+
${O(o)} ${q}
|
|
1053
|
+
</a>
|
|
1054
|
+
<a class="naturefyi-view-link" href="${r}" target="_blank" rel="noopener"
|
|
1055
|
+
style="color:${i.accent}">
|
|
1056
|
+
Full glossary on ${O(i.name)} ${q}
|
|
1057
|
+
</a>
|
|
1058
|
+
</div>
|
|
1059
|
+
</div>
|
|
1060
|
+
${S(i)}
|
|
1061
|
+
`}function ae(e,t){var n;let o=(n=e.dataset.slug)!=null?n:"";if(!o){let r=C(e,t),l=M(r,e,"naturefyi-glossary-widget");I(l,"Missing data-slug attribute.",t);return}let a=C(e,t),s=M(a,e,"naturefyi-glossary-widget");W(s),B(t.apiBase,`glossary/${o}/`).then(r=>{var l,c;if(mt(s,r,t),e.dataset.noSnippet!=="true"){let g=(c=(l=r.name)!=null?l:r.term)!=null?c:r.slug;je({name:g,definition:r.definition},t.domain,t.name)}}).catch(()=>{I(s,`Unable to load glossary term "${O(o)}". Please try again later.`,t)})}function V(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function se(e,t){var n;let o=(n=e.dataset.slug)!=null?n:"";if(!o){let r=C(e,t),l=M(r,e,"naturefyi-guide-widget");I(l,"Missing data-slug attribute.",t);return}let a=C(e,t),s=M(a,e,"naturefyi-guide-widget");W(s),B(t.apiBase,`guides/${o}/`).then(r=>{var y,x,$,L,E,_,f,b;let l=r.url?r.url.startsWith("http")?r.url:`https://${t.domain}${r.url}`:`https://${t.domain}/guides/${V(r.slug)}/`,c=(L=($=(x=(y=r.summary)!=null?y:r.subtitle)!=null?x:r.description)!=null?$:r.excerpt)!=null?L:"",g=(E=r.reading_time_minutes)!=null?E:null,u=(_=r.series_name)!=null?_:null,d=(b=(f=r.date_published)!=null?f:r.published_at)!=null?b:null,m=r.toc&&r.toc.length>0?r.toc.slice(0,5):null;s.innerHTML=`
|
|
1062
|
+
<div class="naturefyi-guide-card">
|
|
1063
|
+
<div class="naturefyi-guide-badges" style="display:flex;flex-wrap:wrap;gap:4px;margin-bottom:8px;">
|
|
1064
|
+
${u?`<span class="naturefyi-badge" style="background:${t.accent};color:#fff;">${V(u)}</span>`:""}
|
|
1065
|
+
${g!=null?`<span class="naturefyi-badge" style="background:#f1f5f9;color:#475569;border:1px solid #e2e8f0;">
|
|
1066
|
+
${V(String(g))} min read
|
|
1067
|
+
</span>`:""}
|
|
1068
|
+
</div>
|
|
1069
|
+
|
|
1070
|
+
<div class="naturefyi-guide-title" style="font-size:1rem;font-weight:600;margin-bottom:8px;">
|
|
1071
|
+
${V(r.title)}
|
|
1072
|
+
</div>
|
|
1073
|
+
|
|
1074
|
+
${c?`<div class="naturefyi-guide-summary" style="font-size:0.875rem;color:#475569;line-height:1.5;margin-bottom:8px;">
|
|
1075
|
+
${V(c)}
|
|
1076
|
+
</div>`:""}
|
|
1077
|
+
|
|
1078
|
+
${m?`<div class="naturefyi-guide-toc" style="margin:8px 0;padding:8px;background:#f8fafc;border-radius:6px;border-left:3px solid ${t.accent};">
|
|
1079
|
+
<div style="font-size:0.75rem;font-weight:600;color:#64748b;margin-bottom:4px;text-transform:uppercase;letter-spacing:0.05em;">Contents</div>
|
|
1080
|
+
<ol style="margin:0;padding-left:16px;font-size:0.8rem;color:#475569;">
|
|
1081
|
+
${m.map(h=>`<li style="margin:2px 0;">${V(h.title)}</li>`).join("")}
|
|
1082
|
+
</ol>
|
|
1083
|
+
</div>`:""}
|
|
1084
|
+
|
|
1085
|
+
<div class="naturefyi-actions" style="margin-top:10px;">
|
|
1086
|
+
<a class="naturefyi-view-link" href="${V(l)}" target="_blank" rel="noopener"
|
|
1087
|
+
style="color:${t.accent}">
|
|
1088
|
+
Read guide on ${V(t.name)} ${q}
|
|
1089
|
+
</a>
|
|
1090
|
+
</div>
|
|
1091
|
+
</div>
|
|
1092
|
+
${S(t)}
|
|
1093
|
+
`,e.dataset.noSnippet!=="true"&&Pe({name:r.title,description:c,url:l,...d?{datePublished:d}:{}},t.domain,t.name)}).catch(()=>{I(s,`Guide "${V(o)}" not found.`,t)})}function J(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var yt={species:"Species",bird:"Bird",fish:"Fish",plant:"Plant",dinosaur:"Dinosaur",glossary:"Glossary",guide:"Guide",faq:"FAQ"},xt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="14" height="14"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>';function le(e,t){var _;let o=(_=e.dataset.placeholder)!=null?_:`Search ${t.entityName}...`,a=C(e,t),s=M(a,e,"naturefyi-search-widget"),n=!1,r="",l=[],c=-1,g=null;s.innerHTML=`
|
|
1094
|
+
<div class="naturefyi-search-wrap">
|
|
1095
|
+
<div class="naturefyi-search-form" style="position:relative;display:flex;align-items:center;">
|
|
1096
|
+
<span class="naturefyi-search-icon" aria-hidden="true"
|
|
1097
|
+
style="position:absolute;left:10px;color:#94a3b8;pointer-events:none;">${xt}</span>
|
|
1098
|
+
<input
|
|
1099
|
+
class="naturefyi-search-input"
|
|
1100
|
+
type="search"
|
|
1101
|
+
autocomplete="off"
|
|
1102
|
+
spellcheck="false"
|
|
1103
|
+
placeholder="${J(o)}"
|
|
1104
|
+
aria-label="Search ${J(t.name)}"
|
|
1105
|
+
aria-autocomplete="list"
|
|
1106
|
+
aria-expanded="false"
|
|
1107
|
+
role="combobox"
|
|
1108
|
+
style="width:100%;padding:8px 10px 8px 32px;border:1px solid #e2e8f0;border-radius:6px;font-size:0.875rem;outline:none;background:#fff;color:#1e293b;box-sizing:border-box;"
|
|
1109
|
+
>
|
|
1110
|
+
</div>
|
|
1111
|
+
<div class="naturefyi-search-dropdown" role="listbox" hidden
|
|
1112
|
+
style="margin-top:4px;border:1px solid #e2e8f0;border-radius:6px;background:#fff;box-shadow:0 4px 16px rgba(0,0,0,0.1);max-height:280px;overflow-y:auto;"></div>
|
|
1113
|
+
</div>
|
|
1114
|
+
${S(t)}
|
|
1115
|
+
`;let u=s.querySelector(".naturefyi-search-input"),d=s.querySelector(".naturefyi-search-dropdown");function m(){return Array.from(d.querySelectorAll(".naturefyi-search-result-item"))}function y(f){m().forEach((h,k)=>{let T=h;k===f?(T.style.background=`${t.accent}15`,T.style.outline=`2px solid ${t.accent}`,T.style.outlineOffset="-2px"):(T.style.background="",T.style.outline="")}),c=f}function x(){n=!0,d.hidden=!1,u.setAttribute("aria-expanded","true")}function $(){n=!1,d.hidden=!0,u.setAttribute("aria-expanded","false"),c=-1}function L(){var b,h,k,T;if(l.length===0){d.innerHTML=`
|
|
1116
|
+
<div style="padding:12px 14px;font-size:0.85rem;color:#64748b;">
|
|
1117
|
+
No results for <strong>${J(r)}</strong>
|
|
1118
|
+
</div>
|
|
1119
|
+
`;return}let f="";for(let v of l){let H=v.type?(b=yt[v.type])!=null?b:v.type:null,R=(T=(k=(h=v.description)!=null?h:v.excerpt)!=null?k:v.subtitle)!=null?T:"",F=v.url?v.url.startsWith("http")?v.url:`https://${t.domain}${v.url}`:`https://${t.domain}/${t.entitySlug}/${J(v.slug)}/`;f+=`
|
|
1120
|
+
<a
|
|
1121
|
+
class="naturefyi-search-result-item"
|
|
1122
|
+
href="${J(F)}"
|
|
1123
|
+
target="_blank"
|
|
1124
|
+
rel="noopener"
|
|
1125
|
+
role="option"
|
|
1126
|
+
tabindex="-1"
|
|
1127
|
+
style="display:block;padding:8px 14px;text-decoration:none;color:inherit;border-bottom:1px solid #f1f5f9;transition:background 0.1s;"
|
|
1128
|
+
>
|
|
1129
|
+
<div style="display:flex;align-items:center;justify-content:space-between;gap:8px;">
|
|
1130
|
+
<span style="font-size:0.875rem;font-weight:500;color:#1e293b;">${J(v.name)}</span>
|
|
1131
|
+
${H?`<span style="font-size:0.7rem;padding:1px 6px;border-radius:10px;background:${t.accent}20;color:${t.accent};white-space:nowrap;flex-shrink:0;font-weight:500;">${J(H)}</span>`:""}
|
|
1132
|
+
</div>
|
|
1133
|
+
${R?`<div style="font-size:0.75rem;color:#64748b;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">${J(R)}</div>`:""}
|
|
1134
|
+
</a>
|
|
1135
|
+
`}d.innerHTML=f}async function E(f){var h;if(!f.trim()){$();return}let b=`https://${t.domain}/api/v1/search/?q=${encodeURIComponent(f)}&limit=10`;try{let k=await fetch(b,{headers:{Accept:"application/json"}});if(!k.ok)throw new Error(`Search failed: ${k.status}`);l=(h=(await k.json()).results)!=null?h:[]}catch(k){l=[]}L(),x(),y(-1)}u.addEventListener("input",()=>{if(r=u.value,g!==null&&clearTimeout(g),!r.trim()){$();return}g=setTimeout(()=>{E(r)},300)}),u.addEventListener("keydown",f=>{if(!n)return;let b=m(),h=b.length;if(f.key==="ArrowDown")f.preventDefault(),y(c<h-1?c+1:0);else if(f.key==="ArrowUp")f.preventDefault(),y(c>0?c-1:h-1);else if(f.key==="Enter")if(f.preventDefault(),c>=0&&b[c])b[c].click();else{let k=`https://${t.domain}${t.searchPath}?q=${encodeURIComponent(r)}`;window.open(k,"_blank","noopener")}else f.key==="Escape"&&($(),u.blur())}),document.addEventListener("click",f=>{n&&(e.contains(f.target)||$())}),u.addEventListener("focus",()=>{u.style.borderColor=t.accent,u.style.boxShadow=`0 0 0 2px ${t.accent}30`}),u.addEventListener("blur",()=>{u.style.borderColor="#e2e8f0",u.style.boxShadow=""})}function ce(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Oe(e,t,i){let o=j(e),a=P(e),s=e.toUpperCase();return`
|
|
1136
|
+
<div class="naturefyi-iucn-badge" style="display:inline-flex;align-items:center;gap:6px;">
|
|
1137
|
+
<span style="display:inline-flex;align-items:center;justify-content:center;padding:2px 8px;border-radius:4px;background:${o.bg};color:${o.text};font-size:0.8rem;font-weight:700;letter-spacing:0.05em;">
|
|
1138
|
+
${ce(s)}
|
|
1139
|
+
</span>
|
|
1140
|
+
${t?`<span style="font-size:0.85rem;color:#374151;">${ce(a)}</span>`:""}
|
|
1141
|
+
</div>
|
|
1142
|
+
${S(i)}
|
|
1143
|
+
`}function pe(e,t){var l,c;let i=e.dataset,o=(l=i.status)!=null?l:"",a=(c=i.slug)!=null?c:"",s=i.showLabel!=="false",n=C(e,t),r=M(n,e,"naturefyi-iucn-badge-widget");if(o){r.innerHTML=Oe(o,s,t);return}if(a){W(r),B(t.apiBase,`${t.entitySlug}/${a}/`).then(g=>{var d,m;let u=String((m=(d=g.conservation_status)!=null?d:g.iucn_status)!=null?m:"NE");r.innerHTML=Oe(u,s,t)}).catch(()=>{I(r,`Could not load status for "${ce(a)}".`,t)});return}I(r,"Missing data-status or data-slug attribute.",t)}function Ue(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function de(e,t){var u;let o=(u=e.dataset.period)!=null?u:"",a=C(e,t),s=M(a,e,"naturefyi-period-timeline-widget"),n=te(),r=n.map(d=>{let m=(d.posEnd-d.posStart)*100,x=d.name.toLowerCase()===o.toLowerCase()?"1":"0.4";return`<div style="width:${m}%;height:20px;background:${d.color};opacity:${x};position:relative;" title="${Ue(d.name)} (${d.start}\u2013${d.end} Ma)"></div>`}).join(""),l="",c=n.find(d=>d.name.toLowerCase()===o.toLowerCase());c&&(l=`<div style="position:absolute;left:${(c.posStart+c.posEnd)/2*100}%;top:50%;width:12px;height:12px;border-radius:50%;background:#1e293b;border:2px solid #fff;transform:translate(-50%,-50%);box-shadow:0 1px 4px rgba(0,0,0,0.3);z-index:1;"></div>`);let g=n.map(d=>`<span style="width:${(d.posEnd-d.posStart)*100}%;text-align:center;font-size:0.7rem;color:#64748b;line-height:1.3;">${Ue(d.name)}<br><span style="font-size:0.6rem;">${d.start}\u2013${d.end} Ma</span></span>`).join("");s.innerHTML=`
|
|
1144
|
+
<div class="naturefyi-period-timeline" style="padding:4px 0;">
|
|
1145
|
+
<div style="display:flex;border-radius:6px;overflow:hidden;position:relative;">
|
|
1146
|
+
${r}
|
|
1147
|
+
${l}
|
|
1148
|
+
</div>
|
|
1149
|
+
<div style="display:flex;margin-top:4px;">${g}</div>
|
|
1150
|
+
</div>
|
|
1151
|
+
${S(t)}
|
|
1152
|
+
`}function qe(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var bt={herbivore:{icon:"\u{1F33F}",label:"Herbivore",bg:"#22c55e",text:"#fff"},carnivore:{icon:"\u{1F9B7}",label:"Carnivore",bg:"#ef4444",text:"#fff"},omnivore:{icon:"\u{1F37D}\uFE0F",label:"Omnivore",bg:"#f59e0b",text:"#fff"}};function ue(e,t){var r;let o=((r=e.dataset.diet)!=null?r:"").toLowerCase().trim(),a=C(e,t),s=M(a,e,"naturefyi-diet-badge-widget");if(!o){I(s,"Missing data-diet attribute.",t);return}let n=bt[o];if(!n){I(s,`Unknown diet type: "${qe(o)}". Use herbivore, carnivore, or omnivore.`,t);return}s.innerHTML=`
|
|
1153
|
+
<div class="naturefyi-diet-badge" style="display:inline-flex;align-items:center;gap:6px;">
|
|
1154
|
+
<span style="display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:6px;background:${n.bg};color:${n.text};font-size:0.85rem;font-weight:600;">
|
|
1155
|
+
${n.icon} ${qe(n.label)}
|
|
1156
|
+
</span>
|
|
1157
|
+
</div>
|
|
1158
|
+
${S(t)}
|
|
1159
|
+
`}function Ge(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ve(e,t){var c;let o=((c=e.dataset.status)!=null?c:"").toUpperCase(),a=C(e,t),s=document.createElement("style");s.textContent=":host { display: inline-flex; vertical-align: baseline; }",a.appendChild(s);let n=document.createElement("span");if(!o){n.textContent="[?]",a.appendChild(n);return}let r=j(o),l=P(o);n.innerHTML=`<span style="display:inline-flex;align-items:center;gap:3px;padding:1px 6px;border-radius:10px;background:${r.bg};color:${r.text};font-size:0.75rem;font-weight:600;line-height:1.4;white-space:nowrap;">[${Ge(o)}] ${Ge(l)}</span>`,a.appendChild(n)}function ht(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ze(e,t){var l;let o=(l=e.dataset.period)!=null?l:"",a=C(e,t),s=document.createElement("style");s.textContent=":host { display: inline-flex; vertical-align: baseline; }",a.appendChild(s);let n=document.createElement("span");if(!o){n.textContent="[?]",a.appendChild(n);return}let r=ee(o);n.innerHTML=`<span style="display:inline-flex;align-items:center;padding:1px 6px;border-radius:10px;background:${r};color:#fff;font-size:0.75rem;font-weight:600;line-height:1.4;white-space:nowrap;">${ht(o)}</span>`,a.appendChild(n)}function Je(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ke(e,t){var u,d;let i=e.dataset,o=(u=i.name)!=null?u:"",a=(d=i.author)!=null?d:"",s=i.extinct==="true",n=C(e,t),r=document.createElement("style");r.textContent=":host { display: inline-flex; vertical-align: baseline; }",n.appendChild(r);let l=document.createElement("span");if(!o){l.textContent="[?]",n.appendChild(l);return}let c=s?"\u2020":"",g=a?` <span style="font-style:normal;font-weight:400;color:#64748b;">${Je(a)}</span>`:"";l.innerHTML=`<span style="font-family:Georgia,'Times New Roman',serif;font-style:italic;font-size:inherit;color:inherit;">${c?`<span style="font-style:normal;">${c}</span>\u200A`:""}${Je(o)}</span>${g}`,n.appendChild(l)}function vt(e,t,i){let o=e.dataset.style||"modern";switch(t){case"entity":ie(e,i);break;case"compare":oe(e,i);break;case"glossary":ae(e,i);break;case"guide":se(e,i);break;case"search":le(e,i);break;case"iucn-badge":pe(e,i);break;case"period-timeline":de(e,i);break;case"diet-badge":ue(e,i);break;case"iucn-inline":Ve(e,i);break;case"period-inline":Ze(e,i);break;case"taxonomy-inline":Ke(e,i);break;default:break}}function wt(e,t){if("IntersectionObserver"in window){let i=new IntersectionObserver(o=>{o.forEach(a=>{a.isIntersecting&&(i.unobserve(e),t())})},{rootMargin:"200px"});i.observe(e)}else t()}function ge(e,t){if(e.shadowRoot)return;let o=t.attribute.replace("data-","").replace(/-([a-z])/g,(s,n)=>n.toUpperCase()),a=e.dataset[o];a&&wt(e,()=>{e.shadowRoot||vt(e,a,t)})}function Xe(e){document.querySelectorAll(`[${e.attribute}]`).forEach(t=>ge(t,e))}(function(){let t='{"site":"dinofyi","name":"DinoFYI","domain":"dinofyi.com","accent":"#F97316","attribute":"data-dinofyi","apiBase":"https://dinofyi.com/api/v1/","searchPath":"/search/","entityName":"Dinosaurs","entitySlug":"dinosaurs"}';document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Xe(t)):Xe(t),new MutationObserver(o=>{o.forEach(a=>{a.addedNodes.forEach(s=>{var r;if(s.nodeType!==Node.ELEMENT_NODE)return;let n=s;n.hasAttribute(t.attribute)&&ge(n,t),(r=n.querySelectorAll)==null||r.call(n,`[${t.attribute}]`).forEach(l=>ge(l,t))})})}).observe(document.body||document.documentElement,{childList:!0,subtree:!0})})();function $t(e,t,i){let o=[...i,"theme","style-variant","size"];return class extends HTMLElement{static get observedAttributes(){return o}connectedCallback(){this.shadowRoot||(this._syncDataAttrs(),t(this,'{"site":"dinofyi","name":"DinoFYI","domain":"dinofyi.com","accent":"#F97316","attribute":"data-dinofyi","apiBase":"https://dinofyi.com/api/v1/","searchPath":"/search/","entityName":"Dinosaurs","entitySlug":"dinosaurs"}'))}attributeChangedCallback(a,s,n){if(s===n||!this.shadowRoot)return;let r=this.shadowRoot;for(;r.firstChild;)r.firstChild.remove();this._syncDataAttrs(),t(this,'{"site":"dinofyi","name":"DinoFYI","domain":"dinofyi.com","accent":"#F97316","attribute":"data-dinofyi","apiBase":"https://dinofyi.com/api/v1/","searchPath":"/search/","entityName":"Dinosaurs","entitySlug":"dinosaurs"}')}_syncDataAttrs(){let a='{"site":"dinofyi","name":"DinoFYI","domain":"dinofyi.com","accent":"#F97316","attribute":"data-dinofyi","apiBase":"https://dinofyi.com/api/v1/","searchPath":"/search/","entityName":"Dinosaurs","entitySlug":"dinosaurs"}'.attribute.replace("data-","");this.dataset[a]=e;for(let l of i){let c=this.getAttribute(l);c!==null&&(this.dataset[l]=c)}let s=this.getAttribute("theme");s!==null&&(this.dataset.theme=s);let n=this.getAttribute("style-variant");n!==null&&(this.dataset.style=n);let r=this.getAttribute("size");r!==null&&(this.dataset.size=r)}}}(function(){if(typeof customElements=="undefined")return;let t='{"site":"dinofyi","name":"DinoFYI","domain":"dinofyi.com","accent":"#F97316","attribute":"data-dinofyi","apiBase":"https://dinofyi.com/api/v1/","searchPath":"/search/","entityName":"Dinosaurs","entitySlug":"dinosaurs"}'.site,i=[[`${t}-entity`,ie,["slug"]],[`${t}-compare`,oe,["slugs"]],[`${t}-glossary`,ae,["slug","letter"]],[`${t}-guide`,se,["slug"]],[`${t}-search`,le,["placeholder","query"]],[`${t}-iucn-badge`,pe,["slug","value"]],[`${t}-period-timeline`,de,["slug","value"]],[`${t}-diet-badge`,ue,["slug","value"]]];for(let[o,a,s]of i)if(!customElements.get(o)){let n=o.slice(t.length+1);customElements.define(o,$t(n,a,s))}})();})();
|