优化loading页面

This commit is contained in:
1152958806@qq.com 2023-10-12 00:53:32 +08:00
parent f041477c10
commit 92aca83c2c
2 changed files with 16 additions and 17 deletions

View File

@ -68,23 +68,6 @@
<!-- todo head 中有它的 css应该可以写一块并改成后台可配置的功能代码中应该还有他的 js -->
<script src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/node-snackbar/0.1.16/snackbar.min.js"></script>
<script th:if="${theme.config.other.loadingBoxs.loadingBoxEnable} and not ${#strings.isEmpty(theme.config.other.loadingBoxs.loadingBoxImg)}">
var preloader = {
endLoading: () => {
//- document.body.style.overflow = 'auto';
document.getElementById('loading-box').classList.add("loaded")
},
initLoading: () => {
//- document.body.style.overflow = '';
document.getElementById('loading-box').classList.remove("loaded")
}
}
window.addEventListener('load', preloader.endLoading())
setTimeout(function () {
preloader.endLoading();
}, 3000)
</script>
<div class="js-pjax">
<!-- 动态标题 -->
<script th:replace="~{modules/common/diytitle :: diytitle}"></script>

View File

@ -85,6 +85,22 @@
<div class="loading-image-dot"></div>
</div>
</div>
<script>
var preloader = {
endLoading: () => {
//- document.body.style.overflow = 'auto';
document.getElementById('loading-box').classList.add("loaded")
},
initLoading: () => {
//- document.body.style.overflow = '';
document.getElementById('loading-box').classList.remove("loaded")
}
}
window.addEventListener('load', preloader.endLoading())
setTimeout(function () {
preloader.endLoading();
}, 3000)
</script>
</th:block>