A Pen by James Warren on CodePen.
Created
July 30, 2022 13:53
-
-
Save Jw-44/b10015cc047ca180cc68d5dff42df325 to your computer and use it in GitHub Desktop.
Elegant CTA button animation
Hover me 🙏
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.clickmeplease { | |
display: inline-block; | |
position: relative; | |
opacity: 1; | |
margin: .3em; | |
padding: .5em 1.5em; | |
border-radius: 6px; | |
transition: all 0.3s; | |
cursor: pointer; | |
font-size: 2rem; | |
background-color: transparent; | |
border: 2px solid rgba(0,0,0,.2); | |
color: #999; | |
font-weight: 400; | |
} | |
.clickmeplease:before, | |
.clickmeplease:after { | |
content: ''; | |
border-style: solid; | |
position: absolute; | |
z-index: 5; | |
border-radius: 6px; | |
box-sizing: content-box; | |
transition: all 0.3s; | |
} | |
.clickmeplease:before { | |
width: 0; | |
height: 100%; | |
border-width: 2px 0 2px 0; | |
top: -2px; | |
left: -2px; | |
transition-delay: 0.05s; | |
} | |
.clickmeplease:after { | |
width: 100%; | |
height: 0; | |
border-width: 0 2px 0 2px; | |
top: -2px; | |
left: -2px; | |
} | |
.clickmeplease:hover:after { | |
height: calc(100% + (2px * 2)); | |
border-color: #30a987; | |
} | |
.clickmeplease:hover:before { | |
width: calc(100% + (2px * 2)); | |
border-color: #30a987; | |
} | |
.clickmeplease:hover { | |
color: #30a987; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hover me