CSS3动画——全屏广告“跳过”按钮样式

先放个效果图:
在这里插入图片描述
上代码:

<div id="timer">
	<div class="timer-text">跳过</div>
	<div class="timer-round">
		<div class="left wrap">
			<div class="left-radius radius"></div>
		</div>
		<div class="right wrap">
			<div class="right-radius radius"></div>
		</div>
	</div>
</div>
html{
	box-shadow: 0 0 10px 5px rgba(0,0,0,0.05);
    padding: 20px;
    margin: 30px;
}
#timer div{
	box-sizing: border-box;
}
#timer{
	position: relative;
	width: 36px;height: 36px;
	margin: 0 auto;
}
.timer-text{
	width: 100%;height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	color: #FFFFFF;
	background: rgba(0,0,0,0.2);
	border-radius: 50%;
}
.timer-round{
	width: 100%;height: 100%;
	position: absolute;
	top: 0;left:0;
}
.wrap{
	width: 50%;height: 100%;
	position: absolute;
	top: 0;
	overflow: hidden;
}
.left{left:0;}
.right{right:0;}
.radius{
	width: 200%;height: 100%;
	border-radius: 50%;
	position: absolute;
	top: 0;
	border: 2px solid #FFFFFF;
}
.left-radius{
	left: 0;
	transform: rotate(45deg);
	border-left-color: #3385ff;
	border-bottom-color: #3385ff;
	animation: leftRadius 4s linear;
	/*动画停留在最后一帧*/
	animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
	-webkit-animation-fill-mode: forwards;
	-o-animation-fill-mode: forwards;
}
.right-radius{
	right: 0;
	transform: rotate(45deg);
	border-right-color: #3385ff;
	border-top-color: #3385ff;
	animation: rightRadius 4s linear;
	/*动画停留在最后一帧*/
	animation-fill-mode: forwards;
	-moz-animation-fill-mode: forwards;
	-webkit-animation-fill-mode: forwards;
	-o-animation-fill-mode: forwards;
}
@keyframes leftRadius{
	0%{
		transform: rotate(45deg);
	}
	50%{
		transform: rotate(45deg);
	}
	100%{
		transform: rotate(225deg);
	}
}
@keyframes rightRadius{
	0%{
		transform: rotate(45deg);
	}
	50%{
		transform: rotate(225deg);
	}
	100%{
		transform: rotate(225deg);
	}
}
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 游动-白 设计师:白松林 返回首页