Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

12.5 KB
Raw Blame
/* Conversation stream (reply header, working strip, decision cards, action row, results).
   Everything here moves with transform and opacity only, lasts 120-200 ms, and is off under
   prefers-reduced-motion. The --kws-* variables alias Pixel's --kw-* tokens (modern.css). */
:root {
  --kws-accent: theme('colors.sky.400');
  --kws-accent-soft: rgb(122 98 240 / 0.16);
  --kws-ok: var(--kw-ok);
  --kws-warn: var(--kw-warn);
  --kws-hairline: var(--kw-hairline-strong);
  --kws-raised: var(--kw-surface-raised);
  --kws-shadow: theme('boxShadow.raised');
}

/* New replies fade and slide in. */
@keyframes kws-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.kws-in { animation: kws-in 180ms ease-out both; }

/* The working strip rises into place above the composer. */
@keyframes kws-strip-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.kws-strip { animation: kws-strip-in 160ms ease-out both; }

/* Skeleton lines while a reply has no words yet (opacity only). */
@keyframes kws-skel {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}
.kws-skel {
  height: 0.7rem;
  border-radius: 9999px;
  background: theme('colors.zinc.700');
  animation: kws-skel 1.3s ease-in-out infinite;
}

/* A small burst on "Mark verified": a ring and six dots, 200 ms. */
.kws-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}
.kws-burst-ring {
  position: absolute;
  left: -11px;
  top: -11px;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 2px solid theme('colors.teal.300');
  animation: kws-burst-ring 200ms ease-out both;
}
.kws-burst-dot {
  position: absolute;
  left: -2px;
  top: -2px;
  width: 4px;
  height: 4px;
  border-radius: 9999px;
  background: theme('colors.teal.300');
  animation: kws-burst-dot 200ms ease-out both;
}
@keyframes kws-burst-ring {
  from { opacity: 0.9; transform: scale(0.3); }
  to { opacity: 0; transform: scale(1.7); }
}
@keyframes kws-burst-dot {
  from { opacity: 1; transform: rotate(var(--kws-a)) translateY(-6px) scale(1); }
  to { opacity: 0; transform: rotate(var(--kws-a)) translateY(-17px) scale(0.4); }
}

@media (prefers-reduced-motion: reduce) {
  .kws-in,
  .kws-strip,
  .kws-skel,
  .kws-burst-ring,
  .kws-burst-dot {
    animation: none;
  }
  .kws-skel { opacity: 0.55; }
  .kws-burst { display: none; }
}

/* ---- Earned moments (the sticker itself is Pixel's .kw-sticker). ---- */
/* Presses in once when it appears: transform and opacity, 160 ms. */
.kws-stamp {
  animation: kws-stamp 160ms ease-out both;
}
@keyframes kws-stamp {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

/* Laya hand-off: the answering bot's avatar rises into the reply header. */
.kws-handoff {
  animation: kws-handoff 200ms ease-out both;
}
@keyframes kws-handoff {
  from { opacity: 0; transform: translateY(28px) scale(0.85); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .kws-stamp,
  .kws-handoff {
    animation: none;
  }
}

/* ---- Chips (spec §4): 20 px tall, 0 8 px, full radius, 500 12/16, 12 px icon, gap 4 px. Information, never holo. ---- */
.kws-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
}
.kws-chip:focus-visible { outline: 2px solid #b8adff; outline-offset: 2px; }
.kws-chip-engine { background: #231d4b; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.07); color: #d9d6f0; }
.kws-chip-failover { background: #2b2360; box-shadow: inset 0 0 0 1px #46379a; color: #e8e4ff; }
.kws-chip-learned { background: #231d4b; color: #d3ccff; }

/* A styled tooltip from data-tip, on hover and keyboard focus (spec §4). The aria-label carries the same words. */
.kws-tip { position: relative; }
.kws-tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  width: max-content;
  max-width: min(280px, 80vw);
  padding: 4px 8px;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 8px;
  background: #2c2552;
  color: #ecebfa;
  font-size: 12px;
  line-height: 16px;
  font-weight: 400;
  white-space: normal;
  pointer-events: none;
  /* Out of layout until shown, so a hidden tip never widens the page at 390 px. */
  display: none;
  transition: opacity 120ms var(--kw-ease), transform 120ms var(--kw-ease);
}
.kws-tip:hover::after,
.kws-tip:focus-visible::after { display: block; opacity: 1; transform: translateY(0); }
@starting-style {
  .kws-tip:hover::after,
  .kws-tip:focus-visible::after { opacity: 0; transform: translateY(-2px); }
}

/* ---- Goal heartbeat (spec §3) ---- */
.kws-heartbeat { container-type: inline-size; display: block; min-width: 0; }
.kws-heartbeat-full,
.kws-heartbeat-tight { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.kws-heartbeat-tight { display: none; }
.kws-beats { display: inline-flex; align-items: center; gap: 3px; }
.kws-beat { width: 6px; height: 6px; border-radius: 1px; flex: none; }
.kws-beat-ok { background: #5eead4; }
.kws-beat-fixing { background: #fcd34d; }
.kws-beat-failing { background: #fb7185; }
.kws-beat-unknown { box-shadow: inset 0 0 0 1.5px #8f88bb; }
.kws-beat-newest { outline: 1px solid rgb(255 255 255 / 0.55); outline-offset: 1px; }
.kws-beat-count { font-size: 12px; line-height: 16px; color: #d9d6f0; font-variant-numeric: tabular-nums; }
.kws-beat-word { font-size: 12px; line-height: 16px; font-weight: 600; }
/* Phones: the last 5 squares and the word. */
@media (max-width: 639px) {
  .kws-beat-desk,
  .kws-beat-count-desk { display: none; }
}
/* Under 64 px free, or under 360 px wide: only the newest square and "1/5 ok". */
@container (max-width: 63px) {
  .kws-heartbeat-full { display: none; }
  .kws-heartbeat-tight { display: inline-flex; }
}
@media (max-width: 359px) {
  .kws-heartbeat-full { display: none; }
  .kws-heartbeat-tight { display: inline-flex; }
}

@media (prefers-reduced-motion: reduce) {
  .kws-tip::after { transition: none; transform: none; }
}

/* Recipe card (0.7.6): a step's badge pops once when it becomes done. Applied with motion-safe only. */
@keyframes kw-step-done { from { transform: scale(.7); opacity: .4; } to { transform: scale(1); opacity: 1; } }

/* P4 image viewer: a 150 ms fade from 98% scale (Mira); nothing moves under reduced motion. */
@keyframes kw-viewer-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: none; }
}
.kw-viewer-in { animation: kw-viewer-in 150ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .kw-viewer-in { animation: none; }
}

/* The bot at work (Mira, autonomy/working-avatar/design.md). Transform and opacity only; one inline SVG; no JS
   timers. The resting state of every element IS the reduced-motion still frame: lines full, paw down, spark hidden. */
:root {
  --kw-wa-ground: #261d4a;
  --kw-wa-lid: #4a3f8a;
  --kw-wa-rim: #6d5fc0;
  --kw-wa-screen: #0d0a1f;
  --kw-wa-type: #b8adff;
  --kw-wa-deck: #5a5383;
  --kw-wa-key: #8d87b8;
  --kw-wa-edge: #3f3868;
  --kw-wa-spark: #e1d6ff;
  --kw-wa-spark-core: #ffffff;
  --kw-wa-text: #9a94c4;
  --kw-wa-name: #ecebfa;
}
/* Light values, for when the app gets a light theme (it is dark only today). */
[data-theme="light"] {
  --kw-wa-ground: #e3e0f5;
  --kw-wa-rim: #6d5fc0;
  --kw-wa-screen: #15112e;
  --kw-wa-deck: #bcb7de;
  --kw-wa-key: #8d87b8;
  --kw-wa-edge: #9a94c4;
  --kw-wa-spark: #9d8fff;
  --kw-wa-spark-core: #6c58e0;
  --kw-wa-text: #5a5383;
  --kw-wa-name: #1d1840;
}

/* The bubble body keeps this height while the reply is live, so the first words land without a jump. */
.kw-wa-hold { min-height: 62px; }

.kw-wa {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 62px;
  animation: kw-wa-in 150ms var(--kw-ease, cubic-bezier(0.2, 0.7, 0.2, 1)) both;
}
.kw-wa[hidden] { display: none; }
.kw-wa-scene { flex: none; display: block; width: 108px; height: 54px; shape-rendering: crispEdges; image-rendering: pixelated; }
.kw-wa-text {
  margin: 0;
  min-width: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--kw-wa-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kw-wa-name { color: var(--kw-wa-name); font-weight: 500; }
/* 16b: an audit turn says whose work it double-checks. The line wraps (it is a sentence, not a name),
   so the scene grows past 62 px instead of cutting it off, and "Open the task" sits under it. */
.kw-wa[data-audit] { height: auto; min-height: 62px; }
.kw-wa-audit { white-space: normal; overflow: visible; }
.kw-wa-audit p { margin: 0; overflow-wrap: anywhere; }
.kw-wa-open {
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #b8adff;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  border-radius: 4px;
}
.kw-wa-open:hover { color: #d6d0ff; }
.kw-wa-open:focus-visible { outline: 2px solid #b8adff; outline-offset: 2px; }
[data-theme="light"] .kw-wa-open { color: #5b4bc4; }
.kw-wa-dots { display: inline-block; width: 1.1em; }

/* The first words fade in over the place the scene held. */
@keyframes kw-wa-in { from { opacity: 0; } to { opacity: 1; } }
.kw-wa-in { animation: kw-wa-in 150ms var(--kw-ease, cubic-bezier(0.2, 0.7, 0.2, 1)) both; }

/* 1. The bot bobs 1 px (a third of a cell) twice per 2.4 s loop. */
@keyframes kw-wa-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-0.3333px); } }
.kw-wa-bob { animation: kw-wa-bob 1.2s ease-in-out infinite; }

/* 2. The screen types three lines left to right, one cell per step, holds, then clears. */
.kw-wa-l { transform-box: fill-box; transform-origin: left center; }
@keyframes kw-wa-l1 {
  0% { transform: scaleX(0); opacity: 1; }
  6% { transform: scaleX(0); animation-timing-function: steps(11, end); }
  28% { transform: scaleX(1); }
  88% { transform: scaleX(1); opacity: 1; animation-timing-function: step-end; }
  89%, 100% { transform: scaleX(1); opacity: 0; }
}
@keyframes kw-wa-l2 {
  0% { transform: scaleX(0); opacity: 1; }
  33% { transform: scaleX(0); animation-timing-function: steps(9, end); }
  49% { transform: scaleX(1); }
  88% { transform: scaleX(1); opacity: 1; animation-timing-function: step-end; }
  89%, 100% { transform: scaleX(1); opacity: 0; }
}
@keyframes kw-wa-l3 {
  0% { transform: scaleX(0); opacity: 1; }
  54% { transform: scaleX(0); animation-timing-function: steps(6, end); }
  64% { transform: scaleX(1); }
  88% { transform: scaleX(1); opacity: 1; animation-timing-function: step-end; }
  89%, 100% { transform: scaleX(1); opacity: 0; }
}
.kw-wa-l1 { animation: kw-wa-l1 2.4s linear infinite; }
.kw-wa-l2 { animation: kw-wa-l2 2.4s linear infinite; }
.kw-wa-l3 { animation: kw-wa-l3 2.4s linear infinite; }

/* 3. The paw taps a key (up one cell) while a line types, and rests while the screen holds. */
@keyframes kw-wa-paw {
  0% { transform: translateY(0); }
  8% { transform: translateY(-1px); } 11% { transform: translateY(0); }
  14% { transform: translateY(-1px); } 17% { transform: translateY(0); }
  20% { transform: translateY(-1px); } 23% { transform: translateY(0); }
  25% { transform: translateY(-1px); } 28% { transform: translateY(0); }
  35% { transform: translateY(-1px); } 38% { transform: translateY(0); }
  42% { transform: translateY(-1px); } 45% { transform: translateY(0); }
  56% { transform: translateY(-1px); } 59% { transform: translateY(0); }
  61% { transform: translateY(-1px); } 63%, 100% { transform: translateY(0); }
}
.kw-wa-paw { animation: kw-wa-paw 2.4s step-end infinite; }

/* 4. A spark pops above its head when line 3 is done, every third loop (7.2 s): centre, then the plus
      at +60 ms, the tips at +120 ms, held, then a 160 ms fade. Hidden at rest. */
.kw-wa-spark rect { opacity: 0; }
@keyframes kw-wa-s1 { 0%, 21.4% { opacity: 0; } 21.41%, 29.6% { opacity: 1; } 31.8%, 100% { opacity: 0; } }
@keyframes kw-wa-s2 { 0%, 22.23% { opacity: 0; } 22.24%, 29.6% { opacity: 1; } 31.8%, 100% { opacity: 0; } }
@keyframes kw-wa-s3 { 0%, 23.06% { opacity: 0; } 23.07%, 29.6% { opacity: 1; } 31.8%, 100% { opacity: 0; } }
.kw-wa-s1 { animation: kw-wa-s1 7.2s linear infinite; }
.kw-wa-s2 { animation: kw-wa-s2 7.2s linear infinite; }
.kw-wa-s3 { animation: kw-wa-s3 7.2s linear infinite; }

/* Reduced motion: the resting frame. Lines full, paw down, no spark, no bob, dots still ("…"). */
@media (prefers-reduced-motion: reduce) {
  .kw-wa, .kw-wa-in, .kw-wa-scene *, .kw-wa-dots > * { animation: none !important; }
  .kw-wa-dots > * { opacity: 0.8; }
}