Skip to content

Instantly share code, notes, and snippets.

@NickMoignard
Last active July 26, 2019 03:12
Show Gist options
  • Save NickMoignard/c2baa352adb057614a090bc9704d080a to your computer and use it in GitHub Desktop.
Save NickMoignard/c2baa352adb057614a090bc9704d080a to your computer and use it in GitHub Desktop.
CSS Hey Typing Indicator
<div class="typing-indicator">
<span></span>
<span></span>
<span></span>
</div>
body {
$ti-color-bg: #E6E7ED;
background-color: $ti-color-bg;
}
.typing-indicator {
$tf-color-bg: #FFF;
background-color: $tf-color-bg;
will-change: transform;
width: auto;
border-radius: 0.25rem;
padding: 15px;
display: table;
margin: 0 auto;
position: relative;
animation: 2s bulge infinite ease-out;
}
span {
height: 7px;
width: 7px;
float: left;
margin: 0 1px;
background-color: #9E9EA1;
display: block;
border-radius: 50%;
opacity: 0.4;
@for $i from 1 through 3 {
&:nth-of-type(#{$i}) {
animation: 1s blink infinite ($i * .3333s);
}
}
}
@keyframes blink {
50% {
opacity: 1;
}
}
@keyframes bulge {
50% {
transform: scale(1.0);
}
}
// vertically center demo
html {
display: table;
height: 100%;
width: 100%;
}
body {
display: table-cell;
vertical-align: middle;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment