Created
December 2, 2014 16:24
-
-
Save MPieter/f468a286e69fd2578c02 to your computer and use it in GitHub Desktop.
Pure CSS Pulse Button
This file contains 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
.container { | |
width: 200px; | |
height: 100%; | |
margin: 0 auto 0; | |
} | |
.pulse-button { | |
position: relative; | |
width: 100px; | |
height: 100px; | |
border: none; | |
box-shadow: 0 0 0 0 rgba(232, 76, 61, 0.7); | |
border-radius: 50%; | |
background-color: #e84c3d; | |
background-image: url(YOUR-URL-IMAGE.png); | |
background-size:cover; | |
background-repeat: no-repeat; | |
cursor: pointer; | |
-webkit-animation: pulse 1.25s infinite cubic-bezier(0.66, 0, 0, 1); | |
-moz-animation: pulse 1.25s infinite cubic-bezier(0.66, 0, 0, 1); | |
-ms-animation: pulse 1.25s infinite cubic-bezier(0.66, 0, 0, 1); | |
animation: pulse 1.25s infinite cubic-bezier(0.66, 0, 0, 1); | |
} | |
.pulse-button:hover | |
{ | |
-webkit-animation: none;-moz-animation: none;-ms-animation: none;animation: none; | |
} | |
@-webkit-keyframes pulse {to {box-shadow: 0 0 0 45px rgba(232, 76, 61, 0);}} | |
@-moz-keyframes pulse {to {box-shadow: 0 0 0 45px rgba(232, 76, 61, 0);}} | |
@-ms-keyframes pulse {to {box-shadow: 0 0 0 45px rgba(232, 76, 61, 0);}} | |
@keyframes pulse {to {box-shadow: 0 0 0 45px rgba(232, 76, 61, 0);}} |
This file contains 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="container"> | |
<button class="pulse-button"></button> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment