Changeset 600fbf3 in Klonkt for src/views/pages/news.ejs


Ignore:
Timestamp:
06/28/2026 05:29:51 PM (2 months ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
3038fc9
Parents:
a64d705
Message:

feat(images): accent-gradient placeholder also for timeline feed media

The News-feed media images now show the same accent-gradient placeholder while loading
(with reserved space via :has(), so no blank gap), and fade in once loaded.

  • views/pages/news.ejs — .tl-media-img gradient placeholder + img fade + :has min-height
  • views/shell.ejs — add .tl-media-img img to the cover fade-in scan
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/views/pages/news.ejs

    ra64d705 r600fbf3  
    185185  /* Always show the FULL image at its natural ratio — never cropped, no letterbox. */
    186186  .tl-media { display: flex; flex-direction: column; gap: .4rem; margin: .75rem 0 0; }
    187   .tl-media-img { display: block; border-radius: 12px; overflow: hidden; background: #fff; }
    188   .tl-media-img img { width: 100%; height: auto; display: block; }
     187  .tl-media-img { display: block; border-radius: 12px; overflow: hidden;
     188    background-image: linear-gradient(135deg,
     189      color-mix(in srgb, var(--accent, #888) 22%, var(--paper-2, var(--paper))) 0%,
     190      color-mix(in srgb, var(--accent, #888) 6%, var(--paper-2, var(--paper))) 100%); }
     191  .tl-media-img img { width: 100%; height: auto; display: block; background: #fff; transition: opacity .4s ease; }
     192  .tl-media-img img.is-loading { opacity: 0; }
     193  /* Reserve placeholder space while the (natural-aspect) feed image loads. */
     194  .tl-media-img:has(img.is-loading) { min-height: 220px; }
    189195
    190196  .tl-media-video, .tl-media-audio { width: 100%; margin: .75rem 0 0; border-radius: 12px; display: block; }
Note: See TracChangeset for help on using the changeset viewer.