From feca67635c6e21c4b4b2f0f4df2b2ae6f5e6cfee Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Fri, 6 Jun 2025 04:57:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Firefox=20=E4=B8=AD?= =?UTF-8?q?=E7=BF=BB=E8=BD=AC=E5=8D=A1=E7=89=87=E6=8C=89=E9=92=AE=E7=9A=84?= =?UTF-8?q?=E5=8F=AF=E8=A7=81=E6=80=A7=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/css/body.css | 13 +++++++++++++ client/js/ui.js | 10 ++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/client/css/body.css b/client/css/body.css index ec80024..d094d8b 100644 --- a/client/css/body.css +++ b/client/css/body.css @@ -63,6 +63,19 @@ body { z-index: 10; } +/* Firefox兼容性修复:控制翻转时按钮的可见性 */ +.flip-card-inner.flipped .flip-card-front .help-btn { + visibility: hidden; + opacity: 0; + pointer-events: none; +} + +.flip-card-inner:not(.flipped) .flip-card-back .help-btn { + visibility: hidden; + opacity: 0; + pointer-events: none; +} + .help-btn:hover { background: #30a8f7; border-color: #30a8f7; diff --git a/client/js/ui.js b/client/js/ui.js index f02caf8..50b050c 100644 --- a/client/js/ui.js +++ b/client/js/ui.js @@ -598,13 +598,19 @@ export function initFlipCard() { // 当前旋转角度 / Current rotation angle let currentRotation = 0; - - // 执行翻转操作 / Execute flip operation + // 执行翻转操作 / Execute flip operation function performFlip() { currentRotation += 180; const flipCardInner = flipCard.querySelector('.flip-card-inner'); if (flipCardInner) { flipCardInner.style.transform = `rotateX(${currentRotation}deg)`; + + // 添加或移除flipped类来控制按钮可见性(Firefox兼容性修复) + if (currentRotation % 360 === 180 || currentRotation % 360 === -180) { + flipCardInner.classList.add('flipped'); + } else { + flipCardInner.classList.remove('flipped'); + } } }