@reuse-sh/lightbox 0.0.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/README.md +65 -16
  2. package/dist/audio.d.ts +2 -0
  3. package/dist/audio.js +17 -0
  4. package/dist/base.css +602 -0
  5. package/dist/browser/audio.js +3 -0
  6. package/dist/browser/audio.js.map +1 -0
  7. package/dist/browser/carousel-link.js +3 -0
  8. package/dist/browser/carousel-link.js.map +1 -0
  9. package/dist/browser/embed.js +3 -0
  10. package/dist/browser/embed.js.map +1 -0
  11. package/dist/browser/html.js +3 -0
  12. package/dist/browser/html.js.map +1 -0
  13. package/dist/browser/iframe.js +3 -0
  14. package/dist/browser/iframe.js.map +1 -0
  15. package/dist/browser/lightbox.js +3 -0
  16. package/dist/browser/lightbox.js.map +1 -0
  17. package/dist/browser/video.js +3 -0
  18. package/dist/browser/video.js.map +1 -0
  19. package/dist/carousel.d.ts +6 -0
  20. package/dist/carousel.js +17 -0
  21. package/dist/chrome.d.ts +35 -0
  22. package/dist/chrome.js +53 -0
  23. package/dist/embed.d.ts +14 -0
  24. package/dist/embed.js +173 -0
  25. package/dist/geometry.d.ts +37 -1
  26. package/dist/geometry.js +75 -5
  27. package/dist/html.d.ts +2 -0
  28. package/dist/html.js +15 -0
  29. package/dist/icons.d.ts +15 -0
  30. package/dist/icons.js +40 -0
  31. package/dist/iframe.d.ts +8 -0
  32. package/dist/iframe.js +43 -0
  33. package/dist/index.d.ts +180 -47
  34. package/dist/index.js +3817 -398
  35. package/dist/react.d.ts +18 -9
  36. package/dist/react.js +71 -46
  37. package/dist/sources.d.ts +28 -0
  38. package/dist/sources.js +179 -0
  39. package/dist/theme.css +236 -0
  40. package/dist/themes/dark.css +12 -0
  41. package/dist/themes/light.css +12 -0
  42. package/dist/themes/page.css +28 -0
  43. package/dist/themes/photos.css +17 -0
  44. package/dist/unlayered/base.css +599 -0
  45. package/dist/unlayered/theme.css +233 -0
  46. package/dist/unlayered/themes/dark.css +9 -0
  47. package/dist/unlayered/themes/light.css +9 -0
  48. package/dist/unlayered/themes/page.css +25 -0
  49. package/dist/unlayered/themes/photos.css +14 -0
  50. package/dist/video.d.ts +3 -0
  51. package/dist/video.js +55 -0
  52. package/package.json +33 -4
  53. package/dist/styles.css +0 -218
@@ -0,0 +1,233 @@
1
+ .re-lightbox {
2
+ --re-lightbox-background: rgb(15 15 17 / 96%);
3
+ --re-lightbox-foreground: #fff;
4
+ --re-lightbox-control: rgb(35 35 38 / 96%);
5
+ --re-lightbox-control-hover: color-mix(
6
+ in srgb,
7
+ var(--re-lightbox-control) 88%,
8
+ var(--re-lightbox-foreground)
9
+ );
10
+ --re-lightbox-panel: rgb(24 24 27 / 96%);
11
+ --re-lightbox-button-size: 44px;
12
+ --re-lightbox-button-padding: 10px;
13
+ --re-lightbox-button-radius: 50%;
14
+ --re-lightbox-press-scale: 0.96;
15
+ --re-lightbox-icon-size: 24px;
16
+ --re-lightbox-font-size: 14px;
17
+ --re-lightbox-counter-font-size: 13px;
18
+ --re-lightbox-blur: 16px;
19
+ --re-lightbox-inset: 16px;
20
+ --re-lightbox-gap: 10px;
21
+ --re-lightbox-arrow-inset: 16px;
22
+ --re-lightbox-footer-inset: 72px;
23
+ --re-lightbox-counter-padding: 6px 12px;
24
+ --re-lightbox-counter-radius: 20px;
25
+ --re-lightbox-caption-padding: 4px 10px;
26
+ --re-lightbox-caption-radius: 4px;
27
+ --re-lightbox-thumbnail-size: 44px;
28
+ --re-lightbox-thumbnail-radius: 5px;
29
+ --re-lightbox-thumbnail-gap: 8px;
30
+ --re-lightbox-thumbnails-padding: 4px;
31
+ --re-lightbox-error-padding: 24px;
32
+ --re-lightbox-placeholder: rgb(255 255 255 / 6%);
33
+ --re-lightbox-media-background: #f2f2f2;
34
+ --re-lightbox-retry-padding: 8px 16px;
35
+ --re-lightbox-retry-radius: 20px;
36
+ --re-lightbox-aside-width: 320px;
37
+ --re-lightbox-aside-height: 40%;
38
+ --re-lightbox-open-duration: 400ms;
39
+ --re-lightbox-close-duration: 300ms;
40
+ --re-lightbox-zoom-duration: 350ms;
41
+ --re-lightbox-fade-duration: 240ms;
42
+ --re-lightbox-ease: cubic-bezier(0.32, 0.72, 0, 1);
43
+ --re-lightbox-control-duration: 300ms;
44
+ --re-lightbox-ring-duration: 150ms;
45
+ color: var(--re-lightbox-foreground);
46
+ font-family: var(
47
+ --re-lightbox-font,
48
+ system-ui,
49
+ -apple-system,
50
+ "Segoe UI",
51
+ Roboto,
52
+ sans-serif
53
+ );
54
+ }
55
+ .re-lightbox-backdrop {
56
+ background: var(--re-lightbox-background);
57
+ transition: background-color var(--re-lightbox-background-duration, 0ms) ease;
58
+ }
59
+ .re-lightbox-button {
60
+ box-sizing: border-box;
61
+ width: var(--re-lightbox-button-size);
62
+ height: var(--re-lightbox-button-size);
63
+ padding: var(--re-lightbox-button-padding);
64
+ border: 0;
65
+ border-radius: var(--re-lightbox-button-radius);
66
+ background: var(--re-lightbox-control);
67
+ color: inherit;
68
+ font: inherit;
69
+ line-height: 1;
70
+ backdrop-filter: blur(var(--re-lightbox-blur));
71
+ }
72
+ .re-lightbox-button svg {
73
+ width: var(--re-lightbox-icon-size);
74
+ height: var(--re-lightbox-icon-size);
75
+ }
76
+ .re-lightbox-button:hover {
77
+ background: var(--re-lightbox-control-hover);
78
+ }
79
+ .re-lightbox-button:active:not(:disabled) {
80
+ scale: var(--re-lightbox-press-scale);
81
+ }
82
+ /* Hit testing follows the scale, so a press held on the edge would end off the button and fire no click. */
83
+ .re-lightbox-button:active:not(:disabled)::before {
84
+ content: "";
85
+ position: absolute;
86
+ inset: calc(-50% * (1 / var(--re-lightbox-press-scale) - 1));
87
+ border-radius: inherit;
88
+ }
89
+ .re-lightbox-button:disabled {
90
+ opacity: calc(0.3 * var(--re-lightbox-chrome-opacity, 1));
91
+ }
92
+ .re-lightbox-close {
93
+ transition: rotate var(--re-lightbox-control-duration) ease;
94
+ }
95
+ .re-lightbox-download {
96
+ text-decoration: none;
97
+ }
98
+ .re-lightbox-slideshow {
99
+ position: relative;
100
+ }
101
+ .re-lightbox[data-slideshow] .re-lightbox-slideshow::after {
102
+ content: "";
103
+ position: absolute;
104
+ inset: 0;
105
+ border-radius: inherit;
106
+ background: conic-gradient(
107
+ currentColor calc(var(--re-lightbox-slideshow-progress, 0) * 1turn),
108
+ transparent 0
109
+ );
110
+ mask: radial-gradient(
111
+ farthest-side,
112
+ transparent calc(100% - 2px),
113
+ #000 calc(100% - 2px)
114
+ );
115
+ pointer-events: none;
116
+ }
117
+ @media (hover: hover) and (prefers-reduced-motion: no-preference) {
118
+ .re-lightbox-close:hover {
119
+ rotate: 90deg;
120
+ }
121
+ }
122
+ .re-lightbox-button:focus-visible,
123
+ .re-lightbox-thumbnails button:focus-visible {
124
+ outline: 2px solid currentColor;
125
+ outline-offset: 3px;
126
+ }
127
+ [data-re-focus-quiet]:focus-visible {
128
+ outline: none;
129
+ }
130
+ .re-lightbox-counter {
131
+ padding: var(--re-lightbox-counter-padding);
132
+ border-radius: var(--re-lightbox-counter-radius);
133
+ background: var(--re-lightbox-control);
134
+ font-size: var(--re-lightbox-counter-font-size);
135
+ font-variant-numeric: tabular-nums;
136
+ backdrop-filter: blur(var(--re-lightbox-blur));
137
+ }
138
+ .re-lightbox-caption {
139
+ padding: var(--re-lightbox-caption-padding);
140
+ border-radius: var(--re-lightbox-caption-radius);
141
+ background: var(--re-lightbox-background);
142
+ font-size: var(--re-lightbox-font-size);
143
+ line-height: 1.5;
144
+ text-align: center;
145
+ }
146
+ .re-lightbox-thumbnails {
147
+ gap: var(--re-lightbox-thumbnail-gap);
148
+ }
149
+ .re-lightbox[data-thumbnails="bottom"] .re-lightbox-thumbnails {
150
+ padding-block: 12px max(14px, env(safe-area-inset-bottom));
151
+ }
152
+ .re-lightbox[data-thumbnails="side"] .re-lightbox-thumbnails {
153
+ padding: 0 var(--re-lightbox-thumbnails-padding);
154
+ }
155
+ .re-lightbox-thumbnails button {
156
+ width: var(--re-lightbox-thumbnail-size);
157
+ height: var(--re-lightbox-thumbnail-size);
158
+ padding: 0;
159
+ border: 0;
160
+ border-radius: var(--re-lightbox-thumbnail-radius);
161
+ background: none;
162
+ opacity: 0.45;
163
+ transition: opacity var(--re-lightbox-control-duration) ease;
164
+ }
165
+ .re-lightbox[data-thumbnails="bottom"] .re-lightbox-thumbnails button {
166
+ width: auto;
167
+ min-width: 24px;
168
+ aspect-ratio: 1;
169
+ }
170
+ @media (hover: hover) {
171
+ .re-lightbox-thumbnails button:hover {
172
+ opacity: 0.8;
173
+ }
174
+ }
175
+ .re-lightbox-thumbnails button:is([aria-current="true"], :focus-visible) {
176
+ opacity: 1;
177
+ }
178
+ .re-lightbox-thumbnail-ring {
179
+ border-radius: var(--re-lightbox-thumbnail-radius);
180
+ outline: 2px solid var(--re-lightbox-foreground);
181
+ outline-offset: 2px;
182
+ transition:
183
+ width var(--re-lightbox-ring-duration) ease,
184
+ height var(--re-lightbox-ring-duration) ease;
185
+ }
186
+ @media (prefers-reduced-motion: reduce) {
187
+ .re-lightbox-thumbnail-ring {
188
+ transition: none;
189
+ }
190
+ }
191
+ .re-lightbox-aside {
192
+ background: var(--re-lightbox-panel);
193
+ }
194
+ .re-lightbox-aside > .re-lightbox-caption {
195
+ padding: calc(
196
+ var(--re-lightbox-inset) +
197
+ var(--re-lightbox-button-size) +
198
+ var(--re-lightbox-gap)
199
+ )
200
+ var(--re-lightbox-inset) var(--re-lightbox-inset);
201
+ border-radius: 0;
202
+ background: none;
203
+ text-align: start;
204
+ }
205
+ .re-lightbox-frame:is([data-loading], [data-error]) {
206
+ background: var(--re-lightbox-placeholder);
207
+ }
208
+ .re-lightbox-error {
209
+ padding: var(--re-lightbox-error-padding);
210
+ font-size: var(--re-lightbox-font-size);
211
+ line-height: 1.5;
212
+ }
213
+ .re-lightbox-retry {
214
+ padding: var(--re-lightbox-retry-padding);
215
+ border: 0;
216
+ border-radius: var(--re-lightbox-retry-radius);
217
+ background: var(--re-lightbox-control);
218
+ color: inherit;
219
+ font: inherit;
220
+ }
221
+ .re-lightbox-retry:hover {
222
+ background: var(--re-lightbox-control-hover);
223
+ }
224
+ .re-lightbox-retry:focus-visible {
225
+ outline: 2px solid currentColor;
226
+ outline-offset: 3px;
227
+ }
228
+ @media (max-width: 480px) {
229
+ .re-lightbox {
230
+ --re-lightbox-arrow-inset: 8px;
231
+ --re-lightbox-footer-inset: 16px;
232
+ }
233
+ }
@@ -0,0 +1,9 @@
1
+ .re-lightbox {
2
+ --re-lightbox-background: rgb(15 15 17 / 96%);
3
+ --re-lightbox-foreground: #fff;
4
+ --re-lightbox-control: rgb(35 35 38 / 96%);
5
+ --re-lightbox-control-hover: rgb(58 58 62 / 98%);
6
+ --re-lightbox-panel: rgb(24 24 27 / 96%);
7
+ --re-lightbox-placeholder: rgb(255 255 255 / 6%);
8
+ --re-lightbox-media-background: #f2f2f2;
9
+ }
@@ -0,0 +1,9 @@
1
+ .re-lightbox {
2
+ --re-lightbox-background: rgb(250 250 250 / 97%);
3
+ --re-lightbox-foreground: #1c1c1e;
4
+ --re-lightbox-control: rgb(255 255 255 / 92%);
5
+ --re-lightbox-control-hover: rgb(236 236 238 / 96%);
6
+ --re-lightbox-panel: rgb(255 255 255 / 96%);
7
+ --re-lightbox-placeholder: rgb(0 0 0 / 5%);
8
+ --re-lightbox-media-background: #fff;
9
+ }
@@ -0,0 +1,25 @@
1
+ .re-lightbox {
2
+ --re-lightbox-background: var(--re-lightbox-page, Canvas);
3
+ --re-lightbox-foreground: var(--re-lightbox-page-foreground, CanvasText);
4
+ --re-lightbox-control: color-mix(
5
+ in srgb,
6
+ var(--re-lightbox-page-foreground, CanvasText) 8%,
7
+ var(--re-lightbox-page, Canvas)
8
+ );
9
+ --re-lightbox-control-hover: color-mix(
10
+ in srgb,
11
+ var(--re-lightbox-page-foreground, CanvasText) 14%,
12
+ var(--re-lightbox-page, Canvas)
13
+ );
14
+ --re-lightbox-panel: var(--re-lightbox-page, Canvas);
15
+ --re-lightbox-placeholder: color-mix(
16
+ in srgb,
17
+ var(--re-lightbox-page-foreground, CanvasText) 6%,
18
+ transparent
19
+ );
20
+ --re-lightbox-media-background: color-mix(
21
+ in srgb,
22
+ var(--re-lightbox-page-foreground, CanvasText) 5%,
23
+ var(--re-lightbox-page, Canvas)
24
+ );
25
+ }
@@ -0,0 +1,14 @@
1
+ .re-lightbox {
2
+ --re-lightbox-background: #fff;
3
+ --re-lightbox-foreground: #1d1d1f;
4
+ --re-lightbox-control: rgb(255 255 255 / 80%);
5
+ --re-lightbox-control-hover: rgb(242 242 247 / 90%);
6
+ --re-lightbox-panel: rgb(249 249 249 / 94%);
7
+ --re-lightbox-placeholder: rgb(0 0 0 / 4%);
8
+ --re-lightbox-media-background: #fff;
9
+ --re-lightbox-background-duration: 300ms;
10
+ }
11
+ .re-lightbox[data-chrome="hidden"] {
12
+ --re-lightbox-background: #000;
13
+ --re-lightbox-foreground: #8e8e93;
14
+ }
@@ -0,0 +1,3 @@
1
+ import type { LightboxContent, LightboxMounted } from "./index.js";
2
+ export declare function playerOf(media: HTMLMediaElement, autoplay: boolean, signal: AbortSignal): LightboxMounted;
3
+ export declare function video(): LightboxContent;
package/dist/video.js ADDED
@@ -0,0 +1,55 @@
1
+ // A player starts by itself only the first time it is current, so a return leaves it as it was.
2
+ export function playerOf(media, autoplay, signal) {
3
+ let pending = autoplay;
4
+ media.addEventListener("play", () => (pending = false), { signal });
5
+ return {
6
+ interactive: true,
7
+ ready: new Promise((resolve) => {
8
+ // Safari may stop at metadata under preload="metadata"; the element shows its poster till then.
9
+ media.addEventListener("loadedmetadata", resolve, { once: true, signal });
10
+ media.addEventListener("error", resolve, { once: true, signal });
11
+ }),
12
+ pause: () => media.pause(),
13
+ resume() {
14
+ if (!pending)
15
+ return;
16
+ pending = false;
17
+ // A browser that refuses sound may still play muted.
18
+ media
19
+ .play()
20
+ .catch((error) => {
21
+ // A pause before the first frame aborts the play; only a refusal retries muted.
22
+ if (error.name !== "NotAllowedError")
23
+ return;
24
+ media.muted = true;
25
+ return media.play();
26
+ })
27
+ .catch(() => { });
28
+ },
29
+ unmount() {
30
+ media.pause();
31
+ media.removeAttribute("src");
32
+ media.load();
33
+ media.remove();
34
+ },
35
+ };
36
+ }
37
+ export function video() {
38
+ return {
39
+ type: "video",
40
+ mount(container, { item, signal, autoplay }) {
41
+ const element = container.ownerDocument.createElement("video");
42
+ element.className = "re-lightbox-video";
43
+ element.controls = true;
44
+ element.playsInline = true;
45
+ element.preload = "metadata";
46
+ if (item.previewSrc)
47
+ element.poster = item.previewSrc;
48
+ element.src = item.src ?? "";
49
+ if (item.alt)
50
+ element.setAttribute("aria-label", item.alt);
51
+ container.append(element);
52
+ return playerOf(element, autoplay, signal);
53
+ },
54
+ };
55
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reuse-sh/lightbox",
3
- "version": "0.0.6",
3
+ "version": "0.2.0",
4
4
  "description": "An image lightbox on native scrolling, with thumbnail transitions, zoom, pan, and pinch.",
5
5
  "keywords": [
6
6
  "reuse",
@@ -32,7 +32,35 @@
32
32
  "types": "./dist/index.d.ts",
33
33
  "import": "./dist/index.js"
34
34
  },
35
- "./styles.css": "./dist/styles.css",
35
+ "./base.css": "./dist/base.css",
36
+ "./theme.css": "./dist/theme.css",
37
+ "./themes/*": "./dist/themes/*",
38
+ "./unlayered/*": "./dist/unlayered/*",
39
+ "./browser/*": "./dist/browser/*",
40
+ "./video": {
41
+ "types": "./dist/video.d.ts",
42
+ "import": "./dist/video.js"
43
+ },
44
+ "./audio": {
45
+ "types": "./dist/audio.d.ts",
46
+ "import": "./dist/audio.js"
47
+ },
48
+ "./iframe": {
49
+ "types": "./dist/iframe.d.ts",
50
+ "import": "./dist/iframe.js"
51
+ },
52
+ "./html": {
53
+ "types": "./dist/html.d.ts",
54
+ "import": "./dist/html.js"
55
+ },
56
+ "./embed": {
57
+ "types": "./dist/embed.d.ts",
58
+ "import": "./dist/embed.js"
59
+ },
60
+ "./carousel": {
61
+ "types": "./dist/carousel.d.ts",
62
+ "import": "./dist/carousel.js"
63
+ },
36
64
  "./react": {
37
65
  "types": "./dist/react.d.ts",
38
66
  "import": "./dist/react.js"
@@ -51,13 +79,14 @@
51
79
  "@types/react": "19.3.0"
52
80
  },
53
81
  "dependencies": {
54
- "@reuse-sh/carousel": "0.1.1"
82
+ "@reuse-sh/carousel": "0.2.0",
83
+ "@reuse-sh/loaders": "0.0.4"
55
84
  },
56
85
  "publishConfig": {
57
86
  "access": "public"
58
87
  },
59
88
  "scripts": {
60
- "build": "node ../../scripts/clean-dist.mjs && tsc -p tsconfig.json && node ../../scripts/copy-styles.mjs",
89
+ "build": "node ../../scripts/clean-dist.mjs && tsc -p tsconfig.json && node ../../scripts/copy-styles.mjs && node ../../scripts/build-browser.mjs",
61
90
  "type-check": "tsc -p tsconfig.json --noEmit",
62
91
  "test": "vitest run"
63
92
  }
package/dist/styles.css DELETED
@@ -1,218 +0,0 @@
1
- .re-lightbox {
2
- --re-lightbox-background: rgb(15 15 17 / 96%);
3
- --re-lightbox-foreground: #fff;
4
- --re-lightbox-control: rgb(35 35 38 / 96%);
5
- position: fixed;
6
- inset: 0;
7
- width: 100%;
8
- max-width: none;
9
- height: 100%;
10
- max-height: none;
11
- margin: 0;
12
- padding: 0;
13
- overflow: hidden;
14
- border: 0;
15
- background: transparent;
16
- color: var(--re-lightbox-foreground);
17
- overscroll-behavior: contain;
18
- font-family: inherit;
19
- }
20
- .re-lightbox::backdrop {
21
- background: transparent;
22
- }
23
- .re-lightbox-backdrop {
24
- position: absolute;
25
- inset: 0;
26
- background: var(--re-lightbox-background);
27
- pointer-events: none;
28
- }
29
- .re-lightbox-viewport {
30
- position: relative;
31
- display: flex;
32
- width: 100%;
33
- height: 100%;
34
- overflow-x: auto;
35
- overflow-y: hidden;
36
- scroll-snap-type: x mandatory;
37
- overscroll-behavior: contain;
38
- scrollbar-width: none;
39
- touch-action: pan-x;
40
- outline-offset: -4px;
41
- }
42
- .re-lightbox-viewport::-webkit-scrollbar {
43
- display: none;
44
- }
45
- .re-lightbox-slide {
46
- position: relative;
47
- display: grid;
48
- flex: 0 0 100%;
49
- width: 100%;
50
- height: 100%;
51
- place-items: center;
52
- scroll-snap-align: start;
53
- scroll-snap-stop: always;
54
- overflow: hidden;
55
- }
56
- .re-lightbox-frame {
57
- position: relative;
58
- flex: none;
59
- transform-origin: center;
60
- cursor: zoom-in;
61
- }
62
- .re-lightbox[data-zoomed="true"] .re-lightbox-frame {
63
- cursor: grab;
64
- }
65
- .re-lightbox[data-zoomed="true"] .re-lightbox-frame:active {
66
- cursor: grabbing;
67
- }
68
- .re-lightbox-image {
69
- display: block;
70
- width: 100%;
71
- height: 100%;
72
- max-width: none;
73
- object-fit: contain;
74
- user-select: none;
75
- -webkit-user-drag: none;
76
- }
77
- .re-lightbox-button {
78
- position: absolute;
79
- z-index: 2;
80
- display: grid;
81
- width: 44px;
82
- height: 44px;
83
- padding: 10px;
84
- place-items: center;
85
- border: 0;
86
- border-radius: 50%;
87
- background: var(--re-lightbox-control);
88
- color: inherit;
89
- font: inherit;
90
- font-size: 26px;
91
- line-height: 1;
92
- cursor: pointer;
93
- touch-action: manipulation;
94
- backdrop-filter: blur(16px);
95
- }
96
- .re-lightbox-button svg {
97
- width: 24px;
98
- height: 24px;
99
- }
100
- .re-lightbox-button:hover {
101
- background: rgb(58 58 62 / 98%);
102
- }
103
- .re-lightbox-button:disabled {
104
- opacity: 0.3;
105
- cursor: default;
106
- }
107
- .re-lightbox-button:focus-visible,
108
- .re-lightbox-thumbnails button:focus-visible {
109
- outline: 2px solid currentColor;
110
- outline-offset: 3px;
111
- }
112
- .re-lightbox-close {
113
- top: max(16px, env(safe-area-inset-top));
114
- right: max(16px, env(safe-area-inset-right));
115
- }
116
- .re-lightbox-zoom {
117
- top: max(16px, env(safe-area-inset-top));
118
- right: calc(max(16px, env(safe-area-inset-right)) + 54px);
119
- }
120
- .re-lightbox-prev {
121
- top: calc(50% - 22px);
122
- left: max(16px, env(safe-area-inset-left));
123
- }
124
- .re-lightbox-next {
125
- top: calc(50% - 22px);
126
- right: max(16px, env(safe-area-inset-right));
127
- }
128
- .re-lightbox-footer {
129
- position: absolute;
130
- z-index: 2;
131
- right: 72px;
132
- bottom: max(16px, env(safe-area-inset-bottom));
133
- left: 72px;
134
- display: grid;
135
- justify-items: center;
136
- gap: 10px;
137
- pointer-events: none;
138
- }
139
- .re-lightbox-counter {
140
- padding: 6px 12px;
141
- border-radius: 20px;
142
- background: var(--re-lightbox-control);
143
- font-size: 13px;
144
- font-variant-numeric: tabular-nums;
145
- backdrop-filter: blur(16px);
146
- }
147
- .re-lightbox-caption {
148
- max-width: 60ch;
149
- max-height: 20vh;
150
- margin: 0;
151
- overflow: auto;
152
- padding: 4px 10px;
153
- border-radius: 4px;
154
- background: var(--re-lightbox-background);
155
- font-size: 14px;
156
- line-height: 1.5;
157
- text-align: center;
158
- overflow-wrap: anywhere;
159
- pointer-events: auto;
160
- }
161
- .re-lightbox-caption:empty {
162
- display: none;
163
- }
164
- .re-lightbox-thumbnails {
165
- display: flex;
166
- max-width: 100%;
167
- gap: 8px;
168
- overflow-x: auto;
169
- padding: 4px;
170
- pointer-events: auto;
171
- }
172
- .re-lightbox-thumbnails button {
173
- flex: 0 0 44px;
174
- width: 44px;
175
- height: 44px;
176
- padding: 0;
177
- overflow: hidden;
178
- border: 2px solid transparent;
179
- border-radius: 5px;
180
- background: none;
181
- opacity: 0.6;
182
- cursor: pointer;
183
- }
184
- .re-lightbox-thumbnails button[aria-current="true"] {
185
- border-color: var(--re-lightbox-foreground);
186
- opacity: 1;
187
- }
188
- .re-lightbox-thumbnails img {
189
- width: 100%;
190
- height: 100%;
191
- object-fit: cover;
192
- }
193
-
194
- .re-lightbox-error {
195
- position: absolute;
196
- inset: 0;
197
- display: grid;
198
- padding: 24px;
199
- place-items: center;
200
- text-align: center;
201
- }
202
- @media (max-width: 480px) {
203
- .re-lightbox-prev {
204
- left: 8px;
205
- }
206
- .re-lightbox-next {
207
- right: 8px;
208
- }
209
- .re-lightbox-footer {
210
- right: 16px;
211
- left: 16px;
212
- }
213
- }
214
- @media (prefers-reduced-motion: reduce) {
215
- .re-lightbox-viewport {
216
- scroll-behavior: auto;
217
- }
218
- }