<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<!-- loading 页面，todo 这块都可以不要，后面删除，先精简代码，后续考虑组件添加 -->
<div id="loading-box" onclick="heo.hideLoading()"
     th:fragment="loading-box"
     th:if="${theme.config.other.loading_box} and not ${#strings.isEmpty(theme.config.other.loading_box_img)}">
    <div class="loading-bg">
        <img class="loading-img" th:src="${theme.config.other.loading_box_img}">
    </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>

</div>

</html>