<div class="item"></div>
@keyframes clippath {
0%,
100% {
clip-path: inset(0 0 95% 0);
}
25% {
clip-path: inset(0 95% 0 0);
}
50% {
clip-path: inset(95% 0 0 0);
}
75% {
clip-path: inset(0 0 0 95%);
}
}
.item {
width: 200px;
height: 100px;
position: relative;
overflow: hidden;
margin: 10%;
border-radius: 4px;
// background: #000;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
// background: red;
border: 10px solid green;
clip-path: inset(0 0 95% 0);
clip-path: inset(0 95% 0 0);
clip-path: inset(95% 0 0 0);
clip-path: inset(0 0 0 95%);
animation: clippath 3s infinite linear;
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.