Skip to content

Instantly share code, notes, and snippets.

@Sunil-ghodela
Created September 24, 2018 04:23
Show Gist options
  • Save Sunil-ghodela/17ea4ad7c670ac3681c3284e0b7a21af to your computer and use it in GitHub Desktop.
Save Sunil-ghodela/17ea4ad7c670ac3681c3284e0b7a21af to your computer and use it in GitHub Desktop.
Blinking dot win CSS
<div class="main">
<div class="container">
<div class="box">
<div class="circContainer">
<div class="circ"></div>
<div class="circPulse one"></div>
<div class="circPulse two"></div>
</div>
</div>
</div>
.main {
display: table;
width: 100%;
height: 100%;
margin: 0 auto;
}
.container {
display: table-cell;
vertical-align: middle;
background: azure;
}
.circContainer {
width: 25px;
height: 25px;
position: relative;
}
circContainer:nth-of-type(1) {
top: 0px;
left: 75px;
}
.circContainer .circ {
background: red
}
.circContainer .circPulse {
background: red
}
.circ {
width: 5px;
height: 5px;
border-radius: 50%;
position: absolute;
z-index: 9;
left: 10px;
top: 10px;
}
.circPulse {
width: 25px;
height: 25px;
border-radius: 50%;
position: absolute;
top: 0;
left: 0;
/* animation */
-webkit-animation: pulse 1.4s ease-out;
-moz-animation: pulse 1.4s ease-out;
animation: pulse 1.4s ease-out;
-webkit-animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
animation-iteration-count: infinite;
}
.one {
-webkit-animation-delay: 0ms;
}
.two {
-webkit-animation-delay: 750ms;
}
@-webkit-keyframes pulse {
0% {
-webkit-transform:scale(0);
opacity:0;
}
25% {
-webkit-transform:scale(0.3);
opacity:1;
}
50% {
-webkit-transform:scale(0.6);
opacity:.6;
}
75% {
-webkit-transform:scale(.9);
opacity:.3;
}
100% {
-webkit-transform:scale(1);
opacity:0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment