Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Page reappears after fading out

I’m trying to make a "fake" loading screen fade out into the actual page. I got the fade out animation right, however after the animation is done, the loading page reappears again. How do I fix this? ive tried changing the animation tro transition, but then it doesnt even fade out.

PS: This is an assignment and I can only use HTML and CSS

.frontpage {
  background-color: black;
  height: 100vh;
  z-index: 1; 
  animation: fadeout 3s linear;
 }

@keyframes fadeout {
    from { opacity: 1; visibility: visible; }
    to { opacity: 0; visibility: hidden; }
}

HTML:

<div class="frontpage">
<h1 align="center"> Loading ...</h1>
<div class="loader"> </div>
</div>

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You should set the ‘forwards’ for the animation-fill-mode in order to stay stable.

.frontpage {
  background-color: black;
  height: 100vh;
  z-index: 1; 
  animation: fadeout 3s linear forwards;
 }
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading