练习 css3动画

在这里插入图片描述
代码:

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>练习 CSS3动画</title>
	<style type="text/css">
		body {
		  background-color : grey;
		}
		div{
			margin: 5px;
		}
		#caseVerte {
		  background-color : #30bf82;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float :left;
		}
		#caseBleu {
		  background-color : #40dbff;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float : left;
		}
		#caseRouge {
		  background-color : #bf3037;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float : left;
		  position : relative;
		}
		#caseMarron {
		  background-color : #ffa773;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float : left;
		  position : relative;
		}
		#caseViolette {
		  background-color : #592780;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float : left;
		  position : relative;
		}
		#caseBlanche {
		  background-color : #C2C2C2;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float : left;
		  position : relative;
		}
		#casePourpre {
		  background-color : #422c83;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float : left;
		  position : relative;
		}

		#caseVerteClaire {
		  background-color : #C9F76F;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float : left;
		  position : relative;
		}

		#caseGrise {
		  background-color : #222222;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float : left;
		  position : relative;
		}

		#caseMarronFonce {
		  background-color : #FFEC73;
		  height : 140px;
		  width : 150px;
		  padding-top : 10px;
		  float : left;
		  position : relative;
		}
		#caseVerte #load {
		  color : #fbfbfb;
		  font-family : calibri;
		  text-align : center;
		}
		#caseBleu #load {
		  color : #0086a6;
		  font-family : calibri;
		  text-align : center;
		}
		#caseRouge #load {
		  color : #ff737a;
		  font-family : calibri;
		  text-align : center;
		  margin-top : 50px; 
		}
		#caseMarron #load {
		  color : #bf6530;
		  font-family : calibri;
		  text-align : center;
		  margin-top : 50px; 
		}
		#caseViolette #load {
		  color : #D8A6FF;
		  font-family : calibri;
		  text-align : center;
		  margin-top : 100px;
		}
		#caseBlanche #load {
		  color : #fff;
		  font-family : calibri;
		  text-align : center;
		  position : absolute;
		  top : 42px;
		  left :42px;
		}
		#casePourpre #load {
		  color : #886ed7;
		  font-family : calibri;
		  text-align : center;
		  position : absolute;
		  top : 42px;
		  left :42px;
		}

		#caseVerteClaire #load {
		  color : #444444;
		  font-family : calibri;
		  text-align : center;
		  position : absolute;
		  top : 42px;
		  left :42px;
		}

		#caseGrise #load {
		  color : #222;
		  font-family : calibri;
		  text-align : center;
		  position : relative;
		  top : 42px;
		  font-size : 11px;
		}
		#caseVerte #case1 {
		  height  : 10px;
		  width : 100px;
		  background-color : #fbfbfb;
		  animation : case1 2.25s infinite;
		}

		#caseBleu #case1 {
		  height  : 10px;
		  width : 100px;
		  background-color : #0086a6;
		  animation : case1 2.25s infinite;
		}

		
		@keyframes case1 {
		  0% {width : 0%;}
		  50% {width : 90px;}
		  100% {width : 0%;}
		}

		#caseVerte #case2 {
		  height : 10px;
		  width : 10px;
		  background-color : #fbfbfb;
		  animation : case2 2s infinite;
		}

		#caseBleu #case2 {
		  height : 10px;
		  width : 10px;
		  background-color : #0086a6;
		  animation : case2 2s infinite;
		}

		@keyframes case2 {
		  0% {width : 0%;}
		  50% {width : 100px;}
		  100% {width : 0%;}
		}

		#caseVerte #case3 {
		  height : 10px;
		  width : 10px;
		  background-color : #fbfbfb;
		  animation : case3 1.75s infinite;
		}

		#caseBleu #case3 {
		  height : 10px;
		  width : 10px;
		  background-color : #0086a6;
		  animation : case3 1.75s infinite;
		}

		@keyframes case3 {
		  0% {width : 0%;}
		  50% {width : 95px;}
		  100% {width : 0%;}
		}

		#caseVerte #case4 {
		  height : 10px;
		  width : 10px;
		  background-color : #fbfbfb;
		  animation : case3 2.5s infinite;
		}

		#caseBleu #case4 {
		  height : 10px;
		  width : 10px;
		  background-color : #0086a6;
		  animation : case3 2.5s infinite;
		}

		@keyframes case4 {
		  0% {width : 0%;}
		  50% {width : 80px;}
		  100% {width : 0%;}
		}

		#caseVerte #case5 {
		  height : 10px;
		  width : 10px;
		  background-color : #fbfbfb;
		  animation : case3 1.5s infinite;
		}

		#caseBleu #case5 {
		  height : 10px;
		  width : 10px;
		  background-color : #0086a6;
		  animation : case3 1.5s infinite;
		}

		@keyframes case5 {
		  0% {width : 0%;}
		  50% {width : 105px;}
		  100% {width : 0%;}
		}

		#caseVerte #case6 {
		  height : 10px;
		  width : 10px;
		  background-color : #fbfbfb;
		  animation : case3 5s infinite;
		}

		#caseBleu #case6 {
		  height : 10px;
		  width : 10px;
		  background-color : #0086a6;
		  animation : case3 5s infinite;
		}

		@keyframes case6 {
		  0% {width : 0%;}
		  50% {width : 75px;}
		  100% {width : 0%;}
		}

		#top{
			height: 10px;
			width: 10px;
			border-radius: 50%;
			background-color: rgba(255,255,255,.5);
			position: absolute;
			top : 10px;
			left : 65px;
			animation: turnTop 2s infinite;
		}

		@keyframes turnTop{
			0%{top: 10px;}
			50%{top: 40px;background-color: rgba(255,255,255,1)}
			100%{top:10px;}
		}

		#left{
			height: 10px;
			width: 10px;
			border-radius: 50%;
			background-color: rgba(255,255,255,.5);
			position: absolute;
			bottom : 10px;
			left : 10px;
			animation: turnLeft 2s infinite;
		}
		@keyframes turnLeft{
			0% {bottom : 10px; left : 10px;}
			50% {bottom : 50px; left : 40px;background-color: rgba(255,255,255,1)}
			100% {bottom : 10px; left : 10px;}
		}

		#right {
		  height : 10px;
		  width : 10px;
		  border-radius : 50%;
		  background-color : rgba(255,255,255,.5);
		  position : absolute;
		  bottom : 10px;
		  right : 10px;
		  animation : turnRight 2s infinite;
		}
		@keyframes turnRight{
			0%{bottom : 10px;right : 10px;}
			50%{bottom: 50px; right: 40px;background-color: rgba(255,255,255,1)}
			100%{bottom : 10px;right : 10px;}
		}

		#boule {
		  height : 10px;
		  width : 10px;
		  position : absolute;
		  top : 80px;
		  left : 10px;
		  background-color : #bf6530;
		  border-radius : 50%;
		  animation : boule 2s infinite;
		}
		@keyframes boule {	
			0% {left : 10px;opacity : 0;}
			50% {height : 20px; width : 20px; opacity : 1;}
			100% {left : 120px; opacity : 0; height : 10px; width : 10px;}
		}

		#circle {
		  height : 50px;
		  width : 50px;
		  position : absolute;
		  top : 45px;
		  left : 45px;
		  border-radius : 50%;
		  background : linear-gradient(#D8A6FF,#FFECEE);
		  animation : turnCircle 2s infinite;
		  animation-timing-function : ease-in-out;
		}
		@keyframes turnCircle {
		  0% {transform : rotate(0deg);}
		  100% {transform : rotate(10080deg);}
		}

		#circleCache {
		  height : 40px;
		  width : 40px;
		  position : absolute;
		  border-radius : 50%;
		  background-color : #592780;
		  z-index : 5;
		}

		#point {
		  height : 2px;
		  width : 2px;
		  position : relative;
		  top : -22px;
		  left : 96px;
		  border-radius : 50%;
		  background-color : #D8A6FF;
		  animation : point 1.5s infinite;
		  animation-timing-function : linear;
		}
		@keyframes point {
		  0% {left : 96px; opacity : 0;}
		  5% {left : 96px; opacity : 1;}
		  15% {left : 96px; opacity : 0;}
		  30% {left : 99px; opacity : 0;}
		  45% {left : 99px; opacity : 1;}
		  60% {left : 99px; opacity : 0;}
		  75% {left : 102px; opacity : 0;}
		  90% {left : 102px; opacity : 1;}
		  100% {left : 102px; opacity : 0;}
		}

		#test {
		  height : 10px;
		  width : 10px;
		  position : absolute;
		  background-color : #fff;
		  border-radius : 50%;
		  top : 0px;
		  left : 10px;
		}

		#rond {
		  height  : 100px;
		  width : 100px;
		  border : 1px solid #fff;
		  border-radius : 50%;
		  position :absolute;
		  top : 20px;
		  left : 15px;
		  animation : rond 2s infinite;
		}

		@keyframes rond {
		  0% {transform : rotate(0deg);}
		  100% {transform : rotate(360deg);}
		}
		/****DEBUT VAGUE****/
		#vague {
		  position : absolute;
		  top : 72px;
		  left : 20px;
		}

		#vague1 {
		  height : 5px;
		  width : 5px;
		  background-color : #886ed7;
		  float : left;
		  animation : vague1 2.5s infinite;
		}

		@keyframes vague1 {
		  0% {height : 5px;}
		  50% {height : 30px;}
		  100% {height : 5px;}
		}

		#vague2 {
		  height : 5px;
		  width : 5px;
		  background-color : #886ed7;
		  float : left;
		  animation : vague2 2.5s infinite;
		  animation-delay : 0.5s;
		}

		@keyframes vague2 {
		  0% {height : 5px;}
		  50% {height : 30px;}
		  100% {height : 5px;}
		}

		#vague3 {
		  height : 5px;
		  width : 5px;
		  background-color : #886ed7;
		  float : left;
		  animation : vague3 2.5s infinite;
		  animation-delay : 1s;
		}

		@keyframes vague3 {
		  0% {height : 5px;}
		  50% {height : 30px;}
		  100% {height : 5px;}
		}

		#vague4 {
		  height : 5px;
		  width : 5px;
		  background-color : #886ed7;
		  float : left;
		  animation : vague4 2.5s infinite;
		  animation-delay : 1.5s;
		}

		@keyframes vague4 {
		  0% {height : 5px;}
		  50% {height : 30px;}
		  100% {height : 5px;}
		}

		#vague5 {
		  height : 5px;
		  width : 5px;
		  background-color : #886ed7;
		  float : left;
		  animation : vague5 2.5s infinite;
		  animation-delay : 2s;
		}

		@keyframes vague5 {
		  0% {height : 5px;}
		  50% {height : 30px;}
		  100% {height : 5px;}
		}

		#vague6 {
		  height : 5px;
		  width : 5px;
		  background-color : #886ed7;
		  float : left;
		  animation : vague6 2.5s infinite;
		  animation-delay : 2.5s;
		}

		@keyframes vague6 {
		  0% {height : 5px;}
		  50% {height : 30px;}
		  100% {height : 5px;}
		}
		/****FIN VAGUE****/

		/****DEBUT TRANSFORM****/
		#tranform {
		  position : absolute;
		  top : 85px;
		  left : 30px;
		}

		#transform1 {
		  height : 30px;
		  width : 30px;
		  border-radius : 50%; 
		  background-color : #444444;
		  position : absolute;
		  top : 85px;
		  left : 15px;
		  opacity : 0;
		  animation : transform 4s infinite;
		}

		#transform2 {
		  height : 30px;
		  width : 30px;
		  border-radius : 50%; 
		  background-color : #444444;
		  position : absolute;
		  top : 85px;
		  left : 54px;
		  opacity : 0;
		  animation : transform 4s infinite;
		  animation-delay : 0.5s;
		}

		#transform3 {
		  height : 30px;
		  width : 30px;
		  border-radius : 50%; 
		  background-color : #444444;
		  position : absolute;
		  top : 85px;
		  left : 94px;
		  opacity : 0;
		  animation : transform 4s infinite;
		  animation-delay : 1s;
		}

		@keyframes transform {
		  0% {border-radius : 0px; opacity : 0;}
		  20% {border-radius : 0px; opacity : 1;}
		  40% {border-radius : 0px; opacity : 0;}
		  60% {border-radius : 50%; opacity : 0;}
		  80% {border-radius : 50%; opacity : 1;}
		  100% {border-radius : 50%; opacity : 0;}
		}

		#progress {
		  height : 10px;
		  width : 120px;
		  position : absolute;
		  top : 60px;
		  left : 10px;
		  box-shadow : 0px 0px 10px #111111 inset;
		}

		#charge {
		  height : 10px;
		  width : 120px;
		  position : absolute;
		  top : 0px;
		  left : 0px;
		  background-color : #C9F76F;
		  margin : 0px;
		  animation : charge 7s infinite;
		  box-shadow : 0px 0px 5px #222 inset;
		}


		@keyframes charge {
		  0% {width : 0px;}
		  100% {width : 100%;}
		}

		#spinner {
		  height : 40px;
		  width : 40px;
		  border : 2px solid #61615e;
		  border-left-color : transparent;
		  border-right-color : transparent;
		  border-radius : 50%;
		  animation : spin 2s infinite;
		}


		@keyframes spin {
		  0% {transform : rotate(0deg);}
		  50% {transform : rotate(360deg);}
		  100% {transform : rotate(0deg);}
		}
	</style>
</head>
<body>
	<div id="caseVerte">  
		<div id="case1"></div>
		<div id="case2"></div>
		<div id="case3"></div>
		<div id="case4"></div>
		<div id="case5"></div>
		<div id="case6"></div>
		<div id="load">
			<p>loading ...</p>
		</div>
	</div>
	<div id="caseBleu">  
		<div id="case1"></div>
		<div id="case2"></div>
		<div id="case3"></div>
		<div id="case4"></div>
		<div id="case5"></div>
		<div id="case6"></div>
		<div id="load">
			<p>loading ...</p>
		</div>
	</div>
	<div id="caseRouge">
		<div id="load">
			<p>loading ...</p>
		</div>
		<div id="top"></div>
		<div id="left"></div>
		<div id="right"></div>
	</div>
	<div id="caseMarron">
		<div id="boule"></div>
		<div id="load">
			<p>loading ...</p>
		</div>
	</div>
	<div id="caseViolette">
		<div id="circle">
			<div id="circleCache"></div>
		</div>
		<div id="load">
			<p>loading</p>
		</div>
		<div id="point"></div>
	</div>
	<div id="caseBlanche">
		<div id="rond">
			<div id="test"></div>
		</div>
		<div id="load">
			<p>loading</p>
		</div>
	</div>
	<div id="casePourpre">
		<div id="load">
			<p>loading</p>
		</div>
		<div id="vague">
			<div id="vague1"></div>
			<div id="vague2"></div>
			<div id="vague3"></div>
			<div id="vague4"></div>
			<div id="vague5"></div>
			<div id="vague6"></div>
		</div>
	</div>
	<div id="caseVerteClaire">
		<div id="transform">
			<div id="transform1"></div>
			<div id="transform2"></div>
			<div id="transform3"></div>
		</div>
		<div id="load">
			<p>loading</p>
		</div>
	</div>
	<div id="caseGrise">
		<div id="progress">
			<div id="charge"></div>
		</div>
		<div id="load">
			<p>loading</p>
		</div>
	</div>
	<div id="caseMarronFonce">
		<div id="spinner"></div>
	</div>
</body>
</html>
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值