div+css实现可爱卡通土星摇摆运动动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现可爱卡通土星摇摆运动动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body .scene_saturn__ring .layer_part, body .scene_saturn__ring .small_part, body .scene_saturn__ring .small, body .scene_saturn__ring, body .scene_saturn__sparks .spark, body .scene_saturn__sparks, body .scene_saturn__face .face_clip .mouth, body .scene_saturn__face, body .scene_saturn__shadowRing, body .scene_saturn__shadow, body .scene_saturn, body .scene_titan, body .scene_titanShadow, body .scene, body .scene_saturn__face .face_clip .eye, body .scene_titan .eyes .eye {
position: absolute;
left: 0;
right: 0;
margin: auto;
top: 50%;
transform: translateY(-50%);
}
body .scene_saturn__face .face_clip .eye, body .scene_titan .eyes .eye {
width: 6px;
height: 6px;
background: #53487a;
border-radius: 10px;
bottom: 34px;
-webkit-animation: blink 1s 0s infinite linear;
animation: blink 1s 0s infinite linear;
}
body .scene_saturn__face .face_clip .eye--left.eye, body .scene_titan .eyes .eye--left.eye {
left: -80px;
}
body .scene_saturn__face .face_clip .eye--right.eye, body .scene_titan .eyes .eye--right.eye {
left: 80px;
}
body {
background: #38216b;
}
body .scene {
perspective: 2600px;
width: 500px;
height: 500px;
}
body .scene_titanShadow {
width: 84px;
height: 21px;
border-radius: 100%;
transform-style: preserve-3d;
box-shadow: 0px 200px 20px #291863;
-webkit-animation: titan 6s infinite ease;
animation: titan 6s infinite ease;
bottom: 400px;
}
body .scene .t_wrap {
-webkit-animation: titanWrap 6s infinite ease;
animation: titanWrap 6s infinite ease;
}
body .scene_titan {
width: 84px;
height: 84px;
border-radius: 42px;
background: #a5c6ff;
transform-style: preserve-3d;
box-shadow: 0px 0px 0px 4px rgba(169, 187, 236, 0.3882352941) inset, -30px -20px 50px #637bff inset;
-webkit-animation: titan 6s infinite ease;
animation: titan 6s infinite ease;
top: -220px;
}
body .scene_titan .eyes {
-webkit-animation: titan_eye 6s infinite ease;
animation: titan_eye 6s infinite ease;
}
body .scene_titan .eyes .eye.eye--left {
left: -34px;
bottom: -120px;
}
body .scene_titan .eyes .eye.eye--right {
left: 34px;
bottom: -120px;
}
body .scene_saturn {
width: 152px;
height: 152px;
border-radius: 76px;
background: white;
transform-style: preserve-3d;
box-shadow: 0px 0px 0px 4px rgba(255, 255, 255, 0.3294117647) inset, -30px -20px 50px #a5adff inset;
-webkit-animation: saturn 0.6s infinite linear;
animation: saturn 0.6s infinite linear;
}
body .scene_saturn__shadow {
width: 152px;
height: 38px;
border-radius: 100%;
box-shadow: 0 150px 40px #291863;
}
body .scene_saturn__shadowRing {
width: 330px;
height: 19px;
border-radius: 100%;
box-shadow: 0 150px 40px #291863;
left: -100px;
-webkit-animation: ringShadow 0.6s infinite linear;
animation: ringShadow 0.6s infinite linear;
}
body .scene_saturn__face {
width: 152px;
height: 152px;
border-radius: 76px;
overflow: hidden;
}
body .scene_saturn__face .face_clip {
position: relative;
top: 95px;
left: 14px;
transform: rotate(8deg);
-webkit-animation: face 3.6s infinite linear, faceTilt 0.9s infinite linear;
animation: face 3.6s infinite linear, faceTilt 0.9s infinite linear;
}
body .scene_saturn__face .face_clip .mouth {
width: 15px;
height: 10px;
top: -5px;
background: #ea0e61;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
box-shadow: 0 6px 0px #53487a inset;
}
body .scene_saturn__sparks {
transform: translateZ(-100px);
}
body .scene_saturn__sparks .spark {
width: 20px;
height: 20px;
border-radius: 10px;
background: #00f7ff;
}
body .scene_saturn__sparks .spark:nth-of-type(odd) {
background: white;
}
@-webkit-keyframes spark--1 {
from {
transform: scale(1);
}
to {
left: 180px;
top: 47px;
transform: scale(0);
}
}
@keyframes spark--1 {
from {
transform: scale(1);
}
to {
left: 180px;
top: 47px;
transform: scale(0);
}
}
body .scene_saturn__sparks .spark:nth-of-type(1) {
-webkit-animation: spark--1 1s 0.1s infinite;
animation: spark--1 1s 0.1s infinite;
}
@-webkit-keyframes spark--2 {
from {
transform: scale(1);
}
to {
left: -83px;
top: 156px;
transform: scale(0);
}
}
@keyframes spark--2 {
from {
transform: scale(1);
}
to {
left: -83px;
top: 156px;
transform: scale(0);
}
}
body .scene_saturn__sparks .spark:nth-of-type(2) {
-webkit-animation: spark--2 1s 0.2s infinite;
animation: spark--2 1s 0.2s infinite;
}
@-webkit-keyframes spark--3 {
from {
transform: scale(1);
}
to {
left: -175px;
top: 137px;
transform: scale(0);
}
}
@keyframes spark--3 {
from {
transform: scale(1);
}
to {
left: -175px;
top: 137px;
transform: scale(0);
}
}
body .scene_saturn__sparks .spark:nth-of-type(3) {
-webkit-animation: spark--3 1s 0.3s infinite;
animation: spark--3 1s 0.3s infinite;
}
@-webkit-keyframes spark--4 {
from {
transform: scale(1);
}
to {
left: -21px;
top: 101px;
transform: scale(0);
}
}
@keyframes spark--4 {
from {
transform: scale(1);
}
to {
left: -21px;
top: 101px;
transform: scale(0);
}
}
body .scene_saturn__sparks .spark:nth-of-type(4) {
-webkit-animation: spark--4 1s 0.4s infinite;
animation: spark--4 1s 0.4s infinite;
}
@-webkit-keyframes spark--5 {
from {
transform: scale(1);
}
to {
left: -93px;
top: -173px;
transform: scale(0);
}
}
@keyframes spark--5 {
from {
transform: scale(1);
}
to {
left: -93px;
top: -173px;
transform: scale(0);
}
}
body .scene_saturn__sparks .spark:nth-of-type(5) {
-webkit-animation: spark--5 1s 0.5s infinite;
animation: spark--5 1s 0.5s infinite;
}
@-webkit-keyframes spark--6 {
from {
transform: scale(1);
}
to {
left: -36px;
top: 57px;
transform: scale(0);
}
}
@keyframes spark--6 {
from {
transform: scale(1);
}
to {
left: -36px;
top: 57px;
transform: scale(0);
}
}
body .scene_saturn__sparks .spark:nth-of-type(6) {
-webkit-animation: spark--6 1s 0.6s infinite;
animation: spark--6 1s 0.6s infinite;
}
@-webkit-keyframes spark--7 {
from {
transform: scale(1);
}
to {
left: 175px;
top: 15px;
transform: scale(0);
}
}
@keyframes spark--7 {
from {
transform: scale(1);
}
to {
left: 175px;
top: 15px;
transform: scale(0);
}
}
body .scene_saturn__sparks .spark:nth-of-type(7) {
-webkit-animation: spark--7 1s 0.7s infinite;
animation: spark--7 1s 0.7s infinite;
}
@-webkit-keyframes spark--8 {
from {
transform: scale(1);
}
to {
left: 16px;
top: 55px;
transform: scale(0);
}
}
@keyframes spark--8 {
from {
transform: scale(1);
}
to {
left: 16px;
top: 55px;
transform: scale(0);
}
}
body .scene_saturn__sparks .spark:nth-of-type(8) {
-webkit-animation: spark--8 1s 0.8s infinite;
animation: spark--8 1s 0.8s infinite;
}
@-webkit-keyframes spark--9 {
from {
transform: scale(1);
}
to {
left: -99px;
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0