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: build:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
image: tradus-web:1.3.22 image: tradus-web:1.3.23
container_name: tradus-web container_name: tradus-web
ports: ports:
- '6000:80' - '6000:80'

View File

@ -427,11 +427,43 @@ onMounted(() => {
fetchUserInfo() // fetchUserInfo() //
startUserInfoRefresh() // 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(() => { onUnmounted(() => {
document.removeEventListener('click', closeMenus) document.removeEventListener('click', closeMenus)
stopUserInfoRefresh() // stopUserInfoRefresh() //
//
const cleanup = (globalThis as typeof globalThis & { __scrollCleanup?: () => void })
.__scrollCleanup
if (cleanup) {
cleanup()
}
}) })
</script> </script>
@ -2002,33 +2034,57 @@ body {
/* 全局滚动条样式 */ /* 全局滚动条样式 */
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 8px; width: 6px;
height: 8px; height: 6px;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background: transparent; background: transparent;
border-radius: 4px; border-radius: 3px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background-color: var(--color-border); background-color: transparent;
border-radius: 4px; border-radius: 3px;
transition: all 0.2s ease; 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 */ /* Firefox */
* { * {
scrollbar-width: thin; scrollbar-width: thin;
scrollbar-color: var(--color-border) transparent; scrollbar-color: transparent transparent;
} }
*:hover { *: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;
} }
/* 确保滚动行为平滑 */ /* 确保滚动行为平滑 */