Skip to content

The Open Standard for Generative UI

9.3 KB
Raw Blame
/* Three agents side by side, each on its own dithered panel tinted from its
   Shiro, with its chat window cropped by the panel's bottom edge. */
.showcase {
  --ls-surface: var(--openui-foreground, #fff);
  --ls-border: var(--openui-border-default, rgba(10, 10, 10, 0.08));
  --ls-text: var(--openui-text-neutral-primary, #0a0a0a);
  --ls-muted: var(--openui-text-neutral-secondary, #6b6b6b);
  --ls-faint: rgba(10, 10, 10, 0.06);
  --ls-rule: rgba(10, 10, 10, 0.14);
  --ls-sand: #f3f0ea;

  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.4vw, 1.25rem);
  color: var(--ls-text);
  font-family: var(--font-inter, inherit);
}

:global([data-theme="dark"]) .showcase {
  --ls-faint: rgba(255, 255, 255, 0.07);
  --ls-rule: rgba(255, 255, 255, 0.18);
  --ls-sand: #2a2722;
}

/* ── The chat window ── */

/* The panel: the accent mixed well down into the page, with a stipple of it
   that fades from the top-right corner, after the stages' Faded Dither. */
.panel {
  --tint: color-mix(in srgb, var(--accent) 9%, #fff);
  --stipple: color-mix(in srgb, var(--accent) 38%, transparent);

  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: 24px;
  background: var(--tint);
  isolation: isolate;
}

:global([data-theme="dark"]) .panel {
  --tint: color-mix(in srgb, var(--accent) 12%, #0e0e0e);
  --stipple: color-mix(in srgb, var(--accent) 45%, transparent);
}

.panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(var(--stipple) 1px, transparent 1.4px);
  background-size: 5px 5px;
  -webkit-mask-image: radial-gradient(120% 90% at 100% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(120% 90% at 100% 0%, #000 0%, transparent 70%);
}

.panelHead {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1.125rem 1.25rem 0.875rem;
}

.mascot {
  flex: none;
  width: 2.75rem;
  height: auto;
}

.panelLabel {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* The chat window, inset from the sides and running off the bottom. */
.window {
  position: relative;
  flex: 1;
  margin: 0 1rem -28px;
  overflow: hidden;
  border: 1px solid var(--ls-border);
  border-radius: 18px;
  background: var(--ls-surface);
  box-shadow: 0 20px 50px -36px rgba(0, 0, 0, 0.35);
}

.recording {
  object-fit: cover;
  object-position: top;
}

.previewBody {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
  padding: 1rem 1rem 0;
}

.prompt {
  /* The user's message sits on the right, as in any chat. */
  align-self: flex-end;
  max-width: 88%;
  margin: 0;
  padding: 0.4375rem 0.875rem;
  border-radius: 999px;
  background: #0a0a0a;
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.35;
}

:global([data-theme="dark"]) .prompt {
  background: #fff;
  color: #0a0a0a;
}


.answer {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.muted {
  margin: 0.25rem 0 0;
  color: var(--ls-muted);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.caption {
  color: var(--ls-muted);
  font-size: 0.75rem;
}

/* The exploded drawing, on the sand panel the reference answer uses. */
.scene {
  overflow: hidden;
  aspect-ratio: 560 / 233;
  border-radius: 14px;
  background: var(--ls-sand);
}

.scene svg {
  display: block;
  width: 100%;
  height: 100%;
}

.shadow {
  fill: rgba(60, 45, 20, 0.07);
}

.part {
  transition:
    transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1),
    opacity 300ms ease;
}

/* Each panel drops into place as its statement arrives. */
.partIn {
  animation: drop 420ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.part polygon {
  stroke: #cdc5b6;
  stroke-width: 0.8;
  stroke-linejoin: round;
}

.faceFront {
  fill: #faf8f4;
}

.faceTop {
  fill: #eee9df;
}

.faceSide {
  fill: #d5ccbc;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--ls-faint);
}

.segmented button {
  padding: 0.25rem 0.75rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ls-muted);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.segmented .segmentOn {
  background: var(--ls-surface);
  color: var(--ls-text);
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.slider {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.sliderHead {
  display: flex;
  justify-content: space-between;
}

.sliderHead span:last-child {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.slider input {
  width: 100%;
  height: 8px;
  margin: 0;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--ls-text) 0 var(--fill),
    var(--ls-faint) var(--fill) 100%
  );
  cursor: pointer;
  appearance: none;
}

.slider input::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--ls-surface);
  border-radius: 999px;
  background: var(--ls-text);
  appearance: none;
}

.slider input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid var(--ls-surface);
  border-radius: 999px;
  background: var(--ls-text);
}

.step {
  padding-top: 0.75rem;
  border-top: 1px dotted var(--ls-rule);
  animation: enter 300ms ease both;
}

.stepTitle {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.stepNav {
  display: flex;
  gap: 0.375rem;
  margin-top: 0.625rem;
}

/* Small hugging pills, no arrows. */
.pill,
.pillGhost {
  padding: 0.25rem 0.75rem;
  border: 1px solid var(--ls-border);
  border-radius: 999px;
  background: transparent;
  color: var(--ls-text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.pillGhost {
  border-color: transparent;
  color: var(--ls-muted);
}

.pill:disabled,
.pillGhost:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Ranked rows on dotted rules: race results, standings, a day's stops. */
.rows {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rows li + li {
  border-top: 1px dotted var(--ls-rule);
}

.row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-size: 0.8125rem;
}

.rowPos {
  width: 1rem;
  color: var(--ls-muted);
  font-variant-numeric: tabular-nums;
}

.teamBar {
  flex: none;
  width: 3px;
  height: 1.125rem;
  border-radius: 999px;
}

.rowMain {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.rowMain strong {
  flex: none;
  font-weight: 600;
}

.rowEnd {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.points {
  display: block;
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ls-faint);
}

.points i {
  display: block;
  height: 100%;
  border-radius: inherit;
  animation: grow 600ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transform-origin: left;
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
}

/* Facts split by dotted rules rather than set in tiles. */
.facts {
  display: flex;
  margin: 0;
}

.facts > div {
  flex: 1;
  padding: 0 1rem;
}

.facts > div:first-child {
  padding-left: 0;
}

.facts > div + div {
  border-left: 1px dotted var(--ls-rule);
}

.facts dt {
  color: var(--ls-muted);
  font-size: 0.6875rem;
}

.facts dd {
  margin: 0.125rem 0 0;
  font-size: 0.8125rem;
  font-weight: 600;
}

.day {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
  animation: enter 300ms ease both;
}

.route {
  display: block;
  width: 100%;
  height: 5.5rem;
  border-radius: 14px;
  background: var(--ls-sand);
}

.routeLine {
  fill: none;
  stroke: var(--ls-text);
  stroke-dasharray: 4 5;
  stroke-width: 1.5;
  opacity: 0.5;
}

.routeDot {
  fill: var(--ls-text);
}

.routeNum {
  fill: var(--ls-surface);
  font-size: 9px;
  font-weight: 600;
  text-anchor: middle;
}

.skeletonRow {
  display: block;
  height: 1.25rem;
  margin: 0.5rem 0;
  border-radius: 6px;
  background: var(--ls-faint);
  animation: pulse 1.2s ease-in-out infinite;
}

/* Placeholders for statements root has named but the stream hasn't reached. */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.skeleton span {
  display: block;
  height: 0.75rem;
  border-radius: 6px;
  background: var(--ls-faint);
  animation: pulse 1.2s ease-in-out infinite;
}

.skeleton span:last-child:not(:first-child) {
  width: 70%;
}

.skeleton .skeletonPicture {
  height: auto;
  aspect-ratio: 560 / 233;
  border-radius: 14px;
}

.enter {
  animation: enter 360ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .enter,
  .step,
  .partIn,
  .part,
  .day,
  .points i,
  .skeletonRow,
  .skeleton span {
    animation: none;
  }
}

/* ── Phones: the panels become a row to swipe through. ── */
@media (max-width: 767px) {
  .showcase {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .showcase::-webkit-scrollbar {
    display: none;
  }

  .panel {
    flex: 0 0 86%;
    scroll-snap-align: center;
  }

}