Skip to content

Instantly share code, notes, and snippets.

@ezos86
Created February 27, 2015 21:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezos86/b5fb73a7296c2484af6c to your computer and use it in GitHub Desktop.
Save ezos86/b5fb73a7296c2484af6c to your computer and use it in GitHub Desktop.
Button Blink
<div class="box"></div>
$('.box').click(function(){
$(this).toggleClass('active');
});
@import "compass/css3";
html{
margin:20px;
}
.box{
width:100px;
height:100px;
background-color:red;
}
.active{
background-color:blue;
//box-shadow: 0 0 10px red;
-webkit-animation: blink 1.0s linear infinite;
-moz-animation: blink 1.0s linear infinite;
-ms-animation: blink 1.0s linear infinite;
-o-animation: blink 1.0s linear infinite;
animation: blink 1.0s linear infinite;
}
@keyframes blink {
0% { box-shadow: 0 0 30px red; }
50% { box-shadow: none; }
100% { box-shadow: 0 0 30px red; }
}
@-webkit-keyframes blink {
0% { box-shadow: 0 0 30px red; }
50% { box-shadow: 0 0 0; }
100% { box-shadow: 0 0 30px red; }
}
/* Chrome, Safari, Opera */
@-webkit-keyframes glow {
from {box-shadow: 0 0 0 red;}
to {box-shadow: 0 0 30px red;}
}
/* Standard syntax */
@keyframes glow {
from {box-shadow: 0 0 0 red;}
to {box-shadow: 0 0 30px red;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment