This commit is contained in:
aaron 2025-05-25 11:24:40 +08:00
parent f3fa5f9470
commit ce3f311f0f
2 changed files with 67 additions and 11 deletions

View File

@ -5,7 +5,7 @@ services:
build:
context: .
dockerfile: Dockerfile
image: tradus-web:1.3.22
image: tradus-web:1.3.23
container_name: tradus-web
ports:
- '6000:80'

View File

@ -427,11 +427,43 @@ onMounted(() => {
fetchUserInfo() //
startUserInfoRefresh() //
}
//
let scrollTimer: number | undefined
const handleScroll = (e: Event) => {
const target = e.target as HTMLElement
if (target) {
target.classList.add('scrolling')
clearTimeout(scrollTimer)
scrollTimer = window.setTimeout(() => {
target.classList.remove('scrolling')
}, 1000)
}
}
//
document.addEventListener('scroll', handleScroll, true)
//
const cleanup = () => {
document.removeEventListener('scroll', handleScroll, true)
clearTimeout(scrollTimer)
}
//
;(globalThis as typeof globalThis & { __scrollCleanup?: () => void }).__scrollCleanup = cleanup
})
onUnmounted(() => {
document.removeEventListener('click', closeMenus)
stopUserInfoRefresh() //
//
const cleanup = (globalThis as typeof globalThis & { __scrollCleanup?: () => void })
.__scrollCleanup
if (cleanup) {
cleanup()
}
})
</script>
@ -2002,33 +2034,57 @@ body {
/* 全局滚动条样式 */
::-webkit-scrollbar {
width: 8px;
height: 8px;
width: 6px;
height: 6px;
}
::-webkit-scrollbar-track {
background: transparent;
border-radius: 4px;
border-radius: 3px;
}
::-webkit-scrollbar-thumb {
background-color: var(--color-border);
border-radius: 4px;
transition: all 0.2s ease;
background-color: transparent;
border-radius: 3px;
transition: background-color 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
background-color: var(--color-accent);
/* 只在滚动时显示滚动条 */
::-webkit-scrollbar-thumb:hover,
*:hover::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
}
/* 深色主题下的滚动条 */
[data-theme='dark'] ::-webkit-scrollbar-thumb:hover,
[data-theme='dark'] *:hover::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.3);
}
/* Firefox */
* {
scrollbar-width: thin;
scrollbar-color: var(--color-border) transparent;
scrollbar-color: transparent transparent;
}
*:hover {
scrollbar-color: var(--color-accent) transparent;
scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}
/* Firefox 深色主题 */
[data-theme='dark'] *:hover {
scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
/* 滚动时显示滚动条 */
*::-webkit-scrollbar-thumb:active,
.scrolling::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.3) !important;
}
[data-theme='dark'] *::-webkit-scrollbar-thumb:active,
[data-theme='dark'] .scrolling::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.4) !important;
}
/* 确保滚动行为平滑 */