Add video picker and Discord video attachments.
CI / test (pull_request) Successful in 6m29s

The picker accepts one MP4 or WebM, the thread lightbox zooms photos, and Discord gets the video as a file on a follow-up message so photo embeds still render.
This commit is contained in:
2026-08-31 02:00:56 -07:00
parent 84dea8ea5d
commit f96df3222d
22 changed files with 1018 additions and 144 deletions
+123
View File
@@ -854,6 +854,55 @@ input:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .vote-btn:
font-size: 0.72rem;
}
.video-picker-slot:not(:empty) {
margin-bottom: 10px;
}
.video-preview {
min-width: 0;
display: grid;
grid-template-rows: auto 1fr;
border: 1px solid var(--line);
border-radius: 3px;
overflow: hidden;
background: #141516;
}
.video-preview[hidden] { display: none; }
.video-preview-media {
position: relative;
background: var(--bg);
}
.video-preview-media video,
.post-video video {
display: block;
width: 100%;
max-height: 20rem;
background: #000;
}
.post-video {
margin: 16px 0 0;
overflow: hidden;
border: 1px solid var(--line);
border-radius: 3px;
background: #141516;
}
.post-video video { max-height: 32rem; }
.post-video figcaption {
padding: 8px 10px;
border-top: 1px solid var(--line);
color: var(--muted);
font-family: var(--mono);
font-size: 0.7rem;
line-height: 1.45;
overflow-wrap: anywhere;
}
.image-preview-list {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
@@ -962,6 +1011,18 @@ input:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .vote-btn:
background: #141516;
}
.post-image-zoom {
display: block;
color: inherit;
text-decoration: none;
cursor: zoom-in;
}
.post-image-zoom:focus-visible {
outline: 2px solid var(--signal);
outline-offset: 2px;
}
.post-image img {
width: 100%;
height: 100%;
@@ -976,6 +1037,68 @@ input:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible, .vote-btn:
object-fit: contain;
}
.image-zoom {
width: min(100vw - 24px, 1100px);
max-width: none;
height: min(100vh - 24px, 100dvh);
max-height: none;
margin: auto;
padding: 12px;
border: 1px solid var(--line);
border-radius: 4px;
background: #101113;
color: var(--ink);
}
.image-zoom::backdrop {
background: rgba(10, 11, 12, 0.88);
}
.image-zoom-bar {
display: flex;
justify-content: flex-end;
margin: 0 0 8px;
}
.image-zoom-close {
min-height: 44px;
padding: 0 12px;
border: 1px solid var(--line);
border-radius: 3px;
background: var(--panel);
color: var(--ink);
font-family: var(--mono);
font-size: 0.72rem;
letter-spacing: 0.06em;
text-transform: uppercase;
cursor: pointer;
}
.image-zoom-close:hover { border-color: var(--zinc); }
.image-zoom-close:focus-visible {
outline: 2px solid var(--signal);
outline-offset: 2px;
}
.image-zoom img {
display: block;
width: 100%;
height: calc(100% - 4.5rem);
max-height: calc(100dvh - 8rem);
object-fit: contain;
background: #000;
}
.image-zoom-caption {
margin: 8px 0 0;
color: var(--muted);
font-family: var(--mono);
font-size: 0.72rem;
line-height: 1.45;
overflow-wrap: anywhere;
}
.post-image figcaption {
padding: 8px 10px;
border-top: 1px solid var(--line);