CSS梦幻光球loading

本文介绍了一种使用CSS实现的梦幻光球加载动画效果。通过不同圆形元素的旋转及阴影变化,创造出炫酷的3D视觉体验。动画涉及关键CSS属性包括-webkit-transform、-webkit-animation及box-shadow。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

CSS梦幻光球loading


CSS梦幻光球loading是本人在昨天讲的css伪3d旋转的升级版,原理是通过多个圆形div通过不同的时间依旧进行旋转控制,并且box-shadow中的宽高阴影增加后的产物:

http://blog.youkuaiyun.com/qq_35515563/article/details/59113085



CSS源码:

body {
			-webkit-perspective: 5000;
		}
		.round {
			position: relative;
			width: 400px;
			height: 400px;
			margin: 50px auto;
		}
		.round div {
			position: absolute;
			width: 400px;
			height: 400px;
			margin: 0 auto;
			border-radius: 50%;
			-webkit-transform-style: preserve-3d;
			-moz-transform-style: preserve-3d;
			transform-style: preserve-3d;
			
		}
		.round div:nth-child(1) {
			box-shadow: inset 10px 50px 80px rgba(255, 0, 0, 0.5);
			-webkit-animation: change 3s linear infinite;
		}
		.round div:nth-child(2) {
			box-shadow: inset 10px 50px 80px rgba(0, 0, 255, 0.5);
			-webkit-animation: change 4s linear infinite;
		}
		.round div:nth-child(3) {
			box-shadow: inset 10px 50px 80px rgba(0, 255, 0, 0.5);
			-webkit-animation: change 5s linear infinite;
		}
		.round div:nth-child(4) {
			box-shadow: inset 10px 50px 80px rgba(0, 175, 0, 0.5);
			-webkit-animation: change 6s linear infinite;
		}
		.round div:nth-child(5) {
			box-shadow: inset 10px 50px 80px rgba(0, 0, 175, 0.5);
			-webkit-animation: change 7s linear infinite;
		}
		@-webkit-keyframes 'change' {
			from {-webkit-transform: rotate(0deg);}
			to {-webkit-transform: rotate(360deg);}
		}
		.round span:nth-child(6) {
			display: block;
			line-height: 400px;
			font-size: 42px;
			font-weight: bold;
			text-align: center;
			-webkit-animation: change2 5s linear infinite;
		}
		@-webkit-keyframes 'change2' {
			0 {color: rgba(0, 0, 0, 1);}
			10% {color: rgba(0, 0, 255, 0.5);}
			20% {color: rgba(0, 255, 255, 1);}
			30% {color: rgba(175, 255, 0, 0.5);}
			40% {color: rgba(255, 175, 255, 1);}
			50% {color: rgba(255, 0, 255, 0.5);}
			60% {color: rgba(175, 0, 175, 1);}
			70% {color: rgba(0, 175, 255, 0.5);}
			80% {color: rgba(255, 175, 175, 1);}
			90% {color: rgba(175, 175, 255, 0.5);}
			100% {color: rgba(0, 0, 0, 1);}
		}

html源码:

<body>
   	<div class='round'>
   		<div></div>
   		<div></div>
   		<div></div>
   		<div></div>
   		<div></div>
   		<span>loading...</span>
   	</div>
</body>


未经过本人许可,请勿私自转载,谢谢!




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值