This is a Loading Animation Concept on Google Style inspired by those cool animations made for Google Home App!. This tricky tumbling transform-origin animation using only CSS.
HTML Snippet
<div id="app">
<div class="boxes">
<div class="box -blue"></div>
<div class="box -red"></div>
<div class="box -yellow"></div>
<div class="box -green"></div>
</div>
</div>
CSS Code
#app {
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1);
animation-timing-function: cubic-bezier(0.6, 0, 0.4, 1);
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
will-change: transform;
}
.boxes {
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr;
height: 25vmin;
width: 25vmin;
background: #eee;
background-image: radial-gradient(circle at center, #FFF 45%, transparent 45%), linear-gradient(to right, transparent 49.99%, #ccc 50%);
}
.boxes,
.box {
-webkit-animation: inherit;
animation: inherit;
}
*, *:before, *:after {
box-sizing: border-box;
position: relative;
}
html, body {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
}
Preview
Leave a Reply