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); }