kitbash Sign in Connect agent
Components

Send a note

One field and a pill button; sending shows a bubble with typing dots that resolves into a reply.

Part of the style

Pixel Redaction Notes

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

Preview

Code
<style>
/* Goes after the pack's base.css */
:root {
  --paper: #3e1016;
  --paper-depth: #390b12;
  --well: #53272a;
  --line: #53272a;
  --marker: #64393c;
  --ink: #fffffe;
  --ink-soft: #f5e9dd;
  --ink-faint: #987374;
  --dot: rgba(255, 255, 254, 0.5);
}
</style>

<section class="note-form">
  <div class="note-form__inner">
    <h2 class="note-form__label">Write</h2>
    <p class="note-form__text">Leave a line and where to find you. I read every one on Sunday mornings.</p>
    <form class="note-form__form" action="#" novalidate>
      <label class="note-form__field">
        <span class="note-form__name">Your note</span>
        <input class="note-form__input" type="text" name="note" placeholder="Hello, I liked the desk…" autocomplete="off" required>
      </label>
      <label class="note-form__field">
        <span class="note-form__name">Email</span>
        <input class="note-form__input" type="email" name="email" placeholder="you@example.org" autocomplete="email" required>
      </label>
      <button class="note-form__send" type="submit">Send note</button>
    </form>
    <div class="note-form__reply" aria-live="polite">
      <span class="note-form__dots" aria-hidden="true"><span class="note-form__dot"></span><span class="note-form__dot"></span><span class="note-form__dot"></span></span>
      <span class="note-form__said">Got it. Expect a reply within the week.</span>
      <span class="note-form__missing">Both lines, please. Then try again.</span>
    </div>
  </div>
</section>

<style>
  .note-form {
    padding: var(--section-space) var(--edge);
  }
  .note-form__inner {
    max-width: var(--measure);
    margin: 0 auto;
  }
  .note-form__label {
    margin: 0 0 var(--space-s);
    color: var(--ink);
    font-size: var(--text-m);
    font-weight: 500;
    line-height: var(--leading-label);
  }
  .note-form__text {
    margin: 0 0 var(--space-l);
    color: var(--ink-soft);
    line-height: var(--leading-read);
  }
  .note-form__form {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: var(--space-m) var(--gap);
  }
  .note-form__field {
    display: grid;
    gap: var(--space-xs);
    min-width: 0;
  }
  .note-form__name {
    color: var(--ink-faint);
    font-size: var(--text-s);
    line-height: var(--leading-small);
  }
  .note-form__input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: var(--rule) solid var(--line);
    border-radius: var(--radius-s);
    background: var(--paper-depth);
    color: var(--ink);
    font: 400 var(--text-m)/var(--leading-label) var(--font-body);
    transition: border-color var(--quick) var(--ease);
  }
  .note-form__input::placeholder {
    color: var(--ink-faint);
  }
  .note-form__input:hover {
    border-color: var(--marker);
  }
  .note-form__input:focus-visible {
    outline: none;
    border-color: var(--ink);
  }
  .note-form__send {
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--paper);
    font: 500 var(--text-s)/var(--leading-small) var(--font-body);
    cursor: pointer;
    transition: background-color var(--quick) var(--ease), scale var(--pop) var(--ease-bounce);
  }
  .note-form__send:hover {
    background: var(--ink-soft);
  }
  .note-form__send:active {
    scale: 0.96;
  }
  .note-form__send:focus-visible {
    outline: var(--rule) solid var(--ink);
    outline-offset: 2px;
  }

  .note-form__reply {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    margin-top: var(--space-m);
    padding: var(--space-xs) 12px;
    background: var(--well);
    border-radius: var(--radius-l);
    color: var(--ink);
    line-height: var(--leading-label);
    transform-origin: 12px 0;
    visibility: hidden;
    opacity: 0;
    scale: 1.05;
    filter: blur(6px);
    transition: all var(--pop) var(--ease-bounce);
  }
  .note-form.is-sending .note-form__reply,
  .note-form.is-sent .note-form__reply,
  .note-form.is-missing .note-form__reply {
    visibility: visible;
    opacity: 1;
    scale: 1;
    filter: blur(0);
  }
  .note-form__dots {
    display: inline-flex;
    gap: var(--space-xs);
  }
  .note-form__dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--dot);
    animation: note-form-pulse var(--pulse) cubic-bezier(0.4, 0, 0.6, 1) infinite;
  }
  .note-form__dot:nth-child(2) { animation-delay: 300ms; }
  .note-form__dot:nth-child(3) { animation-delay: 600ms; }
  .note-form__said,
  .note-form__missing {
    display: none;
    animation: note-form-reveal var(--reveal) linear both;
  }
  .note-form.is-sent .note-form__dots,
  .note-form.is-missing .note-form__dots {
    display: none;
  }
  .note-form.is-sent .note-form__said,
  .note-form.is-missing .note-form__missing {
    display: block;
  }
  @keyframes note-form-pulse {
    50% { opacity: 0.35; }
  }
  @keyframes note-form-reveal {
    from { clip-path: inset(0 100% 0 0); opacity: 0.4; }
    to { clip-path: inset(0 0 0 0); opacity: 1; }
  }

  @media (max-width: 40rem) {
    .note-form__form {
      grid-template-columns: minmax(0, 1fr);
    }
    .note-form__send {
      justify-self: start;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .note-form__reply { transition: none; filter: none; }
    .note-form__dot, .note-form__said, .note-form__missing { animation: none; }
  }
</style>

<script>
(() => {
  const THINK = 1200;
  for (const root of document.querySelectorAll('.note-form')) {
    const form = root.querySelector('.note-form__form');
    let timer = 0;
    form.addEventListener('submit', (event) => {
      event.preventDefault();
      clearTimeout(timer);
      root.classList.remove('is-sent', 'is-missing', 'is-sending');
      if (!form.checkValidity()) {
        root.classList.add('is-missing');
        return;
      }
      root.classList.add('is-sending');
      timer = setTimeout(() => {
        root.classList.replace('is-sending', 'is-sent');
        form.reset();
      }, THINK);
    });
    form.addEventListener('input', () => root.classList.remove('is-missing'));
  }
})();
</script>

Similar components

Sign-up

Sign-up

Postcard with signature pad

Postcard with signature pad

Enquiry sheet

Enquiry sheet

Green bar enquiry

Green bar enquiry

Live pass offer

Live pass offer

Reopening sign-up

Reopening sign-up

Start a page

Start a page

Jelly button sign-up

Jelly button sign-up