Krea inline thumbnails with cached WebP generation and gallery layout

- Add /api/skills/{slug}/output/{filename}/thumb endpoint with ImageSharp
- Generate 300px WebP thumbnails, cached in data/cache/skills/{slug}/
- Replace text badge with inline thumbnail preview in chat
- Click opens full-size image modal with backdrop blur
- wrapKreaGalleries() groups consecutive krea-refs into flex container
- Thumbnails lazy-loaded, cache invalidated when original is newer
This commit is contained in:
Meleki committed 2026-03-01 20:12:14 +01:00
1 parent 9e4ed6dada
commit 8d86406037
3 files changed
+174 -33

No files matched your search

+23 -16
View File
@@ -605,32 +605,39 @@
/* Krea Image Refs in Assistant Bubbles */
.krea-ref-chip {
display: inline-flex;
align-items: center;
gap: .3em;
padding: .15em .5em;
background: var(--f2-bg);
.krea-gallery {
display: flex;
flex-wrap: wrap;
gap: var(--badge-spacing);
margin: var(--box-spacing) 0;
}
.krea-ref {
display: inline-block;
cursor: pointer;
border: var(--border-width) solid var(--f2-border);
border-radius: var(--border-radius);
font-size: var(--font-size);
white-space: nowrap;
vertical-align: baseline;
cursor: pointer;
transition: background var(--transition-duration), border-color var(--transition-duration);
overflow: hidden;
vertical-align: middle;
}
.krea-ref-chip:hover {
border-color: var(--f3-border);
background: var(--f3-bg);
.krea-ref:hover {
border-color: var(--primary);
}
.krea-ref-chip .fa {
color: var(--primary);
.krea-thumb {
display: block;
max-width: 300px;
max-height: 200px;
object-fit: contain;
}
/* Krea Image Modal */
.krea-overlay {
backdrop-filter: blur(4px);
}
.krea-modal {
max-width: 90vw;
max-height: 90vh;