kitbash Sign in Connect agent
Components

Latest work rail

An inky script title with an All Work link, then a sliding rail of 8px-rounded photographs with captions and round arrow buttons; corners soften on hover.

Part of the style

Puffy Wordmark Cream

7 parts that belong together, with their tokens, type and rules.

Preview

Code
<section class="latest" aria-labelledby="latest-title">
  <svg class="latest__defs" width="0" height="0" aria-hidden="true" focusable="false">
    <filter id="latest-ink" x="-5%" y="-15%" width="110%" height="130%">
      <feMorphology in="SourceAlpha" operator="dilate" radius="2" result="fat"/>
      <feGaussianBlur in="fat" stdDeviation="3" result="soft"/>
      <feSpecularLighting class="latest__shine" in="soft" surfaceScale="5" specularConstant="0.8" specularExponent="30" result="light">
        <feDistantLight azimuth="235" elevation="25"/>
      </feSpecularLighting>
      <feComposite in="light" in2="fat" operator="in" result="gloss"/>
      <feTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="1" seed="4" result="noise"/>
      <feColorMatrix in="noise" type="matrix" values="0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  14 0 0 0 -10.2" result="specks"/>
      <feComposite in="specks" in2="fat" operator="in" result="grit"/>
      <feFlood class="latest__body" result="tone"/>
      <feComposite in="tone" in2="fat" operator="in" result="blob"/>
      <feMerge>
        <feMergeNode in="blob"/>
        <feMergeNode in="gloss"/>
        <feMergeNode in="grit"/>
      </feMerge>
    </filter>
  </svg>

  <div class="latest__head">
    <h2 class="latest__title" id="latest-title">The Freshest</h2>
    <a class="latest__all" href="#">All Work
      <svg viewBox="0 0 24 24" width="28" height="28" aria-hidden="true"><path d="M3 12h17M13 5l7 7-7 7"/></svg>
    </a>
  </div>

  <div class="latest__frame">
    <ul class="latest__rail">
      <li class="latest__card">
        <a class="latest__link" href="#">
          <span class="latest__pic"><img src="assets/citrus-slices.jpg" alt="Slices of orange, lemon and grapefruit laid edge to edge" width="1000" height="667" loading="lazy"></span>
          <span class="latest__name">Peel &amp; Co. Sodas</span>
          <span class="latest__line">Six citrus flavours, one loud fridge.</span>
        </a>
      </li>
      <li class="latest__card">
        <a class="latest__link" href="#">
          <span class="latest__pic"><img src="assets/habaneros.jpg" alt="Jars and a basket heaped with orange chilli peppers" width="1000" height="752" loading="lazy"></span>
          <span class="latest__name">Ember Jar</span>
          <span class="latest__line">Pickled heat, packed by hand.</span>
        </a>
      </li>
      <li class="latest__card">
        <a class="latest__link" href="#">
          <span class="latest__pic"><img src="assets/lemon-blue.jpg" alt="A single lemon on a bright blue ground" width="1000" height="667" loading="lazy"></span>
          <span class="latest__name">Sour Hour</span>
          <span class="latest__line">A bar identity that puckers back.</span>
        </a>
      </li>
      <li class="latest__card">
        <a class="latest__link" href="#">
          <span class="latest__pic"><img src="assets/jam-jars.jpg" alt="Rows of filled jam jars with lids" width="563" height="1000" loading="lazy"></span>
          <span class="latest__name">Larder Club</span>
          <span class="latest__line">Jam subscriptions with a postcard habit.</span>
        </a>
      </li>
    </ul>
    <button class="latest__step latest__step--back" type="button" aria-label="Previous">
      <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path d="M21 12H4M11 5l-7 7 7 7"/></svg>
    </button>
    <button class="latest__step latest__step--next" type="button" aria-label="Next">
      <svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true"><path d="M3 12h17M13 5l7 7-7 7"/></svg>
    </button>
  </div>
</section>

<style>
  .latest {
    padding: var(--space-xl) 0 var(--section-space);
  }
  .latest__defs { position: absolute; }
  .latest__shine { lighting-color: var(--cream); }
  .latest__body { flood-color: var(--ink); }

  .latest__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-m);
    padding: 0 var(--edge) var(--space-s);
  }
  .latest__title {
    margin: 0;
    color: var(--ink);
    font: 400 var(--script-size)/0.9 var(--font-script);
    letter-spacing: -0.01em;
    filter: url(#latest-ink);
    opacity: 0;
    translate: 0 16px;
    transition: opacity var(--medium) var(--ease-out), translate var(--medium) var(--ease-out);
  }
  .latest.is-seen .latest__title { opacity: 1; translate: 0 0; }
  .latest__all {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: var(--space-xs);
    min-height: 44px;
    color: inherit;
    font-size: var(--text-l);
    letter-spacing: var(--track-tight);
    text-decoration: none;
  }
  .latest__all svg path,
  .latest__step path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .latest__all svg { transition: translate var(--quick) var(--ease); }
  .latest__all:hover svg { translate: 6px 0; }

  .latest__frame { position: relative; }
  .latest__rail {
    display: flex;
    gap: var(--gap);
    margin: 0;
    padding: 0 var(--space-s);
    overflow-x: auto;
    list-style: none;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 var(--space-s);
    scroll-behavior: smooth;
    scrollbar-width: none;
  }
  .latest__rail::-webkit-scrollbar { display: none; }
  .latest__card {
    flex: 0 0 min(47.5%, 44rem);
    scroll-snap-align: start;
  }
  .latest__link {
    display: grid;
    gap: var(--space-xs);
    color: inherit;
    text-decoration: none;
  }
  .latest__link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: var(--radius); }
  .latest__pic {
    display: block;
    aspect-ratio: 4 / 3;
    margin-bottom: var(--space-xs);
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--veil);
    transition: border-radius var(--medium) var(--ease);
  }
  .latest__link:hover .latest__pic { border-radius: calc(var(--radius) * 4); }
  .latest__pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .latest__name,
  .latest__line { font-size: var(--text-s); line-height: 1.2; }

  .latest__step {
    position: absolute;
    top: calc((min(47.5vw, 44rem) * 0.75) / 2);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    translate: 0 -50%;
    transition: opacity var(--quick) var(--ease);
  }
  .latest__step:disabled { opacity: 0; pointer-events: none; }
  .latest__step--back { left: 0; border-radius: 0 var(--radius-pill) var(--radius-pill) 0; }
  .latest__step--next { right: 0; border-radius: var(--radius-pill) 0 0 var(--radius-pill); }
  .latest__step:focus-visible { outline: 2px solid var(--ink); }

  @media (max-width: 40rem) {
    .latest__head { flex-direction: column; align-items: flex-start; }
    .latest__all { font-size: var(--text-m); }
    .latest__card { flex-basis: 86%; }
    .latest__step { top: calc(86vw * 0.375); }
  }
  @media (prefers-reduced-motion: reduce) {
    .latest__title { opacity: 1; translate: none; transition: none; }
    .latest__rail { scroll-behavior: auto; }
  }
</style>

<script>
(() => {
  const seen = new IntersectionObserver((entries) => {
    for (const entry of entries) {
      if (!entry.isIntersecting) continue;
      entry.target.classList.add('is-seen');
      seen.unobserve(entry.target);
    }
  }, { threshold: 0.15 });
  for (const root of document.querySelectorAll('.latest')) {
    seen.observe(root);
    const rail = root.querySelector('.latest__rail');
    const back = root.querySelector('.latest__step--back');
    const next = root.querySelector('.latest__step--next');
    const step = () => (rail.querySelector('.latest__card')?.getBoundingClientRect().width || 300) + 12;
    const update = () => {
      back.disabled = rail.scrollLeft < 4;
      next.disabled = rail.scrollLeft > rail.scrollWidth - rail.clientWidth - 4;
    };
    back.addEventListener('click', () => rail.scrollBy({ left: -step() }));
    next.addEventListener('click', () => rail.scrollBy({ left: step() }));
    rail.addEventListener('scroll', update, { passive: true });
    window.addEventListener('resize', update);
    update();
  }
})();
</script>

Similar components

Loose project grid

Loose project grid

City chips picture

City chips picture

Bracketed Exhibits

Bracketed Exhibits

Line-screen archive

Line-screen archive

Project index

Project index

Night viewer

Night viewer

Featured tile rail

Featured tile rail

Spread

Spread