<div class="tiles">
<div class="tile"></div>
<div class="tile"></div>
<div class="tile"></div>
<div class="tile"></div>
<div class="tile"></div>
<div class="tile"></div>
<div class="tile"></div>
<div class="tile"></div>
<div class="tile"></div>
</div>
// Variables.
$tile-bg: #cfcfdf;
// Styles.
.tiles {
left: 50%;
position: absolute;
top: 50%;
transform: translateY(-50%) translateX(-50%);
width: 330px;
}
.tile {
animation: 1s ease 0s pulse infinite;
background: $tile-bg;
border-radius: 4px;
float: left;
height: 75px;
margin: 5px;
width: 100px;
}
// Loop from 1-9.
@for $i from 1 through 9 {
.tile {
// :nth-child(1-9)
&:nth-child(#{$i}) {
// Delay the animation. Delay increases as items loop.
animation-delay: $i * (1s / 18);
}
}
}
@keyframes pulse {
0% {
background: $tile-bg;
transform: scale(1);
}
25% {
background: darken($tile-bg, 10%);
transform: scale(1.015);
}
50% {
background: $tile-bg;
transform: scale(1);
}
}
html {
height: 100%;
width: 100%;
}
body {
height: 100%;
margin: 0;
padding: 0;
position: relative;
text-align: center;
width: 100%;
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.