Created
July 13, 2016 10:19
-
-
Save techhahn/567686402be9d5c073b2f8c726d1286b to your computer and use it in GitHub Desktop.
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
| var ripple = $("<div class='ripple'>"); | |
| var offsetX = e.pageX - $(this).offset().left; | |
| var offsetY = e.pageY - $(this).offset().top; | |
| var size = .8 * ($(this).width() > $(this).height() ? $(this).width() : $(this).height()); | |
| ripple.css({left:offsetX, top:offsetY, height:size, width:size}); | |
| ripple.one("webkitAnimationEnd oanimationend msAnimationEnd animationend",function(){$(this).remove()}); | |
| $(this).prepend(ripple); |
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
| @include keyframes(ripple) { | |
| 0% { | |
| @include transform(translateX(-50%) translateY(-50%) scale(1)); | |
| } | |
| 80% { | |
| @include transform(translateX(-50%) translateY(-50%) scale(3)); | |
| } | |
| 100% { | |
| @include transform(translateX(-50%) translateY(-50%) scale(3)); | |
| opacity: 0; | |
| } | |
| } |
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
| .has-ripple { | |
| position: relative; | |
| overflow: hidden; | |
| @include transition(.4s all); | |
| } | |
| .ripple { | |
| background: #FFF; | |
| position: absolute; | |
| -webkit-animation: ripple 1s cubic-bezier(0.23, 1, 0.32, 1); | |
| animation: ripple 1s cubic-bezier(0.23, 1, 0.32, 1); | |
| border-radius: 50%; | |
| -webkit-backface-visibility: hidden; | |
| backface-visibility: hidden; | |
| pointer-events: none; | |
| z-index: 3; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment