A Pen by Captain Anonymous on CodePen.
Created
July 4, 2015 05:06
-
-
Save IPRIT/b0e3c1363f8c2f5ad5a6 to your computer and use it in GitHub Desktop.
qdxzjL
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
| .block | |
| .wrapper | |
| .line.first | |
| .line.second | |
| .line.third |
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
| body { | |
| width: 100px; | |
| margin: auto; | |
| padding: 100px; | |
| } | |
| .block { | |
| width: 48px; | |
| height: 48px; | |
| background: #FF6666; | |
| border-radius: 2px; | |
| padding: 12px; | |
| box-sizing: border-box; | |
| cursor: pointer; | |
| } | |
| .wrapper { | |
| height: 100%; | |
| width: 100%; | |
| position: relative; | |
| } | |
| .line { | |
| height: 3px; | |
| background: #fff; | |
| position: absolute; | |
| width: 100%; | |
| transition: top .1s ease-in, transform .1s ease-in .1s; | |
| } | |
| .line.first { | |
| top: 3px; | |
| } | |
| .line.second { | |
| top: 10px; | |
| transition: opacity .2s ease-out; | |
| } | |
| .line.third { | |
| top: 17px; | |
| } | |
| .block:hover .line.first { | |
| top: 10px; | |
| transform: rotate(45deg); | |
| } | |
| .block:hover .line.third { | |
| top: 10px; | |
| transform: rotate(-45deg); | |
| } | |
| .block:hover .line.second { | |
| opacity: 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment