Preloader HTML CSS JS
Preloader 1 (Utilizado no CodeSnippets) HTML function adicionar_preloader_html() { echo '<div id="preloader"> <img src="https://tutoriais.gustavocampelo.com.br/wp-content/uploads/2024/06/Logotipo.png" alt="Carregando…"> </div>'; } add_action('wp_body_open', 'adicionar_preloader_html'); JS function adicionar_preloader_js() { ?> <script> document.addEventListener("DOMContentLoaded", function() { document.body.classList.add("loading"); }); window.addEventListener("load", function() { document.body.classList.remove("loading"); document.body.classList.add("loaded"); document.getElementById('preloader').style.display = 'none'; }); </script> <?php } add_action('wp_footer', 'adicionar_preloader_js'); CSS #preloader { position: fixed; top: 0; left: 0; right: 0; […]