JSFiddle - React, Tailwind, and code Playground
HTML
<div class="box1">
<img src="#" alt="testing1" class="chart1" />
</div><!-- / .box1 -->
<div class="box2">
<div>
<img src="#" alt="testing1" class="chart2" />
</div>
</div><!-- / .box2 -->
CSS
@-webkit-keyframes chart1 {
0%, 100% { width: 0px; }
50% { width: 50px; }
}
@-webkit-keyframes chart2 {
0%, 100% {
-webkit-transform: scaleX(0);
-webkit-transform-origin: 0 0;
}
50% {
-webkit-transform: scaleX(0);
-webkit-transform-origin: 0 0;
}
}
.box1, .box2 {
position: absolute;
top: 0;
left: 0;
background: blue;
height: 150px;
width: 50px;
overflow: hidden;
}
.box2 {
left: 150px;
}
.box1 div, .box2 div {
position: relative;
width: 50px;
height: 50px;
}
.box1 img, .box2 img {
background: red;
position: absolute;
top: 0;
left: 0;
}
.box1 { -webkit-animation: chart1 2s infinite; }
.box2 { -webkit-animation: chart2 2s infinite; }