mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
优化加载动画逻辑
This commit is contained in:
+2
-8
@@ -123,14 +123,8 @@ function startBackgroundRotation() {
|
|||||||
function animateAndRemoveLoader() {
|
function animateAndRemoveLoader() {
|
||||||
const loadingBg = document.querySelector('#loading-bg') as HTMLElement
|
const loadingBg = document.querySelector('#loading-bg') as HTMLElement
|
||||||
if (loadingBg) {
|
if (loadingBg) {
|
||||||
// 先添加完成动画类
|
removeEl('#loading-bg')
|
||||||
loadingBg.classList.add('loading-complete')
|
document.documentElement.style.removeProperty('background')
|
||||||
// 等待动画完成后再移除元素
|
|
||||||
setTimeout(() => {
|
|
||||||
removeEl('#loading-bg')
|
|
||||||
// 将background属性从html的style中移除
|
|
||||||
document.documentElement.style.removeProperty('background')
|
|
||||||
}, 500)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ export const useGlobalSettingsStore = defineStore('globalSettings', {
|
|||||||
isInitialized: state => state.initialized,
|
isInitialized: state => state.initialized,
|
||||||
isLoading: state => state.loading,
|
isLoading: state => state.loading,
|
||||||
getData: state => state.data,
|
getData: state => state.data,
|
||||||
// 直接返回data对象,避免使用.value
|
|
||||||
globalSettings: state => state.data,
|
globalSettings: state => state.data,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user