{
  "format": "css.observer/playground@1",
  "id": "dedc2063-6acf-5140-a897-6a0ed3eb33e4",
  "url": "https://css.observer/s/deploy-pipeline",
  "title": "Deploy pipeline",
  "description": "Stages light up along the wire. Replay flips success and failure.",
  "category": "loaders",
  "tags": [
    "ci",
    "micro-interaction"
  ],
  "visibility": "public",
  "status": "published",
  "revision": 1,
  "author": "mighil",
  "forked_from": null,
  "created_at": "2026-12-02T12:47:29.000Z",
  "updated_at": "2026-12-02T12:47:29.000Z",
  "published_at": "2026-12-02T12:47:29.000Z",
  "source": {
    "html": "<div class=\"deploy\" id=\"deploy\" data-step=\"0\">\n        <div class=\"deploy-steps\">\n          <div class=\"deploy-node\" data-dn=\"0\"><i></i>Queued</div>\n          <div class=\"deploy-wire\"><b></b></div>\n          <div class=\"deploy-node\" data-dn=\"1\"><i></i>Build</div>\n          <div class=\"deploy-wire\"><b></b></div>\n          <div class=\"deploy-node\" data-dn=\"2\"><i></i>Live</div>\n        </div>\n        <div class=\"deploy-label\" id=\"deploy-label\">Waiting to start…</div>\n      </div>\n",
    "css": "/* Auto light / dark — follows prefers-color-scheme */\n:root{\n  color-scheme: light dark;\n  --text-color: hsl(0, 0%, 18%);\n  --heading-color: hsl(0, 0%, 18%);\n  --background-color: hsl(0, 0%, 99%);\n  --bg-color: hsl(0, 0%, 99%);\n  --link-color: hsl(0, 0%, 18%);\n  --visited-color: hsl(0, 0%, 18%);\n  --blockquote-color: hsl(0, 0%, 18%);\n  --code-bg-color: hsl(0, 0%, 95%);\n  --code-color: hsl(0, 0%, 18%);\n  --sub-color: hsl(0, 0%, 29%);\n}\n@media (prefers-color-scheme: dark){\n:root{\n  --text-color: hsla(0, 0%, 93%, 1);\n  --heading-color: hsla(0, 0%, 93%, 1);\n  --background-color: hsla(0, 0%, 0%, 1);\n  --bg-color: hsla(0, 0%, 0%, 1);\n  --link-color: hsla(0, 0%, 93%, 1);\n  --visited-color: hsla(0, 0%, 93%, 0.85);\n  --blockquote-color: hsla(0, 0%, 93%, 1);\n  --code-bg-color: hsla(0, 0%, 8%, 1);\n  --code-color: limegreen;\n  --sub-color: hsla(0, 0%, 93%, 0.78);\n}\n}\n\n/* Preview layout */\nbody {\n  margin: 0;\n  min-height: 100vh;\n  display: grid;\n  place-items: center;\n  padding: 24px;\n  box-sizing: border-box;\n  background: var(--background-color);\n  color: var(--text-color);\n  font: 15px/1.5 system-ui, -apple-system, \"Segoe UI\", sans-serif;\n}\n\n@keyframes deploy-fill{\n  from{transform:scaleX(0)}\n  to{transform:scaleX(1)}\n}\n\n.deploy{\n  width:min(100%,340px);display:flex;flex-direction:column;gap:12px;\n}\n\n.deploy-steps{display:flex;align-items:center;gap:0;width:100%}\n\n.deploy-node{\n  display:flex;flex-direction:column;align-items:center;gap:6px;flex:0 0 auto;width:56px;\n  font-size:.68rem;color:color-mix(in srgb,var(--text-color) 45%,transparent);\n  transition:color .15s linear;\n}\n\n.deploy-node i{\n  width:12px;height:12px;border-radius:50%;display:block;\n  border:1.5px solid color-mix(in srgb,var(--text-color) 22%,transparent);\n  background:transparent;box-sizing:border-box;\n  transition:background .12s linear,border-color .12s linear,transform .18s ease-out;\n}\n\n.deploy-wire{\n  flex:1;height:1.5px;background:color-mix(in srgb,var(--text-color) 12%,transparent);position:relative;overflow:hidden;margin-bottom:18px;\n}\n\n.deploy-wire > b{\n  position:absolute;inset:0;width:100%;transform:scaleX(0);transform-origin:left;\n  background:color-mix(in srgb,var(--text-color) 45%,transparent);\n}\n\n.deploy-node.is-done,.deploy-node.is-live{color:inherit}\n\n.deploy-node.is-done i,.deploy-node.is-live i{\n  background:color-mix(in srgb,var(--text-color) 55%,transparent);\n  border-color:transparent;transform:scale(1);\n}\n\n.deploy-node[data-dn=\"1\"].is-done{\n  color:color-mix(in srgb,#c90 80%,var(--text-color));\n}\n\n.deploy-node[data-dn=\"1\"].is-done i{background:#c90;border-color:transparent}\n\n.deploy-node.is-live{color:color-mix(in srgb,#2a8 80%,var(--text-color))}\n\n.deploy-node.is-live i{background:color-mix(in srgb,#2a8 75%,transparent)}\n\n.deploy-node.is-fail{\n  color:color-mix(in srgb,#c44 85%,var(--text-color));\n}\n\n.deploy-node.is-fail i{\n  background:#c44;border-color:transparent;\n}\n\n.deploy-node.is-busy i{\n  border-color:color-mix(in srgb,var(--text-color) 50%,transparent);\n}\n\n.deploy[data-step=\"1\"] .deploy-wire:nth-child(2) > b{\n  background:#c90;\n  animation:deploy-fill 1.6s linear forwards;\n}\n\n.deploy[data-step=\"2\"] .deploy-wire:nth-child(2) > b,\n.deploy[data-step=\"3\"] .deploy-wire:nth-child(2) > b{transform:scaleX(1);background:#c90}\n\n.deploy[data-step=\"2\"] .deploy-wire:nth-child(4) > b{\n  background:color-mix(in srgb,#2a8 85%,transparent);\n  animation:deploy-fill .9s linear forwards;\n}\n\n.deploy[data-step=\"3\"] .deploy-wire:nth-child(4) > b{\n  transform:scaleX(1);\n  background:color-mix(in srgb,#2a8 85%,transparent);\n}\n\n.deploy[data-step=\"fail\"] .deploy-wire:nth-child(2) > b{\n  transform:scaleX(1);background:#c44;animation:none;\n}\n\n.deploy-label{\n  font-size:.82rem;font-weight:500;min-height:1.2em;\n  transition:opacity .12s linear;\n}\n\n.deploy-label.is-tick{opacity:.35}\n\n@media (prefers-reduced-motion: reduce){\n  .grow-link::after,.wipe,.wipe .b,.shuffle .card,.odo-digit > b,.flap-reel,.step-node,.step-line > i,\n  .switch,.switch::after,.copy-btn .c-idle,.copy-btn .c-done,.field label,.tip-bubble,.chip,.like-btn svg,\n  .disc-btn svg,.disc-panel,.snack,.save-btn,.ux-box,.seg-pill,.soft-tabs-ink,.list-actions,.success-banner,.search-clear,.pin-btn svg,.submit-ring rect,\n  .hold-btn .hold-fill,.toast,.menu-btn .menu-line,.stars button,.conn,.retry-btn,.sort-item,.mute-btn .wave,.mute-btn .x-line,.wizard-dots span,.cart-badge,.range-bubble,\n  .filter-list li,.upload-bar > i,.quota-track > i,.quota-tip,.splitbtn-toggle svg,.splitbtn-menu,.presence-dot,\n  .draft-banner,.tag-chip,.empty-state,.empty-item,.deadline,.deadline-clock,.deadline-track > i,.edge-fade-mask,.dirty-bar,.seen-ticks path,.nudge-field,.stack-card,\n  .blur-line,.xface span,.magnet-chip,.confirm-btn,.confirm-btn span,.offline-banner,.sort-flip-btn svg,.sort-flip-list li,.react-fan,.react-fan button,.sticky-cta,\n  .pw-toggle .pw-eye,.pw-toggle .pw-slash,.otp input,.exp-search,.exp-search input,.ok-field input,.ok-field .ok-check,.unread-dot,.unread-check,.unread-row,.sync-label,.sync-btn .sync-arrows,.sync-btn .sync-check,\n  .inline-edit .ie-title,.inline-edit .ie-rename,.inline-edit .ie-panel,.inline-edit .ie-input,.inline-edit .ie-bar,\n  .ghost-wrap .ghost-hint,.ghost-wrap .ghost-key,.cmd-palette,.cmd-palette li,.cmd-stage::before,.crumb-mid,.crumb-more,.diff-add,.diff-add > .diff-add-inner,.slot > i,.zoom-thumb,.zoom-full,.zoom-caption,\n  .bulk-bar,.bulk-check svg,.bulk-row,.env-switch .env-ink,.env-switch button,.invite-btn .invite-idle,.invite-btn .invite-done,.flag-row,.flag-sw,.flag-sw::after,.deploy-node,.deploy-node i,.deploy-wire > b,.ws-ink,.ws-item .ws-check,.thread,.thread-body,.thread-resolve svg,\n  .unfurl-card,.unfurl-thumb,.seat,.form-prog-bar > i,.form-prog-field,.form-prog-field svg,.mention b,.glyph-tile path,.glyph-tile line,.glyph-tile circle{transition:none!important}\n\n  .deploy[data-step=\"1\"] .deploy-wire:nth-child(2) > b,\n  .deploy[data-step=\"2\"] .deploy-wire:nth-child(2) > b,\n  .deploy[data-step=\"3\"] .deploy-wire:nth-child(2) > b,\n  .deploy[data-step=\"fail\"] .deploy-wire:nth-child(2) > b,\n  .deploy[data-step=\"2\"] .deploy-wire:nth-child(4) > b,\n  .deploy[data-step=\"3\"] .deploy-wire:nth-child(4) > b{transform:scaleX(1);animation:none}\n\n  .deploy-label.is-tick{opacity:1}\n}\n",
    "js": "// Deploy pipeline\n  const deploy = document.getElementById('deploy');\n  const deployLabel = document.getElementById('deploy-label');\n  let deployTimers = [];\n  let deployFailNext = false; // first run succeeds; Replay alternates\n  function clearDeployTimers() {\n    deployTimers.forEach(clearTimeout);\n    deployTimers = [];\n  }\n  function tickDeployLabel(text) {\n    if (!deployLabel) return;\n    if (reduce) {\n      deployLabel.textContent = text;\n      return;\n    }\n    deployLabel.classList.add('is-tick');\n    deployTimers.push(setTimeout(() => {\n      deployLabel.textContent = text;\n      deployLabel.classList.remove('is-tick');\n    }, 90));\n  }\n  function setDeployStep(step) {\n    if (!deploy) return;\n    deploy.setAttribute('data-step', String(step));\n    deploy.querySelectorAll('.deploy-node').forEach((node) => {\n      const i = Number(node.getAttribute('data-dn'));\n      node.classList.remove('is-done', 'is-busy', 'is-live', 'is-fail');\n      if (step === 'fail') {\n        if (i === 0) node.classList.add('is-done');\n        else if (i === 1) node.classList.add('is-fail');\n        return;\n      }\n      const n = Number(step);\n      if (n >= 3) {\n        if (i === 2) node.classList.add('is-live');\n        else node.classList.add('is-done');\n      } else if (i < n) {\n        node.classList.add('is-done');\n      } else if (i === n) {\n        node.classList.add('is-busy');\n      }\n    });\n    if (step === 'fail') tickDeployLabel('Build failed');\n    else if (step === 0 || step === '0') tickDeployLabel('Queued…');\n    else if (step === 1 || step === '1') tickDeployLabel('Building image…');\n    else if (step === 2 || step === '2') tickDeployLabel('Deploying…');\n    else tickDeployLabel('Live on production');\n  }\n  function runDeploy() {\n    if (!deploy) return;\n    const willFail = deployFailNext;\n    deployFailNext = !deployFailNext;\n    clearDeployTimers();\n    deploy.removeAttribute('data-step');\n    deploy.querySelectorAll('.deploy-node').forEach((node) => {\n      node.classList.remove('is-done', 'is-busy', 'is-live', 'is-fail');\n    });\n    deploy.querySelectorAll('.deploy-wire > b').forEach((bar) => {\n      bar.style.animation = 'none';\n      void bar.offsetWidth;\n      bar.style.animation = '';\n    });\n    if (deployLabel) deployLabel.classList.remove('is-tick');\n    setDeployStep(0);\n    if (reduce) {\n      setDeployStep(willFail ? 'fail' : 3);\n      return;\n    }\n    deployTimers.push(setTimeout(() => setDeployStep(1), 700));\n    if (willFail) {\n      // queue → build crawl → fail at Build\n      deployTimers.push(setTimeout(() => setDeployStep('fail'), 700 + 1700));\n      return;\n    }\n    // queue → build → ship → live\n    deployTimers.push(setTimeout(() => setDeployStep(2), 700 + 1700));\n    deployTimers.push(setTimeout(() => setDeployStep(3), 700 + 1700 + 950));\n  }\n  runDeploy();\n\ndocument.querySelectorAll('[data-act]').forEach((btn) => {\n    btn.addEventListener('click', (e) => {\n      e.stopPropagation();\n      const act = btn.getAttribute('data-act');\n      if (act === 'deploy') runDeploy();\n    });\n  });"
  }
}