Changeset a64d705 in Klonkt for src/views/partials/post-card.ejs


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/views/partials/post-card.ejs

    r201ec06 ra64d705  
    138138    margin-right: calc(-1 * clamp(1.25rem, 4vw, 2rem));
    139139    width: calc(100% + 2 * clamp(1.25rem, 4vw, 2rem)) !important;
    140     background: var(--paper-2);
     140    /* Accent-gradient placeholder shown while the cover loads (the image fades in over it). */
     141    background-image: linear-gradient(135deg,
     142        color-mix(in srgb, var(--accent, #888) 22%, var(--paper-2)) 0%,
     143        color-mix(in srgb, var(--accent, #888) 6%, var(--paper-2)) 100%);
    141144  }
    142145  .post-list-cover img {
     
    144147    object-fit: cover;
    145148    display: block;
    146   }
     149    transition: opacity .4s ease;
     150  }
     151  .post-list-cover img.is-loading { opacity: 0; }
    147152
    148153  /* Re-apply rounded corners on slightly larger phones */
Note: See TracChangeset for help on using the changeset viewer.