Created
December 4, 2017 17:32
-
-
Save panicbus/8ca5ba3599fc0b7c851a9a956866c1e6 to your computer and use it in GitHub Desktop.
a little css pulse of the heart
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
| $('.selector').on('click', function() { | |
| $(this).addClass('addPulse'); | |
| }) |
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
| .addPulse, .removePulse{ | |
| -webkit-animation-duration: 500ms; | |
| animation-duration: 500ms; | |
| -webkit-animation-timing-function: linear; | |
| animation-timing-function: linear; | |
| -webkit-animation-iteration-count: initial; | |
| animation-iteration-count: initial; | |
| } | |
| .addPulse{ | |
| -webkit-animation-name: addPulse; | |
| animation-name: addPulse; | |
| } | |
| .removePulse{ | |
| -webkit-animation-name: removePulse; | |
| animation-name: removePulse; | |
| } | |
| @-webkit-keyframes addPulse { | |
| 25% { | |
| -webkit-transform: scale3d(1.2, 1.2, 1.2); | |
| transform: scale3d(1.2, 1.2, 1.2); | |
| } | |
| 75% { | |
| -webkit-transform: scale3d(0.8, 0.8, 0.8); | |
| transform: scale3d(0.8, 0.8, 0.8); | |
| } | |
| } | |
| @keyframes addPulse { | |
| 25% { | |
| -webkit-transform: scale3d(1.2, 1.2, 1.2); | |
| -ms-transform: scale3d(1.2, 1.2, 1.2); | |
| transform: scale3d(1.2, 1.2, 1.2); | |
| } | |
| 75% { | |
| -webkit-transform: scale3d(0.8, 0.8, 0.8); | |
| -ms-transform: scale3d(0.8, 0.8, 0.8); | |
| transform: scale3d(0.8, 0.8, 0.8); | |
| } | |
| } | |
| @-webkit-keyframes removePulse { | |
| 25% { | |
| -webkit-transform: scale3d(1.2, 1.2, 1.2); | |
| transform: scale3d(1.2, 1.2, 1.2); | |
| } | |
| 75% { | |
| -webkit-transform: scale3d(0.8, 0.8, 0.8); | |
| transform: scale3d(0.8, 0.8, 0.8); | |
| } | |
| } | |
| @keyframes removePulse { | |
| 25% { | |
| -webkit-transform: scale3d(1.2, 1.2, 1.2); | |
| -ms-transform: scale3d(1.2, 1.2, 1.2); | |
| transform: scale3d(1.2, 1.2, 1.2); | |
| } | |
| 75% { | |
| -webkit-transform: scale3d(0.8, 0.8, 0.8); | |
| -ms-transform: scale3d(0.8, 0.8, 0.8); | |
| transform: scale3d(0.8, 0.8, 0.8); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment