Skip to content

Instantly share code, notes, and snippets.

@shopifypartners
Last active July 29, 2019 10:16
Show Gist options
  • Save shopifypartners/15c881a527d442bbdb0ef790e8046e3a to your computer and use it in GitHub Desktop.
Save shopifypartners/15c881a527d442bbdb0ef790e8046e3a to your computer and use it in GitHub Desktop.
Subtle animation for custom themes- Styling for CTA button - https://www.shopify.com/partners/blog/text-animation-css
/*================ Animated CTA ================*/
.section-cta {
text-align: center;
}
.btn-animated {
width: 200px;
height: 50px;
display: inline-block;
position: relative;
background-color: #5C6AC4;
border-radius: 50px;
overflow: hidden;
cursor: pointer;
text-align: center;
z-index: 1;
&:before {
content: "";
position: absolute;
width: 140%;
height: 100%;
background-color: #FFFFFF;
transform: rotate(10deg);
top: -150%;
left: 20%;
transition: .3s ease-in-out;
}
&:after {
content: "";
position: absolute;
width: 140%;
height: 120%;
background-color: #FFFFFF;
transform: rotate(10deg);
top: 150%;
left: -20%;
transition: .3s ease-in-out;
}
&:hover {
background-color: #FFFFFF;
transition: 0s linear;
transition-delay: .3s;
}
&:hover:before {
top: -20px;
left: -20%;
transition: .3s ease-in-out;
}
&:hover:after {
top: 10px;
left: -23%;
transition: .3s ease-in-out;
}
&:hover > .btn-content {
color: #000000;
transition: .3s ease-in-out;
}
.btn-content {
width: 100%;
height: 100%;
text-align: center;
line-height: 50px;
color: #FFFFFF;
font-weight: 400;
position: relative;
z-index: 999;
transition: .3s ease-in-out;
}
}
a:hover {
opacity: 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment