Redesign the image section of the slide form
Show a dropzone (with drag and drop) while a slide has no image and a row with preview, replace and remove buttons otherwise. A newly chosen file is previewed right away. Placement is picked from tiles with a small sketch instead of long radio labels, technical details move into a collapsible help. The section gets full-width dividers, and the modal a slim scrollbar. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0ad29aa484
commit
c6a92e347f
5 files changed
+257
-92
No files matched your search
@@ -816,6 +816,8 @@ body.present {
|
||||
.modal::backdrop { background: rgba(10, 12, 30, .55); }
|
||||
.modal__panel {
|
||||
max-height: calc(100dvh - 24px); overflow: auto;
|
||||
/* slim scrollbar in the theme colours instead of the bright system one */
|
||||
scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--muted) 55%, transparent) transparent;
|
||||
border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
|
||||
box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
|
||||
}
|
||||
@@ -836,12 +838,54 @@ body:has(dialog[open]) { overflow: hidden; }
|
||||
/* slide images: participant page and slide form */
|
||||
.slide-image { margin: 1em 0; }
|
||||
.slide-image img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; }
|
||||
.image-fields, .image-fields__layout { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
|
||||
/* Full width dividers: reach through the 24px padding of .card. */
|
||||
.image-section { margin: 24px -24px; padding: 16px 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
|
||||
.image-fields, .image-layout { border: 0; padding: 0; margin: 0; min-width: 0; }
|
||||
.image-fields > legend { font-weight: 600; padding: 0; margin-bottom: .5em; }
|
||||
.image-fields__layout > legend { padding: 0; margin-bottom: .25em; }
|
||||
.image-fields__current { margin: 0 0 .75em; }
|
||||
.image-fields__optional { font-weight: 400; color: var(--muted); }
|
||||
.image-layout { margin-top: 16px; }
|
||||
.image-layout > legend { font-weight: 600; padding: 0; margin-bottom: .5em; }
|
||||
.image-layout .hint { margin-bottom: 0; }
|
||||
|
||||
/* dropzone (no image yet) */
|
||||
.image-drop {
|
||||
display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
|
||||
padding: 20px 16px; border: 2px dashed var(--border); border-radius: 10px;
|
||||
color: var(--muted); cursor: pointer;
|
||||
}
|
||||
.image-drop[hidden] { display: none; }
|
||||
.image-drop:hover, .image-drop.is-dragover, .image-fields:has(input[type="file"]:focus-visible) .image-drop {
|
||||
border-color: var(--primary); background: var(--primary-soft); color: var(--text);
|
||||
}
|
||||
.image-fields:has(input[type="file"]:focus-visible) .image-drop { outline: 3px solid var(--primary); outline-offset: 2px; }
|
||||
.image-drop__title { font-weight: 600; color: var(--text); }
|
||||
.image-drop__hint { font-size: .875rem; }
|
||||
|
||||
/* current or chosen image: thumbnail, info, buttons */
|
||||
.image-fields__row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; }
|
||||
.image-fields__row[hidden] { display: none; }
|
||||
.image-fields__row.is-dragover { border-color: var(--primary); background: var(--primary-soft); }
|
||||
.image-fields__current { margin: 0; flex: none; }
|
||||
.image-fields__current img { display: block; max-width: 160px; max-height: 110px; width: auto; height: auto; border-radius: 6px; background: var(--surface-2); }
|
||||
.image-fields__current.is-removed img { opacity: .3; filter: grayscale(1); }
|
||||
.image-fields__remove { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0 0 1em; }
|
||||
.image-fields__remove .button { display: inline-flex; align-items: center; gap: 6px; }
|
||||
.image-fields__remove .hint { margin: 0; }
|
||||
.image-fields__current img { display: block; max-width: 100%; max-height: 180px; width: auto; height: auto; border-radius: 6px; }
|
||||
.image-fields__side { flex: 1 1 200px; min-width: 0; }
|
||||
.image-fields__info { margin: 0 0 8px; font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
|
||||
.image-fields__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.image-fields__buttons .button { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
|
||||
.image-fields:has(input[type="file"]:focus-visible) .image-fields__buttons [data-image-pick] { outline: 3px solid var(--primary); outline-offset: 2px; }
|
||||
.image-fields__remove { margin: 0; }
|
||||
.image-fields__help { margin-top: 8px; font-size: .875rem; color: var(--muted); }
|
||||
.image-fields__help summary { cursor: pointer; width: fit-content; }
|
||||
.image-fields__help .hint { margin: .5em 0 0; }
|
||||
|
||||
/* placement tiles (radios) */
|
||||
.image-layout__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; max-width: 420px; }
|
||||
.image-layout__tile {
|
||||
display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 8px;
|
||||
border: 2px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--muted); font-size: .9rem;
|
||||
}
|
||||
.image-layout__tile svg { max-width: 100%; height: auto; }
|
||||
.image-layout__tile svg .img { fill: var(--primary); opacity: .45; }
|
||||
.image-layout__tile:hover { border-color: var(--primary); }
|
||||
.image-layout__tile:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--text); font-weight: 600; }
|
||||
.image-layout__tile:has(input:focus-visible) { outline: 3px solid var(--primary); outline-offset: 2px; }
|
||||
Reference in new issue
Block a user