Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

2.1 KB
Raw Blame
// A light sweep across in-progress text (the "光影" / shimmer effect). The base
// is the muted secondary color and a brighter band slides across, signalling
// "this step is still running" without the layout cost of a spinner.
// One full gradient width (background-size is 200%) so the loop is seamless.
@keyframes chatStreamShimmer {
  0% {
    background-position: 100% 50%;
  }

  100% {
    background-position: -100% 50%;
  }
}

.chat-stream-shimmer-text() {
  // Stronger contrast: a dim placeholder base with a bright primary glint, so
  // the sweeping band reads clearly rather than as a subtle shift.
  background-image: linear-gradient(100deg,
      var(--td-text-color-placeholder) 0%,
      var(--td-text-color-placeholder) 36%,
      var(--td-text-color-primary) 50%,
      var(--td-text-color-placeholder) 64%,
      var(--td-text-color-placeholder) 100%);
  background-size: 200% 100%;
  // Let the gradient tile (default repeat): the dim stops on both ends match,
  // so the element is always fully painted and the band sweeps seamlessly.
  // (no-repeat would leave the uncovered area transparent -> invisible text.)
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: chatStreamShimmer 1.5s linear infinite;
  // Keep the sweep on its own compositor layer so it stays smooth while the
  // surrounding timeline relayouts on each streamed token.
  will-change: background-position;
}

// In-progress step / thinking / tool-call titles shimmer while pending. Both the
// agent timeline (.action-pending) and the RAG pipeline (.is-running) opt in.
.action-card.action-pending .action-name,
.action-name.is-running,
.sandbox-command-code.is-running {
  .chat-stream-shimmer-text();
}

@media (prefers-reduced-motion: reduce) {

  .action-card.action-pending .action-name,
  .action-name.is-running,
  .sandbox-command-code.is-running {
    animation: none;
    background-image: none;
    -webkit-text-fill-color: var(--agent-step-color, var(--td-text-color-secondary));
    color: var(--agent-step-color, var(--td-text-color-secondary));
  }
}