peasy-seo-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 +285 -0
- package/dist/embed.esm.js +2856 -0
- package/dist/embed.min.js +1880 -0
- package/dist/index.d.ts +15 -0
- package/package.json +41 -0
|
@@ -0,0 +1,1880 @@
|
|
|
1
|
+
/* peasy-seo-embed v1.0.0 | MIT | https://widget.peasyseo.com */
|
|
2
|
+
"use strict";(()=>{var w={name:"PeasySEO",slug:"seo",domain:"peasyseo.com",apiBase:"https://peasyseo.com/api/v1",embedBase:"https://peasyseo.com/embed",accent:"#22C55E",attribute:"data-peasy-seo",siteWidgets:[]};function B(t){return`
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
6
|
+
--site-accent: ${t};
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* \u2500\u2500\u2500 Light theme \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
10
|
+
.peasy-widget[data-theme="light"] {
|
|
11
|
+
--bg: #ffffff;
|
|
12
|
+
--text: #1a1a1a;
|
|
13
|
+
--border: #e5e7eb;
|
|
14
|
+
--accent: var(--site-accent);
|
|
15
|
+
--muted: #6b7280;
|
|
16
|
+
--ribbon: #f9fafb;
|
|
17
|
+
--badge-bg: #f3f4f6;
|
|
18
|
+
--badge-text: #374151;
|
|
19
|
+
--link: var(--site-accent);
|
|
20
|
+
--copy-bg: #f3f4f6;
|
|
21
|
+
--copy-hover: #e5e7eb;
|
|
22
|
+
--input-bg: #ffffff;
|
|
23
|
+
--input-border: #d1d5db;
|
|
24
|
+
--input-focus: var(--site-accent);
|
|
25
|
+
--shadow: 0 1px 3px rgba(0,0,0,0.08);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* \u2500\u2500\u2500 Dark theme \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
29
|
+
.peasy-widget[data-theme="dark"] {
|
|
30
|
+
--bg: #18181b;
|
|
31
|
+
--text: #f4f4f5;
|
|
32
|
+
--border: #3f3f46;
|
|
33
|
+
--accent: var(--site-accent);
|
|
34
|
+
--muted: #a1a1aa;
|
|
35
|
+
--ribbon: #111112;
|
|
36
|
+
--badge-bg: #3f3f46;
|
|
37
|
+
--badge-text: #d4d4d8;
|
|
38
|
+
--link: #93c5fd;
|
|
39
|
+
--copy-bg: #3f3f46;
|
|
40
|
+
--copy-hover: #52525b;
|
|
41
|
+
--input-bg: #111112;
|
|
42
|
+
--input-border: #52525b;
|
|
43
|
+
--input-focus: var(--site-accent);
|
|
44
|
+
--shadow: 0 1px 3px rgba(0,0,0,0.4);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* \u2500\u2500\u2500 Sepia theme \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
48
|
+
.peasy-widget[data-theme="sepia"] {
|
|
49
|
+
--bg: #f5f0e8;
|
|
50
|
+
--text: #3d3529;
|
|
51
|
+
--border: #d4c5a9;
|
|
52
|
+
--accent: var(--site-accent);
|
|
53
|
+
--muted: #8b7e6a;
|
|
54
|
+
--ribbon: #ede8df;
|
|
55
|
+
--badge-bg: #e8e0d0;
|
|
56
|
+
--badge-text: #5c4f3d;
|
|
57
|
+
--link: #7c5c3b;
|
|
58
|
+
--copy-bg: #e8e0d0;
|
|
59
|
+
--copy-hover: #ddd4c0;
|
|
60
|
+
--input-bg: #f5f0e8;
|
|
61
|
+
--input-border: #c4b49a;
|
|
62
|
+
--input-focus: var(--site-accent);
|
|
63
|
+
--shadow: 0 1px 3px rgba(61,53,41,0.12);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* \u2500\u2500\u2500 Auto theme (follows OS preference) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
67
|
+
@media (prefers-color-scheme: dark) {
|
|
68
|
+
.peasy-widget[data-theme="auto"] {
|
|
69
|
+
--bg: #18181b;
|
|
70
|
+
--text: #f4f4f5;
|
|
71
|
+
--border: #3f3f46;
|
|
72
|
+
--accent: var(--site-accent);
|
|
73
|
+
--muted: #a1a1aa;
|
|
74
|
+
--ribbon: #111112;
|
|
75
|
+
--badge-bg: #3f3f46;
|
|
76
|
+
--badge-text: #d4d4d8;
|
|
77
|
+
--link: #93c5fd;
|
|
78
|
+
--copy-bg: #3f3f46;
|
|
79
|
+
--copy-hover: #52525b;
|
|
80
|
+
--input-bg: #111112;
|
|
81
|
+
--input-border: #52525b;
|
|
82
|
+
--input-focus: var(--site-accent);
|
|
83
|
+
--shadow: 0 1px 3px rgba(0,0,0,0.4);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@media (prefers-color-scheme: light) {
|
|
88
|
+
.peasy-widget[data-theme="auto"] {
|
|
89
|
+
--bg: #ffffff;
|
|
90
|
+
--text: #1a1a1a;
|
|
91
|
+
--border: #e5e7eb;
|
|
92
|
+
--accent: var(--site-accent);
|
|
93
|
+
--muted: #6b7280;
|
|
94
|
+
--ribbon: #f9fafb;
|
|
95
|
+
--badge-bg: #f3f4f6;
|
|
96
|
+
--badge-text: #374151;
|
|
97
|
+
--link: var(--site-accent);
|
|
98
|
+
--copy-bg: #f3f4f6;
|
|
99
|
+
--copy-hover: #e5e7eb;
|
|
100
|
+
--input-bg: #ffffff;
|
|
101
|
+
--input-border: #d1d5db;
|
|
102
|
+
--input-focus: var(--site-accent);
|
|
103
|
+
--shadow: 0 1px 3px rgba(0,0,0,0.08);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/* \u2500\u2500\u2500 Base widget \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
108
|
+
.peasy-widget {
|
|
109
|
+
box-sizing: border-box;
|
|
110
|
+
border-radius: 8px;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
border: 1px solid var(--border);
|
|
113
|
+
border-left: 3px solid var(--accent);
|
|
114
|
+
background: var(--bg);
|
|
115
|
+
color: var(--text);
|
|
116
|
+
font-size: 14px;
|
|
117
|
+
line-height: 1.6;
|
|
118
|
+
transition: border-color 0.2s;
|
|
119
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.peasy-widget *, .peasy-widget *::before, .peasy-widget *::after {
|
|
123
|
+
box-sizing: border-box;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* \u2500\u2500\u2500 Size variants \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
127
|
+
.peasy-widget[data-size="compact"] {
|
|
128
|
+
max-width: 280px;
|
|
129
|
+
font-size: 13px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.peasy-widget[data-size="default"] {
|
|
133
|
+
max-width: 480px;
|
|
134
|
+
font-size: 14px;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.peasy-widget[data-size="large"] {
|
|
138
|
+
max-width: 720px;
|
|
139
|
+
font-size: 14px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* \u2500\u2500\u2500 Loading skeleton \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
143
|
+
.peasy-loading {
|
|
144
|
+
padding: 20px 16px;
|
|
145
|
+
text-align: center;
|
|
146
|
+
color: var(--muted);
|
|
147
|
+
font-size: 13px;
|
|
148
|
+
display: flex;
|
|
149
|
+
align-items: center;
|
|
150
|
+
justify-content: center;
|
|
151
|
+
gap: 8px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.peasy-spinner {
|
|
155
|
+
width: 16px;
|
|
156
|
+
height: 16px;
|
|
157
|
+
border: 2px solid var(--border);
|
|
158
|
+
border-top-color: var(--accent);
|
|
159
|
+
border-radius: 50%;
|
|
160
|
+
animation: peasy-spin 0.7s linear infinite;
|
|
161
|
+
display: inline-block;
|
|
162
|
+
flex-shrink: 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
@keyframes peasy-spin {
|
|
166
|
+
to { transform: rotate(360deg); }
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* \u2500\u2500\u2500 Error state \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
170
|
+
.peasy-error {
|
|
171
|
+
padding: 16px;
|
|
172
|
+
color: var(--muted);
|
|
173
|
+
font-size: 13px;
|
|
174
|
+
text-align: center;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.peasy-error a {
|
|
178
|
+
color: var(--link);
|
|
179
|
+
text-decoration: none;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.peasy-error a:hover {
|
|
183
|
+
text-decoration: underline;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* \u2500\u2500\u2500 Powered by footer \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
187
|
+
.peasy-powered {
|
|
188
|
+
display: block;
|
|
189
|
+
text-align: center;
|
|
190
|
+
padding: 8px 16px;
|
|
191
|
+
font-size: 11px;
|
|
192
|
+
color: var(--muted);
|
|
193
|
+
border-top: 1px solid var(--border);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.peasy-powered a {
|
|
197
|
+
color: var(--link);
|
|
198
|
+
text-decoration: none;
|
|
199
|
+
font-weight: 500;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.peasy-powered a:hover {
|
|
203
|
+
text-decoration: underline;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* \u2500\u2500\u2500 Button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
207
|
+
.peasy-btn {
|
|
208
|
+
background: var(--accent);
|
|
209
|
+
color: #fff;
|
|
210
|
+
border: none;
|
|
211
|
+
border-radius: 6px;
|
|
212
|
+
padding: 8px 16px;
|
|
213
|
+
font-size: 14px;
|
|
214
|
+
font-weight: 500;
|
|
215
|
+
cursor: pointer;
|
|
216
|
+
font-family: inherit;
|
|
217
|
+
transition: opacity 0.15s;
|
|
218
|
+
white-space: nowrap;
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
align-items: center;
|
|
221
|
+
gap: 5px;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.peasy-btn:hover {
|
|
225
|
+
opacity: 0.88;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.peasy-btn svg {
|
|
229
|
+
width: 14px;
|
|
230
|
+
height: 14px;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/* \u2500\u2500\u2500 Copy button \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
234
|
+
.peasy-copy-btn {
|
|
235
|
+
background: var(--copy-bg);
|
|
236
|
+
color: var(--text);
|
|
237
|
+
border: none;
|
|
238
|
+
border-radius: 5px;
|
|
239
|
+
padding: 5px 10px;
|
|
240
|
+
font-size: 12px;
|
|
241
|
+
cursor: pointer;
|
|
242
|
+
display: inline-flex;
|
|
243
|
+
align-items: center;
|
|
244
|
+
gap: 5px;
|
|
245
|
+
transition: background 0.15s;
|
|
246
|
+
font-family: inherit;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.peasy-copy-btn:hover {
|
|
250
|
+
background: var(--copy-hover);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.peasy-copy-btn svg {
|
|
254
|
+
width: 13px;
|
|
255
|
+
height: 13px;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* \u2500\u2500\u2500 Badge (inline) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
259
|
+
.peasy-badge {
|
|
260
|
+
display: inline-flex;
|
|
261
|
+
align-items: center;
|
|
262
|
+
gap: 4px;
|
|
263
|
+
font-size: 11px;
|
|
264
|
+
font-weight: 500;
|
|
265
|
+
padding: 2px 8px;
|
|
266
|
+
border-radius: 4px;
|
|
267
|
+
background: var(--badge-bg);
|
|
268
|
+
color: var(--badge-text);
|
|
269
|
+
text-transform: uppercase;
|
|
270
|
+
letter-spacing: 0.04em;
|
|
271
|
+
border-left: 3px solid var(--accent);
|
|
272
|
+
font-family: inherit;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/* \u2500\u2500\u2500 Content area \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
276
|
+
.peasy-body {
|
|
277
|
+
padding: 14px 16px 12px;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
.peasy-widget[data-size="compact"] .peasy-body {
|
|
281
|
+
padding: 10px 12px;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* \u2500\u2500\u2500 Title / subtitle \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
285
|
+
.peasy-title {
|
|
286
|
+
font-size: 16px;
|
|
287
|
+
font-weight: 700;
|
|
288
|
+
color: var(--text);
|
|
289
|
+
margin: 0 0 4px 0;
|
|
290
|
+
line-height: 1.3;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
.peasy-subtitle {
|
|
294
|
+
font-size: 13px;
|
|
295
|
+
color: var(--muted);
|
|
296
|
+
margin: 0 0 10px 0;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.peasy-summary {
|
|
300
|
+
font-size: 14px;
|
|
301
|
+
color: var(--text);
|
|
302
|
+
margin: 0;
|
|
303
|
+
line-height: 1.65;
|
|
304
|
+
display: -webkit-box;
|
|
305
|
+
-webkit-line-clamp: 4;
|
|
306
|
+
-webkit-box-orient: vertical;
|
|
307
|
+
overflow: hidden;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* \u2500\u2500\u2500 Actions row \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
311
|
+
.peasy-actions {
|
|
312
|
+
display: flex;
|
|
313
|
+
align-items: center;
|
|
314
|
+
justify-content: space-between;
|
|
315
|
+
gap: 8px;
|
|
316
|
+
padding: 10px 16px;
|
|
317
|
+
border-top: 1px solid var(--border);
|
|
318
|
+
background: var(--bg);
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.peasy-widget[data-size="compact"] .peasy-actions {
|
|
322
|
+
padding: 8px 12px;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/* \u2500\u2500\u2500 Link \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\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
|
+
.peasy-link {
|
|
327
|
+
font-size: 12px;
|
|
328
|
+
font-weight: 500;
|
|
329
|
+
color: var(--link);
|
|
330
|
+
text-decoration: none;
|
|
331
|
+
display: inline-flex;
|
|
332
|
+
align-items: center;
|
|
333
|
+
gap: 4px;
|
|
334
|
+
transition: opacity 0.15s;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.peasy-link:hover {
|
|
338
|
+
opacity: 0.8;
|
|
339
|
+
text-decoration: underline;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.peasy-link svg {
|
|
343
|
+
width: 12px;
|
|
344
|
+
height: 12px;
|
|
345
|
+
flex-shrink: 0;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/* \u2500\u2500\u2500 Search box \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
349
|
+
.peasy-search-wrap {
|
|
350
|
+
padding: 14px 16px;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.peasy-search-form {
|
|
354
|
+
display: flex;
|
|
355
|
+
gap: 8px;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.peasy-search-input {
|
|
359
|
+
flex: 1;
|
|
360
|
+
padding: 8px 12px;
|
|
361
|
+
border: 1px solid var(--input-border);
|
|
362
|
+
border-radius: 6px;
|
|
363
|
+
background: var(--input-bg);
|
|
364
|
+
color: var(--text);
|
|
365
|
+
font-size: 14px;
|
|
366
|
+
font-family: inherit;
|
|
367
|
+
outline: none;
|
|
368
|
+
transition: border-color 0.15s;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.peasy-search-input:focus {
|
|
372
|
+
border-color: var(--input-focus);
|
|
373
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.peasy-search-input::placeholder {
|
|
377
|
+
color: var(--muted);
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* \u2500\u2500\u2500 Meta row (badges, stats) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
381
|
+
.peasy-meta {
|
|
382
|
+
display: flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
flex-wrap: wrap;
|
|
385
|
+
gap: 6px;
|
|
386
|
+
margin-bottom: 10px;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.peasy-stat {
|
|
390
|
+
display: inline-flex;
|
|
391
|
+
align-items: center;
|
|
392
|
+
gap: 4px;
|
|
393
|
+
font-size: 12px;
|
|
394
|
+
color: var(--muted);
|
|
395
|
+
background: var(--badge-bg);
|
|
396
|
+
border-radius: 4px;
|
|
397
|
+
padding: 3px 8px;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
/* \u2500\u2500\u2500 Fade-in animation \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
401
|
+
@keyframes peasy-fade-in {
|
|
402
|
+
from { opacity: 0; transform: translateY(4px); }
|
|
403
|
+
to { opacity: 1; transform: translateY(0); }
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.peasy-widget {
|
|
407
|
+
animation: peasy-fade-in 0.2s ease-out;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/* \u2500\u2500\u2500 Reduced motion \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
411
|
+
@media (prefers-reduced-motion: reduce) {
|
|
412
|
+
.peasy-widget {
|
|
413
|
+
animation: none;
|
|
414
|
+
}
|
|
415
|
+
.peasy-spinner {
|
|
416
|
+
animation: none;
|
|
417
|
+
border-top-color: var(--accent);
|
|
418
|
+
opacity: 0.6;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
`}function u(t,e){let r=t.attachShadow({mode:"open"}),n=document.createElement("style");return n.textContent=B(e.accent),r.appendChild(n),r}function x(t,e,r){let n=A(e),o=document.createElement("div");return o.className=["peasy-widget",r].filter(Boolean).join(" "),o.setAttribute("data-theme",n.theme),o.setAttribute("data-size",n.size),t.appendChild(o),o}function A(t){let e=t.dataset,r=e.theme||"light",n=e.size||"default",o=e.lang||"en",i=e.track==="true";return{theme:r,size:n,lang:o,track:i}}function T(t){t.innerHTML=`
|
|
422
|
+
<div class="peasy-loading">
|
|
423
|
+
<span class="peasy-spinner"></span>
|
|
424
|
+
Loading\u2026
|
|
425
|
+
</div>
|
|
426
|
+
`}function L(t,e,r){t.innerHTML=`
|
|
427
|
+
<div class="peasy-error">
|
|
428
|
+
<p>${s(e)}</p>
|
|
429
|
+
<a href="https://${r.domain}" target="_blank" rel="noopener">
|
|
430
|
+
Visit ${s(r.name)} ${k}
|
|
431
|
+
</a>
|
|
432
|
+
</div>
|
|
433
|
+
`}function m(t){return`<span class="peasy-powered">Powered by <a href="https://${t.domain}" target="_blank" rel="noopener">${s(t.name)}</a></span>`}function E(t,e){t.onclick=()=>{var r;(r=navigator.clipboard)==null||r.writeText(e).then(()=>{t.innerHTML=`${N} Copied!`,setTimeout(()=>{t.innerHTML=`${M} Copy`},2e3)}).catch(()=>{we(e),t.innerHTML=`${N} Copied!`,setTimeout(()=>{t.innerHTML=`${M} Copy`},2e3)})}}function we(t){let e=document.createElement("textarea");e.value=t,e.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none",document.body.appendChild(e);try{e.select(),document.execCommand("copy")}finally{document.body.removeChild(e)}}function s(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var k='<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="12" height="12"><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>',M='<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="13" height="13"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',N='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" width="13" height="13"><polyline points="20 6 9 17 4 12"/></svg>',z='<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"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',P='<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>',I='<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"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>',W='<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"><path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"/></svg>';var O=null,U=new Map,G=new WeakSet;function $e(){return O||(O=new IntersectionObserver(t=>{t.forEach(e=>{if(e.isIntersecting){O.unobserve(e.target);let r=U.get(e.target);U.delete(e.target),r==null||r()}})},{rootMargin:"200px"})),O}function F(t,e){if(!G.has(t)){if(G.add(t),!("IntersectionObserver"in window)){e();return}U.set(t,e),$e().observe(t)}}var q=new Map,ke=5*60*1e3,Ce=24*60*60*1e3,K=4,D=0,j=[];function Se(t){try{let e=localStorage.getItem(`peasy:${t}`);if(!e)return null;let{data:r,ts:n}=JSON.parse(e);return Date.now()-n>Ce?(localStorage.removeItem(`peasy:${t}`),null):r}catch{return null}}function Y(t,e){try{localStorage.setItem(`peasy:${t}`,JSON.stringify({data:e,ts:Date.now()}))}catch{}}function Te(){for(;D<K&&j.length>0;){let t=j.shift();t&&t()}}async function $(t,e,r){let n=`${t.apiBase}${e}`,o=(r==null?void 0:r.lang)||"en",i=`${n}:${o}`,a=q.get(i);if(a&&Date.now()-a.ts<ke)return a.data;if(r!=null&&r.useLS){let p=Se(i);if(p)return q.set(i,{data:p,ts:Date.now()}),p}D>=K&&await new Promise(p=>j.push(p)),D++;try{let p={Accept:"application/json"};o!=="en"&&(p["Accept-Language"]=o);let l=await fetch(n,{headers:p});if(l.status===429){let y=Math.min(parseInt(l.headers.get("Retry-After")||"10",10),10);await new Promise(f=>setTimeout(f,y*1e3));let g=await fetch(n,{headers:p});if(!g.ok)return null;let c=await g.json();return q.set(i,{data:c,ts:Date.now()}),r!=null&&r.useLS&&Y(i,c),c}if(!l.ok)return null;let d=await l.json();return q.set(i,{data:d,ts:Date.now()}),r!=null&&r.useLS&&Y(i,d),d}catch{return null}finally{D--,Te()}}function V(t,e,r){let n=t.dataset.slug;if(!n)return;let o=u(t,e),i=x(o,t,"peasy-format-info");T(i),$(e,`/api/v1/formats/${n}/`,{useLS:!0,lang:r.lang}).then(a=>{if(!a){L(i,"Could not load format information.",e);return}let p=(a.advantages||[]).map(l=>`<li>${s(l)}</li>`).join("");i.innerHTML=`
|
|
434
|
+
<style>
|
|
435
|
+
.peasy-format-info-header {
|
|
436
|
+
display: flex;
|
|
437
|
+
align-items: center;
|
|
438
|
+
gap: 8px;
|
|
439
|
+
padding: 14px 16px 10px;
|
|
440
|
+
border-bottom: 1px solid var(--border);
|
|
441
|
+
background: var(--ribbon);
|
|
442
|
+
}
|
|
443
|
+
.peasy-format-info-header svg { color: var(--accent); flex-shrink: 0; }
|
|
444
|
+
.peasy-format-info-props {
|
|
445
|
+
display: grid;
|
|
446
|
+
grid-template-columns: auto 1fr;
|
|
447
|
+
gap: 0;
|
|
448
|
+
}
|
|
449
|
+
.peasy-format-info-prop-label {
|
|
450
|
+
padding: 7px 16px 7px 16px;
|
|
451
|
+
font-size: 12px;
|
|
452
|
+
color: var(--muted);
|
|
453
|
+
font-weight: 500;
|
|
454
|
+
border-bottom: 1px solid var(--border);
|
|
455
|
+
white-space: nowrap;
|
|
456
|
+
}
|
|
457
|
+
.peasy-format-info-prop-value {
|
|
458
|
+
padding: 7px 16px 7px 8px;
|
|
459
|
+
font-size: 13px;
|
|
460
|
+
color: var(--text);
|
|
461
|
+
border-bottom: 1px solid var(--border);
|
|
462
|
+
word-break: break-all;
|
|
463
|
+
}
|
|
464
|
+
.peasy-format-info-desc {
|
|
465
|
+
padding: 10px 16px;
|
|
466
|
+
font-size: 13px;
|
|
467
|
+
color: var(--text);
|
|
468
|
+
line-height: 1.6;
|
|
469
|
+
border-bottom: 1px solid var(--border);
|
|
470
|
+
}
|
|
471
|
+
.peasy-format-info-advantages {
|
|
472
|
+
padding: 10px 16px;
|
|
473
|
+
border-bottom: 1px solid var(--border);
|
|
474
|
+
}
|
|
475
|
+
.peasy-format-info-advantages-title {
|
|
476
|
+
font-size: 11px;
|
|
477
|
+
font-weight: 600;
|
|
478
|
+
text-transform: uppercase;
|
|
479
|
+
letter-spacing: 0.06em;
|
|
480
|
+
color: var(--muted);
|
|
481
|
+
margin: 0 0 6px 0;
|
|
482
|
+
}
|
|
483
|
+
.peasy-format-info-advantages ul {
|
|
484
|
+
margin: 0;
|
|
485
|
+
padding-left: 18px;
|
|
486
|
+
}
|
|
487
|
+
.peasy-format-info-advantages li {
|
|
488
|
+
font-size: 13px;
|
|
489
|
+
color: var(--text);
|
|
490
|
+
line-height: 1.5;
|
|
491
|
+
margin-bottom: 2px;
|
|
492
|
+
}
|
|
493
|
+
.peasy-bool-yes { color: #16a34a; font-weight: 500; }
|
|
494
|
+
.peasy-bool-no { color: var(--muted); }
|
|
495
|
+
</style>
|
|
496
|
+
<div class="peasy-format-info-header">
|
|
497
|
+
${z}
|
|
498
|
+
<span class="peasy-title" style="margin:0;">${s(a.full_name)}</span>
|
|
499
|
+
<span class="peasy-badge" style="margin-left:auto;">${s(a.extension.toUpperCase())}</span>
|
|
500
|
+
</div>
|
|
501
|
+
<div class="peasy-format-info-props">
|
|
502
|
+
<span class="peasy-format-info-prop-label">Extension</span>
|
|
503
|
+
<span class="peasy-format-info-prop-value">${s(a.extension)}</span>
|
|
504
|
+
<span class="peasy-format-info-prop-label">MIME Type</span>
|
|
505
|
+
<span class="peasy-format-info-prop-value">${s(a.mime_type)}</span>
|
|
506
|
+
<span class="peasy-format-info-prop-label">Category</span>
|
|
507
|
+
<span class="peasy-format-info-prop-value">${s(a.category)}</span>
|
|
508
|
+
<span class="peasy-format-info-prop-label">Binary</span>
|
|
509
|
+
<span class="peasy-format-info-prop-value">${a.is_binary?'<span class="peasy-bool-yes">Yes</span>':'<span class="peasy-bool-no">No</span>'}</span>
|
|
510
|
+
<span class="peasy-format-info-prop-label">Lossy</span>
|
|
511
|
+
<span class="peasy-format-info-prop-value">${a.is_lossy?'<span class="peasy-bool-yes">Yes</span>':'<span class="peasy-bool-no">No</span>'}</span>
|
|
512
|
+
</div>
|
|
513
|
+
${a.description?`<div class="peasy-format-info-desc">${s(a.description)}</div>`:""}
|
|
514
|
+
${p?`
|
|
515
|
+
<div class="peasy-format-info-advantages">
|
|
516
|
+
<p class="peasy-format-info-advantages-title">Advantages</p>
|
|
517
|
+
<ul>${p}</ul>
|
|
518
|
+
</div>
|
|
519
|
+
`:""}
|
|
520
|
+
<div class="peasy-actions">
|
|
521
|
+
<a class="peasy-link" href="https://${e.domain}/formats/${n}/" target="_blank" rel="noopener">
|
|
522
|
+
${s(a.full_name)} format guide on ${s(e.name)} ${k}
|
|
523
|
+
</a>
|
|
524
|
+
</div>
|
|
525
|
+
${m(e)}
|
|
526
|
+
`})}function J(t,e,r){let n=t.dataset.slug;if(!n)return;let o=u(t,e),i=x(o,t,"peasy-tool-card");T(i),$(e,`/api/v1/tools/${n}/`,{lang:r.lang}).then(a=>{if(!a){L(i,"Could not load tool information.",e);return}let p=`https://${e.domain}/${a.category.slug}/${a.slug}/`;i.innerHTML=`
|
|
527
|
+
<style>
|
|
528
|
+
.peasy-tool-card-header {
|
|
529
|
+
display: flex;
|
|
530
|
+
align-items: flex-start;
|
|
531
|
+
gap: 12px;
|
|
532
|
+
padding: 14px 16px 10px;
|
|
533
|
+
border-bottom: 1px solid var(--border);
|
|
534
|
+
background: var(--ribbon);
|
|
535
|
+
}
|
|
536
|
+
.peasy-tool-card-icon {
|
|
537
|
+
width: 40px;
|
|
538
|
+
height: 40px;
|
|
539
|
+
border-radius: 8px;
|
|
540
|
+
background: color-mix(in srgb, var(--accent) 12%, transparent);
|
|
541
|
+
display: flex;
|
|
542
|
+
align-items: center;
|
|
543
|
+
justify-content: center;
|
|
544
|
+
flex-shrink: 0;
|
|
545
|
+
font-size: 20px;
|
|
546
|
+
color: var(--accent);
|
|
547
|
+
}
|
|
548
|
+
.peasy-tool-card-meta { flex: 1; min-width: 0; }
|
|
549
|
+
.peasy-tool-card-desc {
|
|
550
|
+
padding: 10px 16px 12px;
|
|
551
|
+
font-size: 13px;
|
|
552
|
+
color: var(--text);
|
|
553
|
+
line-height: 1.6;
|
|
554
|
+
border-bottom: 1px solid var(--border);
|
|
555
|
+
}
|
|
556
|
+
</style>
|
|
557
|
+
<div class="peasy-tool-card-header">
|
|
558
|
+
<div class="peasy-tool-card-icon">
|
|
559
|
+
${W}
|
|
560
|
+
</div>
|
|
561
|
+
<div class="peasy-tool-card-meta">
|
|
562
|
+
<p class="peasy-title" style="margin:0 0 4px 0;">${s(a.name)}</p>
|
|
563
|
+
<div class="peasy-meta" style="margin-bottom:0;">
|
|
564
|
+
<span class="peasy-badge">${s(a.category.name)}</span>
|
|
565
|
+
</div>
|
|
566
|
+
</div>
|
|
567
|
+
</div>
|
|
568
|
+
${a.tagline?`<p class="peasy-subtitle" style="padding:8px 16px 0;margin:0;">${s(a.tagline)}</p>`:""}
|
|
569
|
+
${a.description?`<div class="peasy-tool-card-desc">${s(a.description)}</div>`:""}
|
|
570
|
+
<div class="peasy-actions">
|
|
571
|
+
<a class="peasy-btn" href="${p}" target="_blank" rel="noopener">
|
|
572
|
+
Try ${s(a.name)} on ${s(e.name)} ${k}
|
|
573
|
+
</a>
|
|
574
|
+
</div>
|
|
575
|
+
${m(e)}
|
|
576
|
+
`})}var Q={lossless:{label:"Lossless \u2713",color:"#16a34a"},lossy:{label:"Lossy",color:"#ea580c"},depends:{label:"Depends on content",color:"#ca8a04"}},X={easy:{label:"Easy",color:"#16a34a",bg:"#dcfce7"},medium:{label:"Medium",color:"#ca8a04",bg:"#fef9c3"},hard:{label:"Hard",color:"#dc2626",bg:"#fee2e2"}};function Z(t,e,r){let n=t.dataset.slug;if(!n)return;let o=u(t,e),i=x(o,t,"peasy-conversion-card");T(i),$(e,`/api/v1/conversions/${n}/`,{lang:r.lang}).then(a=>{if(!a){L(i,"Could not load conversion information.",e);return}let p=Q[a.quality_impact]??Q.depends,l=X[a.difficulty]??X.medium;i.innerHTML=`
|
|
577
|
+
<style>
|
|
578
|
+
.peasy-conv-visual {
|
|
579
|
+
display: flex;
|
|
580
|
+
align-items: center;
|
|
581
|
+
justify-content: center;
|
|
582
|
+
gap: 12px;
|
|
583
|
+
padding: 16px;
|
|
584
|
+
background: var(--ribbon);
|
|
585
|
+
border-bottom: 1px solid var(--border);
|
|
586
|
+
}
|
|
587
|
+
.peasy-conv-format {
|
|
588
|
+
display: flex;
|
|
589
|
+
flex-direction: column;
|
|
590
|
+
align-items: center;
|
|
591
|
+
gap: 4px;
|
|
592
|
+
}
|
|
593
|
+
.peasy-conv-format-ext {
|
|
594
|
+
font-size: 18px;
|
|
595
|
+
font-weight: 700;
|
|
596
|
+
color: var(--accent);
|
|
597
|
+
}
|
|
598
|
+
.peasy-conv-format-name {
|
|
599
|
+
font-size: 11px;
|
|
600
|
+
color: var(--muted);
|
|
601
|
+
text-align: center;
|
|
602
|
+
}
|
|
603
|
+
.peasy-conv-arrow {
|
|
604
|
+
font-size: 20px;
|
|
605
|
+
color: var(--muted);
|
|
606
|
+
flex-shrink: 0;
|
|
607
|
+
}
|
|
608
|
+
.peasy-conv-props {
|
|
609
|
+
padding: 10px 16px;
|
|
610
|
+
display: flex;
|
|
611
|
+
flex-direction: column;
|
|
612
|
+
gap: 8px;
|
|
613
|
+
border-bottom: 1px solid var(--border);
|
|
614
|
+
}
|
|
615
|
+
.peasy-conv-prop-row {
|
|
616
|
+
display: flex;
|
|
617
|
+
align-items: center;
|
|
618
|
+
justify-content: space-between;
|
|
619
|
+
gap: 8px;
|
|
620
|
+
font-size: 13px;
|
|
621
|
+
}
|
|
622
|
+
.peasy-conv-prop-label { color: var(--muted); }
|
|
623
|
+
.peasy-conv-desc {
|
|
624
|
+
padding: 8px 16px 12px;
|
|
625
|
+
font-size: 13px;
|
|
626
|
+
color: var(--text);
|
|
627
|
+
line-height: 1.6;
|
|
628
|
+
border-bottom: 1px solid var(--border);
|
|
629
|
+
}
|
|
630
|
+
.peasy-diff-badge {
|
|
631
|
+
display: inline-block;
|
|
632
|
+
padding: 2px 8px;
|
|
633
|
+
border-radius: 4px;
|
|
634
|
+
font-size: 12px;
|
|
635
|
+
font-weight: 500;
|
|
636
|
+
}
|
|
637
|
+
</style>
|
|
638
|
+
<div class="peasy-conv-visual">
|
|
639
|
+
<div class="peasy-conv-format">
|
|
640
|
+
${z}
|
|
641
|
+
<span class="peasy-conv-format-ext">${s(a.source_format.extension.toUpperCase())}</span>
|
|
642
|
+
<span class="peasy-conv-format-name">${s(a.source_format.full_name)}</span>
|
|
643
|
+
</div>
|
|
644
|
+
<div class="peasy-conv-arrow">\u2192</div>
|
|
645
|
+
<div class="peasy-conv-format">
|
|
646
|
+
${z}
|
|
647
|
+
<span class="peasy-conv-format-ext">${s(a.target_format.extension.toUpperCase())}</span>
|
|
648
|
+
<span class="peasy-conv-format-name">${s(a.target_format.full_name)}</span>
|
|
649
|
+
</div>
|
|
650
|
+
</div>
|
|
651
|
+
<div class="peasy-conv-props">
|
|
652
|
+
<div class="peasy-conv-prop-row">
|
|
653
|
+
<span class="peasy-conv-prop-label">Quality impact</span>
|
|
654
|
+
<span style="font-weight:500;color:${p.color};">${p.label}</span>
|
|
655
|
+
</div>
|
|
656
|
+
<div class="peasy-conv-prop-row">
|
|
657
|
+
<span class="peasy-conv-prop-label">Difficulty</span>
|
|
658
|
+
<span class="peasy-diff-badge" style="background:${l.bg};color:${l.color};">${l.label}</span>
|
|
659
|
+
</div>
|
|
660
|
+
${a.recommended_tool?`
|
|
661
|
+
<div class="peasy-conv-prop-row">
|
|
662
|
+
<span class="peasy-conv-prop-label">Recommended tool</span>
|
|
663
|
+
<a class="peasy-link" href="https://${e.domain}/search/?q=${encodeURIComponent(a.recommended_tool.name)}" target="_blank" rel="noopener">${s(a.recommended_tool.name)}</a>
|
|
664
|
+
</div>
|
|
665
|
+
`:""}
|
|
666
|
+
</div>
|
|
667
|
+
${a.description?`<div class="peasy-conv-desc">${s(a.description)}</div>`:""}
|
|
668
|
+
<div class="peasy-actions">
|
|
669
|
+
<a class="peasy-link" href="https://${e.domain}/conversions/${n}/" target="_blank" rel="noopener">
|
|
670
|
+
${s(a.source_format.extension.toUpperCase())} to ${s(a.target_format.extension.toUpperCase())} conversion guide on ${s(e.name)} ${k}
|
|
671
|
+
</a>
|
|
672
|
+
</div>
|
|
673
|
+
${m(e)}
|
|
674
|
+
`})}function ee(t,e,r){let n=t.dataset,o=n.a,i=n.b;if(!o||!i)return;let a=u(t,e),p=x(a,t,"peasy-format-compare");n.size||p.setAttribute("data-size","large"),T(p),Promise.all([$(e,`/api/v1/formats/${o}/`,{useLS:!0,lang:r.lang}),$(e,`/api/v1/formats/${i}/`,{useLS:!0,lang:r.lang})]).then(([l,d])=>{if(!l||!d){L(p,"Could not load format comparison data.",e);return}function y(c){return c?'<span style="color:#ea580c;font-weight:500;">Yes (lossy)</span>':'<span style="color:#16a34a;font-weight:500;">No (lossless)</span>'}function g(c){return c?"Yes":"No"}p.innerHTML=`
|
|
675
|
+
<style>
|
|
676
|
+
.peasy-compare-header {
|
|
677
|
+
display: grid;
|
|
678
|
+
grid-template-columns: 1fr 1fr;
|
|
679
|
+
gap: 0;
|
|
680
|
+
border-bottom: 1px solid var(--border);
|
|
681
|
+
background: var(--ribbon);
|
|
682
|
+
}
|
|
683
|
+
.peasy-compare-header-cell {
|
|
684
|
+
padding: 12px 16px;
|
|
685
|
+
text-align: center;
|
|
686
|
+
font-weight: 600;
|
|
687
|
+
font-size: 15px;
|
|
688
|
+
color: var(--accent);
|
|
689
|
+
}
|
|
690
|
+
.peasy-compare-header-cell:first-child {
|
|
691
|
+
border-right: 1px solid var(--border);
|
|
692
|
+
}
|
|
693
|
+
.peasy-compare-header-sub {
|
|
694
|
+
font-size: 11px;
|
|
695
|
+
font-weight: 400;
|
|
696
|
+
color: var(--muted);
|
|
697
|
+
margin-top: 2px;
|
|
698
|
+
}
|
|
699
|
+
.peasy-compare-table {
|
|
700
|
+
width: 100%;
|
|
701
|
+
border-collapse: collapse;
|
|
702
|
+
}
|
|
703
|
+
.peasy-compare-row-label {
|
|
704
|
+
padding: 8px 16px;
|
|
705
|
+
font-size: 12px;
|
|
706
|
+
color: var(--muted);
|
|
707
|
+
font-weight: 500;
|
|
708
|
+
background: var(--ribbon);
|
|
709
|
+
border-bottom: 1px solid var(--border);
|
|
710
|
+
border-top: 1px solid var(--border);
|
|
711
|
+
text-align: center;
|
|
712
|
+
letter-spacing: 0.03em;
|
|
713
|
+
text-transform: uppercase;
|
|
714
|
+
font-size: 11px;
|
|
715
|
+
}
|
|
716
|
+
.peasy-compare-cell {
|
|
717
|
+
padding: 8px 16px;
|
|
718
|
+
font-size: 13px;
|
|
719
|
+
color: var(--text);
|
|
720
|
+
border-bottom: 1px solid var(--border);
|
|
721
|
+
text-align: center;
|
|
722
|
+
vertical-align: middle;
|
|
723
|
+
word-break: break-word;
|
|
724
|
+
}
|
|
725
|
+
.peasy-compare-cell:first-child {
|
|
726
|
+
border-right: 1px solid var(--border);
|
|
727
|
+
}
|
|
728
|
+
.peasy-compare-desc-row {
|
|
729
|
+
padding: 10px 16px;
|
|
730
|
+
font-size: 13px;
|
|
731
|
+
color: var(--text);
|
|
732
|
+
line-height: 1.55;
|
|
733
|
+
text-align: center;
|
|
734
|
+
border-bottom: 1px solid var(--border);
|
|
735
|
+
}
|
|
736
|
+
.peasy-compare-links {
|
|
737
|
+
display: flex;
|
|
738
|
+
align-items: center;
|
|
739
|
+
justify-content: space-between;
|
|
740
|
+
gap: 8px;
|
|
741
|
+
padding: 10px 16px;
|
|
742
|
+
border-top: 1px solid var(--border);
|
|
743
|
+
}
|
|
744
|
+
</style>
|
|
745
|
+
<div class="peasy-compare-header">
|
|
746
|
+
<div class="peasy-compare-header-cell">
|
|
747
|
+
${s(l.extension.toUpperCase())}
|
|
748
|
+
<div class="peasy-compare-header-sub">${s(l.full_name)}</div>
|
|
749
|
+
</div>
|
|
750
|
+
<div class="peasy-compare-header-cell">
|
|
751
|
+
${s(d.extension.toUpperCase())}
|
|
752
|
+
<div class="peasy-compare-header-sub">${s(d.full_name)}</div>
|
|
753
|
+
</div>
|
|
754
|
+
</div>
|
|
755
|
+
<table class="peasy-compare-table">
|
|
756
|
+
<tbody>
|
|
757
|
+
<tr><td class="peasy-compare-row-label" colspan="2">Extension</td></tr>
|
|
758
|
+
<tr>
|
|
759
|
+
<td class="peasy-compare-cell">${s(l.extension)}</td>
|
|
760
|
+
<td class="peasy-compare-cell">${s(d.extension)}</td>
|
|
761
|
+
</tr>
|
|
762
|
+
<tr><td class="peasy-compare-row-label" colspan="2">MIME Type</td></tr>
|
|
763
|
+
<tr>
|
|
764
|
+
<td class="peasy-compare-cell">${s(l.mime_type)}</td>
|
|
765
|
+
<td class="peasy-compare-cell">${s(d.mime_type)}</td>
|
|
766
|
+
</tr>
|
|
767
|
+
<tr><td class="peasy-compare-row-label" colspan="2">Category</td></tr>
|
|
768
|
+
<tr>
|
|
769
|
+
<td class="peasy-compare-cell">${s(l.category)}</td>
|
|
770
|
+
<td class="peasy-compare-cell">${s(d.category)}</td>
|
|
771
|
+
</tr>
|
|
772
|
+
<tr><td class="peasy-compare-row-label" colspan="2">Binary</td></tr>
|
|
773
|
+
<tr>
|
|
774
|
+
<td class="peasy-compare-cell">${g(l.is_binary)}</td>
|
|
775
|
+
<td class="peasy-compare-cell">${g(d.is_binary)}</td>
|
|
776
|
+
</tr>
|
|
777
|
+
<tr><td class="peasy-compare-row-label" colspan="2">Lossy Compression</td></tr>
|
|
778
|
+
<tr>
|
|
779
|
+
<td class="peasy-compare-cell">${y(l.is_lossy)}</td>
|
|
780
|
+
<td class="peasy-compare-cell">${y(d.is_lossy)}</td>
|
|
781
|
+
</tr>
|
|
782
|
+
</tbody>
|
|
783
|
+
</table>
|
|
784
|
+
<div class="peasy-compare-links">
|
|
785
|
+
<a class="peasy-link" href="https://${e.domain}/formats/${o}/" target="_blank" rel="noopener">
|
|
786
|
+
${s(l.full_name)} format guide ${k}
|
|
787
|
+
</a>
|
|
788
|
+
<a class="peasy-link" href="https://${e.domain}/formats/${i}/" target="_blank" rel="noopener">
|
|
789
|
+
${s(d.full_name)} format guide ${k}
|
|
790
|
+
</a>
|
|
791
|
+
</div>
|
|
792
|
+
${m(e)}
|
|
793
|
+
`})}function te(t,e,r){let n=t.dataset,o=n.slug,i=n.display||"inline";if(!o)return;if(i==="inline"){let l=t.attachShadow({mode:"open"}),d=document.createElement("style");d.textContent=`
|
|
794
|
+
:host {
|
|
795
|
+
display: inline;
|
|
796
|
+
font-family: inherit;
|
|
797
|
+
cursor: help;
|
|
798
|
+
position: relative;
|
|
799
|
+
}
|
|
800
|
+
.peasy-glossary-term {
|
|
801
|
+
text-decoration: underline dotted var(--accent, #6366f1);
|
|
802
|
+
text-underline-offset: 3px;
|
|
803
|
+
color: inherit;
|
|
804
|
+
}
|
|
805
|
+
.peasy-glossary-popup {
|
|
806
|
+
display: none;
|
|
807
|
+
position: absolute;
|
|
808
|
+
bottom: calc(100% + 8px);
|
|
809
|
+
left: 0;
|
|
810
|
+
z-index: 9999;
|
|
811
|
+
background: #1a1a1a;
|
|
812
|
+
color: #f3f4f6;
|
|
813
|
+
border-radius: 8px;
|
|
814
|
+
padding: 12px 14px;
|
|
815
|
+
font-size: 13px;
|
|
816
|
+
min-width: 220px;
|
|
817
|
+
max-width: 300px;
|
|
818
|
+
box-shadow: 0 4px 16px rgba(0,0,0,0.24);
|
|
819
|
+
line-height: 1.55;
|
|
820
|
+
pointer-events: none;
|
|
821
|
+
white-space: normal;
|
|
822
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
823
|
+
}
|
|
824
|
+
.peasy-glossary-term:hover + .peasy-glossary-popup,
|
|
825
|
+
.peasy-glossary-popup:hover {
|
|
826
|
+
display: block;
|
|
827
|
+
}
|
|
828
|
+
.peasy-glossary-popup-term {
|
|
829
|
+
font-weight: 600;
|
|
830
|
+
font-size: 14px;
|
|
831
|
+
margin-bottom: 6px;
|
|
832
|
+
color: #93c5fd;
|
|
833
|
+
}
|
|
834
|
+
.peasy-glossary-popup-def {
|
|
835
|
+
opacity: 0.9;
|
|
836
|
+
margin-bottom: 8px;
|
|
837
|
+
}
|
|
838
|
+
.peasy-glossary-popup-link {
|
|
839
|
+
font-size: 11px;
|
|
840
|
+
color: #93c5fd;
|
|
841
|
+
text-decoration: none;
|
|
842
|
+
opacity: 0.8;
|
|
843
|
+
display: inline-flex;
|
|
844
|
+
align-items: center;
|
|
845
|
+
gap: 3px;
|
|
846
|
+
pointer-events: auto;
|
|
847
|
+
}
|
|
848
|
+
`,l.appendChild(d);let y=document.createElement("span");y.className="peasy-glossary-term",y.textContent=t.textContent||o,l.appendChild(y),$(e,`/api/v1/glossary/${o}/`,{useLS:!0,lang:r.lang}).then(g=>{if(!g)return;let c=document.createElement("div");c.className="peasy-glossary-popup",c.innerHTML=`
|
|
849
|
+
<div class="peasy-glossary-popup-term">${s(g.term)}</div>
|
|
850
|
+
<div class="peasy-glossary-popup-def">${s(g.explanation_simple||g.definition)}</div>
|
|
851
|
+
<a class="peasy-glossary-popup-link" href="https://${e.domain}/glossary/${encodeURIComponent(o)}/" target="_blank" rel="noopener">
|
|
852
|
+
Learn more about ${s(g.term)} on ${s(e.name)}
|
|
853
|
+
<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="10" height="10"><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>
|
|
854
|
+
</a>
|
|
855
|
+
`,l.appendChild(c)});return}let a=u(t,e),p=x(a,t,"peasy-glossary-card");T(p),$(e,`/api/v1/glossary/${o}/`,{useLS:!0,lang:r.lang}).then(l=>{if(!l){L(p,"Could not load glossary term.",e);return}let d=(l.related_terms||[]).slice(0,4).map(y=>`<a class="peasy-link" href="https://${e.domain}/glossary/${encodeURIComponent(y.slug)}/" target="_blank" rel="noopener">${s(y.term)}</a>`).join("");p.innerHTML=`
|
|
856
|
+
<style>
|
|
857
|
+
.peasy-glossary-header {
|
|
858
|
+
display: flex;
|
|
859
|
+
align-items: center;
|
|
860
|
+
gap: 8px;
|
|
861
|
+
padding: 12px 16px 10px;
|
|
862
|
+
border-bottom: 1px solid var(--border);
|
|
863
|
+
background: var(--ribbon);
|
|
864
|
+
}
|
|
865
|
+
.peasy-glossary-header svg { color: var(--accent); }
|
|
866
|
+
.peasy-glossary-cat {
|
|
867
|
+
margin-left: auto;
|
|
868
|
+
}
|
|
869
|
+
.peasy-glossary-body {
|
|
870
|
+
padding: 12px 16px;
|
|
871
|
+
border-bottom: 1px solid var(--border);
|
|
872
|
+
}
|
|
873
|
+
.peasy-glossary-label {
|
|
874
|
+
font-size: 11px;
|
|
875
|
+
font-weight: 600;
|
|
876
|
+
text-transform: uppercase;
|
|
877
|
+
letter-spacing: 0.06em;
|
|
878
|
+
color: var(--muted);
|
|
879
|
+
margin: 0 0 4px 0;
|
|
880
|
+
}
|
|
881
|
+
.peasy-glossary-section {
|
|
882
|
+
font-size: 13px;
|
|
883
|
+
color: var(--text);
|
|
884
|
+
line-height: 1.6;
|
|
885
|
+
margin-bottom: 12px;
|
|
886
|
+
}
|
|
887
|
+
.peasy-glossary-related {
|
|
888
|
+
display: flex;
|
|
889
|
+
flex-wrap: wrap;
|
|
890
|
+
gap: 6px;
|
|
891
|
+
padding: 10px 16px;
|
|
892
|
+
border-bottom: 1px solid var(--border);
|
|
893
|
+
}
|
|
894
|
+
</style>
|
|
895
|
+
<div class="peasy-glossary-header">
|
|
896
|
+
${I}
|
|
897
|
+
<span class="peasy-title" style="margin:0;">${s(l.term)}</span>
|
|
898
|
+
<span class="peasy-badge peasy-glossary-cat">${s(l.category)}</span>
|
|
899
|
+
</div>
|
|
900
|
+
<div class="peasy-glossary-body">
|
|
901
|
+
${l.explanation_technical?`
|
|
902
|
+
<p class="peasy-glossary-label">Technical Explanation</p>
|
|
903
|
+
<div class="peasy-glossary-section">${s(l.explanation_technical)}</div>
|
|
904
|
+
`:""}
|
|
905
|
+
${l.definition?`
|
|
906
|
+
<p class="peasy-glossary-label">Definition</p>
|
|
907
|
+
<div class="peasy-glossary-section">${s(l.definition)}</div>
|
|
908
|
+
`:""}
|
|
909
|
+
</div>
|
|
910
|
+
${d?`
|
|
911
|
+
<div class="peasy-glossary-related">
|
|
912
|
+
<span style="font-size:11px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:0.06em;display:flex;align-items:center;">Related:</span>
|
|
913
|
+
${d}
|
|
914
|
+
</div>
|
|
915
|
+
`:""}
|
|
916
|
+
<div class="peasy-actions">
|
|
917
|
+
<a class="peasy-link" href="https://${e.domain}/glossary/${o}/" target="_blank" rel="noopener">
|
|
918
|
+
${s(l.term)} \u2014 full glossary entry on ${s(e.name)} ${k}
|
|
919
|
+
</a>
|
|
920
|
+
</div>
|
|
921
|
+
${m(e)}
|
|
922
|
+
`})}function ae(t,e,r){let n=t.dataset,o=parseInt(n.limit||"6",10),i=n.category||"",a=u(t,e),p=x(a,t,"peasy-tool-gallery");T(p);let l=i?`?limit=${o}&category=${encodeURIComponent(i)}`:`?limit=${o}`;$(e,`/api/v1/tools/${l}`,{lang:r.lang}).then(d=>{if(!d||!d.results){L(p,"Could not load tools gallery.",e);return}let y=d.results.map(c=>{let f=`https://${e.domain}/${c.category.slug}/${c.slug}/`,h=c.tagline?c.tagline.length>55?c.tagline.substring(0,55)+"\u2026":c.tagline:"";return`
|
|
923
|
+
<a class="peasy-gallery-tile" href="${f}" target="_blank" rel="noopener" title="${s(c.name)}">
|
|
924
|
+
<div class="peasy-gallery-tile-icon">${s(c.icon||"\u{1F527}")}</div>
|
|
925
|
+
<div class="peasy-gallery-tile-name">${s(c.name)}</div>
|
|
926
|
+
${h?`<div class="peasy-gallery-tile-tagline">${s(h)}</div>`:""}
|
|
927
|
+
</a>
|
|
928
|
+
`}).join(""),g=`https://${e.domain}/`;p.innerHTML=`
|
|
929
|
+
<style>
|
|
930
|
+
.peasy-gallery-header {
|
|
931
|
+
display: flex;
|
|
932
|
+
align-items: center;
|
|
933
|
+
justify-content: space-between;
|
|
934
|
+
padding: 10px 16px 8px;
|
|
935
|
+
border-bottom: 1px solid var(--border);
|
|
936
|
+
background: var(--ribbon);
|
|
937
|
+
}
|
|
938
|
+
.peasy-gallery-count {
|
|
939
|
+
font-size: 12px;
|
|
940
|
+
color: var(--muted);
|
|
941
|
+
}
|
|
942
|
+
.peasy-gallery-grid {
|
|
943
|
+
display: grid;
|
|
944
|
+
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
|
945
|
+
gap: 1px;
|
|
946
|
+
background: var(--border);
|
|
947
|
+
border-bottom: 1px solid var(--border);
|
|
948
|
+
}
|
|
949
|
+
.peasy-gallery-tile {
|
|
950
|
+
display: flex;
|
|
951
|
+
flex-direction: column;
|
|
952
|
+
align-items: center;
|
|
953
|
+
gap: 4px;
|
|
954
|
+
padding: 14px 8px 12px;
|
|
955
|
+
background: var(--bg);
|
|
956
|
+
text-decoration: none;
|
|
957
|
+
color: var(--text);
|
|
958
|
+
text-align: center;
|
|
959
|
+
transition: background 0.15s;
|
|
960
|
+
}
|
|
961
|
+
.peasy-gallery-tile:hover {
|
|
962
|
+
background: var(--ribbon);
|
|
963
|
+
}
|
|
964
|
+
.peasy-gallery-tile-icon {
|
|
965
|
+
font-size: 22px;
|
|
966
|
+
line-height: 1;
|
|
967
|
+
}
|
|
968
|
+
.peasy-gallery-tile-name {
|
|
969
|
+
font-size: 13px;
|
|
970
|
+
font-weight: 600;
|
|
971
|
+
color: var(--text);
|
|
972
|
+
}
|
|
973
|
+
.peasy-gallery-tile-tagline {
|
|
974
|
+
font-size: 11px;
|
|
975
|
+
color: var(--muted);
|
|
976
|
+
line-height: 1.4;
|
|
977
|
+
}
|
|
978
|
+
.peasy-gallery-footer {
|
|
979
|
+
padding: 10px 16px;
|
|
980
|
+
border-top: 1px solid var(--border);
|
|
981
|
+
text-align: center;
|
|
982
|
+
}
|
|
983
|
+
</style>
|
|
984
|
+
<div class="peasy-gallery-header">
|
|
985
|
+
<span class="peasy-title" style="font-size:14px;margin:0;">${i?s(i)+" Tools":"Tool Gallery"}</span>
|
|
986
|
+
<span class="peasy-gallery-count">${d.count}+ tools on ${s(e.name)}</span>
|
|
987
|
+
</div>
|
|
988
|
+
<div class="peasy-gallery-grid">
|
|
989
|
+
${y}
|
|
990
|
+
</div>
|
|
991
|
+
<div class="peasy-gallery-footer">
|
|
992
|
+
<a class="peasy-link" href="${g}" target="_blank" rel="noopener">
|
|
993
|
+
Browse all ${d.count} tools on ${s(e.name)} ${k}
|
|
994
|
+
</a>
|
|
995
|
+
</div>
|
|
996
|
+
${m(e)}
|
|
997
|
+
`})}function oe(t,e,r){let n=t.dataset.slug;if(!n)return;let o=u(t,e),i=x(o,t,"peasy-guide-card");T(i),$(e,`/api/v1/guides/${n}/`,{lang:r.lang}).then(a=>{if(!a){L(i,"Could not load guide information.",e);return}let p=(a.key_takeaways||[]).slice(0,5).map(y=>`<li>${s(y)}</li>`).join(""),d={beginner:"#16a34a",intermediate:"#ca8a04",advanced:"#dc2626"}[(a.audience_level||"").toLowerCase()]||"#6b7280";i.innerHTML=`
|
|
998
|
+
<style>
|
|
999
|
+
.peasy-guide-header {
|
|
1000
|
+
display: flex;
|
|
1001
|
+
align-items: flex-start;
|
|
1002
|
+
gap: 8px;
|
|
1003
|
+
padding: 12px 16px 10px;
|
|
1004
|
+
border-bottom: 1px solid var(--border);
|
|
1005
|
+
background: var(--ribbon);
|
|
1006
|
+
}
|
|
1007
|
+
.peasy-guide-header svg { color: var(--accent); margin-top: 3px; flex-shrink: 0; }
|
|
1008
|
+
.peasy-guide-body {
|
|
1009
|
+
padding: 10px 16px;
|
|
1010
|
+
border-bottom: 1px solid var(--border);
|
|
1011
|
+
}
|
|
1012
|
+
.peasy-guide-summary {
|
|
1013
|
+
font-size: 13px;
|
|
1014
|
+
color: var(--text);
|
|
1015
|
+
line-height: 1.6;
|
|
1016
|
+
margin-bottom: 10px;
|
|
1017
|
+
}
|
|
1018
|
+
.peasy-guide-takeaways {
|
|
1019
|
+
padding: 8px 16px 12px;
|
|
1020
|
+
border-bottom: 1px solid var(--border);
|
|
1021
|
+
}
|
|
1022
|
+
.peasy-guide-takeaways-label {
|
|
1023
|
+
font-size: 11px;
|
|
1024
|
+
font-weight: 600;
|
|
1025
|
+
text-transform: uppercase;
|
|
1026
|
+
letter-spacing: 0.06em;
|
|
1027
|
+
color: var(--muted);
|
|
1028
|
+
margin: 0 0 6px 0;
|
|
1029
|
+
}
|
|
1030
|
+
.peasy-guide-takeaways ul {
|
|
1031
|
+
margin: 0;
|
|
1032
|
+
padding-left: 18px;
|
|
1033
|
+
}
|
|
1034
|
+
.peasy-guide-takeaways li {
|
|
1035
|
+
font-size: 13px;
|
|
1036
|
+
color: var(--text);
|
|
1037
|
+
line-height: 1.5;
|
|
1038
|
+
margin-bottom: 3px;
|
|
1039
|
+
}
|
|
1040
|
+
.peasy-guide-takeaways li::marker { color: var(--accent); }
|
|
1041
|
+
</style>
|
|
1042
|
+
<div class="peasy-guide-header">
|
|
1043
|
+
${I}
|
|
1044
|
+
<div>
|
|
1045
|
+
<p class="peasy-title" style="margin:0 0 5px 0;">${s(a.title)}</p>
|
|
1046
|
+
<div class="peasy-meta" style="margin-bottom:0;">
|
|
1047
|
+
${a.reading_time_minutes?`<span class="peasy-stat">${a.reading_time_minutes} min read</span>`:""}
|
|
1048
|
+
${a.audience_level?`<span class="peasy-stat" style="color:${d};">${s(a.audience_level)}</span>`:""}
|
|
1049
|
+
${a.quality_score?`<span class="peasy-stat">Score: ${a.quality_score}/100</span>`:""}
|
|
1050
|
+
</div>
|
|
1051
|
+
</div>
|
|
1052
|
+
</div>
|
|
1053
|
+
${a.summary?`
|
|
1054
|
+
<div class="peasy-guide-body">
|
|
1055
|
+
<p class="peasy-guide-summary">${s(a.summary)}</p>
|
|
1056
|
+
</div>
|
|
1057
|
+
`:""}
|
|
1058
|
+
${p?`
|
|
1059
|
+
<div class="peasy-guide-takeaways">
|
|
1060
|
+
<p class="peasy-guide-takeaways-label">Key Takeaways</p>
|
|
1061
|
+
<ul>${p}</ul>
|
|
1062
|
+
</div>
|
|
1063
|
+
`:""}
|
|
1064
|
+
<div class="peasy-actions">
|
|
1065
|
+
<a class="peasy-link" href="https://${e.domain}/guides/${n}/" target="_blank" rel="noopener">
|
|
1066
|
+
Read full guide on ${s(e.name)} ${k}
|
|
1067
|
+
</a>
|
|
1068
|
+
</div>
|
|
1069
|
+
${m(e)}
|
|
1070
|
+
`})}function se(t,e,r){let n=t.dataset.slug;if(!n)return;let o=u(t,e),i=x(o,t,"peasy-usecase-card");T(i),$(e,`/api/v1/use-cases/${n}/`,{lang:r.lang}).then(a=>{if(!a){L(i,"Could not load use case information.",e);return}let p=a.tools&&a.tools.length>0?`<div class="peasy-usecase-tools">
|
|
1071
|
+
<span class="peasy-usecase-tools-label">Tools:</span>
|
|
1072
|
+
${a.tools.slice(0,4).map(l=>`<a class="peasy-link" href="https://${e.domain}/search/?q=${encodeURIComponent(l.name)}" target="_blank" rel="noopener">${s(l.name)}</a>`).join("")}
|
|
1073
|
+
</div>`:"";i.innerHTML=`
|
|
1074
|
+
<style>
|
|
1075
|
+
.peasy-usecase-header {
|
|
1076
|
+
padding: 12px 16px 10px;
|
|
1077
|
+
border-bottom: 1px solid var(--border);
|
|
1078
|
+
background: var(--ribbon);
|
|
1079
|
+
}
|
|
1080
|
+
.peasy-usecase-desc {
|
|
1081
|
+
padding: 10px 16px 12px;
|
|
1082
|
+
font-size: 13px;
|
|
1083
|
+
color: var(--text);
|
|
1084
|
+
line-height: 1.6;
|
|
1085
|
+
border-bottom: 1px solid var(--border);
|
|
1086
|
+
}
|
|
1087
|
+
.peasy-usecase-tools {
|
|
1088
|
+
display: flex;
|
|
1089
|
+
align-items: center;
|
|
1090
|
+
flex-wrap: wrap;
|
|
1091
|
+
gap: 8px;
|
|
1092
|
+
padding: 8px 16px;
|
|
1093
|
+
border-bottom: 1px solid var(--border);
|
|
1094
|
+
}
|
|
1095
|
+
.peasy-usecase-tools-label {
|
|
1096
|
+
font-size: 11px;
|
|
1097
|
+
font-weight: 600;
|
|
1098
|
+
text-transform: uppercase;
|
|
1099
|
+
letter-spacing: 0.06em;
|
|
1100
|
+
color: var(--muted);
|
|
1101
|
+
}
|
|
1102
|
+
</style>
|
|
1103
|
+
<div class="peasy-usecase-header">
|
|
1104
|
+
<p class="peasy-title" style="margin:0 0 6px 0;">${s(a.name)}</p>
|
|
1105
|
+
<div class="peasy-meta" style="margin-bottom:0;">
|
|
1106
|
+
${a.industry?`<span class="peasy-badge">${s(a.industry)}</span>`:""}
|
|
1107
|
+
</div>
|
|
1108
|
+
</div>
|
|
1109
|
+
${a.description?`<div class="peasy-usecase-desc">${s(a.description)}</div>`:""}
|
|
1110
|
+
${p}
|
|
1111
|
+
<div class="peasy-actions">
|
|
1112
|
+
<a class="peasy-link" href="https://${e.domain}/use-cases/${n}/" target="_blank" rel="noopener">
|
|
1113
|
+
${s(a.name)} use case guide on ${s(e.name)} ${k}
|
|
1114
|
+
</a>
|
|
1115
|
+
</div>
|
|
1116
|
+
${m(e)}
|
|
1117
|
+
`})}function re(t,e,r){let n=t.dataset.slug;if(!n)return;let o=t.attachShadow({mode:"open"}),i=document.createElement("style");i.textContent=`
|
|
1118
|
+
:host {
|
|
1119
|
+
display: inline-block;
|
|
1120
|
+
position: relative;
|
|
1121
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
1122
|
+
}
|
|
1123
|
+
.peasy-badge-link {
|
|
1124
|
+
display: inline-flex;
|
|
1125
|
+
align-items: center;
|
|
1126
|
+
gap: 4px;
|
|
1127
|
+
font-size: 11px;
|
|
1128
|
+
font-weight: 600;
|
|
1129
|
+
padding: 2px 8px;
|
|
1130
|
+
border-radius: 4px;
|
|
1131
|
+
background: #f3f4f6;
|
|
1132
|
+
color: #374151;
|
|
1133
|
+
text-decoration: none;
|
|
1134
|
+
text-transform: uppercase;
|
|
1135
|
+
letter-spacing: 0.04em;
|
|
1136
|
+
border-left: 3px solid ${e.accent};
|
|
1137
|
+
cursor: pointer;
|
|
1138
|
+
transition: background 0.15s;
|
|
1139
|
+
}
|
|
1140
|
+
.peasy-badge-link:hover { background: #e5e7eb; }
|
|
1141
|
+
.peasy-badge-link:hover + .peasy-badge-tooltip { display: block; }
|
|
1142
|
+
.peasy-badge-tooltip {
|
|
1143
|
+
display: none;
|
|
1144
|
+
position: absolute;
|
|
1145
|
+
top: calc(100% + 6px);
|
|
1146
|
+
left: 0;
|
|
1147
|
+
z-index: 9999;
|
|
1148
|
+
background: #1a1a1a;
|
|
1149
|
+
color: #f3f4f6;
|
|
1150
|
+
border-radius: 6px;
|
|
1151
|
+
padding: 10px 12px;
|
|
1152
|
+
font-size: 12px;
|
|
1153
|
+
min-width: 200px;
|
|
1154
|
+
max-width: 260px;
|
|
1155
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
|
|
1156
|
+
line-height: 1.5;
|
|
1157
|
+
pointer-events: none;
|
|
1158
|
+
}
|
|
1159
|
+
.peasy-badge-tooltip-title {
|
|
1160
|
+
font-weight: 600;
|
|
1161
|
+
font-size: 13px;
|
|
1162
|
+
margin-bottom: 4px;
|
|
1163
|
+
}
|
|
1164
|
+
.peasy-badge-tooltip-row {
|
|
1165
|
+
display: flex;
|
|
1166
|
+
gap: 6px;
|
|
1167
|
+
margin-top: 3px;
|
|
1168
|
+
}
|
|
1169
|
+
.peasy-badge-tooltip-label { color: #9ca3af; }
|
|
1170
|
+
.peasy-badge-tooltip-value { color: #f3f4f6; }
|
|
1171
|
+
`,o.appendChild(i);let a=document.createElement("span");a.style.cssText="display:inline-block;width:48px;height:18px;border-radius:4px;background:#e5e7eb;",o.appendChild(a),$(e,`/api/v1/formats/${n}/`,{useLS:!0,lang:r.lang}).then(p=>{if(a.remove(),!p){let d=document.createElement("span");d.textContent=n.toUpperCase(),d.style.cssText="font-size:11px;color:#9ca3af;font-family:monospace;",o.appendChild(d);return}let l=document.createElement("div");l.style.cssText="position:relative;display:inline-block;",l.innerHTML=`
|
|
1172
|
+
<a class="peasy-badge-link" href="https://${e.domain}/formats/${encodeURIComponent(n)}/" target="_blank" rel="noopener">
|
|
1173
|
+
<span>${s(p.extension.toUpperCase())}</span>
|
|
1174
|
+
<span style="opacity:0.5;">\u25AA</span>
|
|
1175
|
+
<span>${s(p.category)}</span>
|
|
1176
|
+
</a>
|
|
1177
|
+
<div class="peasy-badge-tooltip">
|
|
1178
|
+
<div class="peasy-badge-tooltip-title">${s(p.full_name)}</div>
|
|
1179
|
+
${p.description?`<div style="margin-bottom:6px;opacity:0.8;">${s(p.description.substring(0,100))}${p.description.length>100?"\u2026":""}</div>`:""}
|
|
1180
|
+
<div class="peasy-badge-tooltip-row">
|
|
1181
|
+
<span class="peasy-badge-tooltip-label">MIME:</span>
|
|
1182
|
+
<span class="peasy-badge-tooltip-value">${s(p.mime_type)}</span>
|
|
1183
|
+
</div>
|
|
1184
|
+
<div class="peasy-badge-tooltip-row">
|
|
1185
|
+
<span class="peasy-badge-tooltip-label">Lossy:</span>
|
|
1186
|
+
<span class="peasy-badge-tooltip-value">${p.is_lossy?"Yes":"No"}</span>
|
|
1187
|
+
</div>
|
|
1188
|
+
</div>
|
|
1189
|
+
`,o.appendChild(l)})}function Le(t,e){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>t(...n),e)}}function Ee(t){return t==="format"?z:t==="glossary"?I:W}function Me(t,e){var n;if(e.type==="format")return`https://${t.domain}/formats/${e.slug}/`;if(e.type==="glossary")return`https://${t.domain}/glossary/${e.slug}/`;let r=((n=e.category)==null?void 0:n.slug)||"tools";return`https://${t.domain}/${r}/${e.slug}/`}function ne(t,e,r){let o=t.dataset.placeholder||`Search tools, formats, guides on ${e.name}\u2026`,i=u(t,e),a=x(i,t,"peasy-search-box");a.innerHTML=`
|
|
1190
|
+
<style>
|
|
1191
|
+
.peasy-search-outer { padding: 14px 16px 0; position: relative; }
|
|
1192
|
+
.peasy-search-inner {
|
|
1193
|
+
display: flex;
|
|
1194
|
+
align-items: center;
|
|
1195
|
+
gap: 8px;
|
|
1196
|
+
border: 1px solid var(--input-border);
|
|
1197
|
+
border-radius: 8px;
|
|
1198
|
+
background: var(--input-bg);
|
|
1199
|
+
padding: 0 10px;
|
|
1200
|
+
transition: border-color 0.15s;
|
|
1201
|
+
}
|
|
1202
|
+
.peasy-search-inner:focus-within {
|
|
1203
|
+
border-color: var(--input-focus);
|
|
1204
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
1205
|
+
}
|
|
1206
|
+
.peasy-search-icon-wrap { color: var(--muted); display: flex; }
|
|
1207
|
+
.peasy-search-input-el {
|
|
1208
|
+
flex: 1;
|
|
1209
|
+
border: none;
|
|
1210
|
+
outline: none;
|
|
1211
|
+
background: transparent;
|
|
1212
|
+
color: var(--text);
|
|
1213
|
+
font-size: 14px;
|
|
1214
|
+
font-family: inherit;
|
|
1215
|
+
padding: 10px 0;
|
|
1216
|
+
min-width: 0;
|
|
1217
|
+
}
|
|
1218
|
+
.peasy-search-input-el::placeholder { color: var(--muted); }
|
|
1219
|
+
.peasy-search-results {
|
|
1220
|
+
display: none;
|
|
1221
|
+
position: absolute;
|
|
1222
|
+
top: calc(100% + 4px);
|
|
1223
|
+
left: 0;
|
|
1224
|
+
right: 0;
|
|
1225
|
+
z-index: 999;
|
|
1226
|
+
background: var(--bg);
|
|
1227
|
+
border: 1px solid var(--border);
|
|
1228
|
+
border-radius: 8px;
|
|
1229
|
+
box-shadow: var(--shadow), 0 4px 16px rgba(0,0,0,0.1);
|
|
1230
|
+
max-height: 320px;
|
|
1231
|
+
overflow-y: auto;
|
|
1232
|
+
}
|
|
1233
|
+
.peasy-search-results.open { display: block; }
|
|
1234
|
+
.peasy-search-result-item {
|
|
1235
|
+
display: flex;
|
|
1236
|
+
align-items: flex-start;
|
|
1237
|
+
gap: 10px;
|
|
1238
|
+
padding: 10px 14px;
|
|
1239
|
+
text-decoration: none;
|
|
1240
|
+
color: var(--text);
|
|
1241
|
+
border-bottom: 1px solid var(--border);
|
|
1242
|
+
cursor: pointer;
|
|
1243
|
+
transition: background 0.1s;
|
|
1244
|
+
}
|
|
1245
|
+
.peasy-search-result-item:last-child { border-bottom: none; }
|
|
1246
|
+
.peasy-search-result-item:hover,
|
|
1247
|
+
.peasy-search-result-item.peasy-highlighted {
|
|
1248
|
+
background: var(--ribbon);
|
|
1249
|
+
}
|
|
1250
|
+
.peasy-search-result-icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
|
|
1251
|
+
.peasy-search-result-name { font-weight: 600; font-size: 13px; }
|
|
1252
|
+
.peasy-search-result-desc {
|
|
1253
|
+
font-size: 12px;
|
|
1254
|
+
color: var(--muted);
|
|
1255
|
+
line-height: 1.4;
|
|
1256
|
+
margin-top: 2px;
|
|
1257
|
+
display: -webkit-box;
|
|
1258
|
+
-webkit-line-clamp: 2;
|
|
1259
|
+
-webkit-box-orient: vertical;
|
|
1260
|
+
overflow: hidden;
|
|
1261
|
+
}
|
|
1262
|
+
.peasy-search-result-type {
|
|
1263
|
+
font-size: 10px;
|
|
1264
|
+
text-transform: uppercase;
|
|
1265
|
+
letter-spacing: 0.05em;
|
|
1266
|
+
color: var(--muted);
|
|
1267
|
+
margin-top: 2px;
|
|
1268
|
+
}
|
|
1269
|
+
.peasy-search-empty {
|
|
1270
|
+
padding: 16px;
|
|
1271
|
+
text-align: center;
|
|
1272
|
+
font-size: 13px;
|
|
1273
|
+
color: var(--muted);
|
|
1274
|
+
}
|
|
1275
|
+
.peasy-search-footer { padding: 8px 14px 14px; }
|
|
1276
|
+
</style>
|
|
1277
|
+
<div class="peasy-search-outer">
|
|
1278
|
+
<div class="peasy-search-inner">
|
|
1279
|
+
<span class="peasy-search-icon-wrap">${P}</span>
|
|
1280
|
+
<input class="peasy-search-input-el" type="search" placeholder="${s(o)}" autocomplete="off" spellcheck="false" />
|
|
1281
|
+
</div>
|
|
1282
|
+
<div class="peasy-search-results" role="listbox"></div>
|
|
1283
|
+
</div>
|
|
1284
|
+
<div class="peasy-search-footer">
|
|
1285
|
+
${m(e)}
|
|
1286
|
+
</div>
|
|
1287
|
+
`;let p=a.querySelector(".peasy-search-input-el"),l=a.querySelector(".peasy-search-results"),d=[],y=-1;function g(){l.classList.add("open")}function c(){l.classList.remove("open"),y=-1}function f(b,S){if(b.length===0){let v=document.createElement("div");v.className="peasy-search-empty",v.textContent=`No results for "${S}" \u2014 try a different search term`,l.replaceChildren(v),g();return}l.innerHTML=b.map((v,H)=>{let R=Me(e,v),_=v.description?v.description.length>100?v.description.substring(0,100)+"\u2026":v.description:"";return`
|
|
1288
|
+
<a class="peasy-search-result-item" href="${R}" target="_blank" rel="noopener" data-index="${H}">
|
|
1289
|
+
<span class="peasy-search-result-icon">${Ee(v.type)}</span>
|
|
1290
|
+
<div>
|
|
1291
|
+
<div class="peasy-search-result-name">${s(v.name)}</div>
|
|
1292
|
+
${_?`<div class="peasy-search-result-desc">${s(_)}</div>`:""}
|
|
1293
|
+
<div class="peasy-search-result-type">${s(v.type)}</div>
|
|
1294
|
+
</div>
|
|
1295
|
+
</a>
|
|
1296
|
+
`}).join(""),g(),y=-1}function h(){l.querySelectorAll(".peasy-search-result-item").forEach((S,v)=>{S.classList.toggle("peasy-highlighted",v===y)})}let C=Le((...b)=>{let S=b[0];if(S.length<2){c();return}$(e,`/api/v1/search/?q=${encodeURIComponent(S)}`,{lang:r.lang}).then(v=>{d=(v==null?void 0:v.results)??[],f(d,S)})},300);p.addEventListener("input",()=>{let b=p.value.trim();if(b.length<2){c();return}C(b)}),p.addEventListener("keydown",b=>{let S=l.querySelectorAll(".peasy-search-result-item");if(!(!l.classList.contains("open")||S.length===0))if(b.key==="ArrowDown")b.preventDefault(),y=Math.min(y+1,S.length-1),h();else if(b.key==="ArrowUp")b.preventDefault(),y=Math.max(y-1,0),h();else if(b.key==="Enter"&&y>=0){b.preventDefault();let v=S[y];v.href&&(window.open(v.href,"_blank","noopener"),c())}else b.key==="Escape"&&c()}),document.addEventListener("click",b=>{t.contains(b.target)||c()},{capture:!0})}function ie(t,e,r){let n=t.dataset,o=n.slug,i=n.height||"600";if(!o)return;let a=`${e.embedBase}/${encodeURI(o)}/?theme=${encodeURIComponent(r.theme)}`,p=`https://${e.domain}/${o}/`,l=t.attachShadow({mode:"open"}),d=document.createElement("style");d.textContent=B(e.accent)+`
|
|
1297
|
+
.peasy-iframe-wrap {
|
|
1298
|
+
width: 100%;
|
|
1299
|
+
font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
|
|
1300
|
+
}
|
|
1301
|
+
.peasy-iframe-skeleton {
|
|
1302
|
+
width: 100%;
|
|
1303
|
+
border-radius: 8px;
|
|
1304
|
+
background: linear-gradient(90deg, var(--border) 25%, var(--ribbon) 50%, var(--border) 75%);
|
|
1305
|
+
background-size: 200% 100%;
|
|
1306
|
+
animation: peasy-shimmer 1.4s infinite;
|
|
1307
|
+
display: flex;
|
|
1308
|
+
align-items: center;
|
|
1309
|
+
justify-content: center;
|
|
1310
|
+
color: var(--muted);
|
|
1311
|
+
font-size: 13px;
|
|
1312
|
+
gap: 8px;
|
|
1313
|
+
}
|
|
1314
|
+
@keyframes peasy-shimmer {
|
|
1315
|
+
0% { background-position: 200% 0; }
|
|
1316
|
+
100% { background-position: -200% 0; }
|
|
1317
|
+
}
|
|
1318
|
+
.peasy-iframe-el {
|
|
1319
|
+
display: none;
|
|
1320
|
+
width: 100%;
|
|
1321
|
+
border: none;
|
|
1322
|
+
border-radius: 8px;
|
|
1323
|
+
border: 1px solid var(--border);
|
|
1324
|
+
}
|
|
1325
|
+
.peasy-iframe-footer {
|
|
1326
|
+
display: flex;
|
|
1327
|
+
align-items: center;
|
|
1328
|
+
justify-content: space-between;
|
|
1329
|
+
padding: 8px 4px 0;
|
|
1330
|
+
}
|
|
1331
|
+
`,l.appendChild(d);let y=document.createElement("div");y.className="peasy-widget peasy-iframe-wrap",y.setAttribute("data-theme",r.theme),y.setAttribute("data-size",r.size);let g=document.createElement("div");g.className="peasy-iframe-skeleton",g.style.height=`${i}px`,g.innerHTML=`
|
|
1332
|
+
<span class="peasy-spinner" style="width:18px;height:18px;border:2px solid #e5e7eb;border-top-color:${e.accent};border-radius:50%;animation:peasy-spin 0.7s linear infinite;display:inline-block;"></span>
|
|
1333
|
+
Loading ${e.name} tool\u2026
|
|
1334
|
+
`,y.appendChild(g);let c=document.createElement("iframe");c.className="peasy-iframe-el",c.src=a,c.width="100%",c.height=`${i}`,c.setAttribute("frameborder","0"),c.setAttribute("allow","clipboard-write"),c.setAttribute("style",`border:none;border-radius:8px;width:100%;height:${i}px;`),c.setAttribute("loading","lazy"),c.addEventListener("load",()=>{g.style.display="none",c.style.display="block"}),y.appendChild(c);let f=document.createElement("div");f.className="peasy-iframe-footer",f.innerHTML=`
|
|
1335
|
+
<a class="peasy-link" href="${p}" target="_blank" rel="noopener" style="font-size:12px;font-weight:500;color:${e.accent};text-decoration:none;display:inline-flex;align-items:center;gap:4px;">
|
|
1336
|
+
Open ${s(o.split("/").pop()||"tool")} in full view on ${s(e.name)} ${k}
|
|
1337
|
+
</a>
|
|
1338
|
+
${m(e)}
|
|
1339
|
+
`,y.appendChild(f),l.appendChild(y)}function pe(t,e,r){let n=t.dataset,o=n.placeholder||"Type or paste your text here\u2026",i=n.text||"",a=u(t,e),p=x(a,t,"peasy-word-counter");p.innerHTML=`
|
|
1340
|
+
<style>
|
|
1341
|
+
.peasy-wc-body { padding: 12px 16px; }
|
|
1342
|
+
.peasy-wc-textarea {
|
|
1343
|
+
width: 100%;
|
|
1344
|
+
min-height: 120px;
|
|
1345
|
+
padding: 10px 12px;
|
|
1346
|
+
border: 1px solid var(--input-border);
|
|
1347
|
+
border-radius: 6px;
|
|
1348
|
+
background: var(--input-bg);
|
|
1349
|
+
color: var(--text);
|
|
1350
|
+
font-size: 14px;
|
|
1351
|
+
font-family: inherit;
|
|
1352
|
+
line-height: 1.6;
|
|
1353
|
+
resize: vertical;
|
|
1354
|
+
outline: none;
|
|
1355
|
+
transition: border-color 0.15s;
|
|
1356
|
+
box-sizing: border-box;
|
|
1357
|
+
}
|
|
1358
|
+
.peasy-wc-textarea:focus {
|
|
1359
|
+
border-color: var(--input-focus);
|
|
1360
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
1361
|
+
}
|
|
1362
|
+
.peasy-wc-stats {
|
|
1363
|
+
display: grid;
|
|
1364
|
+
grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
|
|
1365
|
+
gap: 8px;
|
|
1366
|
+
margin-top: 10px;
|
|
1367
|
+
}
|
|
1368
|
+
.peasy-wc-stat-card {
|
|
1369
|
+
background: var(--ribbon);
|
|
1370
|
+
border: 1px solid var(--border);
|
|
1371
|
+
border-radius: 6px;
|
|
1372
|
+
padding: 8px 10px;
|
|
1373
|
+
text-align: center;
|
|
1374
|
+
}
|
|
1375
|
+
.peasy-wc-stat-value {
|
|
1376
|
+
font-size: 18px;
|
|
1377
|
+
font-weight: 700;
|
|
1378
|
+
color: var(--accent);
|
|
1379
|
+
line-height: 1.2;
|
|
1380
|
+
}
|
|
1381
|
+
.peasy-wc-stat-label {
|
|
1382
|
+
font-size: 11px;
|
|
1383
|
+
color: var(--muted);
|
|
1384
|
+
margin-top: 2px;
|
|
1385
|
+
}
|
|
1386
|
+
</style>
|
|
1387
|
+
<div class="peasy-wc-body">
|
|
1388
|
+
<textarea class="peasy-wc-textarea" placeholder="${s(o)}">${s(i)}</textarea>
|
|
1389
|
+
<div class="peasy-wc-stats">
|
|
1390
|
+
<div class="peasy-wc-stat-card">
|
|
1391
|
+
<div class="peasy-wc-stat-value" id="wc-words">0</div>
|
|
1392
|
+
<div class="peasy-wc-stat-label">Words</div>
|
|
1393
|
+
</div>
|
|
1394
|
+
<div class="peasy-wc-stat-card">
|
|
1395
|
+
<div class="peasy-wc-stat-value" id="wc-chars">0</div>
|
|
1396
|
+
<div class="peasy-wc-stat-label">Characters</div>
|
|
1397
|
+
</div>
|
|
1398
|
+
<div class="peasy-wc-stat-card">
|
|
1399
|
+
<div class="peasy-wc-stat-value" id="wc-sentences">0</div>
|
|
1400
|
+
<div class="peasy-wc-stat-label">Sentences</div>
|
|
1401
|
+
</div>
|
|
1402
|
+
<div class="peasy-wc-stat-card">
|
|
1403
|
+
<div class="peasy-wc-stat-value" id="wc-lines">0</div>
|
|
1404
|
+
<div class="peasy-wc-stat-label">Lines</div>
|
|
1405
|
+
</div>
|
|
1406
|
+
<div class="peasy-wc-stat-card">
|
|
1407
|
+
<div class="peasy-wc-stat-value" id="wc-reading">0</div>
|
|
1408
|
+
<div class="peasy-wc-stat-label">Min read</div>
|
|
1409
|
+
</div>
|
|
1410
|
+
</div>
|
|
1411
|
+
</div>
|
|
1412
|
+
${m(e)}
|
|
1413
|
+
`;let l=p.querySelector(".peasy-wc-textarea"),d=p.querySelector("#wc-words"),y=p.querySelector("#wc-chars"),g=p.querySelector("#wc-sentences"),c=p.querySelector("#wc-lines"),f=p.querySelector("#wc-reading");function h(){let C=l.value,b=C.trim()===""?0:C.trim().split(/\s+/).length,S=C.length,v=C===""?0:(C.match(/[.!?]+/g)||[]).length,H=C===""?0:C.split(/\n/).length,R=Math.max(1,Math.ceil(b/200));d.textContent=String(b),y.textContent=String(S),g.textContent=String(v),c.textContent=String(H),f.textContent=String(R)}l.addEventListener("input",h),i&&h()}function ze(t){try{return btoa(unescape(encodeURIComponent(t)))}catch{return btoa(t)}}function He(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function _e(t){return Array.from(t).map(e=>{let r=e.codePointAt(0);return r===void 0?"":`U+${r.toString(16).toUpperCase().padStart(4,"0")}`}).join(" ")}function Ie(t,e){switch(e){case"base64":return ze(t);case"url":return encodeURIComponent(t);case"html":return He(t);case"unicode":return _e(t)}}function le(t,e,r){let n=u(t,e),o=x(n,t,"peasy-encoder");o.innerHTML=`
|
|
1414
|
+
<style>
|
|
1415
|
+
.peasy-enc-body { padding: 12px 16px; }
|
|
1416
|
+
.peasy-enc-textarea {
|
|
1417
|
+
width: 100%;
|
|
1418
|
+
min-height: 80px;
|
|
1419
|
+
padding: 10px 12px;
|
|
1420
|
+
border: 1px solid var(--input-border);
|
|
1421
|
+
border-radius: 6px;
|
|
1422
|
+
background: var(--input-bg);
|
|
1423
|
+
color: var(--text);
|
|
1424
|
+
font-size: 13px;
|
|
1425
|
+
font-family: ui-monospace, 'Fira Code', monospace;
|
|
1426
|
+
line-height: 1.5;
|
|
1427
|
+
resize: vertical;
|
|
1428
|
+
outline: none;
|
|
1429
|
+
transition: border-color 0.15s;
|
|
1430
|
+
box-sizing: border-box;
|
|
1431
|
+
margin-bottom: 10px;
|
|
1432
|
+
}
|
|
1433
|
+
.peasy-enc-textarea:focus {
|
|
1434
|
+
border-color: var(--input-focus);
|
|
1435
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
1436
|
+
}
|
|
1437
|
+
.peasy-enc-tabs {
|
|
1438
|
+
display: flex;
|
|
1439
|
+
gap: 4px;
|
|
1440
|
+
margin-bottom: 8px;
|
|
1441
|
+
flex-wrap: wrap;
|
|
1442
|
+
}
|
|
1443
|
+
.peasy-enc-tab {
|
|
1444
|
+
padding: 5px 12px;
|
|
1445
|
+
border-radius: 5px;
|
|
1446
|
+
border: 1px solid var(--border);
|
|
1447
|
+
background: var(--ribbon);
|
|
1448
|
+
color: var(--text);
|
|
1449
|
+
font-size: 12px;
|
|
1450
|
+
font-weight: 500;
|
|
1451
|
+
cursor: pointer;
|
|
1452
|
+
font-family: inherit;
|
|
1453
|
+
transition: background 0.1s, border-color 0.1s;
|
|
1454
|
+
}
|
|
1455
|
+
.peasy-enc-tab.active {
|
|
1456
|
+
background: var(--accent);
|
|
1457
|
+
color: #fff;
|
|
1458
|
+
border-color: var(--accent);
|
|
1459
|
+
}
|
|
1460
|
+
.peasy-enc-output-wrap {
|
|
1461
|
+
position: relative;
|
|
1462
|
+
}
|
|
1463
|
+
.peasy-enc-copy-row {
|
|
1464
|
+
display: flex;
|
|
1465
|
+
justify-content: flex-end;
|
|
1466
|
+
margin-top: 6px;
|
|
1467
|
+
}
|
|
1468
|
+
</style>
|
|
1469
|
+
<div class="peasy-enc-body">
|
|
1470
|
+
<textarea class="peasy-enc-textarea" placeholder="Enter text to encode\u2026"></textarea>
|
|
1471
|
+
<div class="peasy-enc-tabs">
|
|
1472
|
+
<button class="peasy-enc-tab active" data-mode="base64">Base64</button>
|
|
1473
|
+
<button class="peasy-enc-tab" data-mode="url">URL Encode</button>
|
|
1474
|
+
<button class="peasy-enc-tab" data-mode="html">HTML Entities</button>
|
|
1475
|
+
<button class="peasy-enc-tab" data-mode="unicode">Unicode</button>
|
|
1476
|
+
</div>
|
|
1477
|
+
<div class="peasy-enc-output-wrap">
|
|
1478
|
+
<textarea class="peasy-enc-textarea" id="enc-output" readonly placeholder="Encoded output will appear here\u2026" style="background:var(--ribbon);margin-bottom:0;"></textarea>
|
|
1479
|
+
<div class="peasy-enc-copy-row">
|
|
1480
|
+
<button class="peasy-copy-btn" id="enc-copy-btn">${M} Copy</button>
|
|
1481
|
+
</div>
|
|
1482
|
+
</div>
|
|
1483
|
+
</div>
|
|
1484
|
+
${m(e)}
|
|
1485
|
+
`;let i=o.querySelector(".peasy-enc-textarea"),a=o.querySelector("#enc-output"),p=o.querySelector("#enc-copy-btn"),l=o.querySelectorAll(".peasy-enc-tab"),d="base64";function y(){a.value=i.value?Ie(i.value,d):"",E(p,a.value)}l.forEach(g=>{g.addEventListener("click",()=>{l.forEach(c=>c.classList.remove("active")),g.classList.add("active"),d=g.dataset.mode,y()})}),i.addEventListener("input",y),E(p,"")}async function ce(t,e){let n=new TextEncoder().encode(e),o=await crypto.subtle.digest(t,n);return Array.from(new Uint8Array(o)).map(a=>a.toString(16).padStart(2,"0")).join("")}function de(t,e,r){let n=u(t,e),o=x(n,t,"peasy-hash-generator");o.innerHTML=`
|
|
1486
|
+
<style>
|
|
1487
|
+
.peasy-hash-body { padding: 12px 16px; }
|
|
1488
|
+
.peasy-hash-textarea {
|
|
1489
|
+
width: 100%;
|
|
1490
|
+
min-height: 80px;
|
|
1491
|
+
padding: 10px 12px;
|
|
1492
|
+
border: 1px solid var(--input-border);
|
|
1493
|
+
border-radius: 6px;
|
|
1494
|
+
background: var(--input-bg);
|
|
1495
|
+
color: var(--text);
|
|
1496
|
+
font-size: 13px;
|
|
1497
|
+
font-family: inherit;
|
|
1498
|
+
line-height: 1.5;
|
|
1499
|
+
resize: vertical;
|
|
1500
|
+
outline: none;
|
|
1501
|
+
transition: border-color 0.15s;
|
|
1502
|
+
box-sizing: border-box;
|
|
1503
|
+
margin-bottom: 12px;
|
|
1504
|
+
}
|
|
1505
|
+
.peasy-hash-textarea:focus {
|
|
1506
|
+
border-color: var(--input-focus);
|
|
1507
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
1508
|
+
}
|
|
1509
|
+
.peasy-hash-row {
|
|
1510
|
+
margin-bottom: 10px;
|
|
1511
|
+
}
|
|
1512
|
+
.peasy-hash-label {
|
|
1513
|
+
font-size: 11px;
|
|
1514
|
+
font-weight: 600;
|
|
1515
|
+
text-transform: uppercase;
|
|
1516
|
+
letter-spacing: 0.06em;
|
|
1517
|
+
color: var(--muted);
|
|
1518
|
+
margin-bottom: 4px;
|
|
1519
|
+
display: block;
|
|
1520
|
+
}
|
|
1521
|
+
.peasy-hash-value-row {
|
|
1522
|
+
display: flex;
|
|
1523
|
+
align-items: center;
|
|
1524
|
+
gap: 6px;
|
|
1525
|
+
}
|
|
1526
|
+
.peasy-hash-value {
|
|
1527
|
+
flex: 1;
|
|
1528
|
+
font-family: ui-monospace, 'Fira Code', monospace;
|
|
1529
|
+
font-size: 11px;
|
|
1530
|
+
color: var(--text);
|
|
1531
|
+
background: var(--ribbon);
|
|
1532
|
+
border: 1px solid var(--border);
|
|
1533
|
+
border-radius: 5px;
|
|
1534
|
+
padding: 6px 10px;
|
|
1535
|
+
word-break: break-all;
|
|
1536
|
+
min-height: 30px;
|
|
1537
|
+
}
|
|
1538
|
+
.peasy-hash-placeholder { color: var(--muted); font-style: italic; }
|
|
1539
|
+
</style>
|
|
1540
|
+
<div class="peasy-hash-body">
|
|
1541
|
+
<textarea class="peasy-hash-textarea" placeholder="Enter text to generate cryptographic hash\u2026"></textarea>
|
|
1542
|
+
<div class="peasy-hash-row">
|
|
1543
|
+
<span class="peasy-hash-label">SHA-1</span>
|
|
1544
|
+
<div class="peasy-hash-value-row">
|
|
1545
|
+
<div class="peasy-hash-value" id="hash-sha1"><span class="peasy-hash-placeholder">\u2014</span></div>
|
|
1546
|
+
<button class="peasy-copy-btn" id="hash-sha1-copy">${M} Copy</button>
|
|
1547
|
+
</div>
|
|
1548
|
+
</div>
|
|
1549
|
+
<div class="peasy-hash-row">
|
|
1550
|
+
<span class="peasy-hash-label">SHA-256</span>
|
|
1551
|
+
<div class="peasy-hash-value-row">
|
|
1552
|
+
<div class="peasy-hash-value" id="hash-sha256"><span class="peasy-hash-placeholder">\u2014</span></div>
|
|
1553
|
+
<button class="peasy-copy-btn" id="hash-sha256-copy">${M} Copy</button>
|
|
1554
|
+
</div>
|
|
1555
|
+
</div>
|
|
1556
|
+
</div>
|
|
1557
|
+
${m(e)}
|
|
1558
|
+
`;let i=o.querySelector(".peasy-hash-textarea"),a=o.querySelector("#hash-sha1"),p=o.querySelector("#hash-sha256"),l=o.querySelector("#hash-sha1-copy"),d=o.querySelector("#hash-sha256-copy");function y(c){c.innerHTML='<span class="peasy-hash-placeholder">\u2014</span>'}async function g(){let c=i.value;if(!c){y(a),y(p);return}let[f,h]=await Promise.all([ce("SHA-1",c),ce("SHA-256",c)]);a.textContent=f,p.textContent=h,E(l,f),E(d,h)}i.addEventListener("input",()=>{g()}),E(l,""),E(d,"")}var Re=`/* Try editing this CSS */
|
|
1559
|
+
body {
|
|
1560
|
+
font-family: system-ui, sans-serif;
|
|
1561
|
+
padding: 20px;
|
|
1562
|
+
background: #f9fafb;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
.preview {
|
|
1566
|
+
background: white;
|
|
1567
|
+
padding: 16px;
|
|
1568
|
+
border-radius: 8px;
|
|
1569
|
+
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
span {
|
|
1573
|
+
color: #6366f1;
|
|
1574
|
+
font-weight: 600;
|
|
1575
|
+
}`;function ye(t,e,r){let o=t.dataset.code||Re,i=u(t,e),a=x(i,t,"peasy-css-preview");a.innerHTML=`
|
|
1576
|
+
<style>
|
|
1577
|
+
.peasy-css-body {
|
|
1578
|
+
display: flex;
|
|
1579
|
+
flex-direction: column;
|
|
1580
|
+
gap: 0;
|
|
1581
|
+
}
|
|
1582
|
+
.peasy-css-editor-wrap {
|
|
1583
|
+
padding: 12px 16px;
|
|
1584
|
+
border-bottom: 1px solid var(--border);
|
|
1585
|
+
}
|
|
1586
|
+
.peasy-css-label {
|
|
1587
|
+
font-size: 11px;
|
|
1588
|
+
font-weight: 600;
|
|
1589
|
+
text-transform: uppercase;
|
|
1590
|
+
letter-spacing: 0.06em;
|
|
1591
|
+
color: var(--muted);
|
|
1592
|
+
margin-bottom: 6px;
|
|
1593
|
+
display: block;
|
|
1594
|
+
}
|
|
1595
|
+
.peasy-css-textarea {
|
|
1596
|
+
width: 100%;
|
|
1597
|
+
min-height: 140px;
|
|
1598
|
+
padding: 10px 12px;
|
|
1599
|
+
border: 1px solid var(--input-border);
|
|
1600
|
+
border-radius: 6px;
|
|
1601
|
+
background: var(--input-bg);
|
|
1602
|
+
color: var(--text);
|
|
1603
|
+
font-size: 12px;
|
|
1604
|
+
font-family: ui-monospace, 'Fira Code', monospace;
|
|
1605
|
+
line-height: 1.6;
|
|
1606
|
+
resize: vertical;
|
|
1607
|
+
outline: none;
|
|
1608
|
+
transition: border-color 0.15s;
|
|
1609
|
+
box-sizing: border-box;
|
|
1610
|
+
tab-size: 2;
|
|
1611
|
+
}
|
|
1612
|
+
.peasy-css-textarea:focus {
|
|
1613
|
+
border-color: var(--input-focus);
|
|
1614
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
1615
|
+
}
|
|
1616
|
+
.peasy-css-preview-wrap {
|
|
1617
|
+
padding: 12px 16px;
|
|
1618
|
+
}
|
|
1619
|
+
.peasy-css-preview-frame {
|
|
1620
|
+
width: 100%;
|
|
1621
|
+
min-height: 120px;
|
|
1622
|
+
border: 1px solid var(--border);
|
|
1623
|
+
border-radius: 6px;
|
|
1624
|
+
background: white;
|
|
1625
|
+
box-sizing: border-box;
|
|
1626
|
+
}
|
|
1627
|
+
</style>
|
|
1628
|
+
<div class="peasy-css-body">
|
|
1629
|
+
<div class="peasy-css-editor-wrap">
|
|
1630
|
+
<span class="peasy-css-label">CSS Code</span>
|
|
1631
|
+
<textarea class="peasy-css-textarea" spellcheck="false">${o}</textarea>
|
|
1632
|
+
</div>
|
|
1633
|
+
<div class="peasy-css-preview-wrap">
|
|
1634
|
+
<span class="peasy-css-label">Preview</span>
|
|
1635
|
+
<iframe class="peasy-css-preview-frame" sandbox="" frameborder="0"></iframe>
|
|
1636
|
+
</div>
|
|
1637
|
+
</div>
|
|
1638
|
+
${m(e)}
|
|
1639
|
+
`;let p=a.querySelector(".peasy-css-textarea"),l=a.querySelector(".peasy-css-preview-frame");function d(){let g=`<!DOCTYPE html><html><head><style>${p.value}</style></head><body><div class="preview">Sample text <span>and elements</span> \u2014 CSS preview</div></body></html>`;l.srcdoc=g,l.onload=()=>{var c;try{let f=(c=l.contentDocument)==null?void 0:c.body.scrollHeight;f&&(l.style.height=`${Math.max(80,f)}px`)}catch{}}}p.addEventListener("input",d),d()}function Be(t){return t.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}function ge(t){return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}function me(t,e,r){let n=u(t,e),o=x(n,t,"peasy-css-minifier");o.innerHTML=`
|
|
1640
|
+
<style>
|
|
1641
|
+
.peasy-min-body { padding: 12px 16px; }
|
|
1642
|
+
.peasy-min-textarea {
|
|
1643
|
+
width: 100%;
|
|
1644
|
+
min-height: 120px;
|
|
1645
|
+
padding: 10px 12px;
|
|
1646
|
+
border: 1px solid var(--input-border);
|
|
1647
|
+
border-radius: 6px;
|
|
1648
|
+
background: var(--input-bg);
|
|
1649
|
+
color: var(--text);
|
|
1650
|
+
font-size: 12px;
|
|
1651
|
+
font-family: ui-monospace, 'Fira Code', monospace;
|
|
1652
|
+
line-height: 1.5;
|
|
1653
|
+
resize: vertical;
|
|
1654
|
+
outline: none;
|
|
1655
|
+
transition: border-color 0.15s;
|
|
1656
|
+
box-sizing: border-box;
|
|
1657
|
+
margin-bottom: 10px;
|
|
1658
|
+
tab-size: 2;
|
|
1659
|
+
}
|
|
1660
|
+
.peasy-min-textarea:focus {
|
|
1661
|
+
border-color: var(--input-focus);
|
|
1662
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
1663
|
+
}
|
|
1664
|
+
.peasy-min-stats {
|
|
1665
|
+
display: flex;
|
|
1666
|
+
gap: 10px;
|
|
1667
|
+
flex-wrap: wrap;
|
|
1668
|
+
margin-bottom: 10px;
|
|
1669
|
+
align-items: center;
|
|
1670
|
+
}
|
|
1671
|
+
.peasy-min-stat {
|
|
1672
|
+
font-size: 12px;
|
|
1673
|
+
color: var(--muted);
|
|
1674
|
+
}
|
|
1675
|
+
.peasy-min-stat strong { color: var(--text); }
|
|
1676
|
+
.peasy-min-savings {
|
|
1677
|
+
font-size: 12px;
|
|
1678
|
+
font-weight: 600;
|
|
1679
|
+
color: #16a34a;
|
|
1680
|
+
margin-left: auto;
|
|
1681
|
+
}
|
|
1682
|
+
.peasy-min-bar-wrap {
|
|
1683
|
+
width: 100%;
|
|
1684
|
+
height: 6px;
|
|
1685
|
+
background: var(--border);
|
|
1686
|
+
border-radius: 3px;
|
|
1687
|
+
overflow: hidden;
|
|
1688
|
+
margin-bottom: 10px;
|
|
1689
|
+
}
|
|
1690
|
+
.peasy-min-bar {
|
|
1691
|
+
height: 100%;
|
|
1692
|
+
background: var(--accent);
|
|
1693
|
+
border-radius: 3px;
|
|
1694
|
+
transition: width 0.3s;
|
|
1695
|
+
width: 0%;
|
|
1696
|
+
}
|
|
1697
|
+
.peasy-min-output-label {
|
|
1698
|
+
font-size: 11px;
|
|
1699
|
+
font-weight: 600;
|
|
1700
|
+
text-transform: uppercase;
|
|
1701
|
+
letter-spacing: 0.06em;
|
|
1702
|
+
color: var(--muted);
|
|
1703
|
+
margin-bottom: 4px;
|
|
1704
|
+
}
|
|
1705
|
+
.peasy-min-copy-row {
|
|
1706
|
+
display: flex;
|
|
1707
|
+
justify-content: flex-end;
|
|
1708
|
+
margin-top: 6px;
|
|
1709
|
+
}
|
|
1710
|
+
</style>
|
|
1711
|
+
<div class="peasy-min-body">
|
|
1712
|
+
<textarea class="peasy-min-textarea" placeholder="Paste your CSS here to minify\u2026"></textarea>
|
|
1713
|
+
<div class="peasy-min-stats">
|
|
1714
|
+
<span class="peasy-min-stat">Original: <strong id="min-orig-size">0 B</strong></span>
|
|
1715
|
+
<span class="peasy-min-stat">Minified: <strong id="min-mini-size">0 B</strong></span>
|
|
1716
|
+
<span class="peasy-min-savings" id="min-savings" style="display:none;"></span>
|
|
1717
|
+
</div>
|
|
1718
|
+
<div class="peasy-min-bar-wrap">
|
|
1719
|
+
<div class="peasy-min-bar" id="min-bar"></div>
|
|
1720
|
+
</div>
|
|
1721
|
+
<div class="peasy-min-output-label">Minified Output</div>
|
|
1722
|
+
<textarea class="peasy-min-textarea" id="min-output" readonly placeholder="Minified CSS appears here\u2026" style="background:var(--ribbon);min-height:60px;margin-bottom:0;"></textarea>
|
|
1723
|
+
<div class="peasy-min-copy-row">
|
|
1724
|
+
<button class="peasy-copy-btn" id="min-copy-btn">${M} Copy Minified</button>
|
|
1725
|
+
</div>
|
|
1726
|
+
</div>
|
|
1727
|
+
${m(e)}
|
|
1728
|
+
`;let i=o.querySelector(".peasy-min-textarea"),a=o.querySelector("#min-output"),p=o.querySelector("#min-copy-btn"),l=o.querySelector("#min-orig-size"),d=o.querySelector("#min-mini-size"),y=o.querySelector("#min-savings"),g=o.querySelector("#min-bar");function c(){let f=i.value,h=Be(f);a.value=h;let C=new TextEncoder().encode(f).length,b=new TextEncoder().encode(h).length,S=C>0?Math.round((1-b/C)*100):0,v=C>0?Math.max(5,100-S):0;l.textContent=ge(C),d.textContent=ge(b),g.style.width=`${v}%`,C>0&&S>0?(y.textContent=`\u2212${S}% saved`,y.style.display="inline"):y.style.display="none",E(p,h)}i.addEventListener("input",c),E(p,"")}function Ae(t){let e=t.replace("#","");if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(e))return null;let r=e.length===3?e.split("").map(n=>n+n).join(""):e;return{r:parseInt(r.slice(0,2),16),g:parseInt(r.slice(2,4),16),b:parseInt(r.slice(4,6),16)}}function We(t,e,r){let n=t/255,o=e/255,i=r/255,a=Math.max(n,o,i),p=Math.min(n,o,i),l=0,d=0,y=(a+p)/2;if(a!==p){let g=a-p;switch(d=y>.5?g/(2-a-p):g/(a+p),a){case n:l=((o-i)/g+(o<i?6:0))/6;break;case o:l=((i-n)/g+2)/6;break;case i:l=((n-o)/g+4)/6;break}}return{h:Math.round(l*360),s:Math.round(d*100),l:Math.round(y*100)}}function ue(t,e,r){let o=t.dataset.hex||"",i=u(t,e),a=x(i,t,"peasy-color-converter");a.innerHTML=`
|
|
1729
|
+
<style>
|
|
1730
|
+
.peasy-color-body { padding: 12px 16px; }
|
|
1731
|
+
.peasy-color-input-row {
|
|
1732
|
+
display: flex;
|
|
1733
|
+
align-items: center;
|
|
1734
|
+
gap: 8px;
|
|
1735
|
+
margin-bottom: 12px;
|
|
1736
|
+
}
|
|
1737
|
+
.peasy-color-swatch {
|
|
1738
|
+
width: 36px;
|
|
1739
|
+
height: 36px;
|
|
1740
|
+
border-radius: 6px;
|
|
1741
|
+
border: 1px solid var(--border);
|
|
1742
|
+
flex-shrink: 0;
|
|
1743
|
+
background: #f3f4f6;
|
|
1744
|
+
transition: background 0.2s;
|
|
1745
|
+
}
|
|
1746
|
+
.peasy-color-hex-input {
|
|
1747
|
+
flex: 1;
|
|
1748
|
+
padding: 8px 12px;
|
|
1749
|
+
border: 1px solid var(--input-border);
|
|
1750
|
+
border-radius: 6px;
|
|
1751
|
+
background: var(--input-bg);
|
|
1752
|
+
color: var(--text);
|
|
1753
|
+
font-size: 14px;
|
|
1754
|
+
font-family: ui-monospace, 'Fira Code', monospace;
|
|
1755
|
+
outline: none;
|
|
1756
|
+
transition: border-color 0.15s;
|
|
1757
|
+
}
|
|
1758
|
+
.peasy-color-hex-input:focus {
|
|
1759
|
+
border-color: var(--input-focus);
|
|
1760
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
1761
|
+
}
|
|
1762
|
+
.peasy-color-rows { display: flex; flex-direction: column; gap: 6px; }
|
|
1763
|
+
.peasy-color-row {
|
|
1764
|
+
display: flex;
|
|
1765
|
+
align-items: center;
|
|
1766
|
+
gap: 8px;
|
|
1767
|
+
padding: 6px 10px;
|
|
1768
|
+
background: var(--ribbon);
|
|
1769
|
+
border: 1px solid var(--border);
|
|
1770
|
+
border-radius: 6px;
|
|
1771
|
+
}
|
|
1772
|
+
.peasy-color-row-label {
|
|
1773
|
+
font-size: 11px;
|
|
1774
|
+
font-weight: 700;
|
|
1775
|
+
text-transform: uppercase;
|
|
1776
|
+
color: var(--muted);
|
|
1777
|
+
width: 48px;
|
|
1778
|
+
flex-shrink: 0;
|
|
1779
|
+
}
|
|
1780
|
+
.peasy-color-row-value {
|
|
1781
|
+
flex: 1;
|
|
1782
|
+
font-size: 13px;
|
|
1783
|
+
font-family: ui-monospace, 'Fira Code', monospace;
|
|
1784
|
+
color: var(--text);
|
|
1785
|
+
}
|
|
1786
|
+
.peasy-color-empty { color: var(--muted); font-size: 13px; }
|
|
1787
|
+
</style>
|
|
1788
|
+
<div class="peasy-color-body">
|
|
1789
|
+
<div class="peasy-color-input-row">
|
|
1790
|
+
<div class="peasy-color-swatch" id="color-swatch"></div>
|
|
1791
|
+
<input class="peasy-color-hex-input" type="text" placeholder="#FF6B35 or FF6B35" maxlength="7" value="${o}" />
|
|
1792
|
+
</div>
|
|
1793
|
+
<div class="peasy-color-rows" id="color-results">
|
|
1794
|
+
<div class="peasy-color-empty">Enter a hex color code above to convert formats</div>
|
|
1795
|
+
</div>
|
|
1796
|
+
</div>
|
|
1797
|
+
${m(e)}
|
|
1798
|
+
`;let p=a.querySelector(".peasy-color-hex-input"),l=a.querySelector("#color-swatch"),d=a.querySelector("#color-results");function y(c,f,h){return`
|
|
1799
|
+
<div class="peasy-color-row">
|
|
1800
|
+
<span class="peasy-color-row-label">${c}</span>
|
|
1801
|
+
<span class="peasy-color-row-value" id="${h}">${f}</span>
|
|
1802
|
+
<button class="peasy-copy-btn" data-copy-id="${h}">${M} Copy</button>
|
|
1803
|
+
</div>
|
|
1804
|
+
`}function g(){let c=p.value.trim(),f=c.startsWith("#")?c:`#${c}`,h=Ae(f);if(!h){l.style.background="#f3f4f6",d.innerHTML=c.length<3?'<div class="peasy-color-empty">Enter a hex color code above to convert formats</div>':'<div class="peasy-color-empty" style="color:#dc2626;">Invalid hex color \u2014 use format #RRGGBB</div>';return}let C=We(h.r,h.g,h.b),b=f.toUpperCase(),S=`rgb(${h.r}, ${h.g}, ${h.b})`,v=`hsl(${C.h}, ${C.s}%, ${C.l}%)`;l.style.background=b,d.innerHTML=y("HEX",b,"cv-hex")+y("RGB",S,"cv-rgb")+y("HSL",v,"cv-hsl"),d.querySelectorAll("[data-copy-id]").forEach(H=>{let R=H.dataset.copyId,_=d.querySelector(`#${R}`);E(H,(_==null?void 0:_.textContent)||"")})}p.addEventListener("input",g),o&&g()}var Oe=[{name:"Gzip",ratio:.32,color:"#3b82f6"},{name:"Brotli",ratio:.28,color:"#8b5cf6"},{name:"Zstd",ratio:.29,color:"#06b6d4"},{name:"LZ4",ratio:.41,color:"#f59e0b"}];function qe(t){return t<.001?`${(t*1024*1024).toFixed(0)} B`:t<1?`${(t*1024).toFixed(1)} KB`:`${t.toFixed(2)} MB`}function xe(t,e,r){let n=u(t,e),o=x(n,t,"peasy-compression-ratio");o.innerHTML=`
|
|
1805
|
+
<style>
|
|
1806
|
+
.peasy-cr-body { padding: 14px 16px; }
|
|
1807
|
+
.peasy-cr-input-row {
|
|
1808
|
+
display: flex;
|
|
1809
|
+
align-items: center;
|
|
1810
|
+
gap: 10px;
|
|
1811
|
+
margin-bottom: 14px;
|
|
1812
|
+
flex-wrap: wrap;
|
|
1813
|
+
}
|
|
1814
|
+
.peasy-cr-input-label {
|
|
1815
|
+
font-size: 13px;
|
|
1816
|
+
color: var(--text);
|
|
1817
|
+
font-weight: 500;
|
|
1818
|
+
flex-shrink: 0;
|
|
1819
|
+
}
|
|
1820
|
+
.peasy-cr-number-input {
|
|
1821
|
+
width: 90px;
|
|
1822
|
+
padding: 7px 10px;
|
|
1823
|
+
border: 1px solid var(--input-border);
|
|
1824
|
+
border-radius: 6px;
|
|
1825
|
+
background: var(--input-bg);
|
|
1826
|
+
color: var(--text);
|
|
1827
|
+
font-size: 14px;
|
|
1828
|
+
font-family: inherit;
|
|
1829
|
+
outline: none;
|
|
1830
|
+
transition: border-color 0.15s;
|
|
1831
|
+
}
|
|
1832
|
+
.peasy-cr-number-input:focus {
|
|
1833
|
+
border-color: var(--input-focus);
|
|
1834
|
+
box-shadow: 0 0 0 2px color-mix(in srgb, var(--input-focus) 20%, transparent);
|
|
1835
|
+
}
|
|
1836
|
+
.peasy-cr-slider {
|
|
1837
|
+
flex: 1;
|
|
1838
|
+
min-width: 100px;
|
|
1839
|
+
accent-color: var(--accent);
|
|
1840
|
+
}
|
|
1841
|
+
.peasy-cr-algo-rows { display: flex; flex-direction: column; gap: 8px; }
|
|
1842
|
+
.peasy-cr-algo-row {
|
|
1843
|
+
display: grid;
|
|
1844
|
+
grid-template-columns: 60px 1fr 80px;
|
|
1845
|
+
align-items: center;
|
|
1846
|
+
gap: 10px;
|
|
1847
|
+
}
|
|
1848
|
+
.peasy-cr-algo-name { font-size: 13px; font-weight: 600; color: var(--text); }
|
|
1849
|
+
.peasy-cr-bar-track {
|
|
1850
|
+
height: 10px;
|
|
1851
|
+
background: var(--border);
|
|
1852
|
+
border-radius: 5px;
|
|
1853
|
+
overflow: hidden;
|
|
1854
|
+
}
|
|
1855
|
+
.peasy-cr-bar-fill {
|
|
1856
|
+
height: 100%;
|
|
1857
|
+
border-radius: 5px;
|
|
1858
|
+
transition: width 0.3s;
|
|
1859
|
+
}
|
|
1860
|
+
.peasy-cr-algo-size { font-size: 12px; color: var(--muted); text-align: right; }
|
|
1861
|
+
</style>
|
|
1862
|
+
<div class="peasy-cr-body">
|
|
1863
|
+
<div class="peasy-cr-input-row">
|
|
1864
|
+
<span class="peasy-cr-input-label">File size:</span>
|
|
1865
|
+
<input class="peasy-cr-number-input" type="number" id="cr-size-input" min="0.001" max="10000" step="0.1" value="10" />
|
|
1866
|
+
<span class="peasy-cr-input-label">MB</span>
|
|
1867
|
+
<input class="peasy-cr-slider" type="range" id="cr-size-slider" min="1" max="100" value="10" step="1" />
|
|
1868
|
+
</div>
|
|
1869
|
+
<div class="peasy-cr-algo-rows" id="cr-results"></div>
|
|
1870
|
+
</div>
|
|
1871
|
+
${m(e)}
|
|
1872
|
+
`;let i=o.querySelector("#cr-size-input"),a=o.querySelector("#cr-size-slider"),p=o.querySelector("#cr-results");function l(y){p.innerHTML=Oe.map(g=>{let c=y*g.ratio,f=Math.round(g.ratio*100);return`
|
|
1873
|
+
<div class="peasy-cr-algo-row">
|
|
1874
|
+
<span class="peasy-cr-algo-name">${g.name}</span>
|
|
1875
|
+
<div class="peasy-cr-bar-track">
|
|
1876
|
+
<div class="peasy-cr-bar-fill" style="width:${f}%;background:${g.color};"></div>
|
|
1877
|
+
</div>
|
|
1878
|
+
<span class="peasy-cr-algo-size">${qe(c)} (${f}%)</span>
|
|
1879
|
+
</div>
|
|
1880
|
+
`}).join("")}function d(){let y=parseFloat(i.value);isNaN(y)||y<=0||l(y)}i.addEventListener("input",()=>{a.value=String(Math.min(100,parseFloat(i.value)||10)),d()}),a.addEventListener("input",()=>{i.value=a.value,d()}),l(10)}var ve={format:V,tool:J,convert:Z,compare:ee,glossary:te,gallery:ae,guide:oe,usecase:se,badge:re,search:ne,interactive:ie,wordcount:pe,encode:le,hash:de,preview:ye,minify:me,color:ue,ratio:xe};function fe(t){document.querySelectorAll(`[${t.attribute}]`).forEach(r=>{if(r.shadowRoot)return;let n=r.getAttribute(t.attribute);if(!n)return;let o=ve[n];if(!o)return;let i=A(r);n==="badge"?o(r,t,i):F(r,()=>o(r,t,i))})}function be(t,e){if(!t.hasAttribute(e.attribute)||t.shadowRoot)return;let r=t.getAttribute(e.attribute);if(!r)return;let n=ve[r];if(!n)return;let o=A(t);r==="badge"?n(t,e,o):F(t,()=>n(t,e,o))}(function(){let e=w;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>fe(e)):fe(e),new MutationObserver(n=>{n.forEach(o=>{o.addedNodes.forEach(i=>{var p;if(i.nodeType!==Node.ELEMENT_NODE)return;let a=i;be(a,e),(p=a.querySelectorAll)==null||p.call(a,`[${e.attribute}]`).forEach(l=>{be(l,e)})})})}).observe(document.body||document.documentElement,{childList:!0,subtree:!0})})();})();
|