Jump to content

Splash screen to play only once

Recommended Posts

Hi! I'm building up a site with an initial splash screen with a mini logo animation before jumping into the homepage. I've worked out everything except for it to play only once when the user opens the site for the first time. Currently is playing every time I go back to homepage. 

This is the code I used:

<div class="splash-wrapper">

  <img src="https://static1.squarespace.com/static/6356c0bbe92a431593bd2c3c/t/63764a3958e64a4de52927e0/1668696635137/Serendipity+Studios_LogoSHORT.gif" width="500" height="auto"/>

    

</div>

 

<style>

.splash-wrapper {

  position: fixed;

  z-index: 9999;

  background-color: #FFFFFF;

  height: 100vh;

  width: 100vw;

  display: flex;

  flex-flow: column nowrap;

  justify-content: center;

  align-items: center;

  animation-name: slideUp;

  animation-fill-mode: forwards;

  animation-duration: 2s;

  animation-delay: 2s;

}

 

@keyframes slideUp{

  from{transform: translateY(0vh);}

  to{transform: translateY(-100vh);}

}

Link to comment
  • Replies 2
  • Views 369
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I would like to understand your problem better. There is an image that animates the letters and there is a css animation that slides up the image from outside the screen to the top of the screen. You want to set up a cookie or localstorage to check if the user already was on the site. If yes just don't show the image, right?

Jozsef Kerekes - Front-end developer and Squarespace enthusiast
My Blog: https://ui-workarounds.com
If you like my answer, please give me an upvote/like. Highly appreciated.

 

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.