Skip to content

Instantly share code, notes, and snippets.

@claide
Created May 15, 2020 09:00
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 claide/e19c953438272e82a890c982192e6d16 to your computer and use it in GitHub Desktop.
Save claide/e19c953438272e82a890c982192e6d16 to your computer and use it in GitHub Desktop.
Online indicator blink with animation shorthand
.is-online {
height: 16px;
width: 16px;
display: inline-block;
border-radius: 50%;
background-color: $green;
animation: blink 2s ease-in-out 0s 3;
-webkit-animation: blink 2s ease-in-out 0s 3;
}
/*
* blink - animation name
* 2s - duration
* ease-in-out - timing function
* delay - 0s
* 3 - iteration count
*/
@keyframes blink {
0% {
background-color: $green;
}
20% {
background-color: $green;
}
40% {
background-color: transparent;
}
60% {
background-color: transparent;
}
80% {
background-color: $green;
}
100% {
background-color: $green;
}
}
@-webkit-keyframes blink {
0% {
background-color: $green;
}
20% {
background-color: $green;
}
40% {
background-color: transparent;
}
60% {
background-color: transparent;
}
80% {
background-color: $green;
}
100% {
background-color: $green;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment