A Pen by Jessica Biggs on CodePen.
Created
August 26, 2015 09:02
-
-
Save ds0nt/0af9e2a3f6cc6dcf8a51 to your computer and use it in GitHub Desktop.
Shiney Button
This file contains hidden or 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
| <div class="wrapper"> | |
| <a href="#" class="button">Shiney!</a> | |
| </div> |
This file contains hidden or 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
| $color: #2194E0; | |
| @keyframes sheen { | |
| 0% { | |
| transform: skewY(-45deg) translateX(0); | |
| } | |
| 100% { | |
| transform: skewY(-45deg) translateX(12.5em); | |
| } | |
| } | |
| .wrapper { | |
| display: block; | |
| position: absolute; | |
| top: 50%; | |
| left: 50%; | |
| transform: translate(-50%, -50%); | |
| } | |
| .button { | |
| padding: 0.75em 2em; | |
| text-align: center; | |
| text-decoration: none; | |
| color: $color; | |
| border: 2px solid $color; | |
| font-size: 24px; | |
| display: inline-block; | |
| border-radius: 0.3em; | |
| transition: all 0.2s ease-in-out; | |
| position: relative; | |
| overflow: hidden; | |
| &:before { | |
| content: ""; | |
| background-color: rgba(255,255,255,0.5); | |
| height: 100%; | |
| width: 3em; | |
| display: block; | |
| position: absolute; | |
| top: 0; | |
| left: -4.5em; | |
| transform: skewX(-45deg) translateX(0); | |
| transition: none; | |
| } | |
| &:hover { | |
| background-color: $color; | |
| color: #fff; | |
| border-bottom: 4px solid darken($color, 10%); | |
| &:before { | |
| transform: skewX(-45deg) translateX(13.5em); | |
| transition: all 0.5s ease-in-out; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment