css3好看的六图3D旋转

html:

<html><head lang="en">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>cs3旋转动画实现地球周转</title>
<link rel="stylesheet" href="./css.css">
<script type="text/javascript" src="./js.js"></script>
</head>
<body>
<div id="content">
<div class="inner pr">
<div class="con_bg ">
<div class="section3">
<div class="u_fr">
<div class="ui_base u_p3d">
<div class="ball_c"></div>
<div  id="baseall"  class="base u_p3d">
<div class="ball_base u_p3d ball_1">
<div  id="base11" class="ball">
<img src="./_09.png" alt=""></div></div>
<div class="ball_base u_p3d ball_2">
<div id="base22"  class="ball">
<img src="./_33.png" alt=""></div></div>
<div class="ball_base u_p3d ball_3">
<div id="base33" class="ball">
<img src="./_14.png" alt=""></div></div>
<div class="ball_base u_p3d ball_4">
<div id="base44" class="ball">
<img src="./_03.png" alt=""></div></div>
<div class="ball_base u_p3d ball_5">
<div id="base55" class="ball">
<img src="./_27.png" alt=""></div></div>
<div class="ball_base u_p3d ball_6">
<div id="base66" class="ball">
<a href=''><img src="./_30.png" alt=""></a></div>
</div></div></div></div></div></div></div></div></body></html>

css:

.section3 .ball_base {	background:blue;}
.section3 .base{	background:green;}
.section3 .ball {	background:#9c4227;} 
.section3{width:1000px;height:680px;margin:40px auto 0;background:url(../img/147_03.png) 32px 65px no-repeat}
.u_p3d{-webkit-transform-style:preserve-3d;-ms-transform-style:preserve-3d;-o-transform-style:preserve-3d;-moz-transform-style:preserve-3d;transform-style:preserve-3d}
.section3 .ui_base{position:relative;top:90px;left:280px;width:400px;height:0;-webkit-perspective:1000px;-moz-perspective:1000px;-ms-perspective:1000px;-o-perspective:1000px;perspective:1000px;-webkit-perspective-origin:50% 0%;-moz-perspective-origin:50% 0%;-o-perspective-origin:50% 0%;-ms-perspective-origin:50% 0%;perspective-origin:50% 0%}
.section3 .ball_c{-webkit-transform-origin:50% 50%;-moz-transform-origin:50% 50%;-ms-transform-origin:50% 50%;-o-transform-origin:50% 50%;transform-origin:50% 50%;position:absolute;width:225px;height:157px;line-height:157px;text-align:center;background:url(../img/zfzs.png) no-repeat;left:90px;top:100px}
.section3 .ball_c img{width:125px;height:125px;border-radius:10px}
.section3 .ball_c p{margin-top:-70px}
.section3 .ball_c p a{font-size:19px;font-family:""}
.section3 .base{-webkit-transform:rotateX(80deg) rotateY(-10deg);-moz-transform:rotateX(80deg) rotateY(-10deg);-o-transform:rotateX(80deg) rotateY(-10deg);-ms-transform:rotateX(80deg) rotateY(-10deg);transform:rotateX(80deg) rotateY(-10deg);position:relative;width:350px;height:350px;-webkit-backface-visibility:hidden;backface-visibility:hidden;top:-38px;left:40px}
.section3 .ball_base{-webkit-transform-origin:225px 0;-moz-transform-origin:225px 0;-ms-transform-origin:225px 0;-o-transform-origin:225px 0;transform-origin:225px 0;position:absolute;top:175px;left:-50px;width:225px;height:127px}
.section3 .ball_1{transform:rotateX(-90deg) rotateY(0deg) translateY(-70px)}
.section3 .ball_2{transform:rotateX(-90deg) rotateY(60deg) translateY(-70px)}
.section3 .ball_3{transform:rotateX(-90deg) rotateY(120deg) translateY(-70px)}
.section3 .ball_4{transform:rotateX(-90deg) rotateY(180deg) translateY(-70px)}
.section3 .ball_5{transform:rotateX(-90deg) rotateY(240deg) translateY(-70px)}
.section3 .ball_6{transform:rotateX(-90deg) rotateY(300deg) translateY(-70px)}
.section3 .ball{-webkit-transition:all 2s ease-out 0ms;-o-transition:all 2s ease-out 0ms;-moz-transition:all 2s ease-out 0ms;-ms-transition:all 2s ease-out 0ms;transition:all 2s ease-out 0ms;-webkit-transform-origin:50% 50%;-o-transform-origin:50% 50%;-ms-transform-origin:50% 50%;-moz-transform-origin:50% 50%;transform-origin:50% 50%;position:absolute;left:-200px;top:-30px;overflow:hidden}
.section3 .ball img{width:110px;height:110px}
.section3 .ball_1 .ball{-webkit-animation:cir1 28s linear 0s infinite;-o-animation:cir1 28s linear 0s infinite;-ms-animation:cir1 28s linear 0s infinite;-moz-animation:cir1 28s linear 0s infinite;}
.section3 .ball_2 .ball{-webkit-animation:cir2 28s linear 0s infinite;-o-animation:cir2 28s linear 0s infinite;-ms-animation:cir2 28s linear 0s infinite;-moz-animation:cir2 28s linear 0s infinite;animation:cir2 28s linear 0s infinite}
.section3 .ball_3 .ball{-webkit-animation:cir3 28s linear 0s infinite;-o-animation:cir3 28s linear 0s infinite;-ms-animation:cir3 28s linear 0s infinite;-moz-animation:cir3 28s linear 0s infinite;animation:cir3 28s linear 0s infinite}
.section3 .ball_4 .ball{-webkit-animation:cir4 28s linear 0s infinite;-o-animation:cir4 28s linear 0s infinite;-ms-animation:cir4 28s linear 0s infinite;-moz-animation:cir4 28s linear 0s infinite;animation:cir4 28s linear 0s infinite}
.section3 .ball_5 .ball{-webkit-animation:cir5 28s linear 0s infinite;-o-animation:cir5 28s linear 0s infinite;-ms-animation:cir5 28s linear 0s infinite;-moz-animation:cir5 28s linear 0s infinite;animation:cir5 28s linear 0s infinite}
.section3 .ball_6 .ball{-webkit-animation:cir6 28s linear 0s infinite;-o-animation:cir6 28s linear 0s infinite;-ms-animation:cir6 28s linear 0s infinite;-moz-animation:cir6 28s linear 0s infinite;animation:cir6 28s linear 0s infinite}
.section3 .base{-webkit-animation:cir 28s linear 0s infinite;-o-animation:cir 28s linear 0s infinite;-ms-animation:cir 28s linear 0s infinite;-mozanimation:cir 28s linear 0s infinite;animation:cir 28s linear 0s infinite}
@-webkit-keyframes cir1{0%{-webkit-transform:rotateY(0deg) rotateZ(10deg)}100%{-webkit-transform:rotateY(-360deg) rotateZ(10deg)}}
@keyframes cir1{0%{transform:rotateY(0deg) rotateZ(10deg)}100%{transform:rotateY(-360deg) rotateZ(10deg)}}
@-webkit-keyframes cir2{0%{-webkit-transform:rotateY(-60deg) rotateZ(10deg)}100%{-webkit-transform:rotateY(-420deg) rotateZ(10deg)}}
@keyframes cir2{0%{transform:rotateY(-60deg) rotateZ(10deg)}100%{transform:rotateY(-420deg) rotateZ(10deg)}}
@-webkit-keyframes cir3{0%{-webkit-transform:rotateY(-120deg) rotateZ(10deg)}100%{-webkit-transform:rotateY(-480deg) rotateZ(10deg)}}
@keyframes cir3{0%{transform:rotateY(-120deg) rotateZ(10deg)}100%{transform:rotateY(-480deg) rotateZ(10deg)}}
@-webkit-keyframes cir4{0%{-webkit-transform:rotateY(-180deg) rotateZ(10deg)}100%{-webkit-transform:rotateY(-540deg) rotateZ(10deg)}}
@keyframes cir4{0%{transform:rotateY(-180deg) rotateZ(10deg)}100%{transform:rotateY(-540deg) rotateZ(10deg)}}
@-webkit-keyframes cir5{0%{-webkit-transform:rotateY(-240deg) rotateZ(10deg)}100%{-webkit-transform:rotateY(-600deg) rotateZ(10deg)}}
@keyframes cir5{0%{transform:rotateY(-240deg) rotateZ(10deg)}100%{transform:rotateY(-600deg) rotateZ(10deg)}}
@-webkit-keyframes cir6{0%{-webkit-transform:rotateY(-300deg) rotateZ(10deg)}100%{-webkit-transform:rotateY(-660deg) rotateZ(10deg)}}
@keyframes cir6{0%{transform:rotateY(-300deg) rotateZ(10deg)}100%{transform:rotateY(-660deg) rotateZ(10deg)}}
@keyframes cir{0%{transform:rotateX(80deg) rotateY(-10deg) rotateZ(0deg)}100%{transform:rotateX(80deg) rotateY(-10deg) rotateZ(-360deg)}}
@-webkit-keyframes cir{0%{-webkit-transform:rotateX(80deg) rotateY(-10deg) rotateZ(0deg)}100%{-webkit-transform:rotateX(80deg) rotateY(-10deg) rotateZ(-360deg)}}

可以用js设置开始和暂停:

//暂停
document.getElementById('***').style.setProperty('animation-play-state','paused');
开始
document.getElementById('***').style.setProperty('animation-play-state','');
或者
document.getElementById('***').style.setProperty('animation-play-state','running');
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值