给图片边框加一个动画,顺时针依次变色,因为图片加了border-radius,要怎么把第一张图和第二张图开始的部分加上圆角。或者换一种实现方案
&.active {
width: 290px;
height: 190px;
position: relative;
&.active::before, &::after {
box-sizing: inherit;
position: absolute;
content: '';
border: 4px solid transparent;
border-radius: 20px !important;
width: 1px;
height: 1px;
z-index: 999;
}
&.active::after {
bottom: 0px;
right: 0px;
}
&.active::before {
top: 0px;
left: 0px;
}
&.active:hover::before, &.active:hover::after {
width: 100%;
height: 100%;
}
&.active:hover::before {
border-top-color: #ff6900;
border-right-color: #ff6900;
transition: width 0.5s ease-out 0s, height 0.5s ease-out 0.5s;
}
&.active:hover::after {
border-bottom-color: #ff6900;
border-left-color: #ff6900;
transition: border-color 0s ease-out 1s, width 0.5s ease-out 1s, height 0.5s ease-out 1.5s;
}
}
可以参考下面实现方案
https://csscoco.com/inspiration/#/./background/bg-conic-borde...
https://csscoco.com/inspiration/#/./background/bg-conic-borde...
https://csscoco.com/inspiration/#/./background/bg-linear-bord...
https://codepen.io/alphardex/pen/qBBGxqY
https://codepen.io/alphardex/pen/vYEYGzp