2 回答
TA贡献1784条经验 获得超2个赞
为此, atransition更合适:
document.addEventListener('click', () =>
document.querySelector('.menu').classList.toggle('open')
)
.menu {
position: fixed;
height: 100vh;
width: 100vw;
top: 0;
background-color: #1f1f1f;
clip-path: circle(0% at 5% 10%);
transition: clip-path 2s;
}
.menu.open{
clip-path: circle(100%);
}
<div class="menu" ></div>
Click anywhere to try out effect
TA贡献1777条经验 获得超3个赞
Just adding basic demo code for your undestanding.
.loader {
width: 56px;
height: 56px;
border: 8px solid transparent;
border-top-color: $warning;
border-bottom-color: $warning;
border-radius: 50%;
animation: loader-rotate 1s linear infinite;
top: 50%;
margin: -28px auto 0;
}
@keyframes loader-rotate {
0% {
transform: rotate(0); }
100% {
transform: rotate(360deg); }
}
添加回答
举报