fix(docs): ensure capture indicator colors apply instantly

Disable indicator transitions and cancel active animations before
setting data-state so pending yellow is not stuck on the prior ok green.

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
Yang Jun
2026-06-23 14:10:22 +08:00
co-authored by Cursor
parent 2a0d0cdd0b
commit b2777fd834
+4 -1
View File
@@ -72,6 +72,7 @@ async function prepareCapture (page, { fullTemplate, fullContext }) {
#playground .capture-json .json-string { color: #cf222e; }
#playground .pane-indicator {
animation: none;
transition: none;
transform: none;
box-shadow: none;
opacity: 1;
@@ -122,7 +123,9 @@ async function prepareCapture (page, { fullTemplate, fullContext }) {
function setIndicator (area, state) {
const el = document.querySelector(area + ' .pane-indicator')
if (el) el.dataset.state = state
if (!el) return
el.getAnimations().forEach((a) => a.cancel())
el.dataset.state = state
}
document.querySelector('#playground .playground-hero')?.remove()