css+svg实现漂浮的机器人效果代码
代码语言:html
所属分类:布局界面
代码描述:css+svg实现漂浮的机器人效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
html, body {
height: 100%;
}
body {
background: #2a88c5;
position: relative;
}
#robot {
position: absolute;
top: 50%;
left: 50%;
transform: translate3d(-50%, -50%, 0);
max-width: 50vw;
max-height: 80vh;
margin: 0 auto;
}
#body {
-webkit-animation: hover 1.1s ease-in-out 0s infinite alternate;
animation: hover 1.1s ease-in-out 0s infinite alternate;
}
#head {
-webkit-animation: hover 1.1s ease-in-out 0.05s infinite alternate;
animation: hover 1.1s ease-in-out 0.05s infinite alternate;
}
#arms {
-webkit-animation: hover 1.1s ease-in-out 0.1s infinite alternate;
animation: hover 1.1s ease-in-out 0.1s infinite alternate;
}
#left_arm {
transform-origin: center right;
-webkit-animation: arms_bounce_left 1.1s ease-in-out 0s infinite alternate;
animation: arms_bounce_left 1.1s ease-in-out 0s infinite alternate;
}
#right_arm {
transform-origin: center left;
-webkit-animation: arms_bounce_right 1.1s ease-in-out 0s infinite alternate;
animation: arms_bounce_right 1.1s ease-in-out 0s infinite alternate;
}
#eyes ellipse {
transform-origin: center center;
-webkit-animation: eyes_blink 2s ease-out 0s infinite alternate;
animation: eyes_blink 2s ease-out 0s infinite alternate;
}
#shadow {
transform-origin: center center;
-webkit-animation: shadow 1.1s ease-in-out 0s infinite alternate;
animation: shadow 1.1s ease-in-out 0s infinite alternate;
}
@-webkit-keyframes hover {
0% {
transform: translate3d(0, 80px, 0);
}
100% {
transform: translate3d(0, 30px, 0);
}
}
@keyframes hover {
0% {
transform: translate3d(0, 80px, 0);
}
100% {
transform: translate3d(0, 30px, 0);
}
}
@-webkit-keyframes shadow {
0% {
transform: translate3d(0, 0, 0) scale(1.5, 1.2);
opacity: 0.4;
}
100% {
transform: translate3d.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0