@peeekpage/viewer 0.3.15 → 0.3.17
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/dist/index.js +125 -145
- package/dist/peeekviewer.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as y, jsx as a, Fragment as Ze } from "react/jsx-runtime";
|
|
2
|
-
import { useState as w, useRef as O, useEffect as T, useCallback as
|
|
2
|
+
import { useState as w, useRef as O, useEffect as T, useCallback as S, useMemo as Ue } from "react";
|
|
3
3
|
const je = /* @__PURE__ */ new Set(["http:", "https:"]);
|
|
4
|
-
function
|
|
4
|
+
function D(t) {
|
|
5
5
|
if (typeof t != "string") return null;
|
|
6
6
|
const e = t.trim();
|
|
7
7
|
if (e === "" || e.includes(" ")) return null;
|
|
@@ -45,10 +45,6 @@ const qe = ["en", "pt-BR"], pe = {
|
|
|
45
45
|
about: "About",
|
|
46
46
|
aboutTagline: "Embeddable document viewer by Peeek Page",
|
|
47
47
|
aboutDescription: "Peeek Viewer shows document pages that live in your own storage, so your files stay yours.",
|
|
48
|
-
aboutLearnMore: "Learn more",
|
|
49
|
-
aboutDocs: "Documentation",
|
|
50
|
-
aboutReport: "Report a problem",
|
|
51
|
-
aboutLegal: "Legal",
|
|
52
48
|
aboutClose: "Close"
|
|
53
49
|
}, Ke = {
|
|
54
50
|
prev: "Página anterior",
|
|
@@ -67,10 +63,6 @@ const qe = ["en", "pt-BR"], pe = {
|
|
|
67
63
|
about: "Sobre",
|
|
68
64
|
aboutTagline: "Visualizador de documentos incorporável do Peeek Page",
|
|
69
65
|
aboutDescription: "O Peeek Viewer exibe as páginas de documentos que ficam no seu próprio armazenamento, então seus arquivos continuam seus.",
|
|
70
|
-
aboutLearnMore: "Saiba mais",
|
|
71
|
-
aboutDocs: "Documentação",
|
|
72
|
-
aboutReport: "Relatar um problema",
|
|
73
|
-
aboutLegal: "Aviso legal",
|
|
74
66
|
aboutClose: "Fechar"
|
|
75
67
|
}, Je = { en: pe, "pt-BR": Ke };
|
|
76
68
|
function Qe(t) {
|
|
@@ -87,12 +79,12 @@ function tt(t) {
|
|
|
87
79
|
return {
|
|
88
80
|
src: typeof t.src == "string" ? t.src : "",
|
|
89
81
|
mode: H(t.mode, ["flip", "coverflow"], "flip"),
|
|
90
|
-
logo:
|
|
91
|
-
logoLink:
|
|
82
|
+
logo: D(t.logo),
|
|
83
|
+
logoLink: D(t.logoLink),
|
|
92
84
|
accentColor: ge(t.accentColor) ?? et,
|
|
93
85
|
background: H(t.background, ["color", "image", "transparent"], "color"),
|
|
94
86
|
backgroundColor: We(t.backgroundColor),
|
|
95
|
-
backgroundImage:
|
|
87
|
+
backgroundImage: D(t.backgroundImage),
|
|
96
88
|
layout: H(t.layout, ["single", "double"], "double"),
|
|
97
89
|
fillHeight: I(t.fillHeight, !1),
|
|
98
90
|
pageShadows: I(t.pageShadows, !0),
|
|
@@ -107,13 +99,13 @@ function tt(t) {
|
|
|
107
99
|
arrows: I(t.arrows, !0),
|
|
108
100
|
navigationBar: I(t.navigationBar, !0),
|
|
109
101
|
pagesOverview: I(t.pagesOverview, !0),
|
|
110
|
-
downloadUrl:
|
|
102
|
+
downloadUrl: D(t.downloadUrl),
|
|
111
103
|
aboutButton: I(t.aboutButton, !0),
|
|
112
104
|
pollInterval: typeof t.pollInterval == "number" && t.pollInterval > 0 ? t.pollInterval : 2e3,
|
|
113
105
|
className: typeof t.className == "string" ? t.className : ""
|
|
114
106
|
};
|
|
115
107
|
}
|
|
116
|
-
const
|
|
108
|
+
const re = 5e3;
|
|
117
109
|
function V(t) {
|
|
118
110
|
return typeof t == "string" ? t : "";
|
|
119
111
|
}
|
|
@@ -123,20 +115,20 @@ function nt(t) {
|
|
|
123
115
|
const e = t;
|
|
124
116
|
if (!Array.isArray(e.pages))
|
|
125
117
|
return { ok: !1, error: "manifest.pages is missing or not an array" };
|
|
126
|
-
if (e.pages.length >
|
|
118
|
+
if (e.pages.length > re)
|
|
127
119
|
return { ok: !1, error: "manifest.pages exceeds the maximum" };
|
|
128
120
|
const n = e.total_pages, r = typeof n == "number" && Number.isFinite(n) && n >= 0 ? n : e.pages.length;
|
|
129
|
-
if (r >
|
|
121
|
+
if (r > re)
|
|
130
122
|
return { ok: !1, error: "manifest.total_pages exceeds the maximum" };
|
|
131
123
|
const l = [];
|
|
132
124
|
for (const d of e.pages) {
|
|
133
125
|
if (d === null || typeof d != "object") continue;
|
|
134
|
-
const
|
|
135
|
-
|
|
126
|
+
const i = D(d.url);
|
|
127
|
+
i && l.push(i);
|
|
136
128
|
}
|
|
137
129
|
if (l.length === 0)
|
|
138
130
|
return { ok: !1, error: "manifest has no usable pages" };
|
|
139
|
-
const
|
|
131
|
+
const c = e.status === "wip" ? "wip" : "done", p = e.metadata && typeof e.metadata == "object" ? e.metadata : {}, b = {
|
|
140
132
|
fileId: V(p.file_id),
|
|
141
133
|
filename: V(p.filename),
|
|
142
134
|
creationDate: V(p.creation_date),
|
|
@@ -145,15 +137,15 @@ function nt(t) {
|
|
|
145
137
|
};
|
|
146
138
|
return {
|
|
147
139
|
ok: !0,
|
|
148
|
-
value: { status:
|
|
140
|
+
value: { status: c, totalPages: r, pages: l, metadata: b }
|
|
149
141
|
};
|
|
150
142
|
}
|
|
151
|
-
function
|
|
152
|
-
if (!Array.isArray(t) || t.length >
|
|
143
|
+
function rt(t, e) {
|
|
144
|
+
if (!Array.isArray(t) || t.length > re) return null;
|
|
153
145
|
const n = [];
|
|
154
146
|
for (const l of t) {
|
|
155
|
-
const
|
|
156
|
-
|
|
147
|
+
const c = D(l);
|
|
148
|
+
c && n.push(c);
|
|
157
149
|
}
|
|
158
150
|
return n.length === 0 ? null : {
|
|
159
151
|
status: "done",
|
|
@@ -168,11 +160,11 @@ function at(t, e) {
|
|
|
168
160
|
}
|
|
169
161
|
};
|
|
170
162
|
}
|
|
171
|
-
function
|
|
172
|
-
const [n, r] = w("loading"), [l,
|
|
163
|
+
function at(t, e) {
|
|
164
|
+
const [n, r] = w("loading"), [l, c] = w(null), [p, b] = w(null), d = O(null);
|
|
173
165
|
return T(() => {
|
|
174
|
-
let
|
|
175
|
-
if (r("loading"),
|
|
166
|
+
let i = !1;
|
|
167
|
+
if (r("loading"), c(null), b(null), !t) return;
|
|
176
168
|
const h = () => {
|
|
177
169
|
d.current !== null && (clearTimeout(d.current), d.current = null);
|
|
178
170
|
}, _ = async () => {
|
|
@@ -182,20 +174,20 @@ function rt(t, e) {
|
|
|
182
174
|
if (!s.ok) throw new Error(`HTTP ${s.status}`);
|
|
183
175
|
u = await s.json();
|
|
184
176
|
} catch (s) {
|
|
185
|
-
if (
|
|
177
|
+
if (i) return;
|
|
186
178
|
b(s instanceof Error ? s.message : "fetch failed"), r("error");
|
|
187
179
|
return;
|
|
188
180
|
}
|
|
189
|
-
if (
|
|
181
|
+
if (i) return;
|
|
190
182
|
const f = nt(u);
|
|
191
183
|
if (!f.ok) {
|
|
192
184
|
b(f.error), r("error");
|
|
193
185
|
return;
|
|
194
186
|
}
|
|
195
|
-
|
|
187
|
+
c(f.value), r("ready"), f.value.status === "wip" && (d.current = setTimeout(_, e));
|
|
196
188
|
};
|
|
197
189
|
return _(), () => {
|
|
198
|
-
|
|
190
|
+
i = !0, h();
|
|
199
191
|
};
|
|
200
192
|
}, [t, e]), { state: n, manifest: l, error: p };
|
|
201
193
|
}
|
|
@@ -205,7 +197,7 @@ function ot(t) {
|
|
|
205
197
|
const l = () => n(document.fullscreenElement != null);
|
|
206
198
|
return document.addEventListener("fullscreenchange", l), () => document.removeEventListener("fullscreenchange", l);
|
|
207
199
|
}, []);
|
|
208
|
-
const r =
|
|
200
|
+
const r = S(async () => {
|
|
209
201
|
const l = t.current;
|
|
210
202
|
if (l)
|
|
211
203
|
try {
|
|
@@ -228,7 +220,7 @@ function be() {
|
|
|
228
220
|
return n.addEventListener("change", r), () => n.removeEventListener("change", r);
|
|
229
221
|
}, []), t;
|
|
230
222
|
}
|
|
231
|
-
function
|
|
223
|
+
function ae(t, e) {
|
|
232
224
|
return t <= 0 ? 0 : e === "single" ? t : 1 + Math.ceil((t - 1) / 2);
|
|
233
225
|
}
|
|
234
226
|
function lt(t, e) {
|
|
@@ -244,11 +236,11 @@ function Y(t, e, n) {
|
|
|
244
236
|
return { left: r < e ? r : -1, right: l < e ? l : -1 };
|
|
245
237
|
}
|
|
246
238
|
function he(t, e, n) {
|
|
247
|
-
const { left: r, right: l } = Y(t, e, n),
|
|
248
|
-
return r >= 0 &&
|
|
239
|
+
const { left: r, right: l } = Y(t, e, n), c = [];
|
|
240
|
+
return r >= 0 && c.push(r), l >= 0 && c.push(l), c;
|
|
249
241
|
}
|
|
250
242
|
function ee(t, e, n) {
|
|
251
|
-
const r =
|
|
243
|
+
const r = ae(e, n) - 1;
|
|
252
244
|
return t < 0 ? 0 : t > r ? r : t;
|
|
253
245
|
}
|
|
254
246
|
function st(t) {
|
|
@@ -257,11 +249,11 @@ function st(t) {
|
|
|
257
249
|
label: n,
|
|
258
250
|
progress: r,
|
|
259
251
|
zoom: l,
|
|
260
|
-
minZoom:
|
|
252
|
+
minZoom: c,
|
|
261
253
|
maxZoom: p,
|
|
262
254
|
thumbsOpen: b,
|
|
263
255
|
isFullscreen: d,
|
|
264
|
-
downloadUrl:
|
|
256
|
+
downloadUrl: i,
|
|
265
257
|
show: h,
|
|
266
258
|
onZoomIn: _,
|
|
267
259
|
onZoomOut: u,
|
|
@@ -279,7 +271,7 @@ function st(t) {
|
|
|
279
271
|
type: "button",
|
|
280
272
|
className: "peeek__btn",
|
|
281
273
|
"aria-label": e.zoomOut,
|
|
282
|
-
disabled: l <=
|
|
274
|
+
disabled: l <= c,
|
|
283
275
|
onClick: u,
|
|
284
276
|
children: "−"
|
|
285
277
|
}
|
|
@@ -289,7 +281,7 @@ function st(t) {
|
|
|
289
281
|
{
|
|
290
282
|
type: "range",
|
|
291
283
|
"aria-label": e.zoom,
|
|
292
|
-
min:
|
|
284
|
+
min: c,
|
|
293
285
|
max: p,
|
|
294
286
|
step: 0.25,
|
|
295
287
|
value: l,
|
|
@@ -318,11 +310,11 @@ function st(t) {
|
|
|
318
310
|
children: "▦"
|
|
319
311
|
}
|
|
320
312
|
),
|
|
321
|
-
|
|
313
|
+
i && /* @__PURE__ */ a(
|
|
322
314
|
"a",
|
|
323
315
|
{
|
|
324
316
|
className: "peeek__btn",
|
|
325
|
-
href:
|
|
317
|
+
href: i,
|
|
326
318
|
"aria-label": e.download,
|
|
327
319
|
target: "_blank",
|
|
328
320
|
rel: "noopener noreferrer",
|
|
@@ -354,9 +346,9 @@ function st(t) {
|
|
|
354
346
|
] });
|
|
355
347
|
}
|
|
356
348
|
function it({ pages: t, layout: e, rtl: n, activePages: r, onJump: l }) {
|
|
357
|
-
const
|
|
358
|
-
return /* @__PURE__ */ a("div", { className: "peeek__thumbs", role: "group", "aria-label": "Pages", children: Array.from({ length: b }, (d,
|
|
359
|
-
const h = he(
|
|
349
|
+
const c = t.length, p = new Set(r), b = ae(c, e);
|
|
350
|
+
return /* @__PURE__ */ a("div", { className: "peeek__thumbs", role: "group", "aria-label": "Pages", children: Array.from({ length: b }, (d, i) => {
|
|
351
|
+
const h = he(i, c, e), _ = h.length === 2;
|
|
360
352
|
return /* @__PURE__ */ y("div", { className: "peeek__thumb-group", children: [
|
|
361
353
|
h.map((u, f) => {
|
|
362
354
|
let s = "";
|
|
@@ -374,7 +366,7 @@ function it({ pages: t, layout: e, rtl: n, activePages: r, onJump: l }) {
|
|
|
374
366
|
);
|
|
375
367
|
}),
|
|
376
368
|
/* @__PURE__ */ a("span", { className: "peeek__thumb-badge", "aria-hidden": !0, children: h.map((u) => u + 1).join("-") })
|
|
377
|
-
] },
|
|
369
|
+
] }, i);
|
|
378
370
|
}) });
|
|
379
371
|
}
|
|
380
372
|
const te = 1, ne = 2, me = 0.25;
|
|
@@ -384,16 +376,16 @@ function ct(t) {
|
|
|
384
376
|
strings: n,
|
|
385
377
|
layout: r,
|
|
386
378
|
rtl: l,
|
|
387
|
-
pageShadows:
|
|
379
|
+
pageShadows: c,
|
|
388
380
|
animateInteractions: p,
|
|
389
381
|
autoTransition: b,
|
|
390
382
|
autoTransitionInterval: d,
|
|
391
|
-
show:
|
|
383
|
+
show: i,
|
|
392
384
|
downloadUrl: h,
|
|
393
385
|
isFullscreen: _,
|
|
394
386
|
onToggleFullscreen: u,
|
|
395
387
|
onAbout: f
|
|
396
|
-
} = t, s = e.length, P =
|
|
388
|
+
} = t, s = e.length, P = ae(s, r), N = be() || !p, [W, z] = w(0), [C, U] = w(1), [X, v] = w(!1), [g, $] = w({ x: 0, y: 0 }), [A, R] = w(!1), G = O(null), oe = O(null), [k, le] = w(null), se = O(null), [_e, ke] = w(0.707);
|
|
397
389
|
T(() => {
|
|
398
390
|
if (!e[0]) return;
|
|
399
391
|
const o = new globalThis.Image();
|
|
@@ -401,16 +393,16 @@ function ct(t) {
|
|
|
401
393
|
o.naturalWidth && o.naturalHeight && ke(o.naturalWidth / o.naturalHeight);
|
|
402
394
|
}, o.src = e[0];
|
|
403
395
|
}, [e]);
|
|
404
|
-
const
|
|
396
|
+
const F = ee(W, s, r), ye = F <= 0, q = F >= P - 1, E = S(
|
|
405
397
|
(o) => {
|
|
406
|
-
k ||
|
|
398
|
+
k || z((m) => {
|
|
407
399
|
const x = ee(m + o, s, r);
|
|
408
400
|
return x === m ? m : N ? x : (le({ dir: o, to: x }), m);
|
|
409
401
|
});
|
|
410
402
|
},
|
|
411
403
|
[s, r, N, k]
|
|
412
|
-
), ve =
|
|
413
|
-
le((o) => (o &&
|
|
404
|
+
), ve = S(() => {
|
|
405
|
+
le((o) => (o && z(o.to), null));
|
|
414
406
|
}, []);
|
|
415
407
|
T(() => {
|
|
416
408
|
if (!k) return;
|
|
@@ -427,29 +419,29 @@ function ct(t) {
|
|
|
427
419
|
cancelAnimationFrame(x), cancelAnimationFrame(m);
|
|
428
420
|
};
|
|
429
421
|
}, [k]);
|
|
430
|
-
const we =
|
|
422
|
+
const we = S(
|
|
431
423
|
(o) => {
|
|
432
|
-
|
|
424
|
+
z(ee(lt(o, r), s, r));
|
|
433
425
|
},
|
|
434
426
|
[s, r]
|
|
435
|
-
), Ne =
|
|
427
|
+
), Ne = S(
|
|
436
428
|
(o) => {
|
|
437
|
-
o.key === "ArrowRight" ?
|
|
429
|
+
o.key === "ArrowRight" ? E(l ? -1 : 1) : o.key === "ArrowLeft" && E(l ? 1 : -1);
|
|
438
430
|
},
|
|
439
|
-
[
|
|
431
|
+
[E, l]
|
|
440
432
|
);
|
|
441
433
|
T(() => {
|
|
442
434
|
if (!b || q) return;
|
|
443
|
-
const o = setTimeout(() =>
|
|
435
|
+
const o = setTimeout(() => E(1), d);
|
|
444
436
|
return () => clearTimeout(o);
|
|
445
|
-
}, [b, d, q,
|
|
446
|
-
const Te = () => U((o) => Math.min(ne, o + me)), Ce = () => U((o) => Math.max(te, o - me)), K =
|
|
437
|
+
}, [b, d, q, F, E]);
|
|
438
|
+
const Te = () => U((o) => Math.min(ne, o + me)), Ce = () => U((o) => Math.max(te, o - me)), K = S((o, m, x) => {
|
|
447
439
|
const Q = oe.current;
|
|
448
440
|
if (!Q || x <= 1) return { x: 0, y: 0 };
|
|
449
441
|
const ue = (x - 1) * Q.clientWidth / 2, de = (x - 1) * Q.clientHeight / 2;
|
|
450
442
|
return { x: Math.max(-ue, Math.min(ue, o)), y: Math.max(-de, Math.min(de, m)) };
|
|
451
443
|
}, []);
|
|
452
|
-
T(() => $((o) => K(o.x, o.y, C)), [C, K]), T(() => $({ x: 0, y: 0 }), [
|
|
444
|
+
T(() => $((o) => K(o.x, o.y, C)), [C, K]), T(() => $({ x: 0, y: 0 }), [F]);
|
|
453
445
|
const xe = (o) => {
|
|
454
446
|
C <= 1 || (G.current = { x: o.clientX, y: o.clientY, px: g.x, py: g.y }, R(!0), o.currentTarget.setPointerCapture(o.pointerId));
|
|
455
447
|
}, Ie = (o) => {
|
|
@@ -463,7 +455,7 @@ function ct(t) {
|
|
|
463
455
|
} catch {
|
|
464
456
|
}
|
|
465
457
|
}
|
|
466
|
-
}, j = he(
|
|
458
|
+
}, j = he(F, s, r), J = j[0] ?? 0, Pe = r === "double" && j.length === 2 ? `${j[0] + 1} - ${j[1] + 1} / ${s}` : `${J + 1} / ${s}`, $e = P <= 1 ? 100 : F / (P - 1) * 100, Ae = n.prev, Fe = n.next, Me = k ? k.to : F, L = Y(Me, s, r), Se = L.left < 0 && L.right >= 0, ze = L.left >= 0 && L.right < 0, Ee = L.left >= 0 && L.right >= 0, Le = Se ? "-25%" : ze ? "25%" : "0%", M = Y(F, s, r), B = k ? Y(k.to, s, r) : M, Oe = k ? k.dir === 1 ? M.right >= 0 ? M.right : M.left : M.left >= 0 ? M.left : M.right : J, Re = k ? k.dir === 1 ? B.left >= 0 ? B.left : B.right : B.right >= 0 ? B.right : B.left : J, Be = k ? k.dir === 1 ? "left" : "right" : null, ce = (o) => o === Be ? M[o] : L[o], De = [
|
|
467
459
|
["left", ce("left")],
|
|
468
460
|
["right", ce("right")]
|
|
469
461
|
];
|
|
@@ -477,14 +469,14 @@ function ct(t) {
|
|
|
477
469
|
onKeyDown: Ne,
|
|
478
470
|
style: { "--peeek-aspect": `${_e}` },
|
|
479
471
|
children: [
|
|
480
|
-
|
|
472
|
+
i.arrows && /* @__PURE__ */ a(
|
|
481
473
|
"button",
|
|
482
474
|
{
|
|
483
475
|
type: "button",
|
|
484
476
|
className: "peeek__arrow peeek__arrow--prev",
|
|
485
|
-
"aria-label":
|
|
477
|
+
"aria-label": Ae,
|
|
486
478
|
disabled: ye,
|
|
487
|
-
onClick: () =>
|
|
479
|
+
onClick: () => E(-1),
|
|
488
480
|
children: "‹"
|
|
489
481
|
}
|
|
490
482
|
),
|
|
@@ -494,7 +486,7 @@ function ct(t) {
|
|
|
494
486
|
className: `peeek__zoom${C > 1 ? " peeek__zoom--pannable" : ""}`,
|
|
495
487
|
style: {
|
|
496
488
|
transform: `translate(${g.x}px, ${g.y}px) scale(${C})`,
|
|
497
|
-
transition: N ||
|
|
489
|
+
transition: N || A ? "none" : void 0
|
|
498
490
|
},
|
|
499
491
|
onPointerDown: xe,
|
|
500
492
|
onPointerMove: Ie,
|
|
@@ -503,11 +495,11 @@ function ct(t) {
|
|
|
503
495
|
children: /* @__PURE__ */ y(
|
|
504
496
|
"div",
|
|
505
497
|
{
|
|
506
|
-
className: `peeek__spread${
|
|
507
|
-
style: { transform: `translateX(${
|
|
498
|
+
className: `peeek__spread${c ? " peeek--shadows" : ""}${Ee ? " peeek__spread--pair" : ""}`,
|
|
499
|
+
style: { transform: `translateX(${Le})` },
|
|
508
500
|
children: [
|
|
509
|
-
|
|
510
|
-
const x = m >= 0 &&
|
|
501
|
+
De.map(([o, m]) => {
|
|
502
|
+
const x = m >= 0 && i.fullscreen && !_ && !k && C === 1;
|
|
511
503
|
return /* @__PURE__ */ a(
|
|
512
504
|
"div",
|
|
513
505
|
{
|
|
@@ -543,21 +535,21 @@ function ct(t) {
|
|
|
543
535
|
)
|
|
544
536
|
}
|
|
545
537
|
),
|
|
546
|
-
|
|
538
|
+
i.arrows && /* @__PURE__ */ a(
|
|
547
539
|
"button",
|
|
548
540
|
{
|
|
549
541
|
type: "button",
|
|
550
542
|
className: "peeek__arrow peeek__arrow--next",
|
|
551
|
-
"aria-label":
|
|
543
|
+
"aria-label": Fe,
|
|
552
544
|
disabled: q,
|
|
553
|
-
onClick: () =>
|
|
545
|
+
onClick: () => E(1),
|
|
554
546
|
children: "›"
|
|
555
547
|
}
|
|
556
548
|
)
|
|
557
549
|
]
|
|
558
550
|
}
|
|
559
551
|
),
|
|
560
|
-
|
|
552
|
+
i.toolbar && /* @__PURE__ */ a(
|
|
561
553
|
st,
|
|
562
554
|
{
|
|
563
555
|
strings: n,
|
|
@@ -569,7 +561,7 @@ function ct(t) {
|
|
|
569
561
|
thumbsOpen: X,
|
|
570
562
|
isFullscreen: _,
|
|
571
563
|
downloadUrl: h,
|
|
572
|
-
show: { bar:
|
|
564
|
+
show: { bar: i.bar, fullscreen: i.fullscreen, thumbnails: i.thumbnails && i.overview, about: i.about },
|
|
573
565
|
onZoomIn: Te,
|
|
574
566
|
onZoomOut: Ce,
|
|
575
567
|
onZoomSet: (o) => U(Math.min(ne, Math.max(te, o))),
|
|
@@ -578,7 +570,7 @@ function ct(t) {
|
|
|
578
570
|
onAbout: f
|
|
579
571
|
}
|
|
580
572
|
),
|
|
581
|
-
|
|
573
|
+
i.overview && X && /* @__PURE__ */ a(it, { pages: e, layout: r, rtl: l, activePages: j, onJump: we })
|
|
582
574
|
] });
|
|
583
575
|
}
|
|
584
576
|
function ut(t, e) {
|
|
@@ -604,31 +596,31 @@ function ft(t) {
|
|
|
604
596
|
strings: n,
|
|
605
597
|
filename: r,
|
|
606
598
|
mimeType: l,
|
|
607
|
-
rtl:
|
|
599
|
+
rtl: c,
|
|
608
600
|
autoTransition: p,
|
|
609
601
|
autoTransitionInterval: b,
|
|
610
602
|
downloadUrl: d,
|
|
611
|
-
isFullscreen:
|
|
603
|
+
isFullscreen: i,
|
|
612
604
|
onToggleFullscreen: h,
|
|
613
605
|
onAbout: _,
|
|
614
606
|
show: u
|
|
615
|
-
} = t, f = e.length, [s, P] = w(0), Z = be(), N =
|
|
607
|
+
} = t, f = e.length, [s, P] = w(0), Z = be(), N = S(
|
|
616
608
|
(v) => P((g) => Math.max(0, Math.min(f - 1, g + v))),
|
|
617
609
|
[f]
|
|
618
|
-
), W = s <= 0,
|
|
610
|
+
), W = s <= 0, z = s >= f - 1, C = O([]);
|
|
619
611
|
T(() => {
|
|
620
612
|
var v, g;
|
|
621
613
|
(g = (v = C.current[s]) == null ? void 0 : v.scrollIntoView) == null || g.call(v, { behavior: "smooth", inline: "center", block: "nearest" });
|
|
622
614
|
}, [s]), T(() => {
|
|
623
|
-
if (!p || Z ||
|
|
615
|
+
if (!p || Z || z) return;
|
|
624
616
|
const v = setTimeout(() => N(1), b);
|
|
625
617
|
return () => clearTimeout(v);
|
|
626
|
-
}, [p, b, Z,
|
|
627
|
-
const U =
|
|
618
|
+
}, [p, b, Z, z, s, N]);
|
|
619
|
+
const U = S(
|
|
628
620
|
(v) => {
|
|
629
|
-
v.key === "ArrowRight" ? N(
|
|
621
|
+
v.key === "ArrowRight" ? N(c ? -1 : 1) : v.key === "ArrowLeft" && N(c ? 1 : -1);
|
|
630
622
|
},
|
|
631
|
-
[N,
|
|
623
|
+
[N, c]
|
|
632
624
|
), X = ut(r, l);
|
|
633
625
|
return /* @__PURE__ */ y("div", { className: "peeek__cf", children: [
|
|
634
626
|
/* @__PURE__ */ y("div", { className: "peeek__cf-header", children: [
|
|
@@ -662,9 +654,9 @@ function ft(t) {
|
|
|
662
654
|
"button",
|
|
663
655
|
{
|
|
664
656
|
type: "button",
|
|
665
|
-
className: `peeek__btn${
|
|
657
|
+
className: `peeek__btn${i ? " peeek__btn--active" : ""}`,
|
|
666
658
|
"aria-label": n.fullscreen,
|
|
667
|
-
"aria-pressed":
|
|
659
|
+
"aria-pressed": i,
|
|
668
660
|
onClick: h,
|
|
669
661
|
children: "⛶"
|
|
670
662
|
}
|
|
@@ -701,17 +693,17 @@ function ft(t) {
|
|
|
701
693
|
e.map((v, g) => {
|
|
702
694
|
const $ = g - s;
|
|
703
695
|
if (Math.abs($) > 1) return null;
|
|
704
|
-
const
|
|
696
|
+
const A = $ === 0, R = A && u.fullscreen;
|
|
705
697
|
return /* @__PURE__ */ a(
|
|
706
698
|
"button",
|
|
707
699
|
{
|
|
708
700
|
type: "button",
|
|
709
|
-
className: `peeek__cf-card${
|
|
710
|
-
style: dt($,
|
|
711
|
-
tabIndex:
|
|
701
|
+
className: `peeek__cf-card${A ? " peeek__cf-card--center" : ""}${R ? " peeek__cf-card--zoom" : ""}`,
|
|
702
|
+
style: dt($, c),
|
|
703
|
+
tabIndex: A ? 0 : -1,
|
|
712
704
|
"aria-label": R ? n.openFullscreen : `Go to page ${g + 1}`,
|
|
713
705
|
onClick: () => R ? h() : P(g),
|
|
714
|
-
children: /* @__PURE__ */ a("img", { src: v, alt:
|
|
706
|
+
children: /* @__PURE__ */ a("img", { src: v, alt: A ? `Page ${g + 1}` : "", loading: "lazy", referrerPolicy: "no-referrer" })
|
|
715
707
|
},
|
|
716
708
|
g
|
|
717
709
|
);
|
|
@@ -722,7 +714,7 @@ function ft(t) {
|
|
|
722
714
|
type: "button",
|
|
723
715
|
className: "peeek__arrow peeek__arrow--next",
|
|
724
716
|
"aria-label": n.next,
|
|
725
|
-
disabled:
|
|
717
|
+
disabled: z,
|
|
726
718
|
onClick: () => N(1),
|
|
727
719
|
children: "›"
|
|
728
720
|
}
|
|
@@ -735,8 +727,8 @@ function ft(t) {
|
|
|
735
727
|
return /* @__PURE__ */ y(
|
|
736
728
|
"button",
|
|
737
729
|
{
|
|
738
|
-
ref: (
|
|
739
|
-
C.current[g] =
|
|
730
|
+
ref: (A) => {
|
|
731
|
+
C.current[g] = A;
|
|
740
732
|
},
|
|
741
733
|
type: "button",
|
|
742
734
|
className: `peeek__cf-thumb${$ ? " peeek__cf-thumb--active" : ""}`,
|
|
@@ -760,29 +752,22 @@ function mt({ logo: t, logoLink: e }) {
|
|
|
760
752
|
}
|
|
761
753
|
function gt({ strings: t, onClose: e }) {
|
|
762
754
|
const n = O(null);
|
|
763
|
-
T(() => {
|
|
764
|
-
var
|
|
765
|
-
(
|
|
755
|
+
return T(() => {
|
|
756
|
+
var r;
|
|
757
|
+
(r = n.current) == null || r.focus();
|
|
766
758
|
}, []), T(() => {
|
|
767
|
-
const
|
|
768
|
-
|
|
759
|
+
const r = (l) => {
|
|
760
|
+
l.key === "Escape" && e();
|
|
769
761
|
};
|
|
770
|
-
return document.addEventListener("keydown",
|
|
771
|
-
}, [e])
|
|
772
|
-
const r = [
|
|
773
|
-
{ label: t.aboutLearnMore, href: "https://peeek.page" },
|
|
774
|
-
{ label: t.aboutDocs, href: "https://peeek.page/docs" },
|
|
775
|
-
{ label: t.aboutReport, href: "mailto:hello@cidral.dev" },
|
|
776
|
-
{ label: t.aboutLegal, href: "https://peeek.page/legal/tos" }
|
|
777
|
-
];
|
|
778
|
-
return /* @__PURE__ */ a("div", { className: "peeek__about-backdrop", onClick: e, children: /* @__PURE__ */ y(
|
|
762
|
+
return document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
763
|
+
}, [e]), /* @__PURE__ */ a("div", { className: "peeek__about-backdrop", onClick: e, children: /* @__PURE__ */ y(
|
|
779
764
|
"div",
|
|
780
765
|
{
|
|
781
766
|
role: "dialog",
|
|
782
767
|
"aria-modal": "true",
|
|
783
768
|
"aria-label": "Peeek Viewer",
|
|
784
769
|
className: "peeek__about",
|
|
785
|
-
onClick: (
|
|
770
|
+
onClick: (r) => r.stopPropagation(),
|
|
786
771
|
children: [
|
|
787
772
|
/* @__PURE__ */ a(
|
|
788
773
|
"button",
|
|
@@ -799,19 +784,28 @@ function gt({ strings: t, onClose: e }) {
|
|
|
799
784
|
"svg",
|
|
800
785
|
{
|
|
801
786
|
className: "peeek__about-mark",
|
|
802
|
-
width: "
|
|
803
|
-
height: "
|
|
804
|
-
viewBox: "0 0
|
|
805
|
-
fill: "none",
|
|
806
|
-
stroke: "currentColor",
|
|
807
|
-
strokeWidth: "1.6",
|
|
808
|
-
strokeLinecap: "round",
|
|
809
|
-
strokeLinejoin: "round",
|
|
787
|
+
width: "44",
|
|
788
|
+
height: "44",
|
|
789
|
+
viewBox: "0 0 256 256",
|
|
810
790
|
"aria-hidden": "true",
|
|
811
791
|
children: [
|
|
812
|
-
/* @__PURE__ */ a("
|
|
813
|
-
|
|
814
|
-
|
|
792
|
+
/* @__PURE__ */ a("defs", { children: /* @__PURE__ */ y("radialGradient", { id: "peeek-about-orb", cx: "38%", cy: "30%", r: "80%", children: [
|
|
793
|
+
/* @__PURE__ */ a("stop", { offset: "0%", stopColor: "#9aa2e6" }),
|
|
794
|
+
/* @__PURE__ */ a("stop", { offset: "55%", stopColor: "#6E79D6" }),
|
|
795
|
+
/* @__PURE__ */ a("stop", { offset: "100%", stopColor: "#535cc0" })
|
|
796
|
+
] }) }),
|
|
797
|
+
/* @__PURE__ */ a("circle", { cx: "128", cy: "128", r: "128", fill: "url(#peeek-about-orb)" }),
|
|
798
|
+
/* @__PURE__ */ a(
|
|
799
|
+
"path",
|
|
800
|
+
{
|
|
801
|
+
d: "M90 196 V70 H140 A38 38 0 0 1 140 146 H90",
|
|
802
|
+
fill: "none",
|
|
803
|
+
stroke: "#fff",
|
|
804
|
+
strokeWidth: "30",
|
|
805
|
+
strokeLinecap: "round",
|
|
806
|
+
strokeLinejoin: "round"
|
|
807
|
+
}
|
|
808
|
+
)
|
|
815
809
|
]
|
|
816
810
|
}
|
|
817
811
|
),
|
|
@@ -819,32 +813,18 @@ function gt({ strings: t, onClose: e }) {
|
|
|
819
813
|
/* @__PURE__ */ a("div", { className: "peeek__about-tagline", children: t.aboutTagline }),
|
|
820
814
|
/* @__PURE__ */ y("div", { className: "peeek__about-version", children: [
|
|
821
815
|
"v",
|
|
822
|
-
"0.3.
|
|
816
|
+
"0.3.17"
|
|
823
817
|
] }),
|
|
824
|
-
/* @__PURE__ */ a("p", { className: "peeek__about-desc", children: t.aboutDescription })
|
|
825
|
-
/* @__PURE__ */ a("div", { className: "peeek__about-links", children: r.map((l) => /* @__PURE__ */ y(
|
|
826
|
-
"a",
|
|
827
|
-
{
|
|
828
|
-
className: "peeek__about-link",
|
|
829
|
-
href: l.href,
|
|
830
|
-
target: "_blank",
|
|
831
|
-
rel: "noopener noreferrer",
|
|
832
|
-
children: [
|
|
833
|
-
/* @__PURE__ */ a("span", { children: l.label }),
|
|
834
|
-
/* @__PURE__ */ a("span", { className: "peeek__about-link-arrow", "aria-hidden": "true", children: "›" })
|
|
835
|
-
]
|
|
836
|
-
},
|
|
837
|
-
l.href
|
|
838
|
-
)) })
|
|
818
|
+
/* @__PURE__ */ a("p", { className: "peeek__about-desc", children: t.aboutDescription })
|
|
839
819
|
]
|
|
840
820
|
}
|
|
841
821
|
) });
|
|
842
822
|
}
|
|
843
823
|
function ht(t) {
|
|
844
|
-
const e = tt(t), n = Qe(e.language), r = O(null), { isFullscreen: l, toggle:
|
|
845
|
-
() => d ?
|
|
824
|
+
const e = tt(t), n = Qe(e.language), r = O(null), { isFullscreen: l, toggle: c } = ot(r), [p, b] = w(!1), d = t.pages !== void 0, i = Ue(
|
|
825
|
+
() => d ? rt(t.pages, { filename: t.filename, mimeType: t.mimeType }) : null,
|
|
846
826
|
[d, t.pages, t.filename, t.mimeType]
|
|
847
|
-
), h =
|
|
827
|
+
), h = at(d ? null : e.src, e.pollInterval), _ = d ? i : h.manifest, u = d ? i ? "ready" : "loading" : h.state, f = {
|
|
848
828
|
"--peeek-accent": e.accentColor
|
|
849
829
|
};
|
|
850
830
|
e.background === "transparent" ? f["--peeek-bg"] = "transparent" : e.background === "color" && e.backgroundColor ? f["--peeek-bg"] = e.backgroundColor : e.background === "image" && e.backgroundImage && (f["--peeek-bg"] = `center / cover no-repeat url("${e.backgroundImage}")`);
|
|
@@ -882,7 +862,7 @@ function ht(t) {
|
|
|
882
862
|
autoTransitionInterval: e.autoTransitionInterval,
|
|
883
863
|
downloadUrl: e.downloadUrl,
|
|
884
864
|
isFullscreen: l,
|
|
885
|
-
onToggleFullscreen:
|
|
865
|
+
onToggleFullscreen: c,
|
|
886
866
|
onAbout: () => b(!0),
|
|
887
867
|
show: { arrows: e.arrows, thumbnails: e.pagesOverview, fullscreen: e.fullscreen, about: e.aboutButton }
|
|
888
868
|
}
|
|
@@ -901,7 +881,7 @@ function ht(t) {
|
|
|
901
881
|
show: s,
|
|
902
882
|
downloadUrl: e.downloadUrl,
|
|
903
883
|
isFullscreen: l,
|
|
904
|
-
onToggleFullscreen:
|
|
884
|
+
onToggleFullscreen: c,
|
|
905
885
|
onAbout: () => b(!0)
|
|
906
886
|
}
|
|
907
887
|
),
|
package/dist/peeekviewer.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.peeek{--peeek-accent: #6E79D6;--peeek-bg: #0b0b10;--peeek-surface: rgba(255, 255, 255, .06);--peeek-text: #f5f5fa;--peeek-radius: 16px;position:relative;display:flex;flex-direction:column;width:100%;color:var(--peeek-text);background:var(--peeek-bg);border-radius:var(--peeek-radius);overflow:hidden;font-family:ui-sans-serif,system-ui,sans-serif}.peeek__stage{position:relative;display:flex;align-items:center;justify-content:center;flex:1;min-height:24rem;padding:1.75rem 3rem;overflow:hidden;perspective:2000px}.peeek__zoom{display:flex;align-items:center;justify-content:center;width:100%;height:100%;transform-origin:center center}.peeek__zoom--pannable{cursor:grab;touch-action:none}.peeek__zoom--pannable:active{cursor:grabbing}.peeek__zoom--pannable img{pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.peeek__spread{position:relative;display:flex;width:100%;transition:transform .5s cubic-bezier(.6,.05,.3,.95);transform-style:preserve-3d}.peeek__page{position:relative;width:50%;aspect-ratio:var(--peeek-aspect, .707);background:#fff;overflow:hidden}.peeek__page--empty{background:transparent;box-shadow:none}.peeek__page--left{border-top-left-radius:8px;border-bottom-left-radius:8px}.peeek__page--right{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek__spread:not(.peeek__spread--pair) .peeek__page{border-radius:8px}.peeek__page img{display:block;width:100%;height:100%;object-fit:contain}.peeek__page-btn{all:unset;display:block;width:100%;height:100%;cursor:zoom-in}.peeek--shadows .peeek__spread{box-shadow:0 24px 60px -24px #000000b3}.peeek--shadows.peeek__spread--pair .peeek__page--left{box-shadow:inset -30px 0 36px -22px #0009}.peeek--shadows.peeek__spread--pair .peeek__page--right{box-shadow:inset 30px 0 36px -22px #0009}.peeek--shadows.peeek__spread--pair .peeek__page--left:after,.peeek--shadows.peeek__spread--pair .peeek__page--right:after{content:"";position:absolute;top:0;bottom:0;width:14px;pointer-events:none}.peeek--shadows.peeek__spread--pair .peeek__page--left:after{right:0;background:linear-gradient(to right,#0000,#00000047)}.peeek--shadows.peeek__spread--pair .peeek__page--right:after{left:0;background:linear-gradient(to left,#0000,#00000047)}.peeek__leaf{position:absolute;top:0;width:50%;height:100%;z-index:3;transform-style:preserve-3d;transition:transform .62s cubic-bezier(.55,.06,.3,.98);will-change:transform}.peeek__leaf--fwd{left:50%;transform-origin:left center}.peeek__leaf--back{right:50%;transform-origin:right center}.peeek__leaf-face{position:absolute;top:0;right:0;bottom:0;left:0;backface-visibility:hidden;background:#fff;overflow:hidden}.peeek__leaf-face img{display:block;width:100%;height:100%;object-fit:contain}.peeek__leaf-face--back{transform:rotateY(180deg)}.peeek__leaf-face:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;opacity:.15;animation:peeek-curl .62s cubic-bezier(.55,.06,.3,.98) forwards;background:linear-gradient(var(--peeek-curl-dir, to right),rgba(0,0,0,.34),rgba(0,0,0,0) 58%,rgba(255,255,255,.05))}.peeek__leaf--fwd .peeek__leaf-face:after{--peeek-curl-dir: to right}.peeek__leaf--back .peeek__leaf-face:after{--peeek-curl-dir: to left}.peeek__leaf-face--back:after{transform:scaleX(-1)}@keyframes peeek-curl{0%{opacity:.15}45%{opacity:1}to{opacity:.55}}.peeek__arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:2;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border:none;border-radius:9999px;background:#00000059;color:#fff;cursor:pointer}.peeek__arrow:disabled{opacity:.3;cursor:default}.peeek__arrow--prev{left:.75rem}.peeek__arrow--next{right:.75rem}.peeek__toolbar{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;border-top:1px solid rgba(255,255,255,.08);font-size:14px}.peeek__scrubber{flex:1;height:2px;background:#ffffff26;border-radius:9999px;overflow:hidden}.peeek__scrubber-fill{height:100%;background:var(--peeek-accent)}.peeek__btn{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:none;border-radius:8px;background:transparent;color:var(--peeek-text);cursor:pointer}.peeek__btn:disabled{opacity:.3;cursor:default}.peeek__btn--active{color:var(--peeek-accent)}.peeek__thumbs{display:flex;gap:.4rem;overflow-x:auto;padding:.75rem 1rem;border-top:1px solid rgba(255,255,255,.08)}.peeek__thumb-group{flex:0 0 auto;display:flex;gap:2px;position:relative}.peeek__thumb{flex:0 0 auto;width:4rem;height:5rem;padding:0;border:2px solid transparent;border-radius:6px;background:#fff;cursor:pointer;overflow:hidden}.peeek__thumb img{width:100%;height:100%;object-fit:contain}.peeek__thumb--active{border-color:var(--peeek-accent)}.peeek__thumb--flat-right{border-top-right-radius:0;border-bottom-right-radius:0}.peeek__thumb--flat-left{border-top-left-radius:0;border-bottom-left-radius:0}.peeek__branding{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem}.peeek__branding img{height:1.5rem;width:auto}.peeek__state{display:flex;align-items:center;justify-content:center;min-height:24rem;font-size:16px;color:var(--peeek-text)}.peeek[data-skin=minimal] .peeek__toolbar,.peeek[data-skin=minimal] .peeek__thumbs{border-top:none;background:#00000040}.peeek[data-skin=minimal] .peeek__arrow{background:#0003}.peeek[dir=rtl] .peeek__leaf{transform-origin:right center}.peeek__cf{display:flex;flex:1;flex-direction:column;min-height:0}.peeek__cf-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;border-bottom:1px solid rgba(255,255,255,.08);font-size:14px}.peeek__cf-badge{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.75rem;flex:0 0 auto;border-radius:6px;background:var(--peeek-accent);color:#fff;font-size:13px;font-weight:700}.peeek__cf-meta{display:flex;min-width:0;flex:1;flex-direction:column}.peeek__cf-name{overflow:hidden;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.peeek__cf-count{font-size:14px;opacity:.6}.peeek__cf-indicator{padding:.25rem .75rem;border:1px solid rgba(255,255,255,.1);border-radius:8px;font-family:ui-monospace,monospace;font-size:14px}.peeek__cf-stage{position:relative;display:flex;flex:1;align-items:center;justify-content:center;min-height:20rem;overflow:hidden;perspective:1400px}.peeek__cf-card{position:absolute;display:flex;max-width:55%;align-items:center;justify-content:center;padding:0;border:none;background:transparent;cursor:pointer;transition:transform .3s ease-out,opacity .3s ease-out}.peeek__cf-card--center{max-width:70%}.peeek__cf-card--zoom{cursor:zoom-in}.peeek__cf-card img{max-width:100%;max-height:19rem;border-radius:8px;background:#fff;object-fit:contain;box-shadow:0 18px 40px -12px #0009}.peeek__cf-thumbs{display:flex;gap:.5rem;overflow-x:auto;padding:.75rem 1rem;border-top:1px solid rgba(255,255,255,.08);scrollbar-width:none}.peeek__cf-thumbs::-webkit-scrollbar{display:none}.peeek__cf-thumb{display:flex;flex:0 0 auto;flex-direction:column;align-items:center;gap:.25rem;padding:.25rem;border:2px solid transparent;border-radius:8px;background:transparent;cursor:pointer}.peeek__cf-thumb img{width:3rem;height:4rem;border-radius:4px;background:#fff;object-fit:cover;opacity:.8}.peeek__cf-thumb--active{border-color:var(--peeek-accent);background:#ffffff0f}.peeek__cf-thumb--active img{opacity:1}.peeek__cf-thumb-num{font-family:ui-monospace,monospace;font-size:14px;opacity:.6}.peeek__cf-thumb--active .peeek__cf-thumb-num{color:var(--peeek-accent);opacity:1}.peeek:fullscreen .peeek__cf-card img{max-height:78vh}.peeek:fullscreen .peeek__spread{width:auto;height:100%}.peeek:fullscreen .peeek__page{width:auto;height:100%}.peeek[data-skin=minimal] .peeek__cf-header,.peeek[data-skin=minimal] .peeek__cf-thumbs{border-color:transparent;background:#00000040}.peeek[data-skin=showcase] .peeek__label{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px}.peeek[data-skin=showcase] .peeek__scrubber{height:2px}.peeek[data-skin=showcase] .peeek__scrubber-fill{background:var(--peeek-accent)}.peeek[data-skin=showcase] .peeek__arrow{width:2.5rem;height:2.5rem;border-radius:9999px;background:#0000004d;color:#fff;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}.peeek[data-skin=showcase] .peeek__arrow:hover{background:#00000080}.peeek__thumb-badge{position:absolute;right:2px;bottom:2px;padding:0 4px;border-radius:4px;background:#000000b3;color:#fff;font-size:14px;font-weight:500;pointer-events:none}.peeek--fill-height{height:100%}.peeek--fill-height .peeek__stage{min-height:0}.peeek--fill-height .peeek__spread,.peeek--fill-height .peeek__page{width:auto;height:100%}.peeek[data-layout=double] .peeek__spread:not(.peeek__spread--pair) .peeek__page--right{border-radius:0 8px 8px 0}.peeek[data-layout=double] .peeek__spread:not(.peeek__spread--pair) .peeek__page--left{border-radius:8px 0 0 8px}.peeek[data-layout=double] .peeek__leaf--fwd .peeek__leaf-face--front{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek[data-layout=double] .peeek__leaf--fwd .peeek__leaf-face--back,.peeek[data-layout=double] .peeek__leaf--back .peeek__leaf-face--front{border-top-left-radius:8px;border-bottom-left-radius:8px}.peeek[data-layout=double] .peeek__leaf--back .peeek__leaf-face--back{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek[data-layout=single] .peeek__leaf-face{border-radius:8px}.peeek__about-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:100;display:flex;align-items:center;align-items:safe center;justify-content:center;overflow-y:auto;padding:1rem;background:#06060c9e;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}.peeek__about{position:relative;width:100%;max-width:360px;box-sizing:border-box;padding:1.75rem 1.5rem 1.25rem;text-align:center;color:var(--peeek-text);background:#16161f;border:1px solid rgba(255,255,255,.1);border-radius:var(--peeek-radius);box-shadow:0 24px 60px #00000080}.peeek__about-close{position:absolute;top:.5rem;right:.5rem;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border:none;border-radius:8px;background:transparent;color:var(--peeek-text);font-size:20px;line-height:1;cursor:pointer}.peeek__about-close:hover{background:#ffffff14}.peeek__about-mark{color:var(--peeek-accent)}.peeek__about-name{margin-top:.5rem;font-size:20px;font-weight:700;letter-spacing:.01em}.peeek__about-tagline{margin-top:.25rem;font-size:14px;color:#f5f5fab3}.peeek__about-version{display:inline-block;margin-top:.75rem;padding:.15rem .6rem;font-size:14px;font-weight:600;color:var(--peeek-accent);background:#6e79d629;border-radius:9999px}.peeek__about-desc{margin:.9rem 0 0;font-size:14px;line-height:1.5;color:#f5f5fad1}.peeek__about-links{margin-top:1.1rem;text-align:left;border-top:1px solid rgba(255,255,255,.08)}.peeek__about-link{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding:.7rem .25rem;font-size:14px;color:var(--peeek-text);text-decoration:none;border-bottom:1px solid rgba(255,255,255,.08)}.peeek__about-link:hover{color:var(--peeek-accent)}.peeek__about-link-arrow{color:#f5f5fa80;font-size:16px}.peeek__about-link:hover .peeek__about-link-arrow{color:var(--peeek-accent)}
|
|
1
|
+
.peeek{--peeek-accent: #6E79D6;--peeek-bg: #0b0b10;--peeek-surface: rgba(255, 255, 255, .06);--peeek-text: #f5f5fa;--peeek-radius: 16px;position:relative;display:flex;flex-direction:column;width:100%;color:var(--peeek-text);background:var(--peeek-bg);border-radius:var(--peeek-radius);overflow:hidden;font-family:ui-sans-serif,system-ui,sans-serif}.peeek__stage{position:relative;display:flex;align-items:center;justify-content:center;flex:1;min-height:24rem;padding:1.75rem 3rem;overflow:hidden;perspective:2000px}.peeek__zoom{display:flex;align-items:center;justify-content:center;width:100%;height:100%;transform-origin:center center}.peeek__zoom--pannable{cursor:grab;touch-action:none}.peeek__zoom--pannable:active{cursor:grabbing}.peeek__zoom--pannable img{pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.peeek__spread{position:relative;display:flex;width:100%;transition:transform .5s cubic-bezier(.6,.05,.3,.95);transform-style:preserve-3d}.peeek__page{position:relative;width:50%;aspect-ratio:var(--peeek-aspect, .707);background:#fff;overflow:hidden}.peeek__page--empty{background:transparent;box-shadow:none}.peeek__page--left{border-top-left-radius:8px;border-bottom-left-radius:8px}.peeek__page--right{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek__spread:not(.peeek__spread--pair) .peeek__page{border-radius:8px}.peeek__page img{display:block;width:100%;height:100%;object-fit:contain}.peeek__page-btn{all:unset;display:block;width:100%;height:100%;cursor:zoom-in}.peeek--shadows .peeek__spread{box-shadow:0 24px 60px -24px #000000b3}.peeek--shadows.peeek__spread--pair .peeek__page--left{box-shadow:inset -30px 0 36px -22px #0009}.peeek--shadows.peeek__spread--pair .peeek__page--right{box-shadow:inset 30px 0 36px -22px #0009}.peeek--shadows.peeek__spread--pair .peeek__page--left:after,.peeek--shadows.peeek__spread--pair .peeek__page--right:after{content:"";position:absolute;top:0;bottom:0;width:14px;pointer-events:none}.peeek--shadows.peeek__spread--pair .peeek__page--left:after{right:0;background:linear-gradient(to right,#0000,#00000047)}.peeek--shadows.peeek__spread--pair .peeek__page--right:after{left:0;background:linear-gradient(to left,#0000,#00000047)}.peeek__leaf{position:absolute;top:0;width:50%;height:100%;z-index:3;transform-style:preserve-3d;transition:transform .62s cubic-bezier(.55,.06,.3,.98);will-change:transform}.peeek__leaf--fwd{left:50%;transform-origin:left center}.peeek__leaf--back{right:50%;transform-origin:right center}.peeek__leaf-face{position:absolute;top:0;right:0;bottom:0;left:0;backface-visibility:hidden;background:#fff;overflow:hidden}.peeek__leaf-face img{display:block;width:100%;height:100%;object-fit:contain}.peeek__leaf-face--back{transform:rotateY(180deg)}.peeek__leaf-face:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;pointer-events:none;opacity:.15;animation:peeek-curl .62s cubic-bezier(.55,.06,.3,.98) forwards;background:linear-gradient(var(--peeek-curl-dir, to right),rgba(0,0,0,.34),rgba(0,0,0,0) 58%,rgba(255,255,255,.05))}.peeek__leaf--fwd .peeek__leaf-face:after{--peeek-curl-dir: to right}.peeek__leaf--back .peeek__leaf-face:after{--peeek-curl-dir: to left}.peeek__leaf-face--back:after{transform:scaleX(-1)}@keyframes peeek-curl{0%{opacity:.15}45%{opacity:1}to{opacity:.55}}.peeek__arrow{position:absolute;top:50%;transform:translateY(-50%);z-index:2;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border:none;border-radius:9999px;background:#00000059;color:#fff;cursor:pointer}.peeek__arrow:disabled{opacity:.3;cursor:default}.peeek__arrow--prev{left:.75rem}.peeek__arrow--next{right:.75rem}.peeek__toolbar{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;border-top:1px solid rgba(255,255,255,.08);font-size:14px}.peeek__scrubber{flex:1;height:2px;background:#ffffff26;border-radius:9999px;overflow:hidden}.peeek__scrubber-fill{height:100%;background:var(--peeek-accent)}.peeek__btn{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;border:none;border-radius:8px;background:transparent;color:var(--peeek-text);cursor:pointer}.peeek__btn:disabled{opacity:.3;cursor:default}.peeek__btn--active{color:var(--peeek-accent)}.peeek__thumbs{display:flex;gap:.4rem;overflow-x:auto;padding:.75rem 1rem;border-top:1px solid rgba(255,255,255,.08)}.peeek__thumb-group{flex:0 0 auto;display:flex;gap:2px;position:relative}.peeek__thumb{flex:0 0 auto;width:4rem;height:5rem;padding:0;border:2px solid transparent;border-radius:6px;background:#fff;cursor:pointer;overflow:hidden}.peeek__thumb img{width:100%;height:100%;object-fit:contain}.peeek__thumb--active{border-color:var(--peeek-accent)}.peeek__thumb--flat-right{border-top-right-radius:0;border-bottom-right-radius:0}.peeek__thumb--flat-left{border-top-left-radius:0;border-bottom-left-radius:0}.peeek__branding{display:flex;align-items:center;gap:.5rem;padding:.5rem 1rem}.peeek__branding img{height:1.5rem;width:auto}.peeek__state{display:flex;align-items:center;justify-content:center;min-height:24rem;font-size:16px;color:var(--peeek-text)}.peeek[data-skin=minimal] .peeek__toolbar,.peeek[data-skin=minimal] .peeek__thumbs{border-top:none;background:#00000040}.peeek[data-skin=minimal] .peeek__arrow{background:#0003}.peeek[dir=rtl] .peeek__leaf{transform-origin:right center}.peeek__cf{display:flex;flex:1;flex-direction:column;min-height:0}.peeek__cf-header{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;border-bottom:1px solid rgba(255,255,255,.08);font-size:14px}.peeek__cf-badge{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.75rem;flex:0 0 auto;border-radius:6px;background:var(--peeek-accent);color:#fff;font-size:13px;font-weight:700}.peeek__cf-meta{display:flex;min-width:0;flex:1;flex-direction:column}.peeek__cf-name{overflow:hidden;font-weight:600;text-overflow:ellipsis;white-space:nowrap}.peeek__cf-count{font-size:14px;opacity:.6}.peeek__cf-indicator{padding:.25rem .75rem;border:1px solid rgba(255,255,255,.1);border-radius:8px;font-family:ui-monospace,monospace;font-size:14px}.peeek__cf-stage{position:relative;display:flex;flex:1;align-items:center;justify-content:center;min-height:20rem;overflow:hidden;perspective:1400px}.peeek__cf-card{position:absolute;display:flex;max-width:55%;align-items:center;justify-content:center;padding:0;border:none;background:transparent;cursor:pointer;transition:transform .3s ease-out,opacity .3s ease-out}.peeek__cf-card--center{max-width:70%}.peeek__cf-card--zoom{cursor:zoom-in}.peeek__cf-card img{max-width:100%;max-height:19rem;border-radius:8px;background:#fff;object-fit:contain;box-shadow:0 18px 40px -12px #0009}.peeek__cf-thumbs{display:flex;gap:.5rem;overflow-x:auto;padding:.75rem 1rem;border-top:1px solid rgba(255,255,255,.08);scrollbar-width:none}.peeek__cf-thumbs::-webkit-scrollbar{display:none}.peeek__cf-thumb{display:flex;flex:0 0 auto;flex-direction:column;align-items:center;gap:.25rem;padding:.25rem;border:2px solid transparent;border-radius:8px;background:transparent;cursor:pointer}.peeek__cf-thumb img{width:3rem;height:4rem;border-radius:4px;background:#fff;object-fit:cover;opacity:.8}.peeek__cf-thumb--active{border-color:var(--peeek-accent);background:#ffffff0f}.peeek__cf-thumb--active img{opacity:1}.peeek__cf-thumb-num{font-family:ui-monospace,monospace;font-size:14px;opacity:.6}.peeek__cf-thumb--active .peeek__cf-thumb-num{color:var(--peeek-accent);opacity:1}.peeek:fullscreen .peeek__cf-card img{max-height:78vh}.peeek:fullscreen .peeek__spread{width:auto;height:100%}.peeek:fullscreen .peeek__page{width:auto;height:100%}.peeek[data-skin=minimal] .peeek__cf-header,.peeek[data-skin=minimal] .peeek__cf-thumbs{border-color:transparent;background:#00000040}.peeek[data-skin=showcase] .peeek__label{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px}.peeek[data-skin=showcase] .peeek__scrubber{height:2px}.peeek[data-skin=showcase] .peeek__scrubber-fill{background:var(--peeek-accent)}.peeek[data-skin=showcase] .peeek__arrow{width:2.5rem;height:2.5rem;border-radius:9999px;background:#0000004d;color:#fff;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}.peeek[data-skin=showcase] .peeek__arrow:hover{background:#00000080}.peeek__thumb-badge{position:absolute;right:2px;bottom:2px;padding:0 4px;border-radius:4px;background:#000000b3;color:#fff;font-size:14px;font-weight:500;pointer-events:none}.peeek--fill-height{height:100%}.peeek--fill-height .peeek__stage{min-height:0}.peeek--fill-height .peeek__spread,.peeek--fill-height .peeek__page{width:auto;height:100%}.peeek[data-layout=double] .peeek__spread:not(.peeek__spread--pair) .peeek__page--right{border-radius:0 8px 8px 0}.peeek[data-layout=double] .peeek__spread:not(.peeek__spread--pair) .peeek__page--left{border-radius:8px 0 0 8px}.peeek[data-layout=double] .peeek__leaf--fwd .peeek__leaf-face--front{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek[data-layout=double] .peeek__leaf--fwd .peeek__leaf-face--back,.peeek[data-layout=double] .peeek__leaf--back .peeek__leaf-face--front{border-top-left-radius:8px;border-bottom-left-radius:8px}.peeek[data-layout=double] .peeek__leaf--back .peeek__leaf-face--back{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek[data-layout=single] .peeek__leaf-face{border-radius:8px}.peeek__about-backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:100;display:flex;align-items:center;align-items:safe center;justify-content:center;overflow-y:auto;padding:1rem;background:#06060c9e;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}.peeek__about{position:relative;width:100%;max-width:360px;box-sizing:border-box;padding:1.75rem 1.5rem 1.25rem;text-align:center;color:var(--peeek-text);background:#16161f;border:1px solid rgba(255,255,255,.1);border-radius:var(--peeek-radius);box-shadow:0 24px 60px #00000080}.peeek__about-close{position:absolute;top:.5rem;right:.5rem;display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;border:none;border-radius:8px;background:transparent;color:var(--peeek-text);font-size:20px;line-height:1;cursor:pointer}.peeek__about-close:hover{background:#ffffff14}.peeek__about-mark{display:block;margin-inline:auto;color:var(--peeek-accent)}.peeek__about-name{margin-top:.5rem;font-size:20px;font-weight:700;letter-spacing:.01em}.peeek__about-tagline{margin-top:.25rem;font-size:14px;color:#f5f5fab3}.peeek__about-version{display:inline-block;margin-top:.75rem;padding:.15rem .6rem;font-size:14px;font-weight:600;color:var(--peeek-accent);background:#6e79d629;border-radius:9999px}.peeek__about-desc{margin:.9rem 0 0;font-size:14px;line-height:1.5;color:#f5f5fad1}
|