kitbash Sign in Connect agent
Components

Drifting frames

A slow endless row of small framed pictures, tilted a little each way, that stops when the pointer rests on it.

Part of the style

Pastel Wave Snapshots

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --ink: #010101;
  --ink-soft: #121212;
  --frame: #7c827a;
  --paper: #7d837b;
  --dot: rgba(41, 40, 38, 0.349);
  --scrim: rgba(1, 1, 1, 0.851);
  --shadow-ink: rgba(1, 1, 1, 0.149);
  --link: #280c02;
  --link-deep: #250a01;
  --ribbon-blue: #412014;
  --ribbon-teal: #9b7667;
  --ribbon-cream: #9f7769;
  --ribbon-pink: #835f51;
}
</style>

<section class="drift" aria-label="Recently added">
  <p class="drift__label"><b class="drift__count">142</b> pictures so far, newest first</p>
  <div class="drift__window">
    <ul class="drift__track">
      <li class="drift__item"><img class="drift__photo" src="assets/woman-on-beach.jpg" alt="A woman in white at the shore at night" width="556" height="800"></li>
      <li class="drift__item"><img class="drift__photo" src="assets/seascape.jpg" alt="Blue waves breaking under a stormy sky" width="800" height="631"></li>
      <li class="drift__item"><img class="drift__photo" src="assets/children-berneval.jpg" alt="Children sketched on a beach" width="507" height="800"></li>
      <li class="drift__item"><img class="drift__photo" src="assets/promenade.jpg" alt="A crowd strolling under trees" width="800" height="596"></li>
      <li class="drift__item"><img class="drift__photo" src="assets/in-the-sea.jpg" alt="Figures playing in shallow sea water" width="800" height="603"></li>
      <li class="drift__item"><img class="drift__photo" src="assets/york-harbor.jpg" alt="A misty harbour with two boats" width="800" height="400"></li>
      <li class="drift__item"><img class="drift__photo" src="assets/beach-sainte-adresse.jpg" alt="A pebbly beach with boats" width="800" height="591"></li>
    </ul>
  </div>
</section>

<style>
  .drift {
    padding: var(--section-space) 0;
    text-align: center;
  }
  .drift__label {
    margin: 0 var(--edge) var(--space-l);
    font-size: var(--text-s);
    font-style: italic;
    font-weight: 700;
  }
  .drift__count {
    display: block;
    color: var(--ink);
    font-size: var(--display);
    font-style: normal;
    font-weight: 800;
    line-height: var(--display-leading);
    letter-spacing: var(--display-track);
  }
  .drift__window {
    overflow: hidden;
    padding: var(--space-l) 0;
  }
  .drift__track {
    display: flex;
    width: max-content;
    margin: 0;
    padding: 0;
    list-style: none;
    animation: drift-roll 48s linear infinite;
  }
  .drift__window:hover .drift__track { animation-play-state: paused; }
  .drift__item {
    flex: none;
    margin-right: var(--space-l);
    padding: var(--frame-pad);
    border-radius: var(--radius-frame);
    background: var(--frame);
    box-shadow: var(--shadow);
    rotate: -3deg;
    transition: rotate var(--quick) var(--ease), scale var(--quick) var(--ease);
  }
  .drift__item:nth-child(even) { rotate: 2.5deg; translate: 0 10px; }
  .drift__item:nth-child(3n) { rotate: -1deg; }
  .drift__item:hover { rotate: 0deg; scale: 1.06; }
  .drift__photo {
    width: clamp(120px, 16vw, 190px);
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    border-radius: var(--radius-photo);
  }
  @keyframes drift-roll { to { transform: translateX(-50%); } }
  @media (prefers-reduced-motion: reduce) {
    .drift__track { animation: none; }
  }
</style>

<script>
(() => {
  for (const track of document.querySelectorAll('.drift__track')) {
    for (const item of [...track.children]) {
      const copy = item.cloneNode(true);
      copy.setAttribute('aria-hidden', 'true');
      track.append(copy);
    }
  }
})();
</script>

Similar components

Emblem shelf ticker

Emblem shelf ticker

Pill arch

Pill arch

Blackletter news ticker

Blackletter news ticker

Reed ribbon

Reed ribbon

Red word band

Red word band

Wave ribbon

Wave ribbon

Curved word band

Curved word band

Tilted word ticker

Tilted word ticker