Jump to content

Help with scroll animation

Recommended Posts

Hey guys, I could use some help with a scroll animation. 

my site: https://studiobeni.squarespace.com/
pw: maria

image.thumb.png.5225b99e044b463a7be0e384a1679e31.png

I'm trying to slightly spin the ball graphic on my site, below is the code I used, I see that the animation is applying but not on scroll. 

/**Initial State**/
.sqs-block-image:has([src*='ball']) {
transition:3s;

}

/**Animate State**/

.animate.sqs-block-image:has([src*='ball']) {
  animation: spin 3s;
}


// keyframes

@keyframes spin {
  0% {
    transform: rotate(-0deg);
   
  }
  
  50% {
    transform: rotate(90deg);
   
  }
  
   100% {
    transform: rotate(180deg);
   
  }
}

https://regrocery.co/ is the inspiration (scroll down to the section with the egg graphic to see the slight spin). 

image.thumb.png.2b2093bb784ca605a79e6331156a8a0c.png

I appreciate some pointers as I'm new to scroll animations.

 

Edited by MariaFY
added pw
Link to comment
  • Replies 2
  • Views 2k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

  • 2 months later...

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.