@peeekpage/viewer 0.4.6 → 0.4.8
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 +190 -180
- package/dist/peeekviewer.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as y, jsx as
|
|
1
|
+
import { jsxs as y, jsx as r, Fragment as Qe } from "react/jsx-runtime";
|
|
2
2
|
import { useState as v, useRef as E, useEffect as C, useCallback as L, useMemo as et } from "react";
|
|
3
3
|
const tt = /* @__PURE__ */ new Set(["http:", "https:"]);
|
|
4
4
|
function G(t) {
|
|
@@ -20,13 +20,13 @@ function de(t) {
|
|
|
20
20
|
const e = t.trim();
|
|
21
21
|
return nt.test(e) || at.test(e) ? e : null;
|
|
22
22
|
}
|
|
23
|
-
const
|
|
23
|
+
const rt = /url\(|image\(|image-set\(|element\(|expression|@|\/\*|;|\{|\}|<|>|\\/i, ot = /^(repeating-)?(linear|radial|conic)-gradient\([a-z0-9#.,%()\/\s-]*\)$/i, lt = /^hsla?\([a-z0-9.,%\/\s-]*\)$/i;
|
|
24
24
|
function it(t) {
|
|
25
25
|
if (typeof t != "string") return null;
|
|
26
26
|
const e = t.trim();
|
|
27
|
-
if (e === "" ||
|
|
27
|
+
if (e === "" || rt.test(e)) return null;
|
|
28
28
|
const n = de(e);
|
|
29
|
-
return n !== null ? n : lt.test(e) ||
|
|
29
|
+
return n !== null ? n : lt.test(e) || ot.test(e) ? e : null;
|
|
30
30
|
}
|
|
31
31
|
const st = ["en", "pt-BR"], Ne = {
|
|
32
32
|
prev: "Previous page",
|
|
@@ -142,16 +142,16 @@ function mt(t) {
|
|
|
142
142
|
}
|
|
143
143
|
if (i.length === 0)
|
|
144
144
|
return { ok: !1, error: "manifest has no usable pages" };
|
|
145
|
-
const d = e.status === "wip" ? "wip" : "done",
|
|
146
|
-
fileId: Q(
|
|
147
|
-
filename: Q(
|
|
148
|
-
creationDate: Q(
|
|
149
|
-
fileSize: Q(
|
|
150
|
-
mimeType: Q(
|
|
145
|
+
const d = e.status === "wip" ? "wip" : "done", h = e.metadata && typeof e.metadata == "object" ? e.metadata : {}, k = {
|
|
146
|
+
fileId: Q(h.file_id),
|
|
147
|
+
filename: Q(h.filename),
|
|
148
|
+
creationDate: Q(h.creation_date),
|
|
149
|
+
fileSize: Q(h.file_size),
|
|
150
|
+
mimeType: Q(h.mime_type)
|
|
151
151
|
};
|
|
152
152
|
return {
|
|
153
153
|
ok: !0,
|
|
154
|
-
value: { status: d, totalPages: a, pages: i, metadata:
|
|
154
|
+
value: { status: d, totalPages: a, pages: i, metadata: k }
|
|
155
155
|
};
|
|
156
156
|
}
|
|
157
157
|
function pt(t, e) {
|
|
@@ -175,13 +175,13 @@ function pt(t, e) {
|
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
177
|
function bt(t, e) {
|
|
178
|
-
const [n, a] = v("loading"), [i, d] = v(null), [
|
|
178
|
+
const [n, a] = v("loading"), [i, d] = v(null), [h, k] = v(null), g = E(null);
|
|
179
179
|
return C(() => {
|
|
180
180
|
let c = !1;
|
|
181
|
-
if (a("loading"), d(null),
|
|
181
|
+
if (a("loading"), d(null), k(null), !t) return;
|
|
182
182
|
const w = () => {
|
|
183
183
|
g.current !== null && (clearTimeout(g.current), g.current = null);
|
|
184
|
-
},
|
|
184
|
+
}, _ = async () => {
|
|
185
185
|
let f;
|
|
186
186
|
try {
|
|
187
187
|
const l = await fetch(t);
|
|
@@ -189,21 +189,21 @@ function bt(t, e) {
|
|
|
189
189
|
f = await l.json();
|
|
190
190
|
} catch (l) {
|
|
191
191
|
if (c) return;
|
|
192
|
-
|
|
192
|
+
k(l instanceof Error ? l.message : "fetch failed"), a("error");
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
if (c) return;
|
|
196
196
|
const u = mt(f);
|
|
197
197
|
if (!u.ok) {
|
|
198
|
-
|
|
198
|
+
k(u.error), a("error");
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
d(u.value), a("ready"), u.value.status === "wip" && (g.current = setTimeout(
|
|
201
|
+
d(u.value), a("ready"), u.value.status === "wip" && (g.current = setTimeout(_, e));
|
|
202
202
|
};
|
|
203
|
-
return
|
|
203
|
+
return _(), () => {
|
|
204
204
|
c = !0, w();
|
|
205
205
|
};
|
|
206
|
-
}, [t, e]), { state: n, manifest: i, error:
|
|
206
|
+
}, [t, e]), { state: n, manifest: i, error: h };
|
|
207
207
|
}
|
|
208
208
|
function ht(t) {
|
|
209
209
|
const [e, n] = v(!1);
|
|
@@ -272,23 +272,23 @@ function Ie(t, e) {
|
|
|
272
272
|
const a = Number(n);
|
|
273
273
|
return Number.isFinite(a) ? Math.max(1, Math.min(e, a)) - 1 : null;
|
|
274
274
|
}
|
|
275
|
-
const
|
|
276
|
-
function
|
|
275
|
+
const kt = 640;
|
|
276
|
+
function _t(t, e) {
|
|
277
277
|
const [n, a] = v("auto"), [i, d] = v(null);
|
|
278
278
|
C(() => {
|
|
279
279
|
const c = t.current;
|
|
280
280
|
if (!c || (c.clientWidth > 0 && d(c.clientWidth), typeof ResizeObserver > "u")) return;
|
|
281
|
-
const w = new ResizeObserver((
|
|
281
|
+
const w = new ResizeObserver((_) => {
|
|
282
282
|
var u;
|
|
283
|
-
const f = (u =
|
|
283
|
+
const f = (u = _[0]) == null ? void 0 : u.contentRect.width;
|
|
284
284
|
typeof f == "number" && f > 0 && d(f);
|
|
285
285
|
});
|
|
286
286
|
return w.observe(c), () => w.disconnect();
|
|
287
287
|
}, [t]);
|
|
288
|
-
const
|
|
289
|
-
a(
|
|
290
|
-
}, [
|
|
291
|
-
return { layout:
|
|
288
|
+
const h = i != null && i < kt ? "single" : e, k = n === "auto" ? h : n, g = L(() => {
|
|
289
|
+
a(k === "single" ? "double" : "single");
|
|
290
|
+
}, [k]);
|
|
291
|
+
return { layout: k, toggle: g };
|
|
292
292
|
}
|
|
293
293
|
function me(t, e) {
|
|
294
294
|
return t <= 0 ? 0 : e === "single" ? t : 1 + Math.ceil((t - 1) / 2);
|
|
@@ -296,7 +296,7 @@ function me(t, e) {
|
|
|
296
296
|
function yt(t, e) {
|
|
297
297
|
return e === "single" ? t : t <= 0 ? 0 : Math.floor((t - 1) / 2) + 1;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function re(t, e, n) {
|
|
300
300
|
if (e <= 0) return { left: -1, right: -1 };
|
|
301
301
|
if (n === "single")
|
|
302
302
|
return { left: -1, right: t >= 0 && t < e ? t : -1 };
|
|
@@ -306,7 +306,7 @@ function oe(t, e, n) {
|
|
|
306
306
|
return { left: a < e ? a : -1, right: i < e ? i : -1 };
|
|
307
307
|
}
|
|
308
308
|
function ge(t, e, n) {
|
|
309
|
-
const { left: a, right: i } =
|
|
309
|
+
const { left: a, right: i } = re(t, e, n), d = [];
|
|
310
310
|
return a >= 0 && d.push(a), i >= 0 && d.push(i), d;
|
|
311
311
|
}
|
|
312
312
|
function ne(t, e, n) {
|
|
@@ -320,12 +320,12 @@ function vt(t) {
|
|
|
320
320
|
progress: a,
|
|
321
321
|
zoom: i,
|
|
322
322
|
minZoom: d,
|
|
323
|
-
maxZoom:
|
|
324
|
-
total:
|
|
323
|
+
maxZoom: h,
|
|
324
|
+
total: k,
|
|
325
325
|
currentPage: g,
|
|
326
326
|
layout: c,
|
|
327
327
|
thumbsOpen: w,
|
|
328
|
-
isFullscreen:
|
|
328
|
+
isFullscreen: _,
|
|
329
329
|
downloadUrl: f,
|
|
330
330
|
show: u,
|
|
331
331
|
onZoomIn: l,
|
|
@@ -337,20 +337,20 @@ function vt(t) {
|
|
|
337
337
|
onToggleThumbs: A,
|
|
338
338
|
onToggleFullscreen: Z,
|
|
339
339
|
onAbout: j
|
|
340
|
-
} = t, [M,
|
|
341
|
-
C(() =>
|
|
340
|
+
} = t, [M, z] = v(String(g));
|
|
341
|
+
C(() => z(String(g)), [g]);
|
|
342
342
|
const B = () => {
|
|
343
|
-
const P = Ie(M,
|
|
343
|
+
const P = Ie(M, k);
|
|
344
344
|
if (P === null) {
|
|
345
|
-
|
|
345
|
+
z(String(g));
|
|
346
346
|
return;
|
|
347
347
|
}
|
|
348
|
-
F(P),
|
|
348
|
+
F(P), z(String(P + 1));
|
|
349
349
|
};
|
|
350
350
|
return /* @__PURE__ */ y("div", { className: "peeek__toolbar", children: [
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
u.bar && /* @__PURE__ */
|
|
353
|
-
u.goto && /* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ r("span", { className: "peeek__label", children: n }),
|
|
352
|
+
u.bar && /* @__PURE__ */ r("div", { className: "peeek__scrubber", "aria-hidden": !0, children: /* @__PURE__ */ r("div", { className: "peeek__scrubber-fill", style: { width: `${a}%` } }) }),
|
|
353
|
+
u.goto && /* @__PURE__ */ r(
|
|
354
354
|
"input",
|
|
355
355
|
{
|
|
356
356
|
className: "peeek__goto",
|
|
@@ -358,14 +358,14 @@ function vt(t) {
|
|
|
358
358
|
inputMode: "numeric",
|
|
359
359
|
"aria-label": e.goToPage,
|
|
360
360
|
value: M,
|
|
361
|
-
onChange: (P) =>
|
|
361
|
+
onChange: (P) => z(P.target.value),
|
|
362
362
|
onBlur: B,
|
|
363
363
|
onKeyDown: (P) => {
|
|
364
364
|
P.key === "Enter" && (P.preventDefault(), B());
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
367
|
),
|
|
368
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ r(
|
|
369
369
|
"button",
|
|
370
370
|
{
|
|
371
371
|
type: "button",
|
|
@@ -376,30 +376,30 @@ function vt(t) {
|
|
|
376
376
|
children: "−"
|
|
377
377
|
}
|
|
378
378
|
),
|
|
379
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ r(
|
|
380
380
|
"input",
|
|
381
381
|
{
|
|
382
382
|
type: "range",
|
|
383
383
|
"aria-label": e.zoom,
|
|
384
384
|
min: d,
|
|
385
|
-
max:
|
|
385
|
+
max: h,
|
|
386
386
|
step: 0.25,
|
|
387
387
|
value: i,
|
|
388
388
|
onChange: (P) => O(Number(P.target.value))
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
|
-
/* @__PURE__ */
|
|
391
|
+
/* @__PURE__ */ r(
|
|
392
392
|
"button",
|
|
393
393
|
{
|
|
394
394
|
type: "button",
|
|
395
395
|
className: "peeek__btn",
|
|
396
396
|
"aria-label": e.zoomIn,
|
|
397
|
-
disabled: i >=
|
|
397
|
+
disabled: i >= h,
|
|
398
398
|
onClick: l,
|
|
399
399
|
children: "+"
|
|
400
400
|
}
|
|
401
401
|
),
|
|
402
|
-
u.rotate && /* @__PURE__ */
|
|
402
|
+
u.rotate && /* @__PURE__ */ r(
|
|
403
403
|
"button",
|
|
404
404
|
{
|
|
405
405
|
type: "button",
|
|
@@ -409,7 +409,7 @@ function vt(t) {
|
|
|
409
409
|
children: "⟳"
|
|
410
410
|
}
|
|
411
411
|
),
|
|
412
|
-
u.layoutToggle && /* @__PURE__ */
|
|
412
|
+
u.layoutToggle && /* @__PURE__ */ r(
|
|
413
413
|
"button",
|
|
414
414
|
{
|
|
415
415
|
type: "button",
|
|
@@ -420,7 +420,7 @@ function vt(t) {
|
|
|
420
420
|
children: c === "single" ? "▭" : "▥"
|
|
421
421
|
}
|
|
422
422
|
),
|
|
423
|
-
u.thumbnails && /* @__PURE__ */
|
|
423
|
+
u.thumbnails && /* @__PURE__ */ r(
|
|
424
424
|
"button",
|
|
425
425
|
{
|
|
426
426
|
type: "button",
|
|
@@ -431,7 +431,7 @@ function vt(t) {
|
|
|
431
431
|
children: "▦"
|
|
432
432
|
}
|
|
433
433
|
),
|
|
434
|
-
f && /* @__PURE__ */
|
|
434
|
+
f && /* @__PURE__ */ r(
|
|
435
435
|
"a",
|
|
436
436
|
{
|
|
437
437
|
className: "peeek__btn",
|
|
@@ -443,18 +443,18 @@ function vt(t) {
|
|
|
443
443
|
children: "↓"
|
|
444
444
|
}
|
|
445
445
|
),
|
|
446
|
-
u.fullscreen && /* @__PURE__ */
|
|
446
|
+
u.fullscreen && /* @__PURE__ */ r(
|
|
447
447
|
"button",
|
|
448
448
|
{
|
|
449
449
|
type: "button",
|
|
450
|
-
className: `peeek__btn${
|
|
450
|
+
className: `peeek__btn${_ ? " peeek__btn--active" : ""}`,
|
|
451
451
|
"aria-label": e.fullscreen,
|
|
452
|
-
"aria-pressed":
|
|
452
|
+
"aria-pressed": _,
|
|
453
453
|
onClick: Z,
|
|
454
454
|
children: "⛶"
|
|
455
455
|
}
|
|
456
456
|
),
|
|
457
|
-
u.about && /* @__PURE__ */
|
|
457
|
+
u.about && /* @__PURE__ */ r(
|
|
458
458
|
"button",
|
|
459
459
|
{
|
|
460
460
|
type: "button",
|
|
@@ -467,26 +467,26 @@ function vt(t) {
|
|
|
467
467
|
] });
|
|
468
468
|
}
|
|
469
469
|
function wt({ pages: t, layout: e, rtl: n, activePages: a, onJump: i }) {
|
|
470
|
-
const d = t.length,
|
|
471
|
-
return /* @__PURE__ */
|
|
472
|
-
const w = ge(c, d, e),
|
|
470
|
+
const d = t.length, h = new Set(a), k = me(d, e);
|
|
471
|
+
return /* @__PURE__ */ r("div", { className: "peeek__thumbs", role: "group", "aria-label": "Pages", children: Array.from({ length: k }, (g, c) => {
|
|
472
|
+
const w = ge(c, d, e), _ = w.length === 2;
|
|
473
473
|
return /* @__PURE__ */ y("div", { className: "peeek__thumb-group", children: [
|
|
474
474
|
w.map((f, u) => {
|
|
475
475
|
let l = "";
|
|
476
|
-
return
|
|
476
|
+
return _ && (l = (n ? u === 1 : u === 0) ? " peeek__thumb--flat-right" : " peeek__thumb--flat-left"), /* @__PURE__ */ r(
|
|
477
477
|
"button",
|
|
478
478
|
{
|
|
479
479
|
type: "button",
|
|
480
480
|
"aria-label": `Go to page ${f + 1}`,
|
|
481
|
-
"aria-current":
|
|
482
|
-
className: `peeek__thumb${
|
|
481
|
+
"aria-current": h.has(f),
|
|
482
|
+
className: `peeek__thumb${h.has(f) ? " peeek__thumb--active" : ""}${l}`,
|
|
483
483
|
onClick: () => i(f),
|
|
484
|
-
children: /* @__PURE__ */
|
|
484
|
+
children: /* @__PURE__ */ r("img", { src: t[f], alt: "", loading: "lazy", referrerPolicy: "no-referrer" })
|
|
485
485
|
},
|
|
486
486
|
f
|
|
487
487
|
);
|
|
488
488
|
}),
|
|
489
|
-
/* @__PURE__ */
|
|
489
|
+
/* @__PURE__ */ r("span", { className: "peeek__thumb-badge", "aria-hidden": !0, children: w.map((f) => f + 1).join("-") })
|
|
490
490
|
] }, c);
|
|
491
491
|
}) });
|
|
492
492
|
}
|
|
@@ -498,43 +498,43 @@ function Tt(t) {
|
|
|
498
498
|
layout: a,
|
|
499
499
|
rtl: i,
|
|
500
500
|
pageShadows: d,
|
|
501
|
-
animateInteractions:
|
|
502
|
-
autoTransition:
|
|
501
|
+
animateInteractions: h,
|
|
502
|
+
autoTransition: k,
|
|
503
503
|
autoTransitionInterval: g,
|
|
504
504
|
show: c,
|
|
505
505
|
downloadUrl: w,
|
|
506
|
-
isFullscreen:
|
|
506
|
+
isFullscreen: _,
|
|
507
507
|
onToggleFullscreen: f,
|
|
508
508
|
onAbout: u
|
|
509
|
-
} = t, l = e.length, O = Ce() || !
|
|
509
|
+
} = t, l = e.length, O = Ce() || !h, [F, R] = v(0), [x, A] = v(1), [Z, j] = v(!1), [M, z] = v({ x: 0, y: 0 }), [B, P] = v(!1), [X, m] = v(0), p = E(null), S = E(null), { layout: b, toggle: K } = _t(S, a), oe = me(l, b), [T, le] = v(null), [xe, pe] = v(!1), ie = E(null), [be, Se] = v(0.707);
|
|
510
510
|
C(() => {
|
|
511
511
|
if (!e[0]) return;
|
|
512
|
-
const
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
},
|
|
512
|
+
const o = new globalThis.Image();
|
|
513
|
+
o.onload = () => {
|
|
514
|
+
o.naturalWidth && o.naturalHeight && Se(o.naturalWidth / o.naturalHeight);
|
|
515
|
+
}, o.src = e[0];
|
|
516
516
|
}, [e]);
|
|
517
|
-
const
|
|
517
|
+
const $ = ne(F, l, b), $e = $ <= 0, se = $ >= oe - 1, he = E(/* @__PURE__ */ new Set());
|
|
518
518
|
C(() => {
|
|
519
|
-
const
|
|
520
|
-
for (const s of
|
|
519
|
+
const o = [$ - 1, $ + 1, $ + 2].map((s) => ne(s, l, b)).flatMap((s) => ge(s, l, b)).filter((s) => s >= 0);
|
|
520
|
+
for (const s of o) {
|
|
521
521
|
const N = e[s];
|
|
522
522
|
if (!N || he.current.has(N)) continue;
|
|
523
523
|
he.current.add(N);
|
|
524
524
|
const q = new globalThis.Image();
|
|
525
525
|
q.src = N;
|
|
526
526
|
}
|
|
527
|
-
}, [
|
|
527
|
+
}, [$, l, b, e]);
|
|
528
528
|
const W = L(
|
|
529
|
-
(
|
|
529
|
+
(o) => {
|
|
530
530
|
T || R((s) => {
|
|
531
|
-
const N = ne(s +
|
|
532
|
-
return N === s ? s : O ? N : (le({ dir:
|
|
531
|
+
const N = ne(s + o, l, b);
|
|
532
|
+
return N === s ? s : O ? N : (le({ dir: o, to: N }), s);
|
|
533
533
|
});
|
|
534
534
|
},
|
|
535
535
|
[l, b, O, T]
|
|
536
|
-
),
|
|
537
|
-
|
|
536
|
+
), ze = L((o) => {
|
|
537
|
+
o.target === ie.current && (o.propertyName && o.propertyName !== "transform" || le((s) => s && (R(s.to), pe(!0), requestAnimationFrame(
|
|
538
538
|
() => requestAnimationFrame(() => {
|
|
539
539
|
le(null), pe(!1);
|
|
540
540
|
})
|
|
@@ -542,13 +542,13 @@ function Tt(t) {
|
|
|
542
542
|
}, []);
|
|
543
543
|
C(() => {
|
|
544
544
|
if (!T) return;
|
|
545
|
-
const
|
|
546
|
-
if (!
|
|
547
|
-
|
|
545
|
+
const o = ie.current;
|
|
546
|
+
if (!o) return;
|
|
547
|
+
o.style.transform = "rotateY(0deg)";
|
|
548
548
|
let s = 0;
|
|
549
549
|
const N = requestAnimationFrame(() => {
|
|
550
550
|
s = requestAnimationFrame(() => {
|
|
551
|
-
|
|
551
|
+
o.style.transform = `rotateY(${T.dir === 1 ? -180 : 180}deg)`;
|
|
552
552
|
});
|
|
553
553
|
});
|
|
554
554
|
return () => {
|
|
@@ -556,42 +556,42 @@ function Tt(t) {
|
|
|
556
556
|
};
|
|
557
557
|
}, [T]);
|
|
558
558
|
const ce = L(
|
|
559
|
-
(
|
|
560
|
-
R(ne(yt(
|
|
559
|
+
(o) => {
|
|
560
|
+
R(ne(yt(o, b), l, b));
|
|
561
561
|
},
|
|
562
562
|
[l, b]
|
|
563
563
|
), { onKeyDown: Ae } = Pe({ go: W, jump: ce, total: l, rtl: i });
|
|
564
564
|
C(() => {
|
|
565
|
-
if (!
|
|
566
|
-
const
|
|
567
|
-
return () => clearTimeout(
|
|
568
|
-
}, [
|
|
569
|
-
const Fe = () => A((
|
|
570
|
-
T || A((
|
|
571
|
-
}, Le = () => m((
|
|
565
|
+
if (!k || se) return;
|
|
566
|
+
const o = setTimeout(() => W(1), g);
|
|
567
|
+
return () => clearTimeout(o);
|
|
568
|
+
}, [k, g, se, $, W]);
|
|
569
|
+
const Fe = () => A((o) => Math.min(ae, o + Te)), Me = () => A((o) => Math.max(ee, o - Te)), Ee = () => {
|
|
570
|
+
T || A((o) => o > ee ? ee : ae);
|
|
571
|
+
}, Le = () => m((o) => (o + 90) % 360), De = X === 90 || X === 270 ? be : 1, ue = L((o, s, N) => {
|
|
572
572
|
const q = S.current;
|
|
573
573
|
if (!q || N <= 1) return { x: 0, y: 0 };
|
|
574
574
|
const ye = (N - 1) * q.clientWidth / 2, ve = (N - 1) * q.clientHeight / 2;
|
|
575
|
-
return { x: Math.max(-ye, Math.min(ye,
|
|
575
|
+
return { x: Math.max(-ye, Math.min(ye, o)), y: Math.max(-ve, Math.min(ve, s)) };
|
|
576
576
|
}, []);
|
|
577
|
-
C(() =>
|
|
578
|
-
const Oe = (
|
|
577
|
+
C(() => z((o) => ue(o.x, o.y, x)), [x, ue]), C(() => z({ x: 0, y: 0 }), [$]);
|
|
578
|
+
const Oe = (o) => {
|
|
579
579
|
var s, N;
|
|
580
|
-
x <= 1 || (p.current = { x:
|
|
581
|
-
}, Re = (
|
|
580
|
+
x <= 1 || (p.current = { x: o.clientX, y: o.clientY, px: M.x, py: M.y }, P(!0), (N = (s = o.currentTarget).setPointerCapture) == null || N.call(s, o.pointerId));
|
|
581
|
+
}, Re = (o) => {
|
|
582
582
|
const s = p.current;
|
|
583
|
-
s &&
|
|
584
|
-
},
|
|
583
|
+
s && z(ue(s.px + (o.clientX - s.x), s.py + (o.clientY - s.y), x));
|
|
584
|
+
}, ke = (o) => {
|
|
585
585
|
if (p.current) {
|
|
586
586
|
p.current = null, P(!1);
|
|
587
587
|
try {
|
|
588
|
-
|
|
588
|
+
o.currentTarget.releasePointerCapture(o.pointerId);
|
|
589
589
|
} catch {
|
|
590
590
|
}
|
|
591
591
|
}
|
|
592
|
-
}, Y = ge(
|
|
593
|
-
["left",
|
|
594
|
-
["right",
|
|
592
|
+
}, Y = ge($, l, b), te = Y[0] ?? 0, Be = b === "double" && Y.length === 2 ? `${Y[0] + 1} - ${Y[1] + 1} / ${l}` : `${te + 1} / ${l}`, Ue = oe <= 1 ? 100 : $ / (oe - 1) * 100, Ze = n.prev, He = n.next, Ge = T ? T.to : $, H = re(Ge, l, b), je = H.left < 0 && H.right >= 0, Ve = H.left >= 0 && H.right < 0, Xe = H.left >= 0 && H.right >= 0, Ke = je ? "-25%" : Ve ? "25%" : "0%", U = re($, l, b), V = T ? re(T.to, l, b) : U, We = T ? T.dir === 1 ? U.right >= 0 ? U.right : U.left : U.left >= 0 ? U.left : U.right : te, Ye = T ? T.dir === 1 ? V.left >= 0 ? V.left : V.right : V.right >= 0 ? V.right : V.left : te, qe = T ? T.dir === 1 ? "left" : "right" : null, _e = (o) => o === qe && !xe ? U[o] : H[o], Je = [
|
|
593
|
+
["left", _e("left")],
|
|
594
|
+
["right", _e("right")]
|
|
595
595
|
];
|
|
596
596
|
return /* @__PURE__ */ y(Qe, { children: [
|
|
597
597
|
/* @__PURE__ */ y(
|
|
@@ -604,18 +604,18 @@ function Tt(t) {
|
|
|
604
604
|
onKeyDown: Ae,
|
|
605
605
|
style: { "--peeek-aspect": `${be}` },
|
|
606
606
|
children: [
|
|
607
|
-
c.arrows && /* @__PURE__ */
|
|
607
|
+
c.arrows && /* @__PURE__ */ r(
|
|
608
608
|
"button",
|
|
609
609
|
{
|
|
610
610
|
type: "button",
|
|
611
611
|
className: "peeek__arrow peeek__arrow--prev",
|
|
612
612
|
"aria-label": Ze,
|
|
613
|
-
disabled:
|
|
613
|
+
disabled: $e,
|
|
614
614
|
onClick: () => W(-1),
|
|
615
615
|
children: "‹"
|
|
616
616
|
}
|
|
617
617
|
),
|
|
618
|
-
/* @__PURE__ */
|
|
618
|
+
/* @__PURE__ */ r(
|
|
619
619
|
"div",
|
|
620
620
|
{
|
|
621
621
|
className: `peeek__zoom${x > 1 ? " peeek__zoom--pannable" : ""}`,
|
|
@@ -626,32 +626,32 @@ function Tt(t) {
|
|
|
626
626
|
onDoubleClick: Ee,
|
|
627
627
|
onPointerDown: Oe,
|
|
628
628
|
onPointerMove: Re,
|
|
629
|
-
onPointerUp:
|
|
630
|
-
onPointerCancel:
|
|
629
|
+
onPointerUp: ke,
|
|
630
|
+
onPointerCancel: ke,
|
|
631
631
|
children: /* @__PURE__ */ y(
|
|
632
632
|
"div",
|
|
633
633
|
{
|
|
634
634
|
className: `peeek__spread${d ? " peeek--shadows" : ""}${Xe ? " peeek__spread--pair" : ""}`,
|
|
635
635
|
style: { transform: `translateX(${Ke})` },
|
|
636
636
|
children: [
|
|
637
|
-
Je.map(([
|
|
638
|
-
const N = s >= 0 && c.fullscreen && !
|
|
639
|
-
return /* @__PURE__ */
|
|
637
|
+
Je.map(([o, s]) => {
|
|
638
|
+
const N = s >= 0 && c.fullscreen && !_ && !T && x === 1;
|
|
639
|
+
return /* @__PURE__ */ r(
|
|
640
640
|
"div",
|
|
641
641
|
{
|
|
642
|
-
className: `peeek__page peeek__page--${
|
|
643
|
-
children: s >= 0 && (N ? /* @__PURE__ */
|
|
642
|
+
className: `peeek__page peeek__page--${o}${s < 0 ? " peeek__page--empty" : ""}`,
|
|
643
|
+
children: s >= 0 && (N ? /* @__PURE__ */ r(
|
|
644
644
|
"button",
|
|
645
645
|
{
|
|
646
646
|
type: "button",
|
|
647
647
|
className: "peeek__page-btn",
|
|
648
648
|
"aria-label": n.openFullscreen,
|
|
649
649
|
onClick: f,
|
|
650
|
-
children: /* @__PURE__ */
|
|
650
|
+
children: /* @__PURE__ */ r("img", { src: e[s], alt: `Page ${s + 1}`, referrerPolicy: "no-referrer" })
|
|
651
651
|
}
|
|
652
|
-
) : /* @__PURE__ */
|
|
652
|
+
) : /* @__PURE__ */ r("img", { src: e[s], alt: `Page ${s + 1}`, referrerPolicy: "no-referrer" }))
|
|
653
653
|
},
|
|
654
|
-
|
|
654
|
+
o
|
|
655
655
|
);
|
|
656
656
|
}),
|
|
657
657
|
T && /* @__PURE__ */ y(
|
|
@@ -659,10 +659,10 @@ function Tt(t) {
|
|
|
659
659
|
{
|
|
660
660
|
ref: ie,
|
|
661
661
|
className: `peeek__leaf peeek__leaf--${T.dir === 1 ? "fwd" : "back"}`,
|
|
662
|
-
onTransitionEnd:
|
|
662
|
+
onTransitionEnd: ze,
|
|
663
663
|
children: [
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ r("div", { className: "peeek__leaf-face peeek__leaf-face--front", children: /* @__PURE__ */ r("img", { src: e[We], alt: "", referrerPolicy: "no-referrer" }) }),
|
|
665
|
+
/* @__PURE__ */ r("div", { className: "peeek__leaf-face peeek__leaf-face--back", children: /* @__PURE__ */ r("img", { src: e[Ye], alt: "", referrerPolicy: "no-referrer" }) })
|
|
666
666
|
]
|
|
667
667
|
}
|
|
668
668
|
)
|
|
@@ -671,7 +671,7 @@ function Tt(t) {
|
|
|
671
671
|
)
|
|
672
672
|
}
|
|
673
673
|
),
|
|
674
|
-
c.arrows && /* @__PURE__ */
|
|
674
|
+
c.arrows && /* @__PURE__ */ r(
|
|
675
675
|
"button",
|
|
676
676
|
{
|
|
677
677
|
type: "button",
|
|
@@ -685,7 +685,7 @@ function Tt(t) {
|
|
|
685
685
|
]
|
|
686
686
|
}
|
|
687
687
|
),
|
|
688
|
-
c.toolbar && /* @__PURE__ */
|
|
688
|
+
c.toolbar && /* @__PURE__ */ r(
|
|
689
689
|
vt,
|
|
690
690
|
{
|
|
691
691
|
strings: n,
|
|
@@ -698,7 +698,7 @@ function Tt(t) {
|
|
|
698
698
|
currentPage: te + 1,
|
|
699
699
|
layout: b,
|
|
700
700
|
thumbsOpen: Z,
|
|
701
|
-
isFullscreen:
|
|
701
|
+
isFullscreen: _,
|
|
702
702
|
downloadUrl: w,
|
|
703
703
|
show: {
|
|
704
704
|
bar: c.bar,
|
|
@@ -711,16 +711,16 @@ function Tt(t) {
|
|
|
711
711
|
},
|
|
712
712
|
onZoomIn: Fe,
|
|
713
713
|
onZoomOut: Me,
|
|
714
|
-
onZoomSet: (
|
|
714
|
+
onZoomSet: (o) => A(Math.min(ae, Math.max(ee, o))),
|
|
715
715
|
onJump: ce,
|
|
716
716
|
onRotate: Le,
|
|
717
717
|
onToggleLayout: K,
|
|
718
|
-
onToggleThumbs: () => j((
|
|
718
|
+
onToggleThumbs: () => j((o) => !o),
|
|
719
719
|
onToggleFullscreen: f,
|
|
720
720
|
onAbout: u
|
|
721
721
|
}
|
|
722
722
|
),
|
|
723
|
-
c.overview && Z && /* @__PURE__ */
|
|
723
|
+
c.overview && Z && /* @__PURE__ */ r(wt, { pages: e, layout: b, rtl: i, activePages: Y, onJump: ce })
|
|
724
724
|
] });
|
|
725
725
|
}
|
|
726
726
|
function Nt(t, e) {
|
|
@@ -747,12 +747,12 @@ function Pt(t) {
|
|
|
747
747
|
filename: a,
|
|
748
748
|
mimeType: i,
|
|
749
749
|
rtl: d,
|
|
750
|
-
autoTransition:
|
|
751
|
-
autoTransitionInterval:
|
|
750
|
+
autoTransition: h,
|
|
751
|
+
autoTransitionInterval: k,
|
|
752
752
|
downloadUrl: g,
|
|
753
753
|
isFullscreen: c,
|
|
754
754
|
onToggleFullscreen: w,
|
|
755
|
-
onAbout:
|
|
755
|
+
onAbout: _,
|
|
756
756
|
show: f
|
|
757
757
|
} = t, u = e.length, [l, D] = v(0), O = Ce(), F = L(
|
|
758
758
|
(m) => D((p) => Math.max(0, Math.min(u - 1, p + m))),
|
|
@@ -775,14 +775,14 @@ function Pt(t) {
|
|
|
775
775
|
var m, p;
|
|
776
776
|
(p = (m = j.current[l]) == null ? void 0 : m.scrollIntoView) == null || p.call(m, { behavior: "smooth", inline: "center", block: "nearest" });
|
|
777
777
|
}, [l]), C(() => {
|
|
778
|
-
if (!
|
|
779
|
-
const m = setTimeout(() => F(1),
|
|
778
|
+
if (!h || O || A) return;
|
|
779
|
+
const m = setTimeout(() => F(1), k);
|
|
780
780
|
return () => clearTimeout(m);
|
|
781
|
-
}, [
|
|
782
|
-
const { onKeyDown: M } = Pe({ go: F, jump: R, total: u, rtl: d }), [
|
|
781
|
+
}, [h, k, O, A, l, F]);
|
|
782
|
+
const { onKeyDown: M } = Pe({ go: F, jump: R, total: u, rtl: d }), [z, B] = v(String(l + 1));
|
|
783
783
|
C(() => B(String(l + 1)), [l]);
|
|
784
784
|
const P = () => {
|
|
785
|
-
const m = Ie(
|
|
785
|
+
const m = Ie(z, u);
|
|
786
786
|
if (m === null) {
|
|
787
787
|
B(String(l + 1));
|
|
788
788
|
return;
|
|
@@ -791,9 +791,9 @@ function Pt(t) {
|
|
|
791
791
|
}, X = Nt(a, i);
|
|
792
792
|
return /* @__PURE__ */ y("div", { className: "peeek__cf", children: [
|
|
793
793
|
/* @__PURE__ */ y("div", { className: "peeek__cf-header", children: [
|
|
794
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ r("span", { className: "peeek__cf-badge", children: X }),
|
|
795
795
|
/* @__PURE__ */ y("div", { className: "peeek__cf-meta", children: [
|
|
796
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ r("span", { className: "peeek__cf-name", children: a }),
|
|
797
797
|
/* @__PURE__ */ y("span", { className: "peeek__cf-count", children: [
|
|
798
798
|
u,
|
|
799
799
|
" ",
|
|
@@ -805,14 +805,14 @@ function Pt(t) {
|
|
|
805
805
|
" / ",
|
|
806
806
|
u
|
|
807
807
|
] }),
|
|
808
|
-
f.goto && /* @__PURE__ */
|
|
808
|
+
f.goto && /* @__PURE__ */ r(
|
|
809
809
|
"input",
|
|
810
810
|
{
|
|
811
811
|
className: "peeek__goto",
|
|
812
812
|
type: "text",
|
|
813
813
|
inputMode: "numeric",
|
|
814
814
|
"aria-label": n.goToPage,
|
|
815
|
-
value:
|
|
815
|
+
value: z,
|
|
816
816
|
onChange: (m) => B(m.target.value),
|
|
817
817
|
onBlur: P,
|
|
818
818
|
onKeyDown: (m) => {
|
|
@@ -820,7 +820,7 @@ function Pt(t) {
|
|
|
820
820
|
}
|
|
821
821
|
}
|
|
822
822
|
),
|
|
823
|
-
g && /* @__PURE__ */
|
|
823
|
+
g && /* @__PURE__ */ r(
|
|
824
824
|
"a",
|
|
825
825
|
{
|
|
826
826
|
className: "peeek__btn",
|
|
@@ -832,7 +832,7 @@ function Pt(t) {
|
|
|
832
832
|
children: "↓"
|
|
833
833
|
}
|
|
834
834
|
),
|
|
835
|
-
f.fullscreen && /* @__PURE__ */
|
|
835
|
+
f.fullscreen && /* @__PURE__ */ r(
|
|
836
836
|
"button",
|
|
837
837
|
{
|
|
838
838
|
type: "button",
|
|
@@ -843,13 +843,13 @@ function Pt(t) {
|
|
|
843
843
|
children: "⛶"
|
|
844
844
|
}
|
|
845
845
|
),
|
|
846
|
-
f.about && /* @__PURE__ */
|
|
846
|
+
f.about && /* @__PURE__ */ r(
|
|
847
847
|
"button",
|
|
848
848
|
{
|
|
849
849
|
type: "button",
|
|
850
850
|
className: "peeek__btn",
|
|
851
851
|
"aria-label": n.about,
|
|
852
|
-
onClick:
|
|
852
|
+
onClick: _,
|
|
853
853
|
children: "?"
|
|
854
854
|
}
|
|
855
855
|
)
|
|
@@ -861,7 +861,7 @@ function Pt(t) {
|
|
|
861
861
|
tabIndex: 0,
|
|
862
862
|
onKeyDown: M,
|
|
863
863
|
children: [
|
|
864
|
-
f.arrows && /* @__PURE__ */
|
|
864
|
+
f.arrows && /* @__PURE__ */ r(
|
|
865
865
|
"button",
|
|
866
866
|
{
|
|
867
867
|
type: "button",
|
|
@@ -876,7 +876,7 @@ function Pt(t) {
|
|
|
876
876
|
const S = p - l;
|
|
877
877
|
if (Math.abs(S) > 1) return null;
|
|
878
878
|
const b = S === 0, K = b && f.fullscreen;
|
|
879
|
-
return /* @__PURE__ */
|
|
879
|
+
return /* @__PURE__ */ r(
|
|
880
880
|
"button",
|
|
881
881
|
{
|
|
882
882
|
type: "button",
|
|
@@ -885,12 +885,12 @@ function Pt(t) {
|
|
|
885
885
|
tabIndex: b ? 0 : -1,
|
|
886
886
|
"aria-label": K ? n.openFullscreen : `Go to page ${p + 1}`,
|
|
887
887
|
onClick: () => K ? w() : D(p),
|
|
888
|
-
children: /* @__PURE__ */
|
|
888
|
+
children: /* @__PURE__ */ r("img", { src: m, alt: b ? `Page ${p + 1}` : "", referrerPolicy: "no-referrer" })
|
|
889
889
|
},
|
|
890
890
|
p
|
|
891
891
|
);
|
|
892
892
|
}),
|
|
893
|
-
f.arrows && /* @__PURE__ */
|
|
893
|
+
f.arrows && /* @__PURE__ */ r(
|
|
894
894
|
"button",
|
|
895
895
|
{
|
|
896
896
|
type: "button",
|
|
@@ -904,7 +904,7 @@ function Pt(t) {
|
|
|
904
904
|
]
|
|
905
905
|
}
|
|
906
906
|
),
|
|
907
|
-
f.thumbnails && /* @__PURE__ */
|
|
907
|
+
f.thumbnails && /* @__PURE__ */ r("div", { className: "peeek__cf-thumbs", role: "group", "aria-label": "Pages", children: e.map((m, p) => {
|
|
908
908
|
const S = p === l;
|
|
909
909
|
return /* @__PURE__ */ y(
|
|
910
910
|
"button",
|
|
@@ -918,8 +918,8 @@ function Pt(t) {
|
|
|
918
918
|
"aria-current": S ? "page" : void 0,
|
|
919
919
|
onClick: () => D(p),
|
|
920
920
|
children: [
|
|
921
|
-
/* @__PURE__ */
|
|
922
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ r("img", { src: m, alt: "", loading: "lazy", referrerPolicy: "no-referrer" }),
|
|
922
|
+
/* @__PURE__ */ r("span", { className: "peeek__cf-thumb-num", children: String(p + 1).padStart(2, "0") })
|
|
923
923
|
]
|
|
924
924
|
},
|
|
925
925
|
p
|
|
@@ -929,8 +929,8 @@ function Pt(t) {
|
|
|
929
929
|
}
|
|
930
930
|
function It({ logo: t, logoLink: e }) {
|
|
931
931
|
if (!t) return null;
|
|
932
|
-
const n = /* @__PURE__ */
|
|
933
|
-
return /* @__PURE__ */
|
|
932
|
+
const n = /* @__PURE__ */ r("img", { src: t, alt: "Logo", loading: "lazy", referrerPolicy: "no-referrer" });
|
|
933
|
+
return /* @__PURE__ */ r("div", { className: "peeek__branding", children: e ? /* @__PURE__ */ r("a", { href: e, target: "_blank", rel: "noopener noreferrer", children: n }) : n });
|
|
934
934
|
}
|
|
935
935
|
const xt = [
|
|
936
936
|
{ top: "12%", left: "10%", size: 3, v: "A", dur: 13, delay: 0 },
|
|
@@ -956,7 +956,7 @@ function St({ strings: t, onClose: e }) {
|
|
|
956
956
|
i.key === "Escape" && e();
|
|
957
957
|
};
|
|
958
958
|
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
959
|
-
}, [e]), /* @__PURE__ */
|
|
959
|
+
}, [e]), /* @__PURE__ */ r("div", { className: "peeek__about-backdrop", onClick: e, children: /* @__PURE__ */ y(
|
|
960
960
|
"div",
|
|
961
961
|
{
|
|
962
962
|
role: "dialog",
|
|
@@ -965,7 +965,7 @@ function St({ strings: t, onClose: e }) {
|
|
|
965
965
|
className: "peeek__about",
|
|
966
966
|
onClick: (a) => a.stopPropagation(),
|
|
967
967
|
children: [
|
|
968
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ r("span", { className: "peeek__about-particles", "aria-hidden": "true", children: xt.map((a, i) => /* @__PURE__ */ r(
|
|
969
969
|
"span",
|
|
970
970
|
{
|
|
971
971
|
className: "peeek__about-particle",
|
|
@@ -979,7 +979,7 @@ function St({ strings: t, onClose: e }) {
|
|
|
979
979
|
},
|
|
980
980
|
i
|
|
981
981
|
)) }),
|
|
982
|
-
/* @__PURE__ */
|
|
982
|
+
/* @__PURE__ */ r(
|
|
983
983
|
"button",
|
|
984
984
|
{
|
|
985
985
|
ref: n,
|
|
@@ -992,7 +992,7 @@ function St({ strings: t, onClose: e }) {
|
|
|
992
992
|
),
|
|
993
993
|
/* @__PURE__ */ y("div", { className: "peeek__about-content", children: [
|
|
994
994
|
/* @__PURE__ */ y("div", { className: "peeek__about-orbwrap", children: [
|
|
995
|
-
/* @__PURE__ */
|
|
995
|
+
/* @__PURE__ */ r("span", { className: "peeek__about-ring", "aria-hidden": "true" }),
|
|
996
996
|
/* @__PURE__ */ y(
|
|
997
997
|
"svg",
|
|
998
998
|
{
|
|
@@ -1002,13 +1002,13 @@ function St({ strings: t, onClose: e }) {
|
|
|
1002
1002
|
viewBox: "0 0 256 256",
|
|
1003
1003
|
"aria-hidden": "true",
|
|
1004
1004
|
children: [
|
|
1005
|
-
/* @__PURE__ */
|
|
1006
|
-
/* @__PURE__ */
|
|
1007
|
-
/* @__PURE__ */
|
|
1008
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ r("defs", { children: /* @__PURE__ */ y("radialGradient", { id: "peeek-about-orb", cx: "38%", cy: "30%", r: "80%", children: [
|
|
1006
|
+
/* @__PURE__ */ r("stop", { offset: "0%", stopColor: "#9aa2e6" }),
|
|
1007
|
+
/* @__PURE__ */ r("stop", { offset: "55%", stopColor: "#6E79D6" }),
|
|
1008
|
+
/* @__PURE__ */ r("stop", { offset: "100%", stopColor: "#535cc0" })
|
|
1009
1009
|
] }) }),
|
|
1010
|
-
/* @__PURE__ */
|
|
1011
|
-
/* @__PURE__ */
|
|
1010
|
+
/* @__PURE__ */ r("circle", { cx: "128", cy: "128", r: "128", fill: "url(#peeek-about-orb)" }),
|
|
1011
|
+
/* @__PURE__ */ r(
|
|
1012
1012
|
"path",
|
|
1013
1013
|
{
|
|
1014
1014
|
d: "M90 196 V70 H140 A38 38 0 0 1 140 146 H90",
|
|
@@ -1023,23 +1023,33 @@ function St({ strings: t, onClose: e }) {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
)
|
|
1025
1025
|
] }),
|
|
1026
|
-
/* @__PURE__ */
|
|
1027
|
-
/* @__PURE__ */
|
|
1026
|
+
/* @__PURE__ */ r("div", { className: "peeek__about-name", children: "Peeek Viewer" }),
|
|
1027
|
+
/* @__PURE__ */ r("div", { className: "peeek__about-tagline", children: t.aboutTagline }),
|
|
1028
1028
|
/* @__PURE__ */ y("div", { className: "peeek__about-version", children: [
|
|
1029
1029
|
"v",
|
|
1030
|
-
"0.4.
|
|
1030
|
+
"0.4.8"
|
|
1031
1031
|
] }),
|
|
1032
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ r("p", { className: "peeek__about-desc", children: t.aboutDescription }),
|
|
1033
|
+
/* @__PURE__ */ r(
|
|
1034
|
+
"a",
|
|
1035
|
+
{
|
|
1036
|
+
className: "peeek__about-link",
|
|
1037
|
+
href: "https://peeek.page",
|
|
1038
|
+
target: "_blank",
|
|
1039
|
+
rel: "noopener noreferrer",
|
|
1040
|
+
children: "peeek.page"
|
|
1041
|
+
}
|
|
1042
|
+
)
|
|
1033
1043
|
] })
|
|
1034
1044
|
]
|
|
1035
1045
|
}
|
|
1036
1046
|
) });
|
|
1037
1047
|
}
|
|
1038
1048
|
function Ft(t) {
|
|
1039
|
-
const e = gt(t), n = dt(e.language), a = E(null), { isFullscreen: i, toggle: d } = ht(a), [
|
|
1049
|
+
const e = gt(t), n = dt(e.language), a = E(null), { isFullscreen: i, toggle: d } = ht(a), [h, k] = v(!1), g = t.pages !== void 0, c = et(
|
|
1040
1050
|
() => g ? pt(t.pages, { filename: t.filename, mimeType: t.mimeType }) : null,
|
|
1041
1051
|
[g, t.pages, t.filename, t.mimeType]
|
|
1042
|
-
), w = bt(g ? null : e.src, e.pollInterval),
|
|
1052
|
+
), w = bt(g ? null : e.src, e.pollInterval), _ = g ? c : w.manifest, f = g ? c ? "ready" : "loading" : w.state, u = {
|
|
1043
1053
|
"--peeek-accent": e.accentColor
|
|
1044
1054
|
};
|
|
1045
1055
|
e.background === "transparent" ? u["--peeek-bg"] = "transparent" : e.background === "color" && e.backgroundColor ? u["--peeek-bg"] = e.backgroundColor : e.background === "image" && e.backgroundImage && (u["--peeek-bg"] = `center / cover no-repeat url("${e.backgroundImage}")`);
|
|
@@ -1059,39 +1069,39 @@ function Ft(t) {
|
|
|
1059
1069
|
"div",
|
|
1060
1070
|
{
|
|
1061
1071
|
ref: a,
|
|
1062
|
-
className: `peeek${e.fillHeight ? " peeek--fill-height" : ""}${e.className ? " " + e.className : ""}`,
|
|
1072
|
+
className: `peeek${e.fillHeight ? " peeek--fill-height" : ""}${h ? " peeek--about-open" : ""}${e.className ? " " + e.className : ""}`,
|
|
1063
1073
|
"data-skin": e.skin,
|
|
1064
1074
|
"data-layout": e.layout,
|
|
1065
1075
|
dir: e.rtl ? "rtl" : void 0,
|
|
1066
1076
|
style: u,
|
|
1067
1077
|
children: [
|
|
1068
|
-
/* @__PURE__ */
|
|
1078
|
+
/* @__PURE__ */ r(It, { logo: e.logo, logoLink: e.logoLink }),
|
|
1069
1079
|
f === "loading" && /* @__PURE__ */ y("div", { className: "peeek__state", style: e.loadingColor ? { color: e.loadingColor } : void 0, children: [
|
|
1070
|
-
e.loadingImage && /* @__PURE__ */
|
|
1071
|
-
/* @__PURE__ */
|
|
1080
|
+
e.loadingImage && /* @__PURE__ */ r("img", { className: "peeek__state-img", src: e.loadingImage, alt: "", referrerPolicy: "no-referrer" }),
|
|
1081
|
+
/* @__PURE__ */ r("span", { children: e.loadingCaption ?? n.loading })
|
|
1072
1082
|
] }),
|
|
1073
|
-
f === "error" && /* @__PURE__ */
|
|
1074
|
-
f === "ready" &&
|
|
1083
|
+
f === "error" && /* @__PURE__ */ r("div", { className: "peeek__state", children: n.error }),
|
|
1084
|
+
f === "ready" && _ && e.mode === "coverflow" && /* @__PURE__ */ r(
|
|
1075
1085
|
Pt,
|
|
1076
1086
|
{
|
|
1077
|
-
pages:
|
|
1087
|
+
pages: _.pages,
|
|
1078
1088
|
strings: n,
|
|
1079
|
-
filename:
|
|
1080
|
-
mimeType:
|
|
1089
|
+
filename: _.metadata.filename,
|
|
1090
|
+
mimeType: _.metadata.mimeType,
|
|
1081
1091
|
rtl: e.rtl,
|
|
1082
1092
|
autoTransition: e.autoTransition,
|
|
1083
1093
|
autoTransitionInterval: e.autoTransitionInterval,
|
|
1084
1094
|
downloadUrl: e.downloadUrl,
|
|
1085
1095
|
isFullscreen: i,
|
|
1086
1096
|
onToggleFullscreen: d,
|
|
1087
|
-
onAbout: () =>
|
|
1097
|
+
onAbout: () => k(!0),
|
|
1088
1098
|
show: { arrows: e.arrows, thumbnails: e.pagesOverview, fullscreen: e.fullscreen, about: e.aboutButton, goto: e.goToPage }
|
|
1089
1099
|
}
|
|
1090
1100
|
),
|
|
1091
|
-
f === "ready" &&
|
|
1101
|
+
f === "ready" && _ && e.mode === "flip" && /* @__PURE__ */ r(
|
|
1092
1102
|
Tt,
|
|
1093
1103
|
{
|
|
1094
|
-
pages:
|
|
1104
|
+
pages: _.pages,
|
|
1095
1105
|
strings: n,
|
|
1096
1106
|
layout: e.layout,
|
|
1097
1107
|
rtl: e.rtl,
|
|
@@ -1103,10 +1113,10 @@ function Ft(t) {
|
|
|
1103
1113
|
downloadUrl: e.downloadUrl,
|
|
1104
1114
|
isFullscreen: i,
|
|
1105
1115
|
onToggleFullscreen: d,
|
|
1106
|
-
onAbout: () =>
|
|
1116
|
+
onAbout: () => k(!0)
|
|
1107
1117
|
}
|
|
1108
1118
|
),
|
|
1109
|
-
|
|
1119
|
+
h && /* @__PURE__ */ r(St, { strings: n, onClose: () => k(!1) })
|
|
1110
1120
|
]
|
|
1111
1121
|
}
|
|
1112
1122
|
);
|
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;container-type:inline-size}.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__goto{width:3rem;height:2rem;padding:0 .4rem;text-align:center;border:1px solid rgba(255,255,255,.18);border-radius:8px;background:transparent;color:var(--peeek-text);font:inherit}.peeek__goto:focus-visible{outline:2px solid var(--peeek-accent);outline-offset:1px}.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;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;min-height:24rem;font-size:16px;color:var(--peeek-text)}.peeek__state-img{max-width:8rem;max-height:8rem;object-fit:contain}@container (max-width: 480px){.peeek__toolbar{gap:.4rem;padding:.5rem .6rem}.peeek__toolbar input[type=range],.peeek__scrubber{display:none}}.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__stage[data-layout=double] .peeek__spread:not(.peeek__spread--pair) .peeek__page--right{border-radius:0 8px 8px 0}.peeek__stage[data-layout=double] .peeek__spread:not(.peeek__spread--pair) .peeek__page--left{border-radius:8px 0 0 8px}.peeek__stage[data-layout=double] .peeek__leaf--fwd .peeek__leaf-face--front{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek__stage[data-layout=double] .peeek__leaf--fwd .peeek__leaf-face--back,.peeek__stage[data-layout=double] .peeek__leaf--back .peeek__leaf-face--front{border-top-left-radius:8px;border-bottom-left-radius:8px}.peeek__stage[data-layout=double] .peeek__leaf--back .peeek__leaf-face--back{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek__stage[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;overflow:hidden;-webkit-user-select:none;user-select:none}.peeek__about-particles{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none;overflow:hidden}.peeek__about-particle{position:absolute;border-radius:9999px;background:#6e79d673;box-shadow:0 0 9px #6e79d659}@keyframes peeekAboutDriftA{0%,to{transform:translate(0)}50%{transform:translate(6px,-8px)}}@keyframes peeekAboutDriftB{0%,to{transform:translate(0)}50%{transform:translate(-7px,6px)}}@keyframes peeekAboutDriftC{0%,to{transform:translate(0)}50%{transform:translate(5px,7px)}}.peeek__about-content{position:relative;z-index:1}.peeek__about-orbwrap{position:relative;width:48px;height:48px;margin-inline:auto;border-radius:9999px;animation:peeekAboutPulse 3.2s ease-in-out infinite}.peeek__about-ring{position:absolute;top:-5px;right:-5px;bottom:-5px;left:-5px;border-radius:9999px;background:conic-gradient(from 0deg,transparent 0 66%,#828ce0 86%,transparent 100%);-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 3px));mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 3px));animation:peeekAboutSpin 2.6s linear infinite}@keyframes peeekAboutSpin{to{transform:rotate(360deg)}}@keyframes peeekAboutPulse{0%,to{box-shadow:0 0 26px -8px #6e79d699}50%{box-shadow:0 0 40px -4px #6e79d6e6}}@media (prefers-reduced-motion: reduce){.peeek__about-particle,.peeek__about-ring,.peeek__about-orbwrap{animation:none}}.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}
|
|
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;container-type:inline-size}.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-spine-x: clamp(7px, 1.6cqi, 30px);--peeek-spine-blur: clamp(10px, 1.9cqi, 36px);--peeek-spine-spread: clamp(6px, 1.2cqi, 22px);--peeek-spine-grad: clamp(4px, .8cqi, 14px)}.peeek--shadows.peeek__spread--pair .peeek__page--left{box-shadow:inset calc(-1 * var(--peeek-spine-x)) 0 var(--peeek-spine-blur) calc(-1 * var(--peeek-spine-spread)) #0009}.peeek--shadows.peeek__spread--pair .peeek__page--right{box-shadow:inset var(--peeek-spine-x) 0 var(--peeek-spine-blur) calc(-1 * var(--peeek-spine-spread)) #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:var(--peeek-spine-grad);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__goto{width:3rem;height:2rem;padding:0 .4rem;text-align:center;border:1px solid rgba(255,255,255,.18);border-radius:8px;background:transparent;color:var(--peeek-text);font:inherit}.peeek__goto:focus-visible{outline:2px solid var(--peeek-accent);outline-offset:1px}.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;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;min-height:24rem;font-size:16px;color:var(--peeek-text)}.peeek__state-img{max-width:8rem;max-height:8rem;object-fit:contain}@container (max-width: 480px){.peeek__toolbar{gap:.4rem;padding:.5rem .6rem}.peeek__toolbar input[type=range],.peeek__scrubber{display:none}}.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__stage[data-layout=double] .peeek__spread:not(.peeek__spread--pair) .peeek__page--right{border-radius:0 8px 8px 0}.peeek__stage[data-layout=double] .peeek__spread:not(.peeek__spread--pair) .peeek__page--left{border-radius:8px 0 0 8px}.peeek__stage[data-layout=double] .peeek__leaf--fwd .peeek__leaf-face--front{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek__stage[data-layout=double] .peeek__leaf--fwd .peeek__leaf-face--back,.peeek__stage[data-layout=double] .peeek__leaf--back .peeek__leaf-face--front{border-top-left-radius:8px;border-bottom-left-radius:8px}.peeek__stage[data-layout=double] .peeek__leaf--back .peeek__leaf-face--back{border-top-right-radius:8px;border-bottom-right-radius:8px}.peeek__stage[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;overflow:hidden;-webkit-user-select:none;user-select:none}.peeek__about-particles{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;pointer-events:none;overflow:hidden}.peeek__about-particle{position:absolute;border-radius:9999px;background:#6e79d673;box-shadow:0 0 9px #6e79d659}@keyframes peeekAboutDriftA{0%,to{transform:translate(0)}50%{transform:translate(6px,-8px)}}@keyframes peeekAboutDriftB{0%,to{transform:translate(0)}50%{transform:translate(-7px,6px)}}@keyframes peeekAboutDriftC{0%,to{transform:translate(0)}50%{transform:translate(5px,7px)}}.peeek__about-content{position:relative;z-index:1}.peeek__about-orbwrap{position:relative;width:48px;height:48px;margin-inline:auto;border-radius:9999px;animation:peeekAboutPulse 3.2s ease-in-out infinite}.peeek__about-ring{position:absolute;top:-5px;right:-5px;bottom:-5px;left:-5px;border-radius:9999px;background:conic-gradient(from 0deg,transparent 0 66%,#828ce0 86%,transparent 100%);-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 3px));mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 3px));animation:peeekAboutSpin 2.6s linear infinite}@keyframes peeekAboutSpin{to{transform:rotate(360deg)}}@keyframes peeekAboutPulse{0%,to{box-shadow:0 0 26px -8px #6e79d699}50%{box-shadow:0 0 40px -4px #6e79d6e6}}@media (prefers-reduced-motion: reduce){.peeek__about-particle,.peeek__about-ring,.peeek__about-orbwrap{animation:none}}.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}.peeek__about-link{display:inline-block;margin:.9rem 0 0;font-size:14px;font-weight:600;color:var(--peeek-accent, #6E79D6);text-decoration:none}.peeek__about-link:hover{text-decoration:underline}.peeek--about-open .peeek__stage,.peeek--about-open .peeek__toolbar{filter:blur(4px);transition:filter .2s ease-out}
|