From f22df60873b43409043eb77bcaa2bdcc30318899 Mon Sep 17 00:00:00 2001 From: Xin Wang Date: Mon, 1 Jun 2026 09:52:09 +0800 Subject: [PATCH] Update voice demo copy button --- examples/webpage/app.js | 4 ++-- examples/webpage/index.html | 8 +++++++- examples/webpage/styles.css | 27 ++++++++++++++++++++++----- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/examples/webpage/app.js b/examples/webpage/app.js index 24337ec..defd4bd 100644 --- a/examples/webpage/app.js +++ b/examples/webpage/app.js @@ -171,9 +171,9 @@ async function copyChatId() { els.chatId.disabled = true; } - els.copyChatIdBtn.textContent = "Copied"; + els.copyChatIdBtn.classList.add("copied"); window.setTimeout(() => { - els.copyChatIdBtn.textContent = "Copy"; + els.copyChatIdBtn.classList.remove("copied"); }, 1200); } diff --git a/examples/webpage/index.html b/examples/webpage/index.html index 5364977..677f03a 100644 --- a/examples/webpage/index.html +++ b/examples/webpage/index.html @@ -43,7 +43,13 @@ title="Copy Chat ID" aria-label="Copy Chat ID" > - Copy + + diff --git a/examples/webpage/styles.css b/examples/webpage/styles.css index b0312e6..11abd69 100644 --- a/examples/webpage/styles.css +++ b/examples/webpage/styles.css @@ -351,25 +351,42 @@ body { .chat-id-control__copy { flex: 0 0 auto; + display: flex; + align-items: center; + justify-content: center; + width: 34px; border: 1px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0; background: var(--bg-soft); color: var(--text-dim); - padding: 0 10px; - font: inherit; - font-size: 12px; + padding: 0; cursor: pointer; + transition: color 0.15s, border-color 0.15s, background 0.15s; } .chat-id-control__copy:disabled { - opacity: 0.55; + opacity: 0.45; cursor: not-allowed; } .chat-id-control__copy:not(:disabled):hover { - color: var(--text); + color: var(--accent-strong); border-color: var(--accent); + background: rgba(79, 140, 255, 0.08); +} + +.chat-id-control__copy .copy-icon--check { + display: none; + color: var(--success); +} + +.chat-id-control__copy.copied .copy-icon--default { + display: none; +} + +.chat-id-control__copy.copied .copy-icon--check { + display: block; } .status {