Skip to content
Star

Meeting card

The next meeting from countdown to wrap-up, with the time already gone hatched out and a join that stays open. Free and MIT licensed, as HTML, a typed React component or an Astro component, in three styles with light and dark mode.

$npx designme add meeting-card
$npx shadcn@latest add https://designme.dev/r/shadcn/meeting-card.json

Need this designed into your product? Book a call

Pricing reviewToday, 10:30 to 11:15 In 10 min
MKJOARSL+2+4
01

Install

Add it to your project with the CLI.

HTML, CSS and JS

$npx designme add meeting-card

React

$npx designme add meeting-card --react

Astro

$npx designme add meeting-card --astro

shadcn, React

$npx shadcn@latest add https://designme.dev/r/shadcn/meeting-card.json

shadcn, Astro

$npx shadcn@latest add https://designme.dev/r/shadcn/astro/meeting-card.json

The CLI copies the source into your project, so you own it and can change anything. Where each version lands, what it needs and the shadcn theme bridge: Installation.

02

About

What it is for and what it does.

Meeting card follows one meeting from countdown to wrap-up. A status chip counts down the minutes, says when it is starting, then how many minutes are left, and finally that it has ended. A track shows the meeting on the morning, with the time already gone hatched out, and Join stays open while the meeting runs so people can still join late. It suits an assistant that keeps people on time for their calls.

  • When a home screen or sidebar should show the next call and how long until it starts
  • When people need to see at a glance how far a meeting has got, so they know whether joining late is worth it
  • When an assistant reminds a person about a meeting and offers the link in one place
  • When one upcoming meeting is all that matters and a calendar view is too much
03

Usage

Import it in React and drive it from your own state, or place it in an Astro page.

React

import { MeetingCard } from '@/components/designme/meeting-card/MeetingCard';

React example

The demo above as a React component, 37 lines you can copy.

'use client';
// The animated preview from designme.dev, rebuilt from the React component: an example of driving it from your own state.
import { useRef, useState } from 'react';
import { MeetingCard, type MeetingCardPerson } from './MeetingCard';
import { useStory } from '../lib/useScript';

const PEOPLE: MeetingCardPerson[] = [
  { initials: 'MK', color: 'var(--dm-av-l)', name: 'Maya Kim' }, { initials: 'JO', color: 'var(--dm-av-b)', name: 'Jon Ortiz' },
  { initials: 'AR', color: 'var(--dm-av-k)', name: 'Ari Reyes' }, { initials: 'SL', color: 'var(--dm-av-r)', name: 'Sam Lee' },
  { initials: 'DK', color: 'var(--dm-av-b)', name: 'Dev Kapoor' }, { initials: 'LN', color: 'var(--dm-av-l)', name: 'Lena Novak' }
];
const clock = (m: number) => `${Math.floor(m / 60)}:${String(m % 60).padStart(2, '0')}`;

export default function MeetingCardDemo() {
  const [now, setNow] = useState(620);
  // the countdown, "Starting now", the meeting going by with the gone part hatched, then over; the person in the preview
  // copies the link halfway through, and it plays again
  const ref = useRef<HTMLDivElement>(null);
  useStory(ref, async ({ wait, press }) => {
    for (;;) {
      setNow(620); await wait(1000);
      for (let m = 621; m <= 630; m++) { await wait(500); setNow(m); }
      await wait(2000);
      for (let m = 633; m <= 651; m += 3) { await wait(600); setNow(m); }
      await wait(1500); press('.dm-mtx-cp'); await wait(1500);
      for (let m = 654; m <= 675; m += 3) { await wait(600); setNow(m); }
      await wait(4500);
    }
  });
  return (
    <div ref={ref} style={{ width: '100%' }}>
      <MeetingCard title="Pricing review" start="10:30" end="11:15" from="10:15" to="11:30" now={clock(now)} people={PEOPLE}
        link="meet.google.com/nax-wqkf-stu" onJoin={() => {}} />
    </div>
  );
}

Astro

In a page in src/pages. It plays the demo above; change its meeting-card.js to show your own data. Attributes like class go on its root element.

---
import MeetingCard from '../components/designme/meeting-card/MeetingCard.astro';
---
<MeetingCard />
<MeetingCard data-style="soft" class="my-class" />
04

Props

Everything MeetingCard takes.

PropTypeWhat it does
titlerequiredstringLike "Pricing review"
subtitlestringThe line under the title. Defaults to "Today, 10:30 to 11:15" from `start` and `end`
startrequiredstringWhen it starts, 24-hour "HH:MM", like "10:30"
endrequiredstringWhen it ends, like "11:15"
nowrequiredstringThe time now, like "10:20". The status chip, the now line and the hatched past all follow it
fromstringWhere the track starts. Defaults to half an hour before `start`
tostringWhere the track ends. Defaults to half an hour after `end`
peopleMeetingCardPerson[]Who is invited, as an avatar stack with each name in a tooltip
maxnumberHow many avatars show before a "+N". Defaults to 4
statusstringThe status chip's text, in place of the countdown: "In 10 min", "Starting now", "Live, 30 min left", "Ended"
providerstringThe call's service, for names and labels. Defaults to "Google Meet"
markReactNodeThe service's mark on the Join button. Defaults to the Google Meet mark
linkrequiredstringThe call's link, like "meet.google.com/nax-wqkf-stu"
hrefstringWhere joining goes and what is copied. Defaults to the link over https
onJoin() => voidCalled on Join. Left out, the link opens in a new tab
onCopy(url: string) => void
joinLabelstringDefaults to "Join"
copyLabelstringThe copy button's tooltip. Defaults to "Copy" and the link
copiedLabelstringThe tooltip after copying. Defaults to "Copied"
actionsMeetingCardAction[]The menu under the chevron beside Join. Defaults to Send invite, Add to calendar and Copy invitation; [] hides the chevron
onAction(key: string) => voidCalled with the picked action's key. Copy invitation also copies the title, the time and the link
classNamestring
05

Code

The full source, as the CLI installs it.

MeetingCard.tsxReact · 212 lines
'use client';
import { useEffect, useRef, useState, type CSSProperties, type ReactNode, type RefObject } from 'react';
import { Brand } from '../lib/brands';
import { cx } from '../lib/cx';
import { useCopied, useReducedMotion } from '../lib/hooks';
import { Icon, type IconName } from '../lib/icons';
import { usePopover } from '../lib/popover';
import { avatarInk, Swap, Tip } from '../lib/motion';
import '../designme.css';
// its menus' rows glide in Studio
import '../lib/glide';
import './meeting-card.css';

export interface MeetingCardAction {
  key: string;
  label: string;
  icon?: IconName;
  /** What the chevron says once it is done, like "Invite sent". Defaults to the label */
  done?: string;
}

const ACTIONS: MeetingCardAction[] = [
  { key: 'invite', label: 'Send invite', icon: 'mail', done: 'Invite sent' },
  { key: 'calendar', label: 'Add to calendar', icon: 'cal', done: 'Added to calendar' },
  { key: 'copy', label: 'Copy invitation', icon: 'copy', done: 'Invitation copied' }
];

export interface MeetingCardPerson {
  /** Like "MK" */
  initials: string;
  /** The avatar's colour, like 'var(--dm-av-l)' */
  color: string;
  /** Shown in the avatar's tooltip and read by screen readers, like "Maya Kim" */
  name: string;
}

export interface MeetingCardProps {
  /** Like "Pricing review" */
  title: string;
  /** The line under the title. Defaults to "Today, 10:30 to 11:15" from `start` and `end` */
  subtitle?: string;
  /** When it starts, 24-hour "HH:MM", like "10:30" */
  start: string;
  /** When it ends, like "11:15" */
  end: string;
  /** The time now, like "10:20". The status chip, the now line and the hatched past all follow it */
  now: string;
  /** Where the track starts. Defaults to half an hour before `start` */
  from?: string;
  /** Where the track ends. Defaults to half an hour after `end` */
  to?: string;
  /** Who is invited, as an avatar stack with each name in a tooltip */
  people?: MeetingCardPerson[];
  /** How many avatars show before a "+N". Defaults to 4 */
  max?: number;
  /** The status chip's text, in place of the countdown: "In 10 min", "Starting now", "Live, 30 min left", "Ended" */
  status?: string;
  /** The call's service, for names and labels. Defaults to "Google Meet" */
  provider?: string;
  /** The service's mark on the Join button. Defaults to the Google Meet mark */
  mark?: ReactNode;
  /** The call's link, like "meet.google.com/nax-wqkf-stu" */
  link: string;
  /** Where joining goes and what is copied. Defaults to the link over https */
  href?: string;
  /** Called on Join. Left out, the link opens in a new tab */
  onJoin?: () => void;
  onCopy?: (url: string) => void;
  /** Defaults to "Join" */
  joinLabel?: string;
  /** The copy button's tooltip. Defaults to "Copy" and the link */
  copyLabel?: string;
  /** The tooltip after copying. Defaults to "Copied" */
  copiedLabel?: string;
  /** The menu under the chevron beside Join. Defaults to Send invite, Add to calendar and Copy invitation; [] hides the chevron */
  actions?: MeetingCardAction[];
  /** Called with the picked action's key. Copy invitation also copies the title, the time and the link */
  onAction?: (key: string) => void;
  className?: string;
}


/** A button as wide as its words: when they change it eases to its new width, keeping no room for a longer word */
function useEaseWidth(ref: RefObject<HTMLElement | null>) {
  const reduce = useReducedMotion();
  useEffect(() => {
    const el = ref.current; if (!el || reduce || typeof ResizeObserver === 'undefined') return;
    let w = 0, busy: Animation | null = null;
    const ro = new ResizeObserver(() => {
      if (busy) return;
      const w1 = el.getBoundingClientRect().width;
      if (w && Math.abs(w1 - w) > .5) {
        busy = el.animate([{ width: w + 'px' }, { width: w1 + 'px' }], { duration: 340, easing: 'cubic-bezier(.23,1,.32,1)' });
        busy.finished.catch(() => {}).then(() => { busy = null; w = el.getBoundingClientRect().width; });
      }
      w = w1;
    });
    ro.observe(el);
    return () => ro.disconnect();
  }, [ref, reduce]);
}

const mins = (t: string) => { const [h, m] = t.split(':').map(Number); return h * 60 + (m || 0); };
const clock = (m: number) => `${Math.floor(m / 60)}:${String(m % 60).padStart(2, '0')}`;

/** The next meeting, from countdown to wrap-up: a status chip that counts down, says "Starting now", then the minutes left,
    and "Ended"; a track with the meeting on it, the time already gone hatched out; the people invited; and Join, which
    stays open while the meeting runs. */
export function MeetingCard({ title, subtitle, start, end, now, from, to, people = [], max = 4, status, provider = 'Google Meet', mark,
  link, href, onJoin, onCopy, joinLabel = 'Join', copyLabel, copiedLabel = 'Copied', actions = ACTIONS, onAction, className }: MeetingCardProps) {
  const a = mins(start), b = mins(end), t = mins(now);
  const lo = from ? mins(from) : a - 30, hi = to ? mins(to) : b + 30, span = Math.max(1, hi - lo);
  const pc = (m: number) => Math.min(100, Math.max(0, (m - lo) / span * 100));
  const phase = t < a ? 'soon' : t === a ? 'start' : t < b ? 'live' : 'done';
  const n = phase === 'soon' ? a - t : b - t;
  const url = href ?? 'https://' + link.replace(/^https?:\/\//, '');
  const [copied, copy] = useCopied();
  // a new state fades in, and within a state only the minutes roll; nothing moves on the first render
  const ready = useRef(false);
  useEffect(() => { ready.current = true; }, []);
  const roll = <span className="dm-mtx-roll dm-num"><i key={n} className={ready.current ? 'dm-in' : undefined}>{n}</i></span>;
  const chip = status ?? null;
  // Join presses with a small settle and says it is opening for a moment
  const [label, setLabel] = useState(joinLabel), [pressed, setPressed] = useState(false);
  const joinRef = useRef<HTMLButtonElement>(null);
  useEaseWidth(joinRef);
  const timers = useRef<ReturnType<typeof setTimeout>[]>([]);
  useEffect(() => () => timers.current.forEach(clearTimeout), []);
  useEffect(() => setLabel(joinLabel), [joinLabel]);
  const join = () => {
    setPressed(true); setLabel(`Opening ${provider.split(' ').pop()}`);
    timers.current.push(setTimeout(() => setPressed(false), 110), setTimeout(() => setLabel(joinLabel), 1600));
    if (onJoin) onJoin(); else window.open(url, '_blank', 'noopener');
  };
  // the meeting's actions: the chevron flashes a check and its tooltip says what happened
  const menu = usePopover({ align: 'end' });
  const [did, setDid] = useState<string | null>(null);
  const act = (a: MeetingCardAction) => {
    if (a.key === 'copy') { try { navigator.clipboard.writeText(`${title}, ${subtitle ?? `today ${start} to ${end}`}\n${url}`).catch(() => {}); } catch { /* no clipboard */ } }
    onAction?.(a.key); menu.closeSoon();
    timers.current.push(setTimeout(() => setDid(a.done ?? a.label), 140), setTimeout(() => setDid(null), 1640));
  };
  const shown = people.slice(0, max), rest = people.slice(max), narrowRest = people.slice(Math.min(2, shown.length));
  const live = phase === 'start' || phase === 'live';
  const past = { ['--dm-p' as string]: pc(t) + '%' } as CSSProperties;

  return (
    <div data-dm="" className={cx('dm-mtx dm-panel', live && 'dm-live', phase === 'done' && 'dm-done', className)}>
      <div className="dm-mtx-h">
        <b className="dm-mtx-t">{title}</b><span className="dm-mtx-sub dm-num">{subtitle ?? `Today, ${start} to ${end}`}</span>
        <span className={cx('dm-tag dm-mtx-st', live && 'dm-ok')}>
          <span key={chip ?? phase} className={ready.current ? 'dm-mtx-fade' : undefined}>
            {chip ?? (phase === 'soon' ? <><Icon name="clock" size="xs" />In {roll} min</>
              : phase === 'start' ? <><i className="dm-dot" />Starting now</>
              : phase === 'live' ? <><i className="dm-dot" />Live, {roll} min left</> : 'Ended')}
          </span>
        </span>
      </div>
      <div className="dm-mtx-track" style={past} role="img"
        aria-label={phase === 'done' ? `The meeting ran ${start} to ${end} and has ended` : `Now ${clock(t)}. The meeting runs ${start} to ${end}`}>
        <span className="dm-mtx-blk" style={{ left: pc(a) + '%', width: pc(b) - pc(a) + '%', ['--dm-cut' as string]: Math.min(100, Math.max(0, (t - a) / Math.max(1, b - a) * 100)) + '%' }}>
          <span className="dm-mtx-bp" /><span className="dm-num">{start}</span><span className="dm-num">{end}</span>
        </span>
        <span className="dm-mtx-now"><i /></span>
      </div>
      <div className="dm-mtx-f">
        <div className="dm-mtx-who">
          {shown.map((p, i) => (
            <Tip key={p.name} label={p.name}>
              <span className={cx('dm-av', i >= 2 && 'dm-mtx-wide')} role="img" aria-label={p.name} style={{ background: p.color, color: avatarInk(p.color) }}>{p.initials}</span>
            </Tip>
          ))}
          {rest.length > 0 && (
            <Tip label={rest.map(p => p.name).join(', ')}>
              <span className={cx('dm-av dm-mtx-more', narrowRest.length > rest.length && 'dm-mtx-wide')} role="img" aria-label={rest.map(p => p.name).join(', ')}>+{rest.length}</span>
            </Tip>
          )}
          {/* a narrow card (a phone) shows the first two people and counts the rest */}
          {narrowRest.length > rest.length && (
            <Tip label={narrowRest.map(p => p.name).join(', ')}>
              <span className="dm-av dm-mtx-more dm-mtx-narrow" role="img" aria-label={narrowRest.map(p => p.name).join(', ')}>+{narrowRest.length}</span>
            </Tip>
          )}
        </div>
        <span className="dm-sp" />
        <Tip label={copied ? copiedLabel : copyLabel ?? `Copy ${link}`} open={copied || undefined}>
          <button type="button" className={cx('dm-ib dm-mtx-cp', copied && 'dm-copied')} aria-label={`Copy ${provider} link`} onClick={() => { copy(url); onCopy?.(url); }}>
            <Icon name={copied ? 'check' : 'link'} />
          </button>
        </Tip>
        <div className="dm-mtx-jg">
          <button ref={joinRef} type="button" className={cx('dm-pill dm-primary dm-mtx-join', pressed && 'dm-prs')} disabled={phase === 'done'} onClick={join}>
            <span className="dm-mk">{mark ?? <Brand name="meet" />}</span><Swap className="dm-lb">{label}</Swap>
          </button>
          {actions.length > 0 && <>
            <Tip label={did ?? ''} open={did ? true : undefined} off={!did}>
              <button type="button" {...menu.trigger} className={cx('dm-pill dm-primary dm-mtx-jm', did && 'dm-done')} aria-label="More for this meeting" disabled={phase === 'done'}>
                <Icon name={did ? 'check' : 'chev-d'} size="xs" />
              </button>
            </Tip>
            <div {...menu.pop} className={cx(menu.pop.className, 'dm-mtx-pop')} role="menu">
              {actions.map(a => (
                <button key={a.key} type="button" role="menuitem" className="dm-mi" onClick={() => act(a)}>{a.icon && <Icon name={a.icon} />}{a.label}</button>
              ))}
            </div>
          </>}
        </div>
      </div>
    </div>
  );
}
meeting-card.cssReact · 126 lines
/* Generated from designme.dev by scripts/sync.mjs. Edit the site, then sync. */
/* ---------- Meeting card ---------- */
/* the next meeting, told as it goes: a countdown, "Starting now", the meeting in progress and then over. The track is the
   morning from 10:00 to 12:30 with the meeting on it in the accent tint, its start and end on the block itself. Time that
   has gone is hatched out in neutral grey (the hatch and the tint meet at the now line), and the status chip at the top right
   rolls its minutes. Join stays open while the meeting runs, since people join late. Join is the library's primary button
   (28 Nov: the standard .pill.primary, 32px like the copy button beside it, with no breathing of its own; Studio's ink primary).
   Every state is the same height. Its content sits 16px in from every edge, and nothing in it grows or shrinks when it is
   pressed (owner, 18 Nov) */
.dm-mtx{width:100%;max-width:400px;margin:0 auto;padding:var(--dm-s-4);display:flex;flex-direction:column;gap:var(--dm-s-4);container:mtx/inline-size}
.dm-mtx :is(.dm-pill,.dm-ib):active,.dm-mtx .dm-mtx-join.dm-prs{transform:none}
/* the title and the chip share the first line; the time runs under both, so a longer chip never wraps it and every state
   is the same height */
.dm-mtx-h{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:var(--dm-s-3);row-gap:2px}
.dm-mtx-t{font-size:14px;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dm-mtx-sub{grid-row:2;grid-column:1 / -1;font-size:12.5px;color:var(--dm-muted)}
.dm-mtx-st{grid-row:1;grid-column:2;justify-self:end;transition:background .4s cubic-bezier(.22,1,.36,1),color .4s cubic-bezier(.22,1,.36,1)}
.dm-mtx-st>span{display:inline-flex;align-items:center;gap:5px}
.dm-mtx-st .dm-dot{color:var(--dm-ok-mark)}
.dm-mtx-fade{animation:dm-mtxfade .4s cubic-bezier(.22,1,.36,1) both}
@keyframes dm-mtxfade{from{opacity:0}}
/* the minutes roll: each new number comes up from below */
/* the rolling minutes keep the chip's own line, so the number sits on the words' baseline (owner, 17 Nov) */
.dm-mtx-roll{display:inline-grid;overflow:hidden;line-height:inherit;height:1lh}
.dm-mtx-roll i{font-style:normal}
.dm-mtx-roll i.dm-in{animation:dm-mtxroll .32s cubic-bezier(.22,1,.36,1) both}
@keyframes dm-mtxroll{from{transform:translateY(70%);opacity:0}}
/* the track: the morning on a quiet row, the meeting on it */
.dm-mtx-track{position:relative;height:40px;border-radius:calc(8px * var(--dm-rk-m,var(--dm-rk)));background:var(--dm-row);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--dm-line) 50%,transparent);overflow:hidden}
/* Blueprint's row is the surface itself: its green now line keeps 3:1 on white, not on the row grey */
:root:not([data-style="soft"],[data-style="studio"]) .dm-mtx-track:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:var(--dm-surface)}
.dm-mtx-blk{position:absolute;top:5px;bottom:5px;left:20%;width:60%;display:flex;align-items:center;justify-content:space-between;padding:0 6px;border-radius:calc(5px * var(--dm-rk-s,var(--dm-rk)));background:var(--dm-accent-bg);overflow:hidden;font-size:11.5px;font-weight:500;color:var(--dm-fg2)}
/* the start and end sit on the block in small opaque chips of the surface, so they read on the tint and on the hatch alike
   and nothing crosses them: the now line passes under them (owner, 18 Nov). The block's edge is a faint accent line (owner,
   17 Nov: no grey outline) */
.dm-mtx-blk{outline:1px solid color-mix(in srgb,var(--dm-accent-mark) 35%,transparent);outline-offset:-1px}
.dm-mtx-blk>.dm-num{position:relative;z-index:3;padding:0 6px;line-height:18px;border-radius:calc(4px * var(--dm-rk-s,var(--dm-rk)));background:var(--dm-surface);color:var(--dm-fg2)}
:root[data-theme="dark"] .dm-mtx-blk>.dm-num{color:var(--dm-fg)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .dm-mtx-blk>.dm-num{color:var(--dm-fg)}}
/* gone: fine 45deg accent lines over the tint, inside the meeting block only, across the part that has run (owner, 17 Nov) */
.dm-mtx-bp{position:absolute;top:0;bottom:0;left:0;background:repeating-linear-gradient(45deg,color-mix(in srgb,var(--dm-accent-mark) 60%,transparent) 0 1px,transparent 1px 6px);transition:width .45s cubic-bezier(.22,1,.36,1)}
.dm-mtx-bp{width:var(--dm-cut,0%)}
.dm-mtx-now{position:absolute;top:0;bottom:0;left:var(--dm-p,0%);width:2px;margin-left:-1px;background:var(--dm-accent-mark);transition:left .45s cubic-bezier(.22,1,.36,1);z-index:2}
.dm-mtx-now i{position:absolute;top:3px;left:50%;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:var(--dm-accent-mark)}
.dm-mtx.dm-done .dm-mtx-now{opacity:0;transition:opacity .4s,left .45s cubic-bezier(.22,1,.36,1)}
/* the footer: who is coming, the link, and Join. The people sit side by side, a little apart, never over each other
   (owner, 18 Nov) */
/* the foot sits under a hairline in Soft and Blueprint (owner, 21 Nov), 16px from it on each side as the card's other gaps;
   Studio's is a foot strip */
.dm-mtx-f{display:flex;align-items:center;gap:var(--dm-s-2);padding-top:var(--dm-s-4);border-top:1px solid color-mix(in srgb,var(--dm-line) 50%,transparent)}
.dm-mtx-who{display:flex;align-items:center;gap:4px;padding:2px 0}
.dm-mtx-who .dm-av{width:26px;height:26px;font-size:10px}
.dm-mtx-who .dm-mtx-more{background:var(--dm-chip);color:var(--dm-fg2)}
/* a narrow card (a phone) shows the first two people and counts the rest, so the people, the link and Join keep one row
   inside the card */
.dm-mtx-who .dm-mtx-narrow{display:none}
@container mtx (max-width:340px){.dm-mtx-who .dm-mtx-wide{display:none}.dm-mtx-who .dm-mtx-narrow{display:inline-grid}}
/* the copy button takes the shared hover of every icon button (owner, 21 Nov: one hover); once it has copied, the link's icon
   is the green tick for a moment, at the same size */
.dm-mtx-cp.dm-copied{color:var(--dm-ok-mark)!important}
@media (hover:hover) and (pointer:fine){.dm-mtx-cp.dm-copied:hover{color:var(--dm-ok-mark)!important}}
/* Join and its menu as one split button: a very light divider, a chevron that opens the meeting's actions */
.dm-mtx-jg{position:relative;display:flex;flex:none}
.dm-mtx-jg .dm-mtx-join{border-top-right-radius:0;border-bottom-right-radius:0}
.dm-mtx-jm{position:relative;width:32px;padding:0;justify-content:center;border-top-left-radius:0;border-bottom-left-radius:0}
.dm-mtx-jm::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:1px;background:color-mix(in srgb,var(--dm-on-accent) 30%,transparent)}
.dm-mtx-jm.dm-done{color:var(--dm-on-accent)}
.dm-mtx-pop{min-width:190px}
/* until it first opens (placePop sets its left), the closed menu hangs from Join's right edge, so on a phone it never reaches
   past the page and scrolls it sideways */
.dm-mtx-pop:not([style*="left"]){right:0}
.dm-mtx-cp{width:32px;height:32px}
.dm-mtx-join{padding:0 var(--dm-s-3) 0 6px;gap:var(--dm-s-2);overflow:hidden;justify-content:flex-start;transition:background var(--dm-t-fast),opacity var(--dm-t-fast)}
.dm-mtx-join .dm-mk{width:26px;height:26px;display:grid;place-items:center;border-radius:calc(6px * var(--dm-rk-s,var(--dm-rk)));background:#fff;flex:none}
.dm-mtx-join .dm-mk .dm-brand{width:15px;height:12.5px}
/* a disabled Join goes quiet as a whole: its mark loses its white tile and its colour with the words */
.dm-mtx-join[disabled] .dm-mk{background:none;filter:grayscale(1);opacity:.5}
@media (prefers-reduced-motion:reduce){.dm-mtx-bp,.dm-mtx-now{transition:none}.dm-mtx-roll i.dm-in,.dm-mtx-fade{animation:none}}
/* Studio (owner, 17 and 18 Nov): the meeting and its track on white, the people and actions on an off-white foot strip under a
   hairline. Its content sits 16px in from every edge: the people on the content's edge, and the copy button and Join, split,
   28px pills 16px from the strip's edges (owner, 23 Nov). The track and its block have ordinary round
   corners (they are not controls); the time chips are pills. The block, its lines, the now line, the status chip and the
   people keep their colours. Join is the ink button with a very light divider and no breathing; its menu scales and fades
   from the chevron, and a done action is the green tick */
@keyframes dm-clfade{from{opacity:0}}
@keyframes dm-clroll{from{transform:translateY(60%);opacity:0}}
:root[data-style="studio"] .dm-mtx,:root [data-style="studio"] .dm-mtx,:root [data-style="studio"].dm-mtx{padding:0;gap:0}
:root[data-style="studio"] .dm-mtx-h,:root [data-style="studio"] .dm-mtx-h,:root [data-style="studio"].dm-mtx-h{padding:16px 16px 0}
:root[data-style="studio"] .dm-mtx-t,:root [data-style="studio"] .dm-mtx-t,:root [data-style="studio"].dm-mtx-t{font-size:14px;font-weight:500;letter-spacing:-.01em}
:root[data-style="studio"] .dm-mtx-track,:root [data-style="studio"] .dm-mtx-track,:root [data-style="studio"].dm-mtx-track{margin:16px;height:40px;background:var(--dm-surface);border-radius:var(--dm-r-in);box-shadow:inset 0 0 0 1px var(--dm-line)}
:root[data-style="studio"] .dm-mtx-f,:root [data-style="studio"] .dm-mtx-f,:root [data-style="studio"].dm-mtx-f{position:relative;z-index:3;padding:var(--dm-strip-y) 16px;background:var(--dm-strip);border-top:1px solid var(--dm-line);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}
:root[data-style="studio"] .dm-mtx-blk,:root [data-style="studio"] .dm-mtx-blk,:root [data-style="studio"].dm-mtx-blk{border-radius:calc(var(--dm-r-in) - 5px)}
:root[data-style="studio"] .dm-mtx-blk>.dm-num,:root [data-style="studio"] .dm-mtx-blk>.dm-num,:root [data-style="studio"].dm-mtx-blk>.dm-num{border-radius:999px;box-shadow:0 0 0 1px var(--dm-hair)}
:root[data-style="studio"] .dm-mtx-bp,:root [data-style="studio"] .dm-mtx-bp,:root [data-style="studio"].dm-mtx-bp{transition:width .45s var(--dm-ease)}
:root[data-style="studio"] .dm-mtx-now,:root [data-style="studio"] .dm-mtx-now,:root [data-style="studio"].dm-mtx-now{transition:left .45s var(--dm-ease),opacity .3s var(--dm-ease)}
:root[data-style="studio"] .dm-mtx-fade,:root [data-style="studio"] .dm-mtx-fade,:root [data-style="studio"].dm-mtx-fade{animation:dm-clfade var(--dm-t-fast) var(--dm-ease) both}
:root[data-style="studio"] .dm-mtx-roll i.dm-in,:root [data-style="studio"] .dm-mtx-roll i.dm-in,:root [data-style="studio"].dm-mtx-roll i.dm-in{animation:dm-clroll .3s var(--dm-ease) both}
:root[data-style="studio"] .dm-mtx-cp,:root [data-style="studio"] .dm-mtx-cp,:root [data-style="studio"].dm-mtx-cp{width:28px;height:28px;border-radius:999px}
@media (hover:hover) and (pointer:fine){:root[data-style="studio"] .dm-mtx-cp:hover,:root [data-style="studio"] .dm-mtx-cp:hover,:root [data-style="studio"].dm-mtx-cp:hover{background:var(--dm-row)}}
:root[data-style="studio"] .dm-mtx .dm-ib:active,:root [data-style="studio"] .dm-mtx .dm-ib:active,:root [data-style="studio"].dm-mtx .dm-ib:active{transform:none}
/* (a step of --dm-ok in the vivid green keeps the copied tick at 3:1 on the off-white strip) */
:root[data-style="studio"] .dm-mtx-cp.dm-copied,:root [data-style="studio"] .dm-mtx-cp.dm-copied,:root [data-style="studio"].dm-mtx-cp.dm-copied{color:color-mix(in srgb,var(--dm-ok-mark) 80%,var(--dm-ok))!important}
@media (hover:hover) and (pointer:fine){:root[data-style="studio"] .dm-mtx-cp.dm-copied:hover,:root [data-style="studio"] .dm-mtx-cp.dm-copied:hover,:root [data-style="studio"].dm-mtx-cp.dm-copied:hover{color:color-mix(in srgb,var(--dm-ok-mark) 80%,var(--dm-ok))!important}}
:root[data-style="studio"] .dm-mtx-jg,:root [data-style="studio"] .dm-mtx-jg,:root [data-style="studio"].dm-mtx-jg{z-index:3}
/* (owner, 22 Nov: "more spacing") Join stands 12px from the copy button, its end on the content's 16px column */
:root[data-style="studio"] .dm-mtx-jg,:root [data-style="studio"] .dm-mtx-jg,:root [data-style="studio"].dm-mtx-jg{margin-left:var(--dm-s-1)}
:root[data-style="studio"] .dm-mtx-jg :is(.dm-mtx-join,.dm-mtx-jm),:root [data-style="studio"] .dm-mtx-jg :is(.dm-mtx-join,.dm-mtx-jm),:root [data-style="studio"].dm-mtx-jg :is(.dm-mtx-join,.dm-mtx-jm){height:28px}
:root[data-style="studio"] .dm-mtx-jg .dm-mtx-join,:root [data-style="studio"] .dm-mtx-jg .dm-mtx-join,:root [data-style="studio"].dm-mtx-jg .dm-mtx-join{border-radius:999px 0 0 999px;padding:0 12px 0 11px;gap:6px}
:root[data-style="studio"] .dm-mtx-jg .dm-mtx-jm,:root [data-style="studio"] .dm-mtx-jg .dm-mtx-jm,:root [data-style="studio"].dm-mtx-jg .dm-mtx-jm{border-radius:0 999px 999px 0;width:28px}
:root[data-style="studio"] .dm-mtx-jm::before,:root [data-style="studio"] .dm-mtx-jm::before,:root [data-style="studio"].dm-mtx-jm::before{top:8px;bottom:8px;background:color-mix(in srgb,var(--dm-on-btn) 26%,transparent)}
:root[data-style="studio"] .dm-mtx-jm.dm-done,:root [data-style="studio"] .dm-mtx-jm.dm-done,:root [data-style="studio"].dm-mtx-jm.dm-done{color:var(--dm-ok-mark)}
/* Join's menu is Studio's popover: 22px corners, its rows 6px in with Studio's 10px rows and the one gliding hover (hoverGlide) */
:root[data-style="studio"] .dm-mtx-pop,:root [data-style="studio"] .dm-mtx-pop,:root [data-style="studio"].dm-mtx-pop{padding:6px;border-radius:var(--dm-r-card)}
/* on the white ink of dark mode the green tick is a deeper step, so it keeps 3:1 */
:root[data-style="studio"][data-theme="dark"] .dm-mtx-jm.dm-done,:root[data-theme="dark"] [data-style="studio"] .dm-mtx-jm.dm-done,:root[data-theme="dark"] [data-style="studio"].dm-mtx-jm.dm-done{color:color-mix(in srgb,var(--dm-ok-mark) 60%,#000)}
@media (prefers-color-scheme:dark){:root[data-style="studio"]:not([data-theme="light"]) .dm-mtx-jm.dm-done,:root:not([data-theme="light"]) [data-style="studio"] .dm-mtx-jm.dm-done,:root:not([data-theme="light"]) [data-style="studio"].dm-mtx-jm.dm-done{color:color-mix(in srgb,var(--dm-ok-mark) 60%,#000)}}
/* the call's logo stands on its own beside Join, the size of the word, with no white tile behind it (owner, 21 Nov: "use
   icon without white bg on studio style") */
:root[data-style="studio"] .dm-mtx-join .dm-mk,:root [data-style="studio"] .dm-mtx-join .dm-mk,:root [data-style="studio"].dm-mtx-join .dm-mk{width:14px;height:14px;border-radius:0;background:none}
:root[data-style="studio"] .dm-mtx-join .dm-mk .dm-brand,:root [data-style="studio"] .dm-mtx-join .dm-mk .dm-brand,:root [data-style="studio"].dm-mtx-join .dm-mk .dm-brand{width:14px;height:11.7px}
/* Join and its chevron are one split button: a press sinks its fill (the ink's pressed shade) and never scales one half */
:root[data-style="studio"] .dm-mtx .dm-mtx-jg .dm-pill:is(.dm-mtx-join,.dm-mtx-jm):active,:root [data-style="studio"] .dm-mtx .dm-mtx-jg .dm-pill:is(.dm-mtx-join,.dm-mtx-jm):active,:root [data-style="studio"].dm-mtx .dm-mtx-jg .dm-pill:is(.dm-mtx-join,.dm-mtx-jm):active{transform:none}
/* a phone: the foot strip's pieces close up a little, so Join keeps its room beside the people as its words change */
@media (max-width:400px){.dm-mtx-who{gap:3px}.dm-mtx-who .dm-av{width:24px;height:24px}:root[data-style="studio"] .dm-mtx-f,:root [data-style="studio"] .dm-mtx-f,:root [data-style="studio"].dm-mtx-f{gap:6px}:root[data-style="studio"] .dm-mtx-jg .dm-mtx-join,:root [data-style="studio"] .dm-mtx-jg .dm-mtx-join,:root [data-style="studio"].dm-mtx-jg .dm-mtx-join{padding:0 10px 0 9px;gap:6px}:root[data-style="studio"] .dm-mtx-jg,:root [data-style="studio"] .dm-mtx-jg,:root [data-style="studio"].dm-mtx-jg{margin-left:0}}
@media (prefers-reduced-motion:reduce){:root[data-style="studio"] :is(.dm-mtx-bp,.dm-mtx-now),:root [data-style="studio"] :is(.dm-mtx-bp,.dm-mtx-now),:root [data-style="studio"]:is(.dm-mtx-bp,.dm-mtx-now){transition:none}:root[data-style="studio"] :is(.dm-mtx-fade,.dm-mtx-roll i.dm-in),:root [data-style="studio"] :is(.dm-mtx-fade,.dm-mtx-roll i.dm-in),:root [data-style="studio"]:is(.dm-mtx-fade,.dm-mtx-roll i.dm-in){animation:none}}
MeetingCard.astroAstro · 39 lines
---
// Generated from designme.dev by scripts/sync.mjs. Edit the site, then sync.
// Meeting card: The next meeting from countdown to wrap-up, with the time already gone hatched out and a join that stays open.
// The markup, CSS and script are designme.dev's own, run by the shared core in ../core, which mounts the component when it scrolls
// into view and plays its demo. To show your own data, change meeting-card.js. The markup is kept exactly as it is (is:raw).
import type { HTMLAttributes } from 'astro/types';
import '../core/designme.css';
import './meeting-card.css';

export interface Props extends HTMLAttributes<'div'> {
  /** "soft" or "studio" draws it in that style. Leave it out for Blueprint, or for the style set on <html> (data-style="soft" or "studio") */
  'data-style'?: 'soft' | 'studio';
}
const { class: className, ...rest } = Astro.props;
---
<div class:list={['card', 'wide', className]} data-c="meeting-card" {...rest}>
  <div class="stage-in"><Fragment is:raw>
<div class="mtx panel">
  <div class="mtx-h">
    <b class="mtx-t">Pricing review</b><span class="mtx-sub num">Today, 10:30 to 11:15</span>
    <span class="tag mtx-st"><span><svg class="i xs"><use href="#i-clock"/></svg>In <span class="mtx-roll num"><i>10</i></span> min</span></span>
  </div>
  <div class="mtx-track" role="img" aria-label="Now 10:20. The meeting runs 10:30 to 11:15">
    <span class="mtx-blk"><span class="mtx-bp"></span><span class="num">10:30</span><span class="num">11:15</span></span>
    <span class="mtx-now"><i></i></span>
  </div>
  <div class="mtx-f">
    <div class="mtx-who"><span class="av" style="background:var(--dm-av-l);color:var(--dm-av-l-ink)" role="img" aria-label="Maya Kim" data-tip="Maya Kim" data-pic="MK-g03">MK</span><span class="av" style="background:var(--dm-av-b);color:var(--dm-av-b-ink)" role="img" aria-label="Jon Ortiz" data-tip="Jon Ortiz" data-pic="JO-g01">JO</span><span class="av mtx-wide" style="background:var(--dm-av-k);color:var(--dm-av-k-ink)" role="img" aria-label="Ari Reyes" data-tip="Ari Reyes" data-pic="AR-g02">AR</span><span class="av mtx-wide" style="background:var(--dm-av-r);color:var(--dm-av-r-ink)" role="img" aria-label="Sam Lee" data-tip="Sam Lee" data-pic="SL-g09">SL</span><span class="av mtx-more mtx-wide" role="img" aria-label="Dev Kapoor, Lena Novak" data-tip="Dev Kapoor, Lena Novak">+2</span><span class="av mtx-more mtx-narrow" role="img" aria-label="Ari Reyes, Sam Lee, Dev Kapoor, Lena Novak" data-tip="Ari Reyes, Sam Lee, Dev Kapoor, Lena Novak">+4</span></div>
    <span class="sp"></span>
    <button class="ib mtx-cp" aria-label="Copy Google Meet link" data-tip="Copy meet.google.com/nax-wqkf-stu"><svg class="i s"><use href="#i-link"/></svg></button>
    <div class="mtx-jg"><button class="pill primary mtx-join"><span class="mk"><svg class="brand" aria-hidden="true" viewBox="0 0 87.5 72"><path fill="#00832d" d="M49.5 36l8.53 9.75 11.47 7.33 2-17.02-2-16.64-11.69 6.44z"/><path fill="#0066da" d="M0 51.5V66c0 3.315 2.685 6 6 6h14.5l3-10.96-3-9.54-9.95-3z"/><path fill="#e94235" d="M20.5 0L0 20.5l10.55 3 9.95-3 2.95-9.41z"/><path fill="#2684fc" d="M20.5 20.5H0v31h20.5z"/><path fill="#00ac47" d="M82.6 8.68L69.5 19.42v33.66l13.16 10.79c1.97 1.54 4.85.135 4.85-2.37V11c0-2.535-2.945-3.925-4.91-2.32zM49.5 36v15.5h-29V72h43c3.315 0 6-2.685 6-6V53.08z"/><path fill="#ffba00" d="M63.5 0h-43v20.5h29V36l20-16.57V6c0-3.315-2.685-6-6-6z"/></svg></span><span class="lb">Join</span></button><button class="pill primary mtx-jm" aria-label="More for this meeting" data-pop=".mtx-pop" data-pop-align="end" aria-haspopup="menu"><svg class="i xs"><use href="#i-chev-d"/></svg></button><div class="pop mtx-pop" role="menu"><button class="mi" role="menuitem" data-close data-a="Invite sent"><svg class="i s"><use href="#i-mail"/></svg>Send invite</button><button class="mi" role="menuitem" data-close data-a="Added to calendar"><svg class="i s"><use href="#i-cal"/></svg>Add to calendar</button><button class="mi" role="menuitem" data-close data-a="Invitation copied"><svg class="i s"><use href="#i-copy"/></svg>Copy invitation</button></div></div>
  </div>
</div>
  </Fragment></div>
</div>
<script>
  import './meeting-card.js';
</script>
meeting-card.htmlHTML · 21 lines
<div class="card wide" data-c="meeting-card">
  <div class="stage-in">
    <div class="mtx panel">
      <div class="mtx-h">
        <b class="mtx-t">Pricing review</b><span class="mtx-sub num">Today, 10:30 to 11:15</span>
        <span class="tag mtx-st"><span><svg class="i xs"><use href="#i-clock"/></svg>In <span class="mtx-roll num"><i>10</i></span> min</span></span>
      </div>
      <div class="mtx-track" role="img" aria-label="Now 10:20. The meeting runs 10:30 to 11:15">
        <span class="mtx-blk"><span class="mtx-bp"></span><span class="num">10:30</span><span class="num">11:15</span></span>
        <span class="mtx-now"><i></i></span>
      </div>
      <div class="mtx-f">
        <div class="mtx-who"><span class="av" style="background:var(--dm-av-l);color:var(--dm-av-l-ink)" role="img" aria-label="Maya Kim" data-tip="Maya Kim" data-pic="MK-g03">MK</span><span class="av" style="background:var(--dm-av-b);color:var(--dm-av-b-ink)" role="img" aria-label="Jon Ortiz" data-tip="Jon Ortiz" data-pic="JO-g01">JO</span><span class="av mtx-wide" style="background:var(--dm-av-k);color:var(--dm-av-k-ink)" role="img" aria-label="Ari Reyes" data-tip="Ari Reyes" data-pic="AR-g02">AR</span><span class="av mtx-wide" style="background:var(--dm-av-r);color:var(--dm-av-r-ink)" role="img" aria-label="Sam Lee" data-tip="Sam Lee" data-pic="SL-g09">SL</span><span class="av mtx-more mtx-wide" role="img" aria-label="Dev Kapoor, Lena Novak" data-tip="Dev Kapoor, Lena Novak">+2</span><span class="av mtx-more mtx-narrow" role="img" aria-label="Ari Reyes, Sam Lee, Dev Kapoor, Lena Novak" data-tip="Ari Reyes, Sam Lee, Dev Kapoor, Lena Novak">+4</span></div>
        <span class="sp"></span>
        <button class="ib mtx-cp" aria-label="Copy Google Meet link" data-tip="Copy meet.google.com/nax-wqkf-stu"><svg class="i s"><use href="#i-link"/></svg></button>
        <div class="mtx-jg"><button class="pill primary mtx-join"><span class="mk"><svg class="brand" aria-hidden="true" viewBox="0 0 87.5 72"><path fill="#00832d" d="M49.5 36l8.53 9.75 11.47 7.33 2-17.02-2-16.64-11.69 6.44z"/><path fill="#0066da" d="M0 51.5V66c0 3.315 2.685 6 6 6h14.5l3-10.96-3-9.54-9.95-3z"/><path fill="#e94235" d="M20.5 0L0 20.5l10.55 3 9.95-3 2.95-9.41z"/><path fill="#2684fc" d="M20.5 20.5H0v31h20.5z"/><path fill="#00ac47" d="M82.6 8.68L69.5 19.42v33.66l13.16 10.79c1.97 1.54 4.85.135 4.85-2.37V11c0-2.535-2.945-3.925-4.91-2.32zM49.5 36v15.5h-29V72h43c3.315 0 6-2.685 6-6V53.08z"/><path fill="#ffba00" d="M63.5 0h-43v20.5h29V36l20-16.57V6c0-3.315-2.685-6-6-6z"/></svg></span><span class="lb">Join</span></button><button class="pill primary mtx-jm" aria-label="More for this meeting" data-pop=".mtx-pop" data-pop-align="end" aria-haspopup="menu"><svg class="i xs"><use href="#i-chev-d"/></svg></button><div class="pop mtx-pop" role="menu"><button class="mi" role="menuitem" data-close data-a="Invite sent"><svg class="i s"><use href="#i-mail"/></svg>Send invite</button><button class="mi" role="menuitem" data-close data-a="Added to calendar"><svg class="i s"><use href="#i-cal"/></svg>Add to calendar</button><button class="mi" role="menuitem" data-close data-a="Invitation copied"><svg class="i s"><use href="#i-copy"/></svg>Copy invitation</button></div></div>
      </div>
    </div>
  </div>
</div>
meeting-card.cssHTML · 125 lines
/* ---------- Meeting card ---------- */
/* the next meeting, told as it goes: a countdown, "Starting now", the meeting in progress and then over. The track is the
   morning from 10:00 to 12:30 with the meeting on it in the accent tint, its start and end on the block itself. Time that
   has gone is hatched out in neutral grey (the hatch and the tint meet at the now line), and the status chip at the top right
   rolls its minutes. Join stays open while the meeting runs, since people join late. Join is the library's primary button
   (28 Nov: the standard .pill.primary, 32px like the copy button beside it, with no breathing of its own; Studio's ink primary).
   Every state is the same height. Its content sits 16px in from every edge, and nothing in it grows or shrinks when it is
   pressed (owner, 18 Nov) */
.mtx{width:100%;max-width:400px;margin:0 auto;padding:var(--dm-s-4);display:flex;flex-direction:column;gap:var(--dm-s-4);container:mtx/inline-size}
.mtx :is(.pill,.ib):active,.mtx .mtx-join.prs{transform:none}
/* the title and the chip share the first line; the time runs under both, so a longer chip never wraps it and every state
   is the same height */
.mtx-h{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:var(--dm-s-3);row-gap:2px}
.mtx-t{font-size:14px;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mtx-sub{grid-row:2;grid-column:1 / -1;font-size:12.5px;color:var(--dm-muted)}
.mtx-st{grid-row:1;grid-column:2;justify-self:end;transition:background .4s cubic-bezier(.22,1,.36,1),color .4s cubic-bezier(.22,1,.36,1)}
.mtx-st>span{display:inline-flex;align-items:center;gap:5px}
.mtx-st .dot{color:var(--dm-ok-mark)}
.mtx-fade{animation:mtxfade .4s cubic-bezier(.22,1,.36,1) both}
@keyframes mtxfade{from{opacity:0}}
/* the minutes roll: each new number comes up from below */
/* the rolling minutes keep the chip's own line, so the number sits on the words' baseline (owner, 17 Nov) */
.mtx-roll{display:inline-grid;overflow:hidden;line-height:inherit;height:1lh}
.mtx-roll i{font-style:normal}
.mtx-roll i.in{animation:mtxroll .32s cubic-bezier(.22,1,.36,1) both}
@keyframes mtxroll{from{transform:translateY(70%);opacity:0}}
/* the track: the morning on a quiet row, the meeting on it */
.mtx-track{position:relative;height:40px;border-radius:calc(8px * var(--dm-rk-m,var(--dm-rk)));background:var(--dm-row);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--dm-line) 50%,transparent);overflow:hidden}
/* Blueprint's row is the surface itself: its green now line keeps 3:1 on white, not on the row grey */
:root:not([data-style="soft"],[data-style="studio"]) .mtx-track:not(:where([data-style="soft"],[data-style="soft"] *,[data-style="studio"],[data-style="studio"] *)){background:var(--dm-surface)}
.mtx-blk{position:absolute;top:5px;bottom:5px;left:20%;width:60%;display:flex;align-items:center;justify-content:space-between;padding:0 6px;border-radius:calc(5px * var(--dm-rk-s,var(--dm-rk)));background:var(--dm-accent-bg);overflow:hidden;font-size:11.5px;font-weight:500;color:var(--dm-fg2)}
/* the start and end sit on the block in small opaque chips of the surface, so they read on the tint and on the hatch alike
   and nothing crosses them: the now line passes under them (owner, 18 Nov). The block's edge is a faint accent line (owner,
   17 Nov: no grey outline) */
.mtx-blk{outline:1px solid color-mix(in srgb,var(--dm-accent-mark) 35%,transparent);outline-offset:-1px}
.mtx-blk>.num{position:relative;z-index:3;padding:0 6px;line-height:18px;border-radius:calc(4px * var(--dm-rk-s,var(--dm-rk)));background:var(--dm-surface);color:var(--dm-fg2)}
:root[data-theme="dark"] .mtx-blk>.num{color:var(--dm-fg)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .mtx-blk>.num{color:var(--dm-fg)}}
/* gone: fine 45deg accent lines over the tint, inside the meeting block only, across the part that has run (owner, 17 Nov) */
.mtx-bp{position:absolute;top:0;bottom:0;left:0;background:repeating-linear-gradient(45deg,color-mix(in srgb,var(--dm-accent-mark) 60%,transparent) 0 1px,transparent 1px 6px);transition:width .45s cubic-bezier(.22,1,.36,1)}
.mtx-bp{width:var(--dm-cut,0%)}
.mtx-now{position:absolute;top:0;bottom:0;left:var(--dm-p,0%);width:2px;margin-left:-1px;background:var(--dm-accent-mark);transition:left .45s cubic-bezier(.22,1,.36,1);z-index:2}
.mtx-now i{position:absolute;top:3px;left:50%;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:var(--dm-accent-mark)}
.mtx.done .mtx-now{opacity:0;transition:opacity .4s,left .45s cubic-bezier(.22,1,.36,1)}
/* the footer: who is coming, the link, and Join. The people sit side by side, a little apart, never over each other
   (owner, 18 Nov) */
/* the foot sits under a hairline in Soft and Blueprint (owner, 21 Nov), 16px from it on each side as the card's other gaps;
   Studio's is a foot strip */
.mtx-f{display:flex;align-items:center;gap:var(--dm-s-2);padding-top:var(--dm-s-4);border-top:1px solid color-mix(in srgb,var(--dm-line) 50%,transparent)}
.mtx-who{display:flex;align-items:center;gap:4px;padding:2px 0}
.mtx-who .av{width:26px;height:26px;font-size:10px}
.mtx-who .mtx-more{background:var(--dm-chip);color:var(--dm-fg2)}
/* a narrow card (a phone) shows the first two people and counts the rest, so the people, the link and Join keep one row
   inside the card */
.mtx-who .mtx-narrow{display:none}
@container mtx (max-width:340px){.mtx-who .mtx-wide{display:none}.mtx-who .mtx-narrow{display:inline-grid}}
/* the copy button takes the shared hover of every icon button (owner, 21 Nov: one hover); once it has copied, the link's icon
   is the green tick for a moment, at the same size */
.mtx-cp.copied{color:var(--dm-ok-mark)!important}
@media (hover:hover) and (pointer:fine){.mtx-cp.copied:hover{color:var(--dm-ok-mark)!important}}
/* Join and its menu as one split button: a very light divider, a chevron that opens the meeting's actions */
.mtx-jg{position:relative;display:flex;flex:none}
.mtx-jg .mtx-join{border-top-right-radius:0;border-bottom-right-radius:0}
.mtx-jm{position:relative;width:32px;padding:0;justify-content:center;border-top-left-radius:0;border-bottom-left-radius:0}
.mtx-jm::before{content:"";position:absolute;left:0;top:9px;bottom:9px;width:1px;background:color-mix(in srgb,var(--dm-on-accent) 30%,transparent)}
.mtx-jm.done{color:var(--dm-on-accent)}
.mtx-pop{min-width:190px}
/* until it first opens (placePop sets its left), the closed menu hangs from Join's right edge, so on a phone it never reaches
   past the page and scrolls it sideways */
.mtx-pop:not([style*="left"]){right:0}
.mtx-cp{width:32px;height:32px}
.mtx-join{padding:0 var(--dm-s-3) 0 6px;gap:var(--dm-s-2);overflow:hidden;justify-content:flex-start;transition:background var(--dm-t-fast),opacity var(--dm-t-fast)}
.mtx-join .mk{width:26px;height:26px;display:grid;place-items:center;border-radius:calc(6px * var(--dm-rk-s,var(--dm-rk)));background:#fff;flex:none}
.mtx-join .mk .brand{width:15px;height:12.5px}
/* a disabled Join goes quiet as a whole: its mark loses its white tile and its colour with the words */
.mtx-join[disabled] .mk{background:none;filter:grayscale(1);opacity:.5}
@media (prefers-reduced-motion:reduce){.mtx-bp,.mtx-now{transition:none}.mtx-roll i.in,.mtx-fade{animation:none}}
/* Studio (owner, 17 and 18 Nov): the meeting and its track on white, the people and actions on an off-white foot strip under a
   hairline. Its content sits 16px in from every edge: the people on the content's edge, and the copy button and Join, split,
   28px pills 16px from the strip's edges (owner, 23 Nov). The track and its block have ordinary round
   corners (they are not controls); the time chips are pills. The block, its lines, the now line, the status chip and the
   people keep their colours. Join is the ink button with a very light divider and no breathing; its menu scales and fades
   from the chevron, and a done action is the green tick */
@keyframes clfade{from{opacity:0}}
@keyframes clroll{from{transform:translateY(60%);opacity:0}}
:root[data-style="studio"] .mtx,:root [data-style="studio"] .mtx,:root [data-style="studio"].mtx{padding:0;gap:0}
:root[data-style="studio"] .mtx-h,:root [data-style="studio"] .mtx-h,:root [data-style="studio"].mtx-h{padding:16px 16px 0}
:root[data-style="studio"] .mtx-t,:root [data-style="studio"] .mtx-t,:root [data-style="studio"].mtx-t{font-size:14px;font-weight:500;letter-spacing:-.01em}
:root[data-style="studio"] .mtx-track,:root [data-style="studio"] .mtx-track,:root [data-style="studio"].mtx-track{margin:16px;height:40px;background:var(--dm-surface);border-radius:var(--dm-r-in);box-shadow:inset 0 0 0 1px var(--dm-line)}
:root[data-style="studio"] .mtx-f,:root [data-style="studio"] .mtx-f,:root [data-style="studio"].mtx-f{position:relative;z-index:3;padding:var(--dm-strip-y) 16px;background:var(--dm-strip);border-top:1px solid var(--dm-line);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}
:root[data-style="studio"] .mtx-blk,:root [data-style="studio"] .mtx-blk,:root [data-style="studio"].mtx-blk{border-radius:calc(var(--dm-r-in) - 5px)}
:root[data-style="studio"] .mtx-blk>.num,:root [data-style="studio"] .mtx-blk>.num,:root [data-style="studio"].mtx-blk>.num{border-radius:999px;box-shadow:0 0 0 1px var(--dm-hair)}
:root[data-style="studio"] .mtx-bp,:root [data-style="studio"] .mtx-bp,:root [data-style="studio"].mtx-bp{transition:width .45s var(--dm-ease)}
:root[data-style="studio"] .mtx-now,:root [data-style="studio"] .mtx-now,:root [data-style="studio"].mtx-now{transition:left .45s var(--dm-ease),opacity .3s var(--dm-ease)}
:root[data-style="studio"] .mtx-fade,:root [data-style="studio"] .mtx-fade,:root [data-style="studio"].mtx-fade{animation:clfade var(--dm-t-fast) var(--dm-ease) both}
:root[data-style="studio"] .mtx-roll i.in,:root [data-style="studio"] .mtx-roll i.in,:root [data-style="studio"].mtx-roll i.in{animation:clroll .3s var(--dm-ease) both}
:root[data-style="studio"] .mtx-cp,:root [data-style="studio"] .mtx-cp,:root [data-style="studio"].mtx-cp{width:28px;height:28px;border-radius:999px}
@media (hover:hover) and (pointer:fine){:root[data-style="studio"] .mtx-cp:hover,:root [data-style="studio"] .mtx-cp:hover,:root [data-style="studio"].mtx-cp:hover{background:var(--dm-row)}}
:root[data-style="studio"] .mtx .ib:active,:root [data-style="studio"] .mtx .ib:active,:root [data-style="studio"].mtx .ib:active{transform:none}
/* (a step of --dm-ok in the vivid green keeps the copied tick at 3:1 on the off-white strip) */
:root[data-style="studio"] .mtx-cp.copied,:root [data-style="studio"] .mtx-cp.copied,:root [data-style="studio"].mtx-cp.copied{color:color-mix(in srgb,var(--dm-ok-mark) 80%,var(--dm-ok))!important}
@media (hover:hover) and (pointer:fine){:root[data-style="studio"] .mtx-cp.copied:hover,:root [data-style="studio"] .mtx-cp.copied:hover,:root [data-style="studio"].mtx-cp.copied:hover{color:color-mix(in srgb,var(--dm-ok-mark) 80%,var(--dm-ok))!important}}
:root[data-style="studio"] .mtx-jg,:root [data-style="studio"] .mtx-jg,:root [data-style="studio"].mtx-jg{z-index:3}
/* (owner, 22 Nov: "more spacing") Join stands 12px from the copy button, its end on the content's 16px column */
:root[data-style="studio"] .mtx-jg,:root [data-style="studio"] .mtx-jg,:root [data-style="studio"].mtx-jg{margin-left:var(--dm-s-1)}
:root[data-style="studio"] .mtx-jg :is(.mtx-join,.mtx-jm),:root [data-style="studio"] .mtx-jg :is(.mtx-join,.mtx-jm),:root [data-style="studio"].mtx-jg :is(.mtx-join,.mtx-jm){height:28px}
:root[data-style="studio"] .mtx-jg .mtx-join,:root [data-style="studio"] .mtx-jg .mtx-join,:root [data-style="studio"].mtx-jg .mtx-join{border-radius:999px 0 0 999px;padding:0 12px 0 11px;gap:6px}
:root[data-style="studio"] .mtx-jg .mtx-jm,:root [data-style="studio"] .mtx-jg .mtx-jm,:root [data-style="studio"].mtx-jg .mtx-jm{border-radius:0 999px 999px 0;width:28px}
:root[data-style="studio"] .mtx-jm::before,:root [data-style="studio"] .mtx-jm::before,:root [data-style="studio"].mtx-jm::before{top:8px;bottom:8px;background:color-mix(in srgb,var(--dm-on-btn) 26%,transparent)}
:root[data-style="studio"] .mtx-jm.done,:root [data-style="studio"] .mtx-jm.done,:root [data-style="studio"].mtx-jm.done{color:var(--dm-ok-mark)}
/* Join's menu is Studio's popover: 22px corners, its rows 6px in with Studio's 10px rows and the one gliding hover (hoverGlide) */
:root[data-style="studio"] .mtx-pop,:root [data-style="studio"] .mtx-pop,:root [data-style="studio"].mtx-pop{padding:6px;border-radius:var(--dm-r-card)}
/* on the white ink of dark mode the green tick is a deeper step, so it keeps 3:1 */
:root[data-style="studio"][data-theme="dark"] .mtx-jm.done,:root[data-theme="dark"] [data-style="studio"] .mtx-jm.done,:root[data-theme="dark"] [data-style="studio"].mtx-jm.done{color:color-mix(in srgb,var(--dm-ok-mark) 60%,#000)}
@media (prefers-color-scheme:dark){:root[data-style="studio"]:not([data-theme="light"]) .mtx-jm.done,:root:not([data-theme="light"]) [data-style="studio"] .mtx-jm.done,:root:not([data-theme="light"]) [data-style="studio"].mtx-jm.done{color:color-mix(in srgb,var(--dm-ok-mark) 60%,#000)}}
/* the call's logo stands on its own beside Join, the size of the word, with no white tile behind it (owner, 21 Nov: "use
   icon without white bg on studio style") */
:root[data-style="studio"] .mtx-join .mk,:root [data-style="studio"] .mtx-join .mk,:root [data-style="studio"].mtx-join .mk{width:14px;height:14px;border-radius:0;background:none}
:root[data-style="studio"] .mtx-join .mk .brand,:root [data-style="studio"] .mtx-join .mk .brand,:root [data-style="studio"].mtx-join .mk .brand{width:14px;height:11.7px}
/* Join and its chevron are one split button: a press sinks its fill (the ink's pressed shade) and never scales one half */
:root[data-style="studio"] .mtx .mtx-jg .pill:is(.mtx-join,.mtx-jm):active,:root [data-style="studio"] .mtx .mtx-jg .pill:is(.mtx-join,.mtx-jm):active,:root [data-style="studio"].mtx .mtx-jg .pill:is(.mtx-join,.mtx-jm):active{transform:none}
/* a phone: the foot strip's pieces close up a little, so Join keeps its room beside the people as its words change */
@media (max-width:400px){.mtx-who{gap:3px}.mtx-who .av{width:24px;height:24px}:root[data-style="studio"] .mtx-f,:root [data-style="studio"] .mtx-f,:root [data-style="studio"].mtx-f{gap:6px}:root[data-style="studio"] .mtx-jg .mtx-join,:root [data-style="studio"] .mtx-jg .mtx-join,:root [data-style="studio"].mtx-jg .mtx-join{padding:0 10px 0 9px;gap:6px}:root[data-style="studio"] .mtx-jg,:root [data-style="studio"] .mtx-jg,:root [data-style="studio"].mtx-jg{margin-left:0}}
@media (prefers-reduced-motion:reduce){:root[data-style="studio"] :is(.mtx-bp,.mtx-now),:root [data-style="studio"] :is(.mtx-bp,.mtx-now),:root [data-style="studio"]:is(.mtx-bp,.mtx-now){transition:none}:root[data-style="studio"] :is(.mtx-fade,.mtx-roll i.in),:root [data-style="studio"] :is(.mtx-fade,.mtx-roll i.in),:root [data-style="studio"]:is(.mtx-fade,.mtx-roll i.in){animation:none}}
meeting-card.jsHTML · 64 lines
DM.def('meeting-card', (r, c) => {
  r.innerHTML = r.innerHTML.replace(/\{([\w-]+)\}/g, (m, k) => k === 'meet' ? BRAND.meet : I(k, k === 'clock' || k === 'chev-d' ? 'xs' : 's'));
  // the row runs 10:15 to 11:30 in minutes of the day; the meeting is 10:30 to 11:15, 45 minutes
  const FROM = 615, TO = 690, AT = 630, END = 675, URL = 'https://meet.google.com/nax-wqkf-stu';
  const pc = m => Math.min(100, Math.max(0, (m - FROM) / (TO - FROM) * 100));
  const clock = m => `${Math.floor(m / 60)}:${String(m % 60).padStart(2, '0')}`;
  const root = $('.mtx', r), st = $('.mtx-st', r), track = $('.mtx-track', r), blk = $('.mtx-blk', r), join = $('.mtx-join', r), jm = $('.mtx-jm', r), cp = $('.mtx-cp', r);
  const phase = m => m < AT ? 'soon' : m === AT ? 'start' : m < END ? 'live' : 'done';
  let was = 'soon', num = 10;
  // the chip: a new state fades in; within a state only the minutes change, and they roll
  const chip = (cls, inner) => { st.className = 'tag mtx-st' + (cls ? ' ' + cls : ''); st.innerHTML = `<span class="mtx-fade">${inner}</span>`; };
  const roll = n => { const el = $('.mtx-roll', st); if (el && n !== num) el.innerHTML = `<i class="in">${n}</i>`; num = n; };
  const set = m => {
    const ph = phase(m), p = pc(m);
    root.style.setProperty('--dm-p', p + '%'); track.style.setProperty('--dm-p', p + '%');
    blk.style.setProperty('--dm-cut', Math.min(100, Math.max(0, (m - AT) / (END - AT) * 100)) + '%');
    const n = ph === 'soon' ? AT - m : END - m;
    if (ph !== was){
      if (ph === 'soon') chip('', `${I('clock', 'xs')}In <span class="mtx-roll num"><i>${n}</i></span> min`);
      if (ph === 'start') chip('ok', '<i class="dot"></i>Starting now');
      if (ph === 'live') chip('ok', `<i class="dot"></i>Live, <span class="mtx-roll num"><i>${n}</i></span> min left`);
      if (ph === 'done') chip('', 'Ended');
      num = n;
    } else roll(n);
    was = ph;
    root.classList.toggle('live', ph === 'start' || ph === 'live');
    root.classList.toggle('done', ph === 'done');
    join.disabled = jm.disabled = ph === 'done';
    track.setAttribute('aria-label', ph === 'done' ? 'The meeting ran 10:30 to 11:15 and has ended' : `Now ${clock(m)}. The meeting runs 10:30 to 11:15`);
  };
  set(620);
  // the button is as wide as its words and eases to its new width when they change, keeping no room for a longer one (owner, 18 Nov)
  const easeW = el => { let w = 0, busy = null; const ro = new ResizeObserver(() => { if (busy) return; const w1 = el.getBoundingClientRect().width;
    if (!REDUCE && w && Math.abs(w1 - w) > .5){ busy = el.animate([{ width:w + 'px' }, { width:w1 + 'px' }], { duration:340, easing:'cubic-bezier(.23,1,.32,1)' }); busy.finished.catch(() => {}).then(() => { busy = null; w = el.getBoundingClientRect().width; }); } w = w1; });
    ro.observe(el); c.offs.push(() => ro.disconnect()); };
  easeW(join);
  join.onclick = () => {
    join.classList.add('prs'); c.later(110, () => join.classList.remove('prs'));
    const lb = $('.lb', join); swap(lb, 'Opening Meet'); c.later(1600, () => swap(lb, 'Join'));
  };
  cp.onclick = () => copied(cp, URL, 'Copied');
  // the meeting's actions: the chevron flashes a check and says what happened
  const jmIc = jm.innerHTML;
  $$('.mtx-pop .mi', r).forEach(b => b.addEventListener('click', () => {
    if (b.dataset.a === 'Invitation copied'){ try { navigator.clipboard.writeText(`Pricing review, today 10:30 to 11:15\n${URL}`).catch(() => {}); } catch(e){} }
    clearTimeout(jm._t); c.later(140, () => { jm.innerHTML = I('check', 'xs'); jm.classList.add('done'); jm.dataset.tip = b.dataset.a; showTip(jm);
      jm._t = setTimeout(() => { jm.innerHTML = jmIc; jm.classList.remove('done'); delete jm.dataset.tip; if (tipFor === jm) hideTip(true); }, 1500); });
  }));
  c.offs.push(() => clearTimeout(jm._t));
  const who = $('.mtx-who', r);
  // the preview: the countdown, "Starting now", the meeting going by with the gone part hatched, then over
  c.story(async s => {
    await s.beat(2);
    for (let m = 621; m <= AT; m++){ await s.beat(1); set(m); }
    await s.beat(4);
    for (let m = AT + 3; m <= 651; m += 3){ await s.beat(1.2); set(m); }
    who.classList.add('hv'); await s.point($$('.av', who)[1]); await s.beat(3);
    who.classList.remove('hv'); await s.tap(cp); await s.beat(3);
    s.away();
    for (let m = 654; m <= END; m += 3){ await s.beat(1.2); set(m); }
    await s.beat(5);
  });
});
06

Questions

What people ask about it.

How do I keep it live?
Pass the current time as now and update it once a minute from your own clock, for example with a setInterval. The chip, the now line and the hatch all follow it.
Why does Join stay open after the meeting starts?
People join late, so Join is available from the countdown until end. Only when the meeting is over does it turn disabled.
Can I use it for Zoom or Teams?
Yes. Set provider to the service's name and pass its logo as mark. Join and the copy button work the same.
What time format does it expect?
24-hour "HH:MM" strings for start, end, now, from and to, like "10:30".
07

More in Dates

Pickers for single dates and date ranges.

Date pickerA field that opens a calendar, with quick picks and natural language.
Segmented controlSwitch between views of the same thing, with a sliding indicator.
Event calendarA week view where the agent finds a free slot for you.