<!--
 ~ Copyright 2022 youngmonkeys.org
 ~ 
 ~ Licensed under the ezyplatform, Version 1.0.0 (the "License");
 ~ you may not use this file except in compliance with the License.
 ~ You may obtain a copy of the License at
 ~ 
 ~     https://youngmonkeys.org/licenses/ezyplatform-1.0.0.txt
 ~ 
 ~ Unless required by applicable law or agreed to in writing, software
 ~ distributed under the License is distributed on an "AS IS" BASIS,
 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 ~ See the License for the specific language governing permissions and
 ~ limitations under the License.
-->

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:ezy="http://www.ezyplatform.com/thymeleaf/layout">
<body>
<th:block th:fragment="style">
    <th:block th:if="${commonFragments != null && commonFragments.get('loading') != null && !#strings.isEmpty(commonFragments.get('loading').additionalHead)}">
        <ezy:block ezy:utext="${commonFragments.get('loading').additionalHead}" />
    </th:block>
    <th:block th:if="${commonFragments == null || commonFragments.get('loading') == null || #strings.isEmpty(commonFragments.get('loading').additionalHead)}">
        <style>
            div.screen-loading {
                position: fixed;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                z-index: 2147483647;
                background-color: rgba(16, 16, 16, 0.5);
                text-align: center;
                display: flex;
                flex-direction: column;
                justify-content: center;
            }

            div.screen-loading .loading-percent {
                color: #f0f0f0;
                font-size: 1.25rem;
                font-weight: 600;
            }
        </style>
    </th:block>
</th:block>
<th:block th:fragment="content">
    <th:block th:if="${commonFragments != null && commonFragments.get('loading') != null && commonFragments.get('loading').content != 'loading'}">
        <ezy:block ezy:utext="${commonFragments.get('loading').content}" />
    </th:block>
    <th:block th:if="${commonFragments == null || commonFragments.get('loading') == null || commonFragments.get('loading').content == 'loading'}">
        <div id="loadingScreen" class="screen-loading d-none">
            <i class="fas fa-3x fa-sync fa-spin"></i>
            <div id="ezyLoadingScreenPercent" class="loading-percent mt-3">0%</div>
        </div>
    </th:block>
</th:block>
</body>
</html>
