Created
May 15, 2020 09:00
-
-
Save claide/e19c953438272e82a890c982192e6d16 to your computer and use it in GitHub Desktop.
Online indicator blink with animation shorthand
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
.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