diff --git a/js/Ambiente/Estrutura/load.js b/js/Ambiente/Estrutura/load.js index cc96c6e..4b02b47 100644 --- a/js/Ambiente/Estrutura/load.js +++ b/js/Ambiente/Estrutura/load.js @@ -11,7 +11,13 @@ function verificarAmbiente() { } elemento_2 = ''; - tela_laod.innerHTML = '

' + elemento_1 + '

' + elemento_2 + '
'; + tela_laod.innerHTML = '

' + elemento_1 + '

' + elemento_2 + '
'; + + // Inicia a animação após configurar o canvas + iniciarAnimacao(); + + // Inicia a contagem para limpar a tela após 3 segundos + finalizar(); } function finalizar() { @@ -21,14 +27,6 @@ function finalizar() { }, 3000); } -window.addEventListener('DOMContentLoaded', iniciarAnimacao) - -window.addEventListener('load', () => { - finalizar(); -}); - - - function iniciarAnimacao() { const canvas = document.getElementById('animationCanvas'); const ctx = canvas.getContext('2d'); @@ -83,4 +81,7 @@ function iniciarAnimacao() { circle.centerX = canvas.width / 2; circle.centerY = canvas.height / 2; }); -} \ No newline at end of file +} + +// Executa verificarAmbiente apenas uma vez após o carregamento total da página +window.addEventListener('load', verificarAmbiente);