A Pen by Alexander Belov on CodePen.
Created
July 4, 2015 21:51
-
-
Save IPRIT/6ef18a8130b3c68eee22 to your computer and use it in GitHub Desktop.
QbmWgd
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
| .layer | |
| .button.block1 | |
| .wrapper | |
| .line.first | |
| .line.second | |
| .line.third | |
| .button.block2 | |
| .wrapper | |
| .line.first | |
| .line.second | |
| .line.third | |
| .button.block3 | |
| .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
| $(document).ready(function() { | |
| $('.button').on('click', function(e) { | |
| var element = $(this), | |
| className = 'opened'; | |
| element.hasClass(className) ? | |
| element.removeClass(className) : | |
| element.addClass(className); | |
| }); | |
| }); |
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
| <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
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
| .layer { | |
| width: 300px; | |
| margin: auto; | |
| padding: 40px; | |
| text-align: center; | |
| } | |
| .layer .button { | |
| margin: 0 10px; | |
| } | |
| .button { | |
| width: 48px; | |
| height: 48px; | |
| background: #FF6666; | |
| border-radius: 2px; | |
| padding: 12px; | |
| box-sizing: border-box; | |
| cursor: pointer; | |
| display: inline-block; | |
| } | |
| .wrapper { | |
| height: 100%; | |
| width: 100%; | |
| position: relative; | |
| overflow: hidden; | |
| } | |
| .line { | |
| height: 3px; | |
| background: #fff; | |
| position: absolute; | |
| width: 100%; | |
| transition: top .1s ease-in, | |
| transform .2s cubic-bezier(0.18, 0.89, 0.32, 1.28) .1s; | |
| } | |
| .line.first { | |
| top: 3px; | |
| } | |
| .line.second { | |
| top: 10px; | |
| transition: right .15s ease-out, opacity .3s ease-in; | |
| right: 0; | |
| opacity: 1; | |
| } | |
| .line.third { | |
| top: 17px; | |
| } | |
| .opened .line.first { | |
| top: 10px; | |
| transform: rotate(45deg); | |
| } | |
| .opened .line.third { | |
| top: 10px; | |
| transform: rotate(-45deg); | |
| } | |
| .opened .line.second { | |
| right: 40px; | |
| opacity: 0; | |
| } | |
| .block2 { | |
| background: #FFB115; | |
| } | |
| .block3 { | |
| background: #7893A6; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment