kitbash Sign in Connect agent
Components

Column issue

Cocoa column feature: pink script masthead, issue number and date, a dimmed picture with the title over it, and arrows to step through issues.

Part of the style

Blush Script Parlour

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --blush: #9d9485;
  --cocoa: #07150a;
  --cocoa-veil: rgba(8, 22, 11, 0.5);
  --cocoa-line: rgba(7, 21, 10, 0.35);
  --blush-line: rgba(157, 148, 133, 0.4);
  --blush-soft: rgba(157, 148, 133, 0.72);
  --night: #000701;
  --pink: #2d9148;
}
</style>

<section class="journal">
  <header class="journal__head">
    <p class="journal__kicker">A column on rooms and their smells</p>
    <h2 class="journal__masthead">Letters</h2>
  </header>
  <div class="journal__stage">
    <article class="journal__issue is-active">
      <p class="journal__meta"><span>N.012</span><span>14 · Nov · 26</span></p>
      <a class="journal__card" href="#">
        <img class="journal__photo" src="assets/bedroom.jpg" alt="A dark panelled bedchamber with a canopied bed and a brass chandelier" width="843" height="639" />
        <span class="journal__title">The guest room problem</span>
        <span class="journal__read">Read the letter</span>
      </a>
    </article>
    <article class="journal__issue" hidden>
      <p class="journal__meta"><span>N.011</span><span>31 · Oct · 26</span></p>
      <a class="journal__card" href="#">
        <img class="journal__photo" src="assets/roses.jpg" alt="A painting of pale and pink roses in a dark bowl" width="800" height="667" />
        <span class="journal__title">Cut flowers lie about the season</span>
        <span class="journal__read">Read the letter</span>
      </a>
    </article>
    <article class="journal__issue" hidden>
      <p class="journal__meta"><span>N.010</span><span>17 · Oct · 26</span></p>
      <a class="journal__card" href="#">
        <img class="journal__photo" src="assets/sitting-room.jpg" alt="A blue sitting room with red curtains and two tall windows" width="800" height="559" />
        <span class="journal__title">Why curtains keep a memory</span>
        <span class="journal__read">Read the letter</span>
      </a>
    </article>
  </div>
  <div class="journal__foot">
    <a class="journal__all" href="#">All letters</a>
    <span class="journal__count" aria-live="polite">1 / 3</span>
    <div class="journal__steps">
      <button class="journal__step" type="button" data-step="-1" aria-label="Newer letter">←</button>
      <button class="journal__step" type="button" data-step="1" aria-label="Older letter">→</button>
    </div>
  </div>
</section>

<style>
  .journal {
    overflow: hidden;
    padding: 0 var(--edge) var(--space-xl);
    background: var(--cocoa);
    color: var(--blush);
  }
  .journal__head {
    position: relative;
    text-align: center;
  }
  .journal__kicker {
    position: relative;
    z-index: 1;
    margin: 0;
    padding-top: var(--space-l);
    font-family: var(--font-serif);
    font-size: var(--text-l);
    letter-spacing: var(--tracking-serif);
    text-transform: uppercase;
  }
  .journal__masthead {
    margin: clamp(-1.5rem, -2vw, -0.5rem) 0 clamp(-3rem, -4vw, -1rem);
    color: var(--pink);
    font-family: var(--font-script);
    font-size: clamp(6rem, 19vw, 18rem);
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
  }
  .journal__stage {
    position: relative;
  }
  .journal__issue.is-active {
    animation: journal-in var(--slow) var(--ease);
  }
  .journal__meta {
    display: flex;
    gap: var(--space-l);
    margin: 0 0 var(--space-s);
    font-size: var(--text-xs);
    text-transform: uppercase;
  }
  .journal__card {
    position: relative;
    display: grid;
    align-content: end;
    min-height: clamp(18rem, 34vw, 30rem);
    padding: var(--space-l) clamp(var(--space-m), 6vw, 6rem);
    overflow: hidden;
    background: var(--night);
    color: var(--blush);
    text-decoration: none;
  }
  .journal__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
    transition: opacity var(--slow) var(--ease), scale var(--slow) var(--ease);
  }
  .journal__card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--cocoa-veil);
    mix-blend-mode: multiply;
  }
  .journal__card:hover .journal__photo,
  .journal__card:focus-visible .journal__photo {
    opacity: 0.75;
    scale: 1.03;
  }
  .journal__card:focus-visible {
    outline: var(--rule) solid var(--pink);
    outline-offset: 4px;
  }
  .journal__title,
  .journal__read {
    position: relative;
    z-index: 1;
  }
  .journal__title {
    font-family: var(--font-serif);
    font-size: var(--serif-l);
    letter-spacing: var(--tracking-serif);
    line-height: 1;
    text-transform: uppercase;
    text-wrap: balance;
  }
  .journal__read {
    margin-top: var(--space-s);
    color: var(--blush-soft);
    font-size: var(--text-m);
  }
  .journal__foot {
    display: flex;
    align-items: center;
    gap: var(--space-m);
    margin-top: var(--space-l);
    border-top: var(--rule) solid var(--blush-line);
  }
  .journal__all {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    margin-right: auto;
    color: inherit;
    font-size: var(--text-m);
    text-decoration: none;
  }
  .journal__all:hover { color: var(--pink); }
  .journal__count {
    color: var(--blush-soft);
    font-size: var(--text-xs);
  }
  .journal__steps {
    display: flex;
  }
  .journal__step {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: var(--blush);
    font: inherit;
    cursor: pointer;
  }
  .journal__step:hover,
  .journal__step:focus-visible {
    background: var(--blush);
    color: var(--cocoa);
    outline: none;
  }
  .journal__step {
    transition: background-color var(--quick) var(--ease), color var(--quick) var(--ease);
  }
  @keyframes journal-in {
    from { opacity: 0; translate: 24px 0; }
  }
</style>

<script>
  (() => {
    for (const root of document.querySelectorAll('.journal')) {
      const issues = [...root.querySelectorAll('.journal__issue')];
      const count = root.querySelector('.journal__count');
      let at = 0;
      const show = (next) => {
        at = (next + issues.length) % issues.length;
        issues.forEach((issue, index) => {
          const on = index === at;
          issue.hidden = !on;
          issue.classList.toggle('is-active', on);
        });
        count.textContent = `${at + 1} / ${issues.length}`;
      };
      for (const button of root.querySelectorAll('.journal__step')) {
        button.addEventListener('click', () => show(at + Number(button.dataset.step)));
      }
    }
  })();
</script>

Similar components

Focus rows

Focus rows

Serif project index

Serif project index

Agenda

Agenda

Contents with buttons

Contents with buttons

Transcript

Transcript

Grid and list index

Grid and list index

Ledger

Ledger

Step rail

Step rail