vinofyi-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 +173 -0
- package/dist/embed.esm.js +1723 -0
- package/dist/embed.min.js +840 -0
- package/dist/index.d.ts +27 -0
- package/package.json +43 -0
|
@@ -0,0 +1,840 @@
|
|
|
1
|
+
/* vinofyi-embed v1.0.0 | MIT | https://widget.vinofyi.com */
|
|
2
|
+
"use strict";(()=>{function X(){return`
|
|
3
|
+
/* Modern: gradient accent header */
|
|
4
|
+
.drinkfyi-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
|
+
.drinkfyi-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
|
+
.drinkfyi-header-subtitle {
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
color: rgba(255, 255, 255, 0.8);
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Image area \u2014 for recipe/entity cards */
|
|
28
|
+
.drinkfyi-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
|
+
.drinkfyi-img img {
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
object-fit: cover;
|
|
45
|
+
border-radius: 8px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* Body area */
|
|
49
|
+
.drinkfyi-body {
|
|
50
|
+
padding: 16px 20px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Key-value rows \u2014 spacious */
|
|
54
|
+
.drinkfyi-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
|
+
.drinkfyi-row:last-child {
|
|
64
|
+
border-bottom: none;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.drinkfyi-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
|
+
.drinkfyi-value {
|
|
77
|
+
font-size: 13px;
|
|
78
|
+
color: var(--text);
|
|
79
|
+
text-align: right;
|
|
80
|
+
word-break: break-word;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Section title */
|
|
84
|
+
.drinkfyi-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
|
+
.drinkfyi-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
|
+
.drinkfyi-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
|
+
.drinkfyi-link:hover {
|
|
118
|
+
opacity: 0.8;
|
|
119
|
+
text-decoration: underline;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.drinkfyi-link svg {
|
|
123
|
+
width: 12px;
|
|
124
|
+
height: 12px;
|
|
125
|
+
flex-shrink: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Footer link row */
|
|
129
|
+
.drinkfyi-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
|
+
`}function Z(){return`
|
|
138
|
+
/* Classic: serif headings throughout */
|
|
139
|
+
.drinkfyi-widget {
|
|
140
|
+
font-family: Georgia, 'Times New Roman', serif;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/* Header \u2014 surface background with thin accent top border */
|
|
144
|
+
.drinkfyi-header {
|
|
145
|
+
background: var(--surface);
|
|
146
|
+
border-top: 3px solid var(--accent);
|
|
147
|
+
padding: 16px 20px;
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: flex-start;
|
|
150
|
+
gap: 14px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.drinkfyi-header-title {
|
|
154
|
+
font-size: 16px;
|
|
155
|
+
font-weight: 700;
|
|
156
|
+
color: var(--text);
|
|
157
|
+
margin: 0 0 4px 0;
|
|
158
|
+
line-height: 1.3;
|
|
159
|
+
font-family: Georgia, 'Times New Roman', serif;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.drinkfyi-header-subtitle {
|
|
163
|
+
font-size: 12px;
|
|
164
|
+
color: var(--muted);
|
|
165
|
+
margin: 0;
|
|
166
|
+
font-style: italic;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Image area \u2014 for recipe/entity cards */
|
|
170
|
+
.drinkfyi-img {
|
|
171
|
+
width: 56px;
|
|
172
|
+
height: 56px;
|
|
173
|
+
border-radius: 4px;
|
|
174
|
+
object-fit: cover;
|
|
175
|
+
background: var(--badge-bg);
|
|
176
|
+
flex-shrink: 0;
|
|
177
|
+
display: flex;
|
|
178
|
+
align-items: center;
|
|
179
|
+
justify-content: center;
|
|
180
|
+
overflow: hidden;
|
|
181
|
+
border: 1px solid var(--border);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.drinkfyi-img img {
|
|
185
|
+
width: 100%;
|
|
186
|
+
height: 100%;
|
|
187
|
+
object-fit: cover;
|
|
188
|
+
border-radius: 4px;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Body area */
|
|
192
|
+
.drinkfyi-body {
|
|
193
|
+
padding: 14px 20px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/* Key-value rows \u2014 dotted borders */
|
|
197
|
+
.drinkfyi-row {
|
|
198
|
+
display: flex;
|
|
199
|
+
justify-content: space-between;
|
|
200
|
+
align-items: flex-start;
|
|
201
|
+
gap: 12px;
|
|
202
|
+
padding: 8px 0;
|
|
203
|
+
border-bottom: 1px dotted var(--border);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.drinkfyi-row:last-child {
|
|
207
|
+
border-bottom: none;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.drinkfyi-label {
|
|
211
|
+
font-size: 11px;
|
|
212
|
+
font-weight: 600;
|
|
213
|
+
color: var(--muted);
|
|
214
|
+
white-space: nowrap;
|
|
215
|
+
flex-shrink: 0;
|
|
216
|
+
min-width: 30%;
|
|
217
|
+
font-variant: small-caps;
|
|
218
|
+
letter-spacing: 0.06em;
|
|
219
|
+
text-transform: lowercase;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.drinkfyi-value {
|
|
223
|
+
font-size: 13px;
|
|
224
|
+
color: var(--text);
|
|
225
|
+
text-align: right;
|
|
226
|
+
word-break: break-word;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Section title */
|
|
230
|
+
.drinkfyi-section-title {
|
|
231
|
+
font-size: 11px;
|
|
232
|
+
font-weight: 600;
|
|
233
|
+
color: var(--muted);
|
|
234
|
+
font-variant: small-caps;
|
|
235
|
+
letter-spacing: 0.08em;
|
|
236
|
+
text-transform: lowercase;
|
|
237
|
+
margin: 0 0 10px 0;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/* Tags \u2014 muted badges with border */
|
|
241
|
+
.drinkfyi-tag {
|
|
242
|
+
display: inline-block;
|
|
243
|
+
font-size: 11px;
|
|
244
|
+
font-weight: 500;
|
|
245
|
+
padding: 2px 8px;
|
|
246
|
+
border-radius: 3px;
|
|
247
|
+
background: var(--badge-bg);
|
|
248
|
+
color: var(--badge-text);
|
|
249
|
+
border: 1px solid var(--border);
|
|
250
|
+
margin: 2px 3px 2px 0;
|
|
251
|
+
letter-spacing: 0.02em;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* Link */
|
|
255
|
+
.drinkfyi-link {
|
|
256
|
+
font-size: 13px;
|
|
257
|
+
font-weight: 500;
|
|
258
|
+
color: var(--link);
|
|
259
|
+
text-decoration: none;
|
|
260
|
+
display: inline-flex;
|
|
261
|
+
align-items: center;
|
|
262
|
+
gap: 4px;
|
|
263
|
+
font-style: normal;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.drinkfyi-link:hover {
|
|
267
|
+
text-decoration: underline;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.drinkfyi-link svg {
|
|
271
|
+
width: 12px;
|
|
272
|
+
height: 12px;
|
|
273
|
+
flex-shrink: 0;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* Footer link row */
|
|
277
|
+
.drinkfyi-footer-link {
|
|
278
|
+
display: flex;
|
|
279
|
+
align-items: center;
|
|
280
|
+
justify-content: space-between;
|
|
281
|
+
padding: 10px 20px;
|
|
282
|
+
border-top: 1px solid var(--border);
|
|
283
|
+
gap: 8px;
|
|
284
|
+
}
|
|
285
|
+
`}function se(t){switch(t){case"classic":return Z();case"modern":default:return X()}}function ee(t,e="modern"){return`
|
|
286
|
+
:host {
|
|
287
|
+
display: block;
|
|
288
|
+
--site-accent: ${t};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
292
|
+
Size variants
|
|
293
|
+
compact=280px, default=420px, large=720px
|
|
294
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
295
|
+
.drinkfyi-widget {
|
|
296
|
+
box-sizing: border-box;
|
|
297
|
+
min-width: 240px;
|
|
298
|
+
max-width: 420px;
|
|
299
|
+
border-radius: 8px;
|
|
300
|
+
overflow: hidden;
|
|
301
|
+
border: 1px solid var(--border);
|
|
302
|
+
background: var(--bg);
|
|
303
|
+
color: var(--text);
|
|
304
|
+
font-size: 14px;
|
|
305
|
+
line-height: 1.6;
|
|
306
|
+
transition: border-color 0.2s;
|
|
307
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.drinkfyi-widget[data-size="compact"] {
|
|
311
|
+
max-width: 280px;
|
|
312
|
+
font-size: 13px;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.drinkfyi-widget[data-size="default"] {
|
|
316
|
+
max-width: 420px;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.drinkfyi-widget[data-size="large"] {
|
|
320
|
+
max-width: 720px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
324
|
+
Light theme (default)
|
|
325
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
326
|
+
.drinkfyi-widget[data-theme="light"] {
|
|
327
|
+
--bg: #fff;
|
|
328
|
+
--text: #1e293b;
|
|
329
|
+
--border: #e2e8f0;
|
|
330
|
+
--accent: var(--site-accent);
|
|
331
|
+
--muted: #64748b;
|
|
332
|
+
--surface: #f8fafc;
|
|
333
|
+
--badge-bg: #f1f5f9;
|
|
334
|
+
--badge-text: #374151;
|
|
335
|
+
--link: var(--site-accent);
|
|
336
|
+
--copy-bg: #f3f4f6;
|
|
337
|
+
--copy-hover: #e5e7eb;
|
|
338
|
+
--input-bg: #ffffff;
|
|
339
|
+
--input-border: #d1d5db;
|
|
340
|
+
--input-focus: var(--site-accent);
|
|
341
|
+
--shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
345
|
+
Dark theme
|
|
346
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
347
|
+
.drinkfyi-widget[data-theme="dark"] {
|
|
348
|
+
--bg: #1a1a1a;
|
|
349
|
+
--text: #f3f4f6;
|
|
350
|
+
--border: #374151;
|
|
351
|
+
--accent: var(--site-accent);
|
|
352
|
+
--muted: #9ca3af;
|
|
353
|
+
--surface: #111827;
|
|
354
|
+
--badge-bg: #374151;
|
|
355
|
+
--badge-text: #d1d5db;
|
|
356
|
+
--link: color-mix(in srgb, var(--site-accent) 80%, #fff);
|
|
357
|
+
--copy-bg: #374151;
|
|
358
|
+
--copy-hover: #4b5563;
|
|
359
|
+
--input-bg: #111111;
|
|
360
|
+
--input-border: #4b5563;
|
|
361
|
+
--input-focus: var(--site-accent);
|
|
362
|
+
--shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
366
|
+
Sepia theme
|
|
367
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
368
|
+
.drinkfyi-widget[data-theme="sepia"] {
|
|
369
|
+
--bg: #f5f0e8;
|
|
370
|
+
--text: #3d3529;
|
|
371
|
+
--border: #d4c5a9;
|
|
372
|
+
--accent: var(--site-accent);
|
|
373
|
+
--muted: #8b7d6b;
|
|
374
|
+
--surface: #ede8df;
|
|
375
|
+
--badge-bg: #e8e0d0;
|
|
376
|
+
--badge-text: #5c4f3d;
|
|
377
|
+
--link: color-mix(in srgb, var(--site-accent) 70%, #3d3529);
|
|
378
|
+
--copy-bg: #e8e0d0;
|
|
379
|
+
--copy-hover: #ddd4c0;
|
|
380
|
+
--input-bg: #f5f0e8;
|
|
381
|
+
--input-border: #c4b49a;
|
|
382
|
+
--input-focus: var(--site-accent);
|
|
383
|
+
--shadow: 0 1px 3px rgba(61, 53, 41, 0.12);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.drinkfyi-widget *, .drinkfyi-widget *::before, .drinkfyi-widget *::after {
|
|
387
|
+
box-sizing: border-box;
|
|
388
|
+
}
|
|
389
|
+
|
|
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
|
+
Loading state
|
|
392
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
393
|
+
.drinkfyi-loading {
|
|
394
|
+
padding: 20px 16px;
|
|
395
|
+
text-align: center;
|
|
396
|
+
color: var(--muted);
|
|
397
|
+
font-size: 13px;
|
|
398
|
+
display: flex;
|
|
399
|
+
align-items: center;
|
|
400
|
+
justify-content: center;
|
|
401
|
+
gap: 8px;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.drinkfyi-spinner {
|
|
405
|
+
width: 16px;
|
|
406
|
+
height: 16px;
|
|
407
|
+
border: 2px solid var(--border);
|
|
408
|
+
border-top-color: var(--accent);
|
|
409
|
+
border-radius: 50%;
|
|
410
|
+
animation: drinkfyi-spin 0.7s linear infinite;
|
|
411
|
+
display: inline-block;
|
|
412
|
+
flex-shrink: 0;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
@keyframes drinkfyi-spin {
|
|
416
|
+
to { transform: rotate(360deg); }
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
420
|
+
Error state
|
|
421
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
422
|
+
.drinkfyi-error {
|
|
423
|
+
padding: 16px;
|
|
424
|
+
color: var(--muted);
|
|
425
|
+
font-size: 13px;
|
|
426
|
+
text-align: center;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.drinkfyi-error p {
|
|
430
|
+
margin: 0 0 8px 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.drinkfyi-error a {
|
|
434
|
+
color: var(--link);
|
|
435
|
+
text-decoration: none;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.drinkfyi-error a:hover {
|
|
439
|
+
text-decoration: underline;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
443
|
+
Badge (generic)
|
|
444
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
445
|
+
.drinkfyi-badge {
|
|
446
|
+
display: inline-block;
|
|
447
|
+
font-size: 10px;
|
|
448
|
+
font-weight: 600;
|
|
449
|
+
padding: 2px 7px;
|
|
450
|
+
border-radius: 4px;
|
|
451
|
+
background: var(--badge-bg);
|
|
452
|
+
color: var(--badge-text);
|
|
453
|
+
text-transform: uppercase;
|
|
454
|
+
letter-spacing: 0.04em;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
458
|
+
Search inputs
|
|
459
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
460
|
+
.drinkfyi-search-wrap {
|
|
461
|
+
padding: 12px 16px;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.drinkfyi-search-form {
|
|
465
|
+
display: flex;
|
|
466
|
+
gap: 8px;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.drinkfyi-search-input {
|
|
470
|
+
flex: 1;
|
|
471
|
+
padding: 8px 12px;
|
|
472
|
+
border: 1px solid var(--input-border);
|
|
473
|
+
border-radius: 6px;
|
|
474
|
+
background: var(--input-bg);
|
|
475
|
+
color: var(--text);
|
|
476
|
+
font-size: 13px;
|
|
477
|
+
font-family: inherit;
|
|
478
|
+
outline: none;
|
|
479
|
+
transition: border-color 0.15s;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.drinkfyi-search-input:focus {
|
|
483
|
+
border-color: var(--input-focus);
|
|
484
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
.drinkfyi-search-input::placeholder {
|
|
488
|
+
color: var(--muted);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.drinkfyi-search-btn {
|
|
492
|
+
background: var(--accent);
|
|
493
|
+
color: #fff;
|
|
494
|
+
border: none;
|
|
495
|
+
border-radius: 6px;
|
|
496
|
+
padding: 8px 14px;
|
|
497
|
+
font-size: 13px;
|
|
498
|
+
font-weight: 500;
|
|
499
|
+
cursor: pointer;
|
|
500
|
+
font-family: inherit;
|
|
501
|
+
transition: opacity 0.15s;
|
|
502
|
+
white-space: nowrap;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.drinkfyi-search-btn:hover {
|
|
506
|
+
opacity: 0.9;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/* Search results list */
|
|
510
|
+
.drinkfyi-search-results {
|
|
511
|
+
padding: 0 16px 12px;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
.drinkfyi-result-item {
|
|
515
|
+
padding: 8px 0;
|
|
516
|
+
border-bottom: 1px solid var(--border);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.drinkfyi-result-item:last-child {
|
|
520
|
+
border-bottom: none;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
.drinkfyi-result-title {
|
|
524
|
+
font-size: 13px;
|
|
525
|
+
font-weight: 600;
|
|
526
|
+
color: var(--text);
|
|
527
|
+
margin: 0 0 3px 0;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.drinkfyi-result-meta {
|
|
531
|
+
font-size: 11px;
|
|
532
|
+
color: var(--muted);
|
|
533
|
+
display: flex;
|
|
534
|
+
align-items: center;
|
|
535
|
+
gap: 6px;
|
|
536
|
+
flex-wrap: wrap;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
/* \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
540
|
+
Powered by footer
|
|
541
|
+
\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
542
|
+
.drinkfyi-powered {
|
|
543
|
+
display: block;
|
|
544
|
+
text-align: center;
|
|
545
|
+
padding: 8px 16px;
|
|
546
|
+
font-size: 11px;
|
|
547
|
+
color: var(--muted);
|
|
548
|
+
border-top: 1px solid var(--border);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.drinkfyi-powered a {
|
|
552
|
+
color: var(--link);
|
|
553
|
+
text-decoration: none;
|
|
554
|
+
font-weight: 500;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.drinkfyi-powered a:hover {
|
|
558
|
+
text-decoration: underline;
|
|
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
|
+
Copy button
|
|
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
|
+
.drinkfyi-copy-btn {
|
|
565
|
+
background: var(--copy-bg);
|
|
566
|
+
color: var(--text);
|
|
567
|
+
border: none;
|
|
568
|
+
border-radius: 5px;
|
|
569
|
+
padding: 4px 9px;
|
|
570
|
+
font-size: 11px;
|
|
571
|
+
cursor: pointer;
|
|
572
|
+
display: inline-flex;
|
|
573
|
+
align-items: center;
|
|
574
|
+
gap: 4px;
|
|
575
|
+
transition: background 0.15s;
|
|
576
|
+
font-family: inherit;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.drinkfyi-copy-btn:hover {
|
|
580
|
+
background: var(--copy-hover);
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
.drinkfyi-copy-btn svg {
|
|
584
|
+
width: 11px;
|
|
585
|
+
height: 11px;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
${se(e)}
|
|
589
|
+
`}function p(t,e){let r=t.dataset.style||"modern",i=t.attachShadow({mode:"open"}),o=document.createElement("style");return o.textContent=ee(e.accent,r),i.appendChild(o),i}function oe(t){let e=t.dataset.theme||"light";return e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function g(t,e,r){let i=oe(e),o=e.dataset.size||"default",n=document.createElement("div");return n.className=["drinkfyi-widget",r].filter(Boolean).join(" "),n.setAttribute("data-theme",i),n.setAttribute("data-size",o),t.appendChild(n),e.dataset.theme==="auto"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",s=>{n.setAttribute("data-theme",s.matches?"dark":"light")}),n}function T(t){t.innerHTML=`
|
|
590
|
+
<div class="drinkfyi-loading">
|
|
591
|
+
<span class="drinkfyi-spinner"></span>
|
|
592
|
+
Loading\u2026
|
|
593
|
+
</div>
|
|
594
|
+
`}function u(t,e,r){t.innerHTML=`
|
|
595
|
+
<div class="drinkfyi-error">
|
|
596
|
+
<p>${e}</p>
|
|
597
|
+
<a href="https://${r.domain}" target="_blank" rel="noopener">
|
|
598
|
+
Visit ${r.name}
|
|
599
|
+
</a>
|
|
600
|
+
</div>
|
|
601
|
+
`}var x='<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 b(t){return`<span class="drinkfyi-powered">Powered by <a href="https://${t.domain}" target="_blank" rel="noopener">${t.name}</a></span>`}function D(t){return`drinkfyi_embed_${t}`}function de(t){try{let e=sessionStorage.getItem(D(t));if(!e)return null;let r=JSON.parse(e);return Date.now()-r.ts>3e5?(sessionStorage.removeItem(D(t)),null):r.data}catch(e){return null}}function le(t,e){try{let r={data:e,ts:Date.now()};sessionStorage.setItem(D(t),JSON.stringify(r))}catch(r){}}async function E(t,e,r){let i=t.endsWith("/")?t:t+"/",o=e.startsWith("/")?e.slice(1):e,n=new URL(o,i);r&&Object.entries(r).forEach(([h,c])=>n.searchParams.set(h,c));let s=n.toString(),a=de(s);if(a!==null)return a;let d=await fetch(s,{headers:{Accept:"application/json"}});if(!d.ok)throw new Error(`API error ${d.status}: ${s}`);let l=await d.json();return le(s,l),l}function te(t,e){if(document.querySelector('script[data-drinkfyi-snippet="recipe"]'))return;let r={"@context":"https://schema.org","@type":"Recipe",name:t.name,url:`https://${e}/${t.slug}/`};t.category&&(r.recipeCategory=t.category),t.ingredients&&t.ingredients.length>0&&(r.recipeIngredient=t.ingredients),t.prep_time_minutes&&(r.totalTime=`PT${t.prep_time_minutes}M`);let i=document.createElement("script");i.type="application/ld+json",i.setAttribute("data-drinkfyi-snippet","recipe"),i.textContent=JSON.stringify(r),document.head.appendChild(i)}function ie(t,e,r){if(document.querySelector('script[data-drinkfyi-snippet="term"]'))return;let i={"@context":"https://schema.org","@type":"DefinedTerm",name:t.name,description:t.definition,inDefinedTermSet:{"@type":"DefinedTermSet",name:`${r} Glossary`,url:`https://${e}/glossary/`}},o=document.createElement("script");o.type="application/ld+json",o.setAttribute("data-drinkfyi-snippet","term"),o.textContent=JSON.stringify(i),document.head.appendChild(o)}function re(t,e,r){if(document.querySelector('script[data-drinkfyi-snippet="faq"]'))return;let i={"@context":"https://schema.org","@type":"FAQPage",name:`${r} FAQ`,url:`https://${e}/faqs/`,mainEntity:[{"@type":"Question",name:t.question,acceptedAnswer:{"@type":"Answer",text:t.answer}}]},o=document.createElement("script");o.type="application/ld+json",o.setAttribute("data-drinkfyi-snippet","faq"),o.textContent=JSON.stringify(i),document.head.appendChild(o)}function M(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var ce={cocktailfyi:[{label:"Category",key:"category"},{label:"Glass",key:"glass"},{label:"Difficulty",key:"difficulty"},{label:"Prep Time",key:"prep_time_minutes"}],vinofyi:[{label:"Style",key:"style"},{label:"Region",key:"region"},{label:"Country",key:"country"}],beerfyi:[{label:"BJCP",key:"bjcp_code"},{label:"Category",key:"category_name"},{label:"ABV",key:"abv_range"},{label:"IBU",key:"ibu_range"},{label:"SRM",key:"srm_range"}],brewfyi:[{label:"Species",key:"species"},{label:"Country",key:"country"},{label:"Region",key:"region"}],whiskeyfyi:[{label:"Type",key:"type"},{label:"Distillery",key:"distillery"},{label:"Region",key:"region"},{label:"Country",key:"country"}],teafyi:[{label:"Category",key:"category"},{label:"Country",key:"country"},{label:"Region",key:"region"}],nihonshufyi:[{label:"Grade",key:"grade"},{label:"Rice",key:"rice"},{label:"Brewery",key:"brewery"}]},pe=[{label:"Category",key:"category"},{label:"Country",key:"country"}];function W(t,e){var a;let i=(a=t.dataset.slug)!=null?a:"";if(!i){let d=p(t,e),l=g(d,t);u(l,"Missing data-slug attribute.",e);return}let o=p(t,e),n=g(o,t);T(n);let s=`${e.entitySlug}/${i}/`;E(e.apiBase,s).then(d=>{ge(n,d,i,e,t)}).catch(()=>{u(n,`Unable to load "${M(i)}". Please try again later.`,e)})}function ge(t,e,r,i,o){var k,v,f,C,L,H,I,q,y;let n=e.name?M(String(e.name)):M(r),s=(L=(C=(f=(v=(k=e.category)!=null?k:e.style)!=null?v:e.type)!=null?f:e.grade)!=null?C:e.category_name)!=null?L:"",a=s?M(String(s)):"",d=(I=(H=e.description)!=null?H:e.excerpt)!=null?I:"",l=`https://${i.domain}/${i.entitySlug}/${r}/`,c=((q=ce[i.site])!=null?q:pe).filter(({key:w})=>{let m=e[w];return m!=null&&m!==""}).map(({label:w,key:m})=>{let $=e[m],S;Array.isArray($)?S=M($.join(", ")):S=M(String($));let F=m==="prep_time_minutes"?" min":"";return`
|
|
602
|
+
<div class="drinkfyi-kv-row">
|
|
603
|
+
<div class="drinkfyi-kv-key">${M(w)}</div>
|
|
604
|
+
<div class="drinkfyi-kv-value">${S}${F}</div>
|
|
605
|
+
</div>`}).join("");if(t.innerHTML=`
|
|
606
|
+
<div class="drinkfyi-header">
|
|
607
|
+
<div class="drinkfyi-header-text">
|
|
608
|
+
<p class="drinkfyi-title">${n}</p>
|
|
609
|
+
${a?`<p class="drinkfyi-subtitle">${a}</p>`:""}
|
|
610
|
+
</div>
|
|
611
|
+
${a?`<span class="drinkfyi-badge">${a}</span>`:""}
|
|
612
|
+
</div>
|
|
613
|
+
|
|
614
|
+
${c?`<div class="drinkfyi-kv-table">${c}</div>`:""}
|
|
615
|
+
|
|
616
|
+
${d?`<p class="drinkfyi-description">${M(d)}</p>`:""}
|
|
617
|
+
|
|
618
|
+
<div class="drinkfyi-actions">
|
|
619
|
+
<a class="drinkfyi-link" href="${l}" target="_blank" rel="noopener">
|
|
620
|
+
View on ${M(i.name)} ${x}
|
|
621
|
+
</a>
|
|
622
|
+
</div>
|
|
623
|
+
|
|
624
|
+
${b(i)}
|
|
625
|
+
`,i.site==="cocktailfyi"&&o.dataset.noSnippet!=="true"){let w=Array.isArray(e.ingredients)?e.ingredients.map(m=>String(m)):[];te({name:String((y=e.name)!=null?y:r),category:e.category?String(e.category):void 0,ingredients:w,prep_time_minutes:e.prep_time_minutes?Number(e.prep_time_minutes):void 0,slug:r},i.domain)}}function B(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var fe={cocktailfyi:[["Category","category"],["Glass","glass"],["Difficulty","difficulty"],["Prep Time","prep_time_minutes"],["ABV","abv"]],vinofyi:[["Style","style"],["Region","region"],["Country","country"],["Grape","grape"],["Vintage","vintage"]],beerfyi:[["BJCP","bjcp_code"],["Category","category_name"],["ABV","abv_range"],["IBU","ibu_range"],["SRM","srm_range"]],brewfyi:[["Species","species"],["Country","country"],["Region","region"],["Process","process"]],whiskeyfyi:[["Type","type"],["Distillery","distillery"],["Region","region"],["Country","country"],["Age","age_statement"]],teafyi:[["Category","category"],["Country","country"],["Region","region"],["Oxidation","oxidation_level"]],nihonshufyi:[["Grade","grade"],["Rice","rice"],["Brewery","brewery"],["Prefecture","prefecture"],["SMV","nihonshu_do"]]},ye=[["Category","category"],["Country","country"],["Region","region"]];function ue(t){return t==null||t===""?"\u2014":typeof t=="boolean"?t?"\u2713":"\u2717":Array.isArray(t)?t.join(", "):String(t)}function G(t,e){var a;let o=((a=t.dataset.slugs)!=null?a:"").split(",").map(d=>d.trim()).filter(Boolean);if(o.length<2){let d=p(t,e),l=g(d,t,"drinkfyi-compare-widget");u(l,'Provide at least 2 slugs in data-slugs="a,b"',e);return}let n=p(t,e),s=g(n,t,"drinkfyi-compare-widget");T(s),Promise.all(o.map(d=>E(e.apiBase,`${e.entitySlug}/${d}/`))).then(d=>{var v;let h=((v=fe[e.site])!=null?v:ye).filter(([,f])=>d.some(C=>C[f]!==null&&C[f]!==void 0&&C[f]!=="")),c=Math.floor(100/(d.length+1)),k=`
|
|
626
|
+
<div class="drinkfyi-header">
|
|
627
|
+
<div class="drinkfyi-header-text">
|
|
628
|
+
<p class="drinkfyi-title">Comparison</p>
|
|
629
|
+
<p class="drinkfyi-subtitle">${d.length} items \xB7 ${B(e.name)}</p>
|
|
630
|
+
</div>
|
|
631
|
+
</div>
|
|
632
|
+
<div class="drinkfyi-compare-scroll">
|
|
633
|
+
<table class="drinkfyi-compare-table">
|
|
634
|
+
<thead>
|
|
635
|
+
<tr>
|
|
636
|
+
<th class="drinkfyi-compare-th drinkfyi-compare-th--label" style="width:${c}%">Field</th>
|
|
637
|
+
${d.map(f=>`
|
|
638
|
+
<th class="drinkfyi-compare-th" style="width:${c}%">
|
|
639
|
+
<a href="https://${e.domain}/${e.entitySlug}/${B(f.slug)}/" target="_blank" rel="noopener" class="drinkfyi-compare-entity-link">
|
|
640
|
+
${B(String(f.name))}
|
|
641
|
+
${x}
|
|
642
|
+
</a>
|
|
643
|
+
</th>`).join("")}
|
|
644
|
+
</tr>
|
|
645
|
+
</thead>
|
|
646
|
+
<tbody>
|
|
647
|
+
${h.map(([f,C])=>`
|
|
648
|
+
<tr class="drinkfyi-compare-row">
|
|
649
|
+
<td class="drinkfyi-kv-key">${B(f)}</td>
|
|
650
|
+
${d.map(L=>`<td class="drinkfyi-compare-td">${B(ue(L[C]))}</td>`).join("")}
|
|
651
|
+
</tr>`).join("")}
|
|
652
|
+
</tbody>
|
|
653
|
+
</table>
|
|
654
|
+
</div>
|
|
655
|
+
${b(e)}
|
|
656
|
+
`;s.innerHTML=k}).catch(()=>{u(s,"Failed to load comparison data.",e)})}function R(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function N(t,e){var s;let i=(s=t.dataset.slug)!=null?s:"";if(!i){let a=p(t,e),d=g(a,t);u(d,"Missing data-slug attribute.",e);return}let o=p(t,e),n=g(o,t);T(n),E(e.apiBase,`glossary/${i}/`).then(a=>{me(n,a,e),t.dataset.noSnippet!=="true"&&ie({name:a.name,definition:a.definition},e.domain,e.name)}).catch(()=>{u(n,`Unable to load glossary term "${R(i)}". Please try again later.`,e)})}function me(t,e,r){let i=`https://${r.domain}/glossary/${e.slug}/`,o=`https://${r.domain}/glossary/`,n=e.category?R(e.category):"",s=e.related_terms&&e.related_terms.length>0?e.related_terms.map(a=>`<a class="drinkfyi-pill" href="https://${r.domain}/glossary/${R(a.slug)}/" target="_blank" rel="noopener">${R(a.name)}</a>`).join(""):"";t.innerHTML=`
|
|
657
|
+
<div class="drinkfyi-header">
|
|
658
|
+
<div class="drinkfyi-header-text">
|
|
659
|
+
<p class="drinkfyi-title">${R(e.name)}</p>
|
|
660
|
+
<p class="drinkfyi-subtitle">Glossary term${n?` \xB7 ${n}`:""}</p>
|
|
661
|
+
</div>
|
|
662
|
+
${n?`<span class="drinkfyi-badge">${n}</span>`:""}
|
|
663
|
+
</div>
|
|
664
|
+
|
|
665
|
+
<div class="drinkfyi-summary">
|
|
666
|
+
${R(e.definition)}
|
|
667
|
+
</div>
|
|
668
|
+
|
|
669
|
+
${s?`<div class="drinkfyi-pills-row">${s}</div>`:""}
|
|
670
|
+
|
|
671
|
+
<div class="drinkfyi-actions">
|
|
672
|
+
<a class="drinkfyi-link" href="${i}" target="_blank" rel="noopener">
|
|
673
|
+
${R(e.name)} ${x}
|
|
674
|
+
</a>
|
|
675
|
+
<a class="drinkfyi-link" href="${o}" target="_blank" rel="noopener">
|
|
676
|
+
Full glossary on ${R(r.name)} ${x}
|
|
677
|
+
</a>
|
|
678
|
+
</div>
|
|
679
|
+
|
|
680
|
+
${b(r)}
|
|
681
|
+
`}function z(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function U(t,e){var s;let i=(s=t.dataset.slug)!=null?s:"";if(!i){let a=p(t,e),d=g(a,t);u(d,"Missing data-slug attribute.",e);return}let o=p(t,e),n=g(o,t);T(n),E(e.apiBase,`faqs/${i}/`).then(a=>{he(n,a,e),t.dataset.noSnippet!=="true"&&re({question:a.question,answer:a.answer},e.domain,e.name)}).catch(()=>{u(n,`Unable to load FAQ "${z(i)}". Please try again later.`,e)})}function he(t,e,r){let i=`https://${r.domain}/faqs/${e.slug}/`,o=`https://${r.domain}/faqs/`,n=e.category?z(e.category):"";t.innerHTML=`
|
|
682
|
+
<div class="drinkfyi-header">
|
|
683
|
+
<div class="drinkfyi-header-text">
|
|
684
|
+
<p class="drinkfyi-title">${z(e.question)}</p>
|
|
685
|
+
<p class="drinkfyi-subtitle">Frequently Asked Question${n?` \xB7 ${n}`:""}</p>
|
|
686
|
+
</div>
|
|
687
|
+
</div>
|
|
688
|
+
|
|
689
|
+
<details class="drinkfyi-faq-details" open>
|
|
690
|
+
<summary class="drinkfyi-faq-summary">Answer</summary>
|
|
691
|
+
<div class="drinkfyi-summary">
|
|
692
|
+
${z(e.answer)}
|
|
693
|
+
</div>
|
|
694
|
+
</details>
|
|
695
|
+
|
|
696
|
+
<div class="drinkfyi-actions">
|
|
697
|
+
<a class="drinkfyi-link" href="${i}" target="_blank" rel="noopener">
|
|
698
|
+
Full answer ${x}
|
|
699
|
+
</a>
|
|
700
|
+
<a class="drinkfyi-link" href="${o}" target="_blank" rel="noopener">
|
|
701
|
+
More FAQs on ${z(r.name)} ${x}
|
|
702
|
+
</a>
|
|
703
|
+
</div>
|
|
704
|
+
|
|
705
|
+
${b(r)}
|
|
706
|
+
`}function A(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function O(t,e){var s;let i=(s=t.dataset.slug)!=null?s:"";if(!i){let a=p(t,e),d=g(a,t,"drinkfyi-guide-widget");u(d,"Missing data-slug attribute.",e);return}let o=p(t,e),n=g(o,t,"drinkfyi-guide-widget");T(n),E(e.apiBase,`guides/${i}/`).then(a=>{var v,f,C,L,H,I;let d=a.url?`https://${e.domain}${a.url}`:`https://${e.domain}/guides/${A(a.slug)}/`,l=(f=(v=a.excerpt)!=null?v:a.description)!=null?f:"",h=(L=(C=a.reading_time_minutes)!=null?C:a.reading_time)!=null?L:null,c=(I=(H=a.category_name)!=null?H:a.category)!=null?I:null,k=`
|
|
707
|
+
<div class="drinkfyi-guide-card">
|
|
708
|
+
<div class="drinkfyi-guide-header">
|
|
709
|
+
<div class="drinkfyi-guide-badges">
|
|
710
|
+
${c?`<span class="drinkfyi-badge">${A(c)}</span>`:""}
|
|
711
|
+
${h?`<span class="drinkfyi-badge drinkfyi-badge--time">${A(String(h))} min read</span>`:""}
|
|
712
|
+
</div>
|
|
713
|
+
<h3 class="drinkfyi-guide-title">${A(String(a.title))}</h3>
|
|
714
|
+
</div>
|
|
715
|
+
${l?`<p class="drinkfyi-guide-excerpt">${A(l)}</p>`:""}
|
|
716
|
+
<div class="drinkfyi-guide-footer">
|
|
717
|
+
<a href="${d}" target="_blank" rel="noopener" class="drinkfyi-guide-cta">
|
|
718
|
+
Read guide on ${A(e.name)}
|
|
719
|
+
${x}
|
|
720
|
+
</a>
|
|
721
|
+
</div>
|
|
722
|
+
</div>
|
|
723
|
+
${b(e)}
|
|
724
|
+
`;n.innerHTML=k}).catch(()=>{u(n,`Guide "${A(i)}" not found.`,e)})}function j(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var ke={cocktailfyi:"ingredients",vinofyi:"grapes",beerfyi:"hops",brewfyi:"varieties",whiskeyfyi:"casks",teafyi:"compounds",nihonshufyi:"rice"};function V(t,e){var a,d;let i=(a=t.dataset.slug)!=null?a:"";if(!i){let l=p(t,e),h=g(l,t);u(h,"Missing data-slug attribute.",e);return}let o=(d=ke[e.site])!=null?d:"ingredients",n=p(t,e),s=g(n,t);T(s),E(e.apiBase,`${o}/${i}/`).then(l=>{be(s,l,o,e)}).catch(()=>{u(s,`Unable to load "${j(i)}". Please try again later.`,e)})}function be(t,e,r,i){var h,c,k,v,f;let o=j(e.name),n=(c=(h=e.category)!=null?h:e.type)!=null?c:"",s=n?j(String(n)):"",a=(k=e.description)!=null?k:"",d=(f=(v=e.origin)!=null?v:e.country)!=null?f:"",l=`https://${i.domain}/${r}/${e.slug}/`;t.innerHTML=`
|
|
725
|
+
<div class="drinkfyi-header">
|
|
726
|
+
<div class="drinkfyi-header-text">
|
|
727
|
+
<p class="drinkfyi-title">${o}</p>
|
|
728
|
+
${s?`<p class="drinkfyi-subtitle">${s}</p>`:""}
|
|
729
|
+
</div>
|
|
730
|
+
${s?`<span class="drinkfyi-badge">${s}</span>`:""}
|
|
731
|
+
</div>
|
|
732
|
+
|
|
733
|
+
${d?`<div class="drinkfyi-kv-table">
|
|
734
|
+
<div class="drinkfyi-kv-row">
|
|
735
|
+
<div class="drinkfyi-kv-key">Origin</div>
|
|
736
|
+
<div class="drinkfyi-kv-value">${j(String(d))}</div>
|
|
737
|
+
</div>
|
|
738
|
+
</div>`:""}
|
|
739
|
+
|
|
740
|
+
${a?`<p class="drinkfyi-description">${j(a)}</p>`:""}
|
|
741
|
+
|
|
742
|
+
<div class="drinkfyi-actions">
|
|
743
|
+
<a class="drinkfyi-link" href="${l}" target="_blank" rel="noopener">
|
|
744
|
+
View on ${j(i.name)} ${x}
|
|
745
|
+
</a>
|
|
746
|
+
</div>
|
|
747
|
+
|
|
748
|
+
${b(i)}
|
|
749
|
+
`}function _(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var ve=new Set(["cocktailfyi","vinofyi"]);function Q(t,e){var a;let i=(a=t.dataset.food)!=null?a:"",o=p(t,e),n=g(o,t,"drinkfyi-pairing-widget");if(!ve.has(e.site)){n.innerHTML=`
|
|
750
|
+
<div class="drinkfyi-header">
|
|
751
|
+
<div class="drinkfyi-header-text">
|
|
752
|
+
<p class="drinkfyi-title">Food Pairings</p>
|
|
753
|
+
<p class="drinkfyi-subtitle">Beverage pairing guide</p>
|
|
754
|
+
</div>
|
|
755
|
+
</div>
|
|
756
|
+
<div class="drinkfyi-summary">
|
|
757
|
+
Food pairings are available on
|
|
758
|
+
<a href="https://cocktailfyi.com/" target="_blank" rel="noopener">CocktailFYI</a>
|
|
759
|
+
and
|
|
760
|
+
<a href="https://vinofyi.com/" target="_blank" rel="noopener">VinoFYI</a>.
|
|
761
|
+
</div>
|
|
762
|
+
${b(e)}
|
|
763
|
+
`;return}if(!i){u(n,"Missing data-food attribute.",e);return}T(n);let s=e.site==="vinofyi"?`foods/${i}/`:`cocktails/?pairing=${encodeURIComponent(i)}&limit=5`;E(e.apiBase,s).then(d=>{xe(n,d,i,e)}).catch(()=>{u(n,`Unable to load pairing suggestions for "${_(i)}". Please try again later.`,e)})}function xe(t,e,r,i){var a,d;let o=_(String((d=(a=e.name)!=null?a:e.food)!=null?d:r)),n=Array.isArray(e.pairings)?e.pairings:Array.isArray(e.results)?e.results:[];if(n.length===0){t.innerHTML=`
|
|
764
|
+
<div class="drinkfyi-header">
|
|
765
|
+
<div class="drinkfyi-header-text">
|
|
766
|
+
<p class="drinkfyi-title">Pairings for ${o}</p>
|
|
767
|
+
<p class="drinkfyi-subtitle">${_(i.name)}</p>
|
|
768
|
+
</div>
|
|
769
|
+
</div>
|
|
770
|
+
<div class="drinkfyi-summary">
|
|
771
|
+
No pairing suggestions found for "${o}".
|
|
772
|
+
<a href="https://${i.domain}/" target="_blank" rel="noopener">Browse ${_(i.name)}</a>
|
|
773
|
+
for more options.
|
|
774
|
+
</div>
|
|
775
|
+
${b(i)}
|
|
776
|
+
`;return}let s=n.map(l=>{var k,v;let h=l.url?`https://${i.domain}${l.url}`:`https://${i.domain}/${i.entitySlug}/${_(l.slug)}/`,c=(v=(k=l.pairing_notes)!=null?k:l.description)!=null?v:"";return`
|
|
777
|
+
<div class="drinkfyi-pairing-item">
|
|
778
|
+
<a class="drinkfyi-pairing-name" href="${h}" target="_blank" rel="noopener">
|
|
779
|
+
${_(l.name)}
|
|
780
|
+
${x}
|
|
781
|
+
</a>
|
|
782
|
+
${c?`<p class="drinkfyi-pairing-note">${_(c)}</p>`:""}
|
|
783
|
+
</div>`}).join("");t.innerHTML=`
|
|
784
|
+
<div class="drinkfyi-header">
|
|
785
|
+
<div class="drinkfyi-header-text">
|
|
786
|
+
<p class="drinkfyi-title">Pairings for ${o}</p>
|
|
787
|
+
<p class="drinkfyi-subtitle">${n.length} suggestion${n.length!==1?"s":""} \xB7 ${_(i.name)}</p>
|
|
788
|
+
</div>
|
|
789
|
+
</div>
|
|
790
|
+
|
|
791
|
+
<div class="drinkfyi-pairing-list">
|
|
792
|
+
${s}
|
|
793
|
+
</div>
|
|
794
|
+
|
|
795
|
+
<div class="drinkfyi-actions">
|
|
796
|
+
<a class="drinkfyi-link" href="https://${i.domain}/" target="_blank" rel="noopener">
|
|
797
|
+
Explore ${_(i.name)} ${x}
|
|
798
|
+
</a>
|
|
799
|
+
</div>
|
|
800
|
+
|
|
801
|
+
${b(i)}
|
|
802
|
+
`}function P(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var we={cocktail:"Cocktail",wine:"Wine",beer:"Beer Style",coffee:"Coffee",whiskey:"Whiskey",tea:"Tea",sake:"Sake",ingredient:"Ingredient",grape:"Grape",hop:"Hop",glossary:"Glossary",guide:"Guide",faq:"FAQ"},$e='<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 K(t,e){var q;let i=(q=t.dataset.placeholder)!=null?q:`Search ${e.entityName}\u2026`,o=p(t,e),n=g(o,t,"drinkfyi-search-widget"),s=!1,a="",d=[],l=-1,h=null;n.innerHTML=`
|
|
803
|
+
<div class="drinkfyi-search-wrap">
|
|
804
|
+
<div class="drinkfyi-search-form">
|
|
805
|
+
<span class="drinkfyi-search-icon" aria-hidden="true">${$e}</span>
|
|
806
|
+
<input
|
|
807
|
+
class="drinkfyi-search-input"
|
|
808
|
+
type="search"
|
|
809
|
+
autocomplete="off"
|
|
810
|
+
spellcheck="false"
|
|
811
|
+
placeholder="${P(i)}"
|
|
812
|
+
aria-label="Search ${P(e.name)}"
|
|
813
|
+
aria-autocomplete="list"
|
|
814
|
+
aria-expanded="false"
|
|
815
|
+
role="combobox"
|
|
816
|
+
>
|
|
817
|
+
</div>
|
|
818
|
+
<div class="drinkfyi-search-dropdown" role="listbox" hidden></div>
|
|
819
|
+
</div>
|
|
820
|
+
${b(e)}
|
|
821
|
+
`;let c=n.querySelector(".drinkfyi-search-input"),k=n.querySelector(".drinkfyi-search-dropdown");function v(){return Array.from(k.querySelectorAll(".drinkfyi-search-result-item"))}function f(y){v().forEach((m,$)=>{$===y?m.classList.add("drinkfyi-search-result-item--active"):m.classList.remove("drinkfyi-search-result-item--active")}),l=y}function C(){s=!0,k.hidden=!1,c.setAttribute("aria-expanded","true")}function L(){s=!1,k.hidden=!0,c.setAttribute("aria-expanded","false"),l=-1}function H(){var w,m,$;if(d.length===0){k.innerHTML=`
|
|
822
|
+
<div class="drinkfyi-search-empty">
|
|
823
|
+
No results for <strong>${P(a)}</strong>
|
|
824
|
+
</div>
|
|
825
|
+
`;return}let y="";for(let S of d){let F=S.type?(w=we[S.type])!=null?w:S.type:null,Y=($=(m=S.description)!=null?m:S.excerpt)!=null?$:"",ae=S.url?`https://${e.domain}${S.url}`:`https://${e.domain}/${e.entitySlug}/${P(S.slug)}/`;y+=`
|
|
826
|
+
<a
|
|
827
|
+
class="drinkfyi-search-result-item"
|
|
828
|
+
href="${ae}"
|
|
829
|
+
target="_blank"
|
|
830
|
+
rel="noopener"
|
|
831
|
+
role="option"
|
|
832
|
+
tabindex="-1"
|
|
833
|
+
>
|
|
834
|
+
<div class="drinkfyi-search-result-row">
|
|
835
|
+
<span class="drinkfyi-result-title">${P(S.name)}</span>
|
|
836
|
+
${F?`<span class="drinkfyi-badge">${P(F)}</span>`:""}
|
|
837
|
+
</div>
|
|
838
|
+
${Y?`<div class="drinkfyi-result-meta">${P(Y)}</div>`:""}
|
|
839
|
+
</a>
|
|
840
|
+
`}k.innerHTML=y}async function I(y){var m;if(!y.trim()){L();return}let w=`https://${e.domain}/api/v1/search/?q=${encodeURIComponent(y)}`;try{let $=await fetch(w,{headers:{Accept:"application/json"}});if(!$.ok)throw new Error(`Search failed: ${$.status}`);d=(m=(await $.json()).results)!=null?m:[]}catch($){d=[]}H(),C(),f(-1)}c.addEventListener("input",()=>{if(a=c.value,h!==null&&clearTimeout(h),!a.trim()){L();return}h=setTimeout(()=>{I(a)},300)}),c.addEventListener("keydown",y=>{if(!s)return;let w=v(),m=w.length;if(y.key==="ArrowDown")y.preventDefault(),f(l<m-1?l+1:0);else if(y.key==="ArrowUp")y.preventDefault(),f(l>0?l-1:m-1);else if(y.key==="Enter")if(y.preventDefault(),l>=0&&w[l])w[l].click();else{let $=`https://${e.domain}${e.searchPath}?q=${encodeURIComponent(a)}`;window.open($,"_blank","noopener")}else y.key==="Escape"&&(L(),c.blur())}),document.addEventListener("click",y=>{s&&(t.contains(y.target)||L())})}function Se(t,e,r){let i=t.dataset.style||"modern";switch(e){case"recipe":W(t,r);break;case"compare":G(t,r);break;case"glossary":N(t,r);break;case"faq":U(t,r);break;case"guide":O(t,r);break;case"ingredient":V(t,r);break;case"pairing":Q(t,r);break;case"search":K(t,r);break;default:break}}function Te(t,e){if("IntersectionObserver"in window){let r=new IntersectionObserver(i=>{i.forEach(o=>{o.isIntersecting&&(r.unobserve(t),e())})},{rootMargin:"200px"});r.observe(t)}else e()}function J(t,e){if(t.shadowRoot)return;let i=e.attribute.replace("data-","").replace(/-([a-z])/g,(n,s)=>s.toUpperCase()),o=t.dataset[i];o&&Te(t,()=>{t.shadowRoot||Se(t,o,e)})}function ne(t){document.querySelectorAll(`[${t.attribute}]`).forEach(e=>J(e,t))}(function(){let e='{"site":"vinofyi","name":"VinoFYI","domain":"vinofyi.com","accent":"#7F1D1D","attribute":"data-vinofyi","apiBase":"https://vinofyi.com/api/v1/","searchPath":"/search/","entityName":"Wines","entitySlug":"wines"}';document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>ne(e)):ne(e),new MutationObserver(i=>{i.forEach(o=>{o.addedNodes.forEach(n=>{var a;if(n.nodeType!==Node.ELEMENT_NODE)return;let s=n;s.hasAttribute(e.attribute)&&J(s,e),(a=s.querySelectorAll)==null||a.call(s,`[${e.attribute}]`).forEach(d=>J(d,e))})})}).observe(document.body||document.documentElement,{childList:!0,subtree:!0})})();function Ee(t,e,r){let i=[...r,"theme","style-variant","size"];return class extends HTMLElement{static get observedAttributes(){return i}connectedCallback(){this.shadowRoot||(this._syncDataAttrs(),e(this,'{"site":"vinofyi","name":"VinoFYI","domain":"vinofyi.com","accent":"#7F1D1D","attribute":"data-vinofyi","apiBase":"https://vinofyi.com/api/v1/","searchPath":"/search/","entityName":"Wines","entitySlug":"wines"}'))}attributeChangedCallback(o,n,s){if(n===s||!this.shadowRoot)return;let a=this.shadowRoot;for(;a.firstChild;)a.firstChild.remove();this._syncDataAttrs(),e(this,'{"site":"vinofyi","name":"VinoFYI","domain":"vinofyi.com","accent":"#7F1D1D","attribute":"data-vinofyi","apiBase":"https://vinofyi.com/api/v1/","searchPath":"/search/","entityName":"Wines","entitySlug":"wines"}')}_syncDataAttrs(){let o='{"site":"vinofyi","name":"VinoFYI","domain":"vinofyi.com","accent":"#7F1D1D","attribute":"data-vinofyi","apiBase":"https://vinofyi.com/api/v1/","searchPath":"/search/","entityName":"Wines","entitySlug":"wines"}'.attribute.replace("data-","");this.dataset[o]=t;for(let d of r){let l=this.getAttribute(d);l!==null&&(this.dataset[d]=l)}let n=this.getAttribute("theme");n!==null&&(this.dataset.theme=n);let s=this.getAttribute("style-variant");s!==null&&(this.dataset.style=s);let a=this.getAttribute("size");a!==null&&(this.dataset.size=a)}}}(function(){if(typeof customElements=="undefined")return;let e='{"site":"vinofyi","name":"VinoFYI","domain":"vinofyi.com","accent":"#7F1D1D","attribute":"data-vinofyi","apiBase":"https://vinofyi.com/api/v1/","searchPath":"/search/","entityName":"Wines","entitySlug":"wines"}'.site,r=[[`${e}-recipe`,W,["slug"]],[`${e}-compare`,G,["slugs"]],[`${e}-glossary`,N,["slug","letter"]],[`${e}-faq`,U,["slug","category"]],[`${e}-guide`,O,["slug"]],[`${e}-ingredient`,V,["slug"]],[`${e}-pairing`,Q,["slug"]],[`${e}-search`,K,["placeholder","query"]]];for(let[i,o,n]of r)if(!customElements.get(i)){let s=i.slice(e.length+1);customElements.define(i,Ee(s,o,n))}})();})();
|