Changeset a64d705 in Klonkt for src/assets/css/style.css


Ignore:
Timestamp:
06/28/2026 05:25:46 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
600fbf3
Parents:
201ec06
Message:

feat(images): accent-gradient placeholder while covers load + fade-in

Cover tiles/cards now show an accent-coloured gradient placeholder while the image loads
(instead of a white flash), and the cover fades in once loaded. Cached images stay instant.
Makes image-heavy pages feel responsive even before thumbnails finish.

  • assets/css/style.css — grid-tile gradient placeholder; grid-tile-img white moved to img + fade
  • views/partials/post-card.ejs — post-list-cover gradient placeholder + img fade
  • views/shell.ejs — cover fade-in script (hide-while-loading, instant for cached); buster v=61
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/assets/css/style.css

    r201ec06 ra64d705  
    23772377}
    23782378
    2379 /* Transparent covers (PNG logos etc.) sit on white everywhere so they don't blend
    2380    into a dark theme. Opaque covers fully cover the white — no visible change. */
     2379/* Transparent covers (PNG logos etc.) sit on white so they don't blend into a dark
     2380   theme. The white is on the IMG, so the tile's accent-gradient placeholder shows
     2381   while the image is still loading. */
    23812382.post-cover img,
    23822383.post-list-cover img,
    2383 .grid-tile:not(.grid-tile-gradient) { background-color: #fff; }
     2384.grid-tile-img { background-color: #fff; }
     2385/* Accent-gradient placeholder shown while the cover image loads (the image fades in
     2386   over it), instead of a white flash on cover tiles. */
     2387.grid-tile:not(.grid-tile-gradient) {
     2388    background-image: linear-gradient(135deg,
     2389        color-mix(in srgb, var(--accent, #888) 22%, var(--paper-2, var(--paper))) 0%,
     2390        color-mix(in srgb, var(--accent, #888) 6%, var(--paper-2, var(--paper))) 100%);
     2391}
    23842392/* Cover as a real <img> (not background-image): browsers downsample <img> with the
    2385    high-quality image pipeline, so high-res line-art covers don't go jagged when shrunk. */
    2386 .grid-tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; filter: blur(.4px); }
     2393   high-quality image pipeline, so high-res line-art covers don't go jagged when shrunk.
     2394   Fades in on load (.is-loading removed) so the placeholder shows meanwhile. */
     2395.grid-tile-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; filter: blur(.4px); transition: opacity .4s ease; }
     2396.grid-tile-img.is-loading { opacity: 0; }
    23872397.grid-tile:hover { transform: scale(0.98); }
    23882398.grid-tile-overlay {
Note: See TracChangeset for help on using the changeset viewer.