tangled
alpha
login
or
join now
pds.ls
/
pdsls
399
fork
atom
atmosphere explorer
pds.ls
tool
typescript
atproto
399
fork
atom
overview
issues
1
pulls
pipelines
add full size image overlay
handle.invalid
2 weeks ago
db993dd8
827e3507
verified
This commit was signed with the committer's
known signature
.
handle.invalid
SSH Key Fingerprint:
SHA256:mBrT4x0JdzLpbVR95g1hjI1aaErfC02kmLRkPXwsYCk=
+25
-1
1 changed file
expand all
collapse all
unified
split
src
components
json.tsx
+25
-1
src/components/json.tsx
···
8
8
ErrorBoundary,
9
9
For,
10
10
on,
11
11
+
onCleanup,
11
12
Show,
12
13
useContext,
13
14
} from "solid-js";
15
15
+
import { Portal } from "solid-js/web";
14
16
import { resolveLexiconAuthority } from "../utils/api";
15
17
import { formatFileSize } from "../utils/format";
16
18
import { hideMedia } from "../views/settings";
···
288
290
(blob.mimeType.startsWith("image/") || blob.mimeType === "video/mp4");
289
291
290
292
const MediaDisplay = () => {
293
293
+
const [expanded, setExpanded] = createSignal(false);
294
294
+
295
295
+
createEffect(() => {
296
296
+
if (!expanded()) return;
297
297
+
const handler = (e: KeyboardEvent) => { if (e.key === "Escape") setExpanded(false); };
298
298
+
window.addEventListener("keydown", handler);
299
299
+
onCleanup(() => window.removeEventListener("keydown", handler));
300
300
+
});
291
301
const [imageUrl] = createResource(
292
302
() => (blob.mimeType.startsWith("image/") ? blob.ref.$link : null),
293
303
async (cid) => {
···
318
328
}
319
329
>
320
330
<img
321
321
-
class="h-auto max-h-48 max-w-64 object-contain"
331
331
+
class="h-auto max-h-48 max-w-64 cursor-zoom-in object-contain"
322
332
src={imageUrl()}
323
333
onLoad={() => setMediaLoaded(true)}
334
334
+
onclick={() => setExpanded(true)}
324
335
/>
336
336
+
<Show when={expanded()}>
337
337
+
<Portal>
338
338
+
<div
339
339
+
class="fixed inset-0 z-50 flex cursor-zoom-out items-center justify-center bg-black/80"
340
340
+
onclick={() => setExpanded(false)}
341
341
+
>
342
342
+
<img
343
343
+
class="max-h-screen max-w-screen object-contain"
344
344
+
src={imageUrl()}
345
345
+
/>
346
346
+
</div>
347
347
+
</Portal>
348
348
+
</Show>
325
349
</Show>
326
350
</Show>
327
351
<Show when={blob.mimeType === "video/mp4"}>