<div class="card" >
<span class="line"></span>
<span class="line"></span>
<span class="line"></span>
<span class="line"></span>
<div style="height: 320px;" id="echart1"></div>
</div>
.card {
position: relative;
overflow: hidden;
box-shadow: 0 0 0 2px inset #d03d00;
}
.card .line:nth-child(1) {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 2px;
background: linear-gradient(to right, #d03d00, #f9da03);
animation: animate1 2s linear infinite;
-webkit-animation: animate1 2s linear infinite;
}
@keyframes animate1 {
0% {
transform: translateX(-100%);
-webkit-transform: translateX(-100%);
-moz-transform: translateX(-100%);
-ms-transform: translateX(-100%);
-o-transform: translateX(-100%);
}
100% {
transform: translateX(100%);
-webkit-transform: translateX(100%);
-moz-transform: translateX(100%);
-ms-transform: translateX(100%);
-o-transform: translateX(100%);
}
}
.card .line:nth-child(2) {
position: absolute;
top: 0px;
right: 0px;
width: 2px;
height: 100%;
background: linear-gradient(to bottom, #d03d00, #f9da03);
animation: animate2 2s linear infinite;
-webkit-animation: animate2 2s linear infinite;
/* add delay to have continuity on effect*/
animation-delay: 1s;
}
@keyframes animate2 {
0% {
transform: translateY(-100%);
-webkit-transform: translateY(-100%);
-moz-transform: translateY(-100%);
-ms-transform: translateY(-100%);
-o-transform: translateY(-100%);
}
100% {
transform: translateY(100%);
-webkit-transform: translateX(100%);
-moz-transform: translateX(100%);
-ms-transform: translateX(100%);
-o-transform: translateX(100%);
}
}
.card .line:nth-child(3) {
position: absolute;
bottom: 0px;
right: 0px;
width: 100%;
height: 2px;
background: linear-gradient(to left, #d03d00, #f9da03);
animation: animate3 2s linear infinite;
-webkit-animation: animate3 2s linear infinite;
}
@keyframes animate3 {
0% {
transform: translateX(100%);
-webkit-transform: translateX(100%);
-moz-transform: translateX(100%);
-ms-transform: translateX(100%);
-o-transform: translateX(100%);
}
100% {
transform: translateX(-100%);
-webkit-transform: translateX(-100%);
-moz-transform: translateX(-100%);
-ms-transform: translateX(-100%);
-o-transform: translateX(-100%);
}
}
.card .line:nth-child(4) {
position: absolute;
top: 0px;
left: 0px;
width: 2px;
height: 100%;
background: linear-gradient(to top, #d03d00, #f9da03);
animation: animate4 2s linear infinite;
-webkit-animation: animate4 2s linear infinite;
/* add delay to have continuity on effect*/
animation-delay: 1s;
}
@keyframes animate4 {
0% {
transform: translateY(100%);
-webkit-transform: translateY(100%);
-moz-transform: translateY(100%);
-ms-transform: translateY(100%);
-o-transform: translateY(100%);
}
100% {
transform: translateY(-100%);
-webkit-transform: translateY(-100%);
-moz-transform: translateY(-100%);
-ms-transform: translateY(-100%);
-o-transform: translateY(-100%);
}
}