fixed 修复首页闪烁的bug
This commit is contained in:
1 parent
f658dcc767
commit
8b7f9e7ebf
3 files changed
+24
-1
No files matched your search
@@ -3467,6 +3467,9 @@ input[type=submit] {
|
|||||||
/* GPU Acceleration for container */
|
/* GPU Acceleration for container */
|
||||||
transform: translateZ(0);
|
transform: translateZ(0);
|
||||||
will-change: transform;
|
will-change: transform;
|
||||||
|
/* Ensure visibility stability */
|
||||||
|
opacity: 1;
|
||||||
|
visibility: visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
.floating-tools a {
|
.floating-tools a {
|
||||||
@@ -3532,6 +3535,7 @@ input[type=submit] {
|
|||||||
will-change: opacity, transform, height;
|
will-change: opacity, transform, height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ensure consistent display state when active */
|
||||||
#back-to-top.show {
|
#back-to-top.show {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
@@ -3541,6 +3545,7 @@ input[type=submit] {
|
|||||||
transform: translate3d(0, 0, 0) scale(1);
|
transform: translate3d(0, 0, 0) scale(1);
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
|
display: flex; /* Force flex display to keep icon centered */
|
||||||
}
|
}
|
||||||
|
|
||||||
#back-to-top.show:hover {
|
#back-to-top.show:hover {
|
||||||
|
|||||||
@@ -160,7 +160,10 @@ window.initFloatingTools = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Initial check
|
// Initial check
|
||||||
|
// Use setTimeout to avoid initial render flickering
|
||||||
|
setTimeout(function() {
|
||||||
checkCommentVisibility(toComments);
|
checkCommentVisibility(toComments);
|
||||||
|
}, 100);
|
||||||
|
|
||||||
var newToComments = toComments.cloneNode(true);
|
var newToComments = toComments.cloneNode(true);
|
||||||
if (toComments.parentNode) {
|
if (toComments.parentNode) {
|
||||||
|
|||||||
@@ -35,15 +35,30 @@ window.showToast = function(text, type) {
|
|||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
transition: opacity 0.3s;
|
transition: opacity 0.3s, background-color 0.3s;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
// Add dark mode support class
|
||||||
|
toast.setAttribute('data-toast', 'true');
|
||||||
document.body.appendChild(toast);
|
document.body.appendChild(toast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Update toast style based on theme
|
||||||
|
const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
||||||
|
if (isDark) {
|
||||||
|
toast.style.background = 'rgba(255, 255, 255, 0.9)';
|
||||||
|
toast.style.color = '#333';
|
||||||
|
toast.style.boxShadow = '0 4px 12px rgba(0,0,0,0.3)';
|
||||||
|
} else {
|
||||||
|
toast.style.background = 'rgba(0,0,0,0.8)';
|
||||||
|
toast.style.color = 'white';
|
||||||
|
toast.style.boxShadow = '0 4px 12px rgba(0,0,0,0.1)';
|
||||||
|
}
|
||||||
|
|
||||||
// Simple icon mapping for fallback
|
// Simple icon mapping for fallback
|
||||||
let icon = '';
|
let icon = '';
|
||||||
if (type === 'success') icon = '✅ ';
|
if (type === 'success') icon = '✅ ';
|
||||||
|
|||||||
Reference in new issue
Block a user