以下是 HTML5球体斑点运动动画代码 的示例演示效果:
部分效果截图:
HTML代码(index.html):
<!DOCTYPE html>
<html>
<head>
<meta charset="gb2312">
<title>HTML5球体斑点运动动画</title>
<style>
*, *:before, *:after {
box-sizing: border-box;
}
html {
background: #222222;
}
.scene {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
width: 300px;
height: 300px;
border-radius: 50%;
background: rgba(61, 184, 245, 0.85);
perspective: 9999px;
transform-style: preserve-3d;
}
.scene:before,
.scene:after {
position: absolute;
width: 100%;
border-radius: 50%;
content: '';
}
.scene:before {
top: 400px;
height: 50px;
background: rgba(0, 0, 0, 0.25);
}
.scene:after {
top: 0;
height: 100%;
border: 3px solid black;
border-radius: 50%;
box-shadow: -20px -20px 0 rgba(0, 0, 0, 0.25) inset;
transform: translateZ(151px);
}
.sphere {
width: 100%;
height: 100%;
animation: rotate 24s infinite linear;
transform-style: preserve-3d;
}
.ring {
position: absolute;
width: 100%;
height: 100%;
transform-style: preserve-3d;
}
.spoke {
position: absolute;
top: 0;
bottom: 0;
margin: auto;
width: 100%;
height: 0;
transform-style: preserve-3d;
}
.sphere #ring1 {
animation: rotateRing1 24s infinite ease-in-out alternate;
}
.sphere #ring2 {
animation: rotateRing2 24s infinite ease-in-out alternate;
}
.sphere #ring3 {
animation: rotateRing3 24s infinite ease-in-out alternate;
}
.sphere #ring4 {
animation: rotateRing4 24s infinite ease-in-out alternate;
}
.sphere #ring5 {
animation: rotateRing5 24s infinite ease-in-out alternate;
}
.sphere #ring6 {
animation: rotateRing6 24s infinite ease-in-out alternate;
}
.sphere #ring7 {
animation: rotateRing7 24s infinite ease-in-out alternate;
}
.sphere #ring8 {
animation: rotateRing8 24s infinite ease-in-out alternate;
}
.sphere #ring9 {
animation: rotateRing9 24s infinite ease-in-out alternate;
}
.sphere #ring10 {
animation: rotateRing10 24s infinite ease-in-out alternate;
}
.sphere #ring11 {
animation: rotateRing11 24s infinite ease-in-out alternate;
}
.sphere #ring12 {
animation: rotateRing12 24s infinite ease-in-out alternate;
}
.sphere #spoke1 {
animation: rotateSpoke1 60s infinite ease-in-out alternate;
}
.sphere #spoke2 {
animation: rotateSpoke2 60s infinite ease-in-out alternate;
}
.sphere #spoke3 {
animation: rotateSpoke3 60s infinite ease-in-out alternate;
}
.sphere #spoke4 {
animation: rotateSpoke4 60s infinite ease-in-out alternate;
}
.sphere #spoke5 {
animation: rotateSpoke5 60s infinite ease-in-out alternate;
}
.sphere #spoke6 {
animation: rotateSpoke6 60s infinite ease-in-out alternate;
}
.sphere #spoke7 {
animation: rotateSpoke7 60s infinite ease-in-out alternate;
}
.sphere #spoke8 {
animation: rotateSpoke8 60s infinite ease-in-out alternate;
}
.sphere #spoke9 {
animation: rotateSpoke9 60s infinite ease-in-out alternate;
}
.sphere #spoke10 {
animation: rotateSpoke10 60s infinite ease-in-out alternate;
}
.sphere #spoke11 {
animation: rotateSpoke11 60s infinite ease-in-out alternate;
}
.sphere #spoke12 {
animation: rotateSpoke12 60s infinite ease-in-out alternate;
}
.spoke:before,
.spoke:after {
position: absolute;
width: 12px;
height: 12px;
border-radius: 50%;
background: #fafa9e;
content: '';
transform: rotateY(90deg);
}
.spoke:before {
top: -6px;
right: -6px;
transform: rotateY(90deg);
}
.spoke:after {
top: -6px;
left: -6px;
transform: rotateY(-90deg);
}
@keyframes rotateRing1 {
0% {
transform: rotateX(32.72727deg);
}
20% {
transform: rotateX(30deg);
}
40% {
transform: rotateY(32.72727deg);
}
60% {
transform: rotateY(30deg);
}
80% {
transform: rotateZ(32.72727deg);
}
100% {
transform: rotateZ(30deg);
}
}
@keyframes rotateRing2 {
0% {
transform: rotateX(65.45455deg);
}
20% {
transform: rotateX(60deg);
}
40% {
transform: rotateY(65.45455deg);
}
60% {
transform: rotateY(60deg);
}
80% {
transform: rotateZ(65.45455deg);
}
100% {
transform: rotateZ(60deg);
}
}
@keyframes rotateRing3 {
0% {
transform: rotateX(98.18182deg);
}
20% {
transform: rotateX(90deg);
}
40% {
transform: rotateY(98.18182deg);
}
60% {
transform: rotateY(90deg);
}
80% {
transform: rotateZ(98.18182deg);
}
100% {
transform: rotateZ(90deg);
}
}
@keyframes rotateRing4 {
0% {
transform: rotateX(130.90909deg);
}
20% {
transform: rotateX(120deg);
}
40% {
transform: rotateY(130.90909deg);
}
60% {
transform: rotateY(120deg);
}
80% {
transform: rotateZ(130.90909deg);
}
100% {
transform: rotateZ(120deg);
}
}
@keyframes rotateRing5 {
0% {
transform: rotateX(163.63636deg);
}
20% {
transform: rotateX(150deg);
}
40% {
transform: rotateY(163.63636deg);
}
60% {
transform: rotateY(150deg);
}
80% {
transform: rotateZ(163.63636deg);
}
100% {
transform: rotateZ(150deg);
}
}
@keyframes rotateRing6 {
0% {
transform: rotateX(196.36364deg);
}
20% {
transform: rotateX(180deg);
}
40% {
transform: rotateY(196.36364deg);
}
60% {
transform: rotateY(180deg);
}
80% {
transform: rotateZ(196.36364deg);
}
100% {
transform: rotateZ(180deg);
}
}
@keyframes rotateRing7 {
0% {
transform: rotateX(229.09091deg);
}
20% {
transform: rotateX(210deg);
}
40% {
transform: rotateY(229.09091deg);
}
60% {
transform: rotateY(210deg);
}
80% {
transform: rotateZ(229.09091deg);
}
100% {
transform: rotateZ(210deg);
}
}
@keyframes rotateRing8 {
0% {
transform: rotateX(261.81818deg);
}
20% {
transform: rotateX(240deg);
}
40% {
transform: rotateY(261.81818deg);
}
60% {
transform: rotateY(240deg);
}
80% {
transform: rotateZ(261.81818deg);
}
100% {
transform: rotateZ(240deg);
}
}
@keyframes rotateRing9 {
0% {
transform: rotateX(294.54545deg);
}
20% {
transform: rotateX(270deg);
}
40% {
transform: rotateY(294.54545deg);
}
60% {
transform: rotateY(270deg);
}
80% {
transform: rotateZ(294.54545deg);
}
100% {
transform: rotateZ(270deg);
}
}
@keyframes rotateRing10 {
0% {
transform: rotateX(327.27273deg);
}
20% {
transform: rotateX(300deg);
}
40% {
transform: rotateY(327.27273deg);
}
60% {
transform: rotateY(300deg);
}
80% {
transform: rotateZ(327.27273deg);
}
100% {
transform: rotateZ(300deg);
}
}
@keyframes rotateRing11 {
0% {
transform: rotateX(360deg);
}
20% {
transform: rotateX(330deg);
}
40% {
transform: rotateY(360deg);
}
60% {
transform: rotateY(330deg);
}
80% {
transform: rotateZ(360deg);
}
100% {
transform: rotateZ(330deg);
}
}
@keyframes rotateRing12 {
0% {
transform: rotateX(392.72727deg);
}
20% {
transform: rotateX(360deg);
}
40% {
transform: rotateY(392.72727deg);
}
60% {
transform: rotateY(360deg);
}
80% {
transform: rotateZ(392.72727deg);
}
100% {
transform: rotateZ(360deg);
}
}
@keyframes rotateSpoke1 {
0% {
transform: rotateX(15deg);
}
10% {
transform: rotateY(15deg);
}
20% {
transform: rotateZ(15deg);
}
30% {
transform: rotateX(15deg) rotateY(15deg);
}
40% {
transform: rotateX(15deg) rotateY(15deg) rotateZ(15deg);
}
50% {
transform: rotateY(10deg);
}
60% {
transform: rotateZ(10deg);
}
70% {
transform: rotateY(15deg);
}
80% {
transform: rotateZ(15deg);
}
90% {
transform: rotateZ(15deg);
}
100% {
transform: rotateX(30deg);
}
}
@keyframes rotateSpoke2 {
0% {
transform: rotateX(30deg);
}
10% {
transform: rotateY(30deg);
}
20% {
transform: rotateZ(30deg);
}
30% {
transform: rotateX(30deg) rotateY(30deg);
}
40% {
transform: rotateX(30deg) rotateY(30deg) rotateZ(30deg);
}
50% {
transform: rotateY(20deg);
}
60% {
transform: rotateZ(20deg);
}
70% {
transform: rotateY(30deg);
}
80% {
transform: rotateZ(30deg);
}
90% {
transform: rotateZ(30deg);
}
100% {
transform: rotateX(60deg);
}
}
@keyframes rotateSpoke3 {
0% {
transform: rotateX(45deg);
}
10% {
transform: rotateY(45deg);
}
20% {
transform: rotateZ(45deg);
}
30% {
transform: rotateX(45deg) rotateY(45deg);
}
40% {
transform: rotateX(45deg) rotateY(45deg) rotateZ(45deg);
}
50% {
transform: rotateY(30deg);
}
60% {
transform: rotateZ(30deg);
}
70% {
transform: rotateY(45deg);
}
80% {
transform: rotateZ(45deg);
}
90% {
transform: rotateZ(45deg);
}
100% {
transform: rotateX(90deg);
}
}
@keyframes rotateSpoke4 {
0% {
transform: rotateX(60deg);
}
10% {
transform: rotateY(60deg);
}
20% {
transform: rotateZ(60deg);
}
30% {
transform: rotateX(60deg) rotateY(60deg);
}
40% {
transform: rotateX(60deg) rotateY(60deg) rotateZ(60deg);
}
50% {
transform: rotateY(40deg);
}
60% {
transform: rotateZ(40deg);
}
70% {
transform: rotateY(60deg);
}
80% {
transform: rotateZ(60deg);
}
90% {
transform: rotateZ(60deg);
}
100% {
transform: rotateX(120deg);
}
}
@keyframes rotateSpoke5 {
0% {
transform: rotateX(75deg);
}
10% {
transform: rotateY(75deg);
}
20% {
transform: rotateZ(75deg);
}
30% {
transform: rotateX(75deg) rotateY(75deg);
}
40% {
transform: rotateX(75deg) rotateY(75deg) rotateZ(75deg);
}
50% {
transform: rotateY(50deg);
}
60% {
transform: rotateZ(50deg);
}
70% {
transform: rotateY(75deg);
}
80% {
transform: rotateZ(75deg);
}
90% {
transform: rotateZ(75deg);
}
100% {
transform: rotateX(150deg);
}
}
@keyframes rotateSpoke6 {
0% {
transform: rotateX(90deg);
}
10% {
transform: rotateY(90deg);
}
20% {
transform: rotateZ(90deg);
}
30% {
transform: rotateX(90deg) rotateY(90deg);
}
40% {
transform: rotateX(90deg) rotateY(90deg) rotateZ(90deg);
}
50% {
transform: rotateY(60deg);
}
60% {
transform: rotateZ(60deg);
}
70% {
transform: rotateY(90deg);
}
80% {
transform: rotateZ(90deg);
}
90% {
transform: rotateZ(90deg);
}
100% {
transform: rotateX(180deg);
}
}
@keyframes rotateSpoke7 {
0% {
transform: rotateX(105deg);
}
10% {
transform: rotateY(105deg);
}
20% {
transform: rotateZ(105deg);
}
30% {
transform: rotateX(105deg) rotateY(105deg);
}
40% {
transform: rotateX(105deg) rotateY(105deg) rotateZ(105deg);
}
50% {
transform: rotateY(70deg);
}
60% {
transform: rotateZ(70deg);
}
70% {
transform: rotateY(105deg);
}
80% {
transform: rotateZ(105deg);
}
90% {
transform: rotateZ(105deg);
}
100% {
transform: rotateX(210deg);
}
}
@keyframes rotateSpoke8 {
0% {
transform: rotateX(120deg);
}
10% {
transform: rotateY(120deg);
}
20% {
transform: rotateZ(120deg);
}
30% {
transform: rotateX(120deg) rotateY(120deg);
}
40% {
transform: rotateX(120deg) rotateY(120deg) rotateZ(120deg);
}
50% {
transform: rotateY(80deg);
}
60% {
transform: rotateZ(80deg);
}
70% {
transform: rotateY(120deg);
}
80% {
transform: rotateZ(120deg);
}
90% {
transform: rotateZ(120deg);
}
100% {
transform: rotateX(240deg);
}
}
@keyframes rotateSpoke9 {
0% {
transform: rotateX(135deg);
}
10% {
transform: rotateY(135deg);
}
20% {
transform: rotateZ(135deg);
}
30% {
transform: rotateX(135deg) rotateY(135deg);
}
40% {
transform: rotateX(135deg) rotateY(135deg) rotateZ(135deg);
}
50% {
transform: rotateY(90deg);
}
60% {
transform: rotateZ(90deg);
}
70% {
transform: rotateY(135deg);
}
80% {
transform: rotateZ(135deg);
}
90% {
transform: rotateZ(135deg);
}
100% {
transform: rotateX(270deg);
}
}
@keyframes rotateSpoke10 {
0% {
transform: rotateX(150deg);
}
10% {
transform: rotateY(150deg);
}
20% {
transform: rotateZ(150deg);
}
30% {
transform: rotateX(150deg) rotateY(150deg);
}
40% {
transform: rotateX(150deg) rotateY(150deg) rotateZ(150deg);
}
50% {
transform: rotateY(100deg);
}
60% {
transform: rotateZ(100deg);
}
70% {
transform: rotateY(150deg);
}
80% {
transform: rotateZ(150deg);
}
90% {
transform: rotateZ(150deg);
}
100% {
transform: rotateX(300deg);
}
}
@keyframes rotateSpoke11 {
0% {
transform: rotateX(165deg);
}
10% {
transform: rotateY(165deg);
}
20% {
transform: rotateZ(165deg);
}
30% {
transform: rotateX(165deg) rotateY(165deg);
}
40% {
transform: rotateX(165deg) rotateY(165deg) rotateZ(165deg);
}
50% {
transform: rotateY(110deg);
}
60% {
transform: rotateZ(110deg);
}
70% {
transform: rotateY(165deg);
}
80% {
transform: rotateZ(165deg);
}
90% {
transform: rotateZ(165deg);
}
100% {
transform: rotateX(330deg);
}
}
@keyframes rotateSpoke12 {
0% {
transform: rotateX(180deg);
}
10% {
transform: rotateY(180deg);
}
20% {
transform: rotateZ(180deg);
}
30% {
transform: rotateX(180deg) rotateY(180deg);
}
40% {
transform: rotateX(180deg) rotateY(180deg) rotateZ(180deg);
}
50% {
transform: rotateY(120deg);
}
60% {
transform: rotateZ(120deg);
}
70% {
transform: rotateY(180deg);
}
80% {
transform: rotateZ(180deg);
}
90% {
transform: rotateZ(180deg);
}
100% {
transform: rotateX(360deg);
}
}
@keyframes rotate {
100% {
transform: rotateX(360deg) rotateY(720deg) rotateZ(360deg);
}
}
</style>
<script src="js/prefixfree.min.js"></script>
<script src="js/modernizr.js"></script>
</head>
<body>
<div class='scene'>
<div class='sphere'>
<div class='ring' id='ring1'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring2'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring3'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring4'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring5'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring6'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring7'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring8'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring9'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring10'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring11'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
<div class='ring' id='ring12'>
<div class='spoke' id='spoke1'></div>
<div class='spoke' id='spoke2'></div>
<div class='spoke' id='spoke3'></div>
<div class='spoke' id='spoke4'></div>
<div class='spoke' id='spoke5'></div>
<div class='spoke' id='spoke6'></div>
<div class='spoke' id='spoke7'></div>
<div class='spoke' id='spoke8'></div>
<div class='spoke' id='spoke9'></div>
<div class='spoke' id='spoke10'></div>
<div class='spoke' id='spoke11'></div>
<div class='spoke' id='spoke12'></div>
</div>
</div>
</div>
</body>
</html>
JS代码(prefixfree.min.js):
/** * StyleFix 1.0.3 & PrefixFree 1.0.7 * @author Lea Verou * MIT license */
(function(){
function t(e,t){
return[].slice.call((t||document).querySelectorAll(e))}
if(!window.addEventListener)return;
var e=window.StyleFix={
link:function(t){
try{
if(t.rel!=="stylesheet"||t.hasAttribute("data-noprefix"))return}
catch(n){
return}
var r=t.href||t.getAttribute("data-href"),i=r.replace(/[^\/]+$/,""),s=(/^[a-z]{
3,10}
:/.exec(i)||[""])[0],o=(/^[a-z]{
3,10}
:\/\/[^\/]+/.exec(i)||[""])[0],u=/^([^?]*)\??/.exec(r)[1],a=t.parentNode,f=new XMLHttpRequest,l;
f.onreadystatechange=function(){
f.readyState===4&&l()}
,l=function(){
var n=f.responseText;
if(n&&t.parentNode&&(!f.status||f.status<400||f.status>600)){
n=e.fix(n,!0,t);
if(i){
n=n.replace(/url\(\s*?((?:"|')?)(.+?)\1\s*?\)/gi,function(e,t,n){
return/^([a-z]{
3,10}
:|#)/i.test(n)?e:/^\/\//.test(n)?'url("'+s+n+'")':/^\//.test(n)?'url("'+o+n+'")':/^\?/.test(n)?'url("'+u+n+'")':'url("'+i+n+'")'}
);
var r=i.replace(/([\\\^\$*+[\]?{
}
.=!:(|)])/g,"\\$1");
n=n.replace(RegExp("\\b(behavior:\\s*?url\\('?\"?)"+r,"gi"),"$1")}
var l=document.createElement("style");
l.textContent=n,l.media=t.media,l.disabled=t.disabled,l.setAttribute("data-href",t.getAttribute("href")),a.insertBefore(l,t),a.removeChild(t),l.media=t.media}
}
;
try{
f.open("GET",r),f.send(null)}
catch(n){
typeof XDomainRequest!="undefined"&&(f=new XDomainRequest,f.onerror=f.onprogress=function(){
}
,f.onload=l,f.open("GET",r),f.send(null))}
t.setAttribute("data-inprogress","")}
,styleElement:function(t){
if(t.hasAttribute("data-noprefix"))return;
var n=t.disabled;
t.textContent=e.fix(t.textContent,!0,t),t.disabled=n}
,styleAttribute:function(t){
var n=t.getAttribute("style");
n=e.fix(n,!1,t),t.setAttribute("style",n)}
,process:function(){
t("style").forEach(StyleFix.styleElement),t("[style]").forEach(StyleFix.styleAttribute)}
,register:function(t,n){
(e.fixers=e.fixers||[]).splice(n===undefined?e.fixers.length:n,0,t)}
,fix:function(t,n,r){
for(var i=0;
i<e.fixers.length;
i++)t=e.fixers[i](t,n,r)||t;
return t}
,camelCase:function(e){
return e.replace(/-([a-z])/g,function(e,t){
return t.toUpperCase()}
).replace("-","")}
,deCamelCase:function(e){
return e.replace(/[A-Z]/g,function(e){
return"-"+e.toLowerCase()}
)}
}
;
(function(){
setTimeout(function(){
}
,10),document.addEventListener("DOMContentLoaded",StyleFix.process,!1)}
)()}
)(),function(e){
function t(e,t,r,i,s){
e=n[e];
if(e.length){
var o=RegExp(t+"("+e.join("|")+")"+r,"gi");
s=s.replace(o,i)}
return s}
if(!window.StyleFix||!window.getComputedStyle)return;
var n=window.PrefixFree={
prefixCSS:function(e,r,i){
var s=n.prefix;
n.functions.indexOf("linear-gradient")>-1&&(e=e.replace(/(\s|:|,)(repeating-)?linear-gradient\(\s*(-?\d*\.?\d*)deg/ig,function(e,t,n,r){
return t+(n||"")+"linear-gradient("+(90-r)+"deg"}
)),e=t("functions","(\\s|:|,)","\\s*\\(","$1"+s+"$2(",e),e=t("keywords","(\\s|:)","(\\s|;
|\\}
|$)","$1"+s+"$2$3",e),e=t("properties","(^|\\{
|\\s|;
)","\\s*:","$1"+s+"$2:",e);
if(n.properties.length){
var o=RegExp("\\b("+n.properties.join("|")+")(?!:)","gi");
e=t("valueProperties","\\b",":(.+?);
",function(e){
return e.replace(o,s+"$1")}
,e)}
return r&&(e=t("selectors","","\\b",n.prefixSelector,e),e=t("atrules","@","\\b","@"+s+"$1",e)),e=e.replace(RegExp("-"+s,"g"),"-"),e=e.replace(/-\*-(?=[a-z]+)/gi,n.prefix),e}
,property:function(e){
return(n.properties.indexOf(e)?n.prefix:"")+e}
,value:function(e,r){
return e=t("functions","(^|\\s|,)","\\s*\\(","$1"+n.prefix+"$2(",e),e=t("keywords","(^|\\s)","(\\s|$)","$1"+n.prefix+"$2$3",e),e}
,prefixSelector:function(e){
return e.replace(/^:{
1,2}
/,function(e){
return e+n.prefix}
)}
,prefixProperty:function(e,t){
var r=n.prefix+e;
return t?StyleFix.camelCase(r):r}
}
;
(function(){
var e={
}
,t=[],r={
}
,i=getComputedStyle(document.documentElement,null),s=document.createElement("div").style,o=function(n){
if(n.charAt(0)==="-"){
t.push(n);
var r=n.split("-"),i=r[1];
e[i]=++e[i]||1;
while(r.length>3){
r.pop();
var s=r.join("-");
u(s)&&t.indexOf(s)===-1&&t.push(s)}
}
}
,u=function(e){
return StyleFix.camelCase(e)in s}
;
if(i.length>0)for(var a=0;
a<i.length;
a++)o(i[a]);
else for(var f in i)o(StyleFix.deCamelCase(f));
var l={
uses:0}
;
for(var c in e){
var h=e[c];
l.uses<h&&(l={
prefix:c,uses:h}
)}
n.prefix="-"+l.prefix+"-",n.Prefix=StyleFix.camelCase(n.prefix),n.properties=[];
for(var a=0;
a<t.length;
a++){
var f=t[a];
if(f.indexOf(n.prefix)===0){
var p=f.slice(n.prefix.length);
u(p)||n.properties.push(p)}
}
n.Prefix=="Ms"&&!("transform"in s)&&!("MsTransform"in s)&&"msTransform"in s&&n.properties.push("transform","transform-origin"),n.properties.sort()}
)(),function(){
function i(e,t){
return r[t]="",r[t]=e,!!r[t]}
var e={
"linear-gradient":{
property:"backgroundImage",params:"red,teal"}
,calc:{
property:"width",params:"1px + 5%"}
,element:{
property:"backgroundImage",params:"#foo"}
,"cross-fade":{
property:"backgroundImage",params:"url(a.png),url(b.png),50%"}
}
;
e["repeating-linear-gradient"]=e["repeating-radial-gradient"]=e["radial-gradient"]=e["linear-gradient"];
var t={
initial:"color","zoom-in":"cursor","zoom-out":"cursor",box:"display",flexbox:"display","inline-flexbox":"display",flex:"display","inline-flex":"display",grid:"display","inline-grid":"display","min-content":"width"}
;
n.functions=[],n.keywords=[];
var r=document.createElement("div").style;
for(var s in e){
var o=e[s],u=o.property,a=s+"("+o.params+")";
!i(a,u)&&i(n.prefix+a,u)&&n.functions.push(s)}
for(var f in t){
var u=t[f];
!i(f,u)&&i(n.prefix+f,u)&&n.keywords.push(f)}
}
(),function(){
function s(e){
return i.textContent=e+"{
}
",!!i.sheet.cssRules.length}
var t={
":read-only":null,":read-write":null,":any-link":null,"::selection":null}
,r={
keyframes:"name",viewport:null,document:'regexp(".")'}
;
n.selectors=[],n.atrules=[];
var i=e.appendChild(document.createElement("style"));
for(var o in t){
var u=o+(t[o]?"("+t[o]+")":"");
!s(u)&&s(n.prefixSelector(u))&&n.selectors.push(o)}
for(var a in r){
var u=a+" "+(r[a]||"");
!s("@"+u)&&s("@"+n.prefix+u)&&n.atrules.push(a)}
e.removeChild(i)}
(),n.valueProperties=["transition","transition-property"],e.className+=" "+n.prefix,StyleFix.register(n.prefixCSS)}
(document.documentElement);
CSS代码(style.css):
*,*:before,*:after{box-sizing:border-box;}
html{background:#222222;}
.scene{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;width:300px;height:300px;border-radius:50%;background:rgba(61,184,245,0.85);perspective:9999px;transform-style:preserve-3d;}
.scene:before,.scene:after{position:absolute;width:100%;border-radius:50%;content:'';}
.scene:before{top:400px;height:50px;background:rgba(0,0,0,0.25);}
.scene:after{top:0;height:100%;border:3px solid black;border-radius:50%;box-shadow:-20px -20px 0 rgba(0,0,0,0.25) inset;transform:translateZ(151px);}
.sphere{width:100%;height:100%;animation:rotate 24s infinite linear;transform-style:preserve-3d;}
.ring{position:absolute;width:100%;height:100%;transform-style:preserve-3d;}
.spoke{position:absolute;top:0;bottom:0;margin:auto;width:100%;height:0;transform-style:preserve-3d;}
.sphere #ring1{animation:rotateRing1 24s infinite ease-in-out alternate;}
.sphere #ring2{animation:rotateRing2 24s infinite ease-in-out alternate;}
.sphere #ring3{animation:rotateRing3 24s infinite ease-in-out alternate;}
.sphere #ring4{animation:rotateRing4 24s infinite ease-in-out alternate;}
.sphere #ring5{animation:rotateRing5 24s infinite ease-in-out alternate;}
.sphere #ring6{animation:rotateRing6 24s infinite ease-in-out alternate;}
.sphere #ring7{animation:rotateRing7 24s infinite ease-in-out alternate;}
.sphere #ring8{animation:rotateRing8 24s infinite ease-in-out alternate;}
.sphere #ring9{animation:rotateRing9 24s infinite ease-in-out alternate;}
.sphere #ring10{animation:rotateRing10 24s infinite ease-in-out alternate;}
.sphere #ring11{animation:rotateRing11 24s infinite ease-in-out alternate;}
.sphere #ring12{animation:rotateRing12 24s infinite ease-in-out alternate;}
.sphere #spoke1{animation:rotateSpoke1 60s infinite ease-in-out alternate;}
.sphere #spoke2{animation:rotateSpoke2 60s infinite ease-in-out alternate;}
.sphere #spoke3{animation:rotateSpoke3 60s infinite ease-in-out alternate;}
.sphere #spoke4{animation:rotateSpoke4 60s infinite ease-in-out alternate;}
.sphere #spoke5{animation:rotateSpoke5 60s infinite ease-in-out alternate;}
.sphere #spoke6{animation:rotateSpoke6 60s infinite ease-in-out alternate;}
.sphere #spoke7{animation:rotateSpoke7 60s infinite ease-in-out alternate;}
.sphere #spoke8{animation:rotateSpoke8 60s infinite ease-in-out alternate;}
.sphere #spoke9{animation:rotateSpoke9 60s infinite ease-in-out alternate;}
.sphere #spoke10{animation:rotateSpoke10 60s infinite ease-in-out alternate;}
.sphere #spoke11{animation:rotateSpoke11 60s infinite ease-in-out alternate;}
.sphere #spoke12{animation:rotateSpoke12 60s infinite ease-in-out alternate;}
.spoke:before,.spoke:after{position:absolute;width:12px;height:12px;border-radius:50%;background:#fafa9e;content:'';transform:rotateY(90deg);}
.spoke:before{top:-6px;right:-6px;transform:rotateY(90deg);}
.spoke:after{top:-6px;left:-6px;transform:rotateY(-90deg);}
@keyframes rotateRing1{0%{transform:rotateX(32.72727deg);}
20%{transform:rotateX(30deg);}
40%{transform:rotateY(32.72727deg);}
60%{transform:rotateY(30deg);}
80%{transform:rotateZ(32.72727deg);}
100%{transform:rotateZ(30deg);}
}
@keyframes rotateRing2{0%{transform:rotateX(65.45455deg);}
20%{transform:rotateX(60deg);}
40%{transform:rotateY(65.45455deg);}
60%{transform:rotateY(60deg);}
80%{transform:rotateZ(65.45455deg);}
100%{transform:rotateZ(60deg);}
}
@keyframes rotateRing3{0%{transform:rotateX(98.18182deg);}
20%{transform:rotateX(90deg);}
40%{transform:rotateY(98.18182deg);}
60%{transform:rotateY(90deg);}
80%{transform:rotateZ(98.18182deg);}
100%{transform:rotateZ(90deg);}
}
@keyframes rotateRing4{0%{transform:rotateX(130.90909deg);}
20%{transform:rotateX(120deg);}
40%{transform:rotateY(130.90909deg);}
60%{transform:rotateY(120deg);}
80%{transform:rotateZ(130.90909deg);}
100%{transform:rotateZ(120deg);}
}
@keyframes rotateRing5{0%{transform:rotateX(163.63636deg);}
20%{transform:rotateX(150deg);}
40%{transform:rotateY(163.63636deg);}
60%{transform:rotateY(150deg);}
80%{transform:rotateZ(163.63636deg);}
100%{transform:rotateZ(150deg);}
}
@keyframes rotateRing6{0%{transform:rotateX(196.36364deg);}
20%{transform:rotateX(180deg);}
40%{transform:rotateY(196.36364deg);}
60%{transform:rotateY(180deg);}
80%{transform:rotateZ(196.36364deg);}
100%{transform:rotateZ(180deg);}
}
@keyframes rotateRing7{0%{transform:rotateX(229.09091deg);}
20%{transform:rotateX(210deg);}
40%{transform:rotateY(229.09091deg);}
60%{transform:rotateY(210deg);}
80%{transform:rotateZ(229.09091deg);}
100%{transform:rotateZ(210deg);}
}
@keyframes rotateRing8{0%{transform:rotateX(261.81818deg);}
20%{transform:rotateX(240deg);}
40%{transform:rotateY(261.81818deg);}
60%{transform:rotateY(240deg);}
80%{transform:rotateZ(261.81818deg);}
100%{transform:rotateZ(240deg);}
}
@keyframes rotateRing9{0%{transform:rotateX(294.54545deg);}
20%{transform:rotateX(270deg);}
40%{transform:rotateY(294.54545deg);}
60%{transform:rotateY(270deg);}
80%{transform:rotateZ(294.54545deg);}
100%{transform:rotateZ(270deg);}
}
@keyframes rotateRing10{0%{transform:rotateX(327.27273deg);}
20%{transform:rotateX(300deg);}
40%{transform:rotateY(327.27273deg);}
60%{transform:rotateY(300deg);}
80%{transform:rotateZ(327.27273deg);}
100%{transform:rotateZ(300deg);}
}
@keyframes rotateRing11{0%{transform:rotateX(360deg);}
20%{transform:rotateX(330deg);}
40%{transform:rotateY(360deg);}
60%{transform:rotateY(330deg);}
80%{transform:rotateZ(360deg);}
100%{transform:rotateZ(330deg);}
}
@keyframes rotateRing12{0%{transform:rotateX(392.72727deg);}
20%{transform:rotateX(360deg);}
40%{transform:rotateY(392.72727deg);}
60%{transform:rotateY(360deg);}
80%{transform:rotateZ(392.72727deg);}
100%{transform:rotateZ(360deg);}
}
@keyframes rotateSpoke1{0%{transform:rotateX(15deg);}
10%{transform:rotateY(15deg);}
20%{transform:rotateZ(15deg);}
30%{transform:rotateX(15deg) rotateY(15deg);}
40%{transform:rotateX(15deg) rotateY(15deg) rotateZ(15deg);}
50%{transform:rotateY(10deg);}
60%{transform:rotateZ(10deg);}
70%{transform:rotateY(15deg);}
80%{transform:rotateZ(15deg);}
90%{transform:rotateZ(15deg);}
100%{transform:rotateX(30deg);}
}
@keyframes rotateSpoke2{0%{transform:rotateX(30deg);}
10%{transform:rotateY(30deg);}
20%{transform:rotateZ(30deg);}
30%{transform:rotateX(30deg) rotateY(30deg);}
40%{transform:rotateX(30deg) rotateY(30deg) rotateZ(30deg);}
50%{transform:rotateY(20deg);}
60%{transform:rotateZ(20deg);}
70%{transform:rotateY(30deg);}
80%{transform:rotateZ(30deg);}
90%{transform:rotateZ(30deg);}
100%{transform:rotateX(60deg);}
}
@keyframes rotateSpoke3{0%{transform:rotateX(45deg);}
10%{transform:rotateY(45deg);}
20%{transform:rotateZ(45deg);}
30%{transform:rotateX(45deg) rotateY(45deg);}
40%{transform:rotateX(45deg) rotateY(45deg) rotateZ(45deg);}
50%{transform:rotateY(30deg);}
60%{transform:rotateZ(30deg);}
70%{transform:rotateY(45deg);}
80%{transform:rotateZ(45deg);}
90%{transform:rotateZ(45deg);}
100%{transform:rotateX(90deg);}
}
@keyframes rotateSpoke4{0%{transform:rotateX(60deg);}
10%{transform:rotateY(60deg);}
20%{transform:rotateZ(60deg);}
30%{transform:rotateX(60deg) rotateY(60deg);}
40%{transform:rotateX(60deg) rotateY(60deg) rotateZ(60deg);}
50%{transform:rotateY(40deg);}
60%{transform:rotateZ(40deg);}
70%{transform:rotateY(60deg);}
80%{transform:rotateZ(60deg);}
90%{transform:rotateZ(60deg);}
100%{transform:rotateX(120deg);}
}
@keyframes rotateSpoke5{0%{transform:rotateX(75deg);}
10%{transform:rotateY(75deg);}
20%{transform:rotateZ(75deg);}
30%{transform:rotateX(75deg) rotateY(75deg);}
40%{transform:rotateX(75deg) rotateY(75deg) rotateZ(75deg);}
50%{transform:rotateY(50deg);}
60%{transform:rotateZ(50deg);}
70%{transform:rotateY(75deg);}
80%{transform:rotateZ(75deg);}
90%{transform:rotateZ(75deg);}
100%{transform:rotateX(150deg);}
}
@keyframes rotateSpoke6{0%{transform:rotateX(90deg);}
10%{transform:rotateY(90deg);}
20%{transform:rotateZ(90deg);}
30%{transform:rotateX(90deg) rotateY(90deg);}
40%{transform:rotateX(90deg) rotateY(90deg) rotateZ(90deg);}
50%{transform:rotateY(60deg);}
60%{transform:rotateZ(60deg);}
70%{transform:rotateY(90deg);}
80%{transform:rotateZ(90deg);}
90%{transform:rotateZ(90deg);}
100%{transform:rotateX(180deg);}
}
@keyframes rotateSpoke7{0%{transform:rotateX(105deg);}
10%{transform:rotateY(105deg);}
20%{transform:rotateZ(105deg);}
30%{transform:rotateX(105deg) rotateY(105deg);}
40%{transform:rotateX(105deg) rotateY(105deg) rotateZ(105deg);}
50%{transform:rotateY(70deg);}
60%{transform:rotateZ(70deg);}
70%{transform:rotateY(105deg);}
80%{transform:rotateZ(105deg);}
90%{transform:rotateZ(105deg);}
100%{transform:rotateX(210deg);}
}
@keyframes rotateSpoke8{0%{transform:rotateX(120deg);}
10%{transform:rotateY(120deg);}
20%{transform:rotateZ(120deg);}
30%{transform:rotateX(120deg) rotateY(120deg);}
40%{transform:rotateX(120deg) rotateY(120deg) rotateZ(120deg);}
50%{transform:rotateY(80deg);}
60%{transform:rotateZ(80deg);}
70%{transform:rotateY(120deg);}
80%{transform:rotateZ(120deg);}
90%{transform:rotateZ(120deg);}
100%{transform:rotateX(240deg);}
}
@keyframes rotateSpoke9{0%{transform:rotateX(135deg);}
10%{transform:rotateY(135deg);}
20%{transform:rotateZ(135deg);}
30%{transform:rotateX(135deg) rotateY(135deg);}
40%{transform:rotateX(135deg) rotateY(135deg) rotateZ(135deg);}
50%{transform:rotateY(90deg);}
60%{transform:rotateZ(90deg);}
70%{transform:rotateY(135deg);}
80%{transform:rotateZ(135deg);}
90%{transform:rotateZ(135deg);}
100%{transform:rotateX(270deg);}
}
@keyframes rotateSpoke10{0%{transform:rotateX(150deg);}
10%{transform:rotateY(150deg);}
20%{transform:rotateZ(150deg);}
30%{transform:rotateX(150deg) rotateY(150deg);}
40%{transform:rotateX(150deg) rotateY(150deg) rotateZ(150deg);}
50%{transform:rotateY(100deg);}
60%{transform:rotateZ(100deg);}
70%{transform:rotateY(150deg);}
80%{transform:rotateZ(150deg);}
90%{transform:rotateZ(150deg);}
100%{transform:rotateX(300deg);}
}
@keyframes rotateSpoke11{0%{transform:rotateX(165deg);}
10%{transform:rotateY(165deg);}
20%{transform:rotateZ(165deg);}
30%{transform:rotateX(165deg) rotateY(165deg);}
40%{transform:rotateX(165deg) rotateY(165deg) rotateZ(165deg);}
50%{transform:rotateY(110deg);}
60%{transform:rotateZ(110deg);}
70%{transform:rotateY(165deg);}
80%{transform:rotateZ(165deg);}
90%{transform:rotateZ(165deg);}
100%{transform:rotateX(330deg);}
}
@keyframes rotateSpoke12{0%{transform:rotateX(180deg);}
10%{transform:rotateY(180deg);}
20%{transform:rotateZ(180deg);}
30%{transform:rotateX(180deg) rotateY(180deg);}
40%{transform:rotateX(180deg) rotateY(180deg) rotateZ(180deg);}
50%{transform:rotateY(120deg);}
60%{transform:rotateZ(120deg);}
70%{transform:rotateY(180deg);}
80%{transform:rotateZ(180deg);}
90%{transform:rotateZ(180deg);}
100%{transform:rotateX(360deg);}
}
@keyframes rotate{100%{transform:rotateX(360deg) rotateY(720deg) rotateZ(360deg);}
}