HTML+css渐变方块与圆型块动画源码

效果:
在这里插入图片描述

HTML

<div class="welcome"></div>
	<div class="square">
		<ul>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>
	
	<div class="circle">
		<ul>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
			<li></li>
		</ul>
	</div>

CSS

.welcome{
	background-image: linear-gradient(#fa983a,#e55039);   
	position: relative;
	height: 100vh;
	overflow: hidden;
	font-family: sans-serif;
}
ul li{
	position: absolute;
	border: 1px solid #fff;
	width: 30px;
	height: 30px;
	list-style: none;
	opacity: 0;
	background: #fff;
}
.square li
{
	top: 50vh;
	left: 45vw;
	animation: square 10s linear infinite;
}
.square li:nth-child(2)
{
	top: 80vh;
	left: 10vw;
	animation-delay: 2s;
}
.square li:nth-child(3)
{
	top: 80vh;
	left: 85vw;
	animation-delay: 4s;
}
.square li:nth-child(4)
{
	top: 10vh;
	left: 70vw;
	animation-delay: 6s;
}
.square li:nth-child(5)
{
	top: 10vh;
	left: 10vw;
	animation-delay: 8s;
}
@keyframes square
{
	0%{
		transform: scale(0) rotateY(0deg);
		opacity: 1;
	}
	100%{
		transform: scale(5) rotateY(1000deg);
		opacity: 0;
	}
}
.circle li
{
	bottom: 0;
	left: 15vw;
	animation: circle 10s linear infinite
}
.circle li:nth-child(2)
{
	left: 35vw;
	animation-delay: 2s;
}
.circle li:nth-child(3)
{
	left: 55vw;
	animation-delay: 4s;
}
.circle li:nth-child(4)
{
	left: 75vw;
	animation-delay: 6s;
}
.circle li:nth-child(5)
{
	left: 90vw;
	animation-delay: 8s;
}

@keyframes circle
{
	0%{
		transform: scale(0) rotate(0deg);
		opacity: 1;
		bottom: 0;
		border-radius: 0;
	}
	100%{
		transform: scale(5) rotate(1000deg);
		opacity: 0;
		bottom: 90vh;
		border-radius: 50%;
	}
}
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值