From 0518c9c92c19fd4a65364339bf808d0567eb4a55 Mon Sep 17 00:00:00 2001 From: Vaica <94612053+zqlit@users.noreply.github.com> Date: Sun, 1 Mar 2026 10:16:28 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E7=81=AF=E7=AE=B1bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/Ying/assets/css/main.css | 17 ++++++++++++++-- .../Ying/assets/js/modules/floating-tools.js | 20 +++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/themes/Ying/assets/css/main.css b/themes/Ying/assets/css/main.css index d193f24a..77355cb1 100644 --- a/themes/Ying/assets/css/main.css +++ b/themes/Ying/assets/css/main.css @@ -1694,7 +1694,7 @@ ul { color: #111827; text-decoration: none; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06); - z-index: 2147483647; /* Ensure it's on top */ + z-index: 900; /* Ensure it's on top */ cursor: pointer; } @@ -3460,7 +3460,7 @@ input[type=submit] { position: fixed; bottom: 30px; right: 15px; - z-index: 2147483647; + z-index: 900; /* Lowered from max-int to be below modals and lightbox */ display: flex; flex-direction: column; gap: 10px; @@ -3471,6 +3471,19 @@ input[type=submit] { /* Ensure visibility stability */ opacity: 1; visibility: visible; + transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease; +} + +.floating-tools.hidden { + opacity: 0 !important; + visibility: hidden !important; + transform: translateZ(0) translateY(20px) !important; + pointer-events: none !important; +} + +/* Override ViewImage z-index to ensure it is above floating tools */ +.view-image { + z-index: 2000 !important; } .floating-tools a { diff --git a/themes/Ying/assets/js/modules/floating-tools.js b/themes/Ying/assets/js/modules/floating-tools.js index dc0f8cee..e7c0d5b7 100644 --- a/themes/Ying/assets/js/modules/floating-tools.js +++ b/themes/Ying/assets/js/modules/floating-tools.js @@ -190,6 +190,26 @@ window.initFloatingTools = function() { } }); } + + // 4. Lightbox Observer (ViewImage) + // Hide floating tools when lightbox is open + if (window.lightboxObserver) { + window.lightboxObserver.disconnect(); + } + + if (container) { + window.lightboxObserver = new MutationObserver(function(mutations) { + var lightbox = document.querySelector('.view-image'); + if (lightbox) { + container.classList.add('hidden'); + } else { + container.classList.remove('hidden'); + } + }); + + window.lightboxObserver.observe(document.body, { childList: true }); + } + } catch (e) { console.error('Error in initFloatingTools:', e); }