From 0f8905b6f5c3d37d5da1ced59bb65159801fb2e0 Mon Sep 17 00:00:00 2001 From: QIU SHENGMING Date: Sun, 28 Sep 2025 12:57:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E5=A4=8D=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E6=8C=89=E9=92=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/main.css | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/src/styles/main.css b/src/styles/main.css index 82c6f29..aa84fd2 100644 --- a/src/styles/main.css +++ b/src/styles/main.css @@ -140,3 +140,68 @@ .collapsed { height: var(--collapsedHeight); } + +.copy-btn { + position: absolute; + top: 0.5rem; + right: 0.5rem; + opacity: 0; + transition: opacity 0.2s ease; + background: var(--btn-regular-bg); + border: none; + border-radius: 0.5rem; + padding: 0.5rem; + cursor: pointer; + z-index: 10; + display: flex; + align-items: center; + justify-content: center; +} + +.copy-btn:hover { + background: var(--btn-regular-bg-hover); +} + +.copy-btn:active { + background: var(--btn-regular-bg-active); + transform: scale(0.95); +} + +.copy-btn-icon { + width: 1rem; + height: 1rem; + position: relative; +} + +.copy-btn-icon svg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + fill: var(--btn-content); + transition: opacity 0.2s ease; +} + +.copy-icon { + opacity: 1; +} + +.success-icon { + opacity: 0; + fill: var(--primary); +} + +/* 成功状态 */ +.copy-btn.success .copy-icon { + opacity: 0; +} + +.copy-btn.success .success-icon { + opacity: 1; +} + +/* 确保在 hover 时显示 */ +.frame:hover .copy-btn { + opacity: 1; +} \ No newline at end of file