Jump to content

Custom Gradient CSS Background in a section

Recommended Posts

Site URL: https://flower-springtail-8n3z.squarespace.com/

I'm trying to achieve this effect for a section on my site: https://codepen.io/P1N2O/pen/pyBNzX

I am able to identify the section then applied the gradient, I just can't figure to animate it. Can anyone tell me how to solve this?

[data-section-id="608a398bf571e2467b77682d"] .section-background {
  	background: linear-gradient(45deg, #2242c1, #2beadb) !important;
	background-size: 200% 200% !important;
  	-webkit-animation: AnimationName 5s ease infinite !important;
    -moz-animation: AnimationName 5s ease infinite !important;
    animation: AnimationName 5s ease infinite !important;
}

@-webkit-keyframes AnimationName {
    0%{background-position:0% 51%}
    50%{background-position:100% 50%}
    100%{background-position:0% 51%}
}
@-moz-keyframes AnimationName {
    0%{background-position:0% 51%}
    50%{background-position:100% 50%}
    100%{background-position:0% 51%}
}
@keyframes AnimationName {
    0%{background-position:0% 51%}
    50%{background-position:100% 50%}
    100%{background-position:0% 51%}
}

 

Edited by sumcwan
Link to comment

This snippet works

[data-section-id="608a398bf571e2467b77682d"] .section-background {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

 

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date format)
💫 Animated Buttons (Referral URL)
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

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.