svg+css实现可爱熊猫动画效果代码
代码语言:html
所属分类:动画
代码描述:svg+css实现可爱熊猫动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
background-color: #dfe;
background-image:
repeating-linear-gradient(20deg, #0000, #0000 20px, #2431 50px),
repeating-linear-gradient(110deg, #0000, #0000 20px, #2431 50px)
}
svg {
width: 100vw;
height: 100vh;
}
.line {
fill: none;
stroke: #222;
stroke-width: 5px;
}
.ear {
fill: #111;
animation: head 1s -0.2s infinite alternate ease-in-out
}
.ear__g {
fill: #444;
animation: head 1s -0.1s infinite alternate ease-in-out
}
.head {
fill: #eee;
stroke: #111;
stroke-width: 5px;
animation: head 1s infinite alternate ease-in-out
}
.eye {
fill: #111;
animation: head 1s -0.1s infinite alternate ease-in-out
}
.eye__w {
fill: #fff;
animation: head 1s infinite alternate ease-in-out
}
.eye__i {
fill: #111;
animation: head 1s 0.1s infinite alternate ease-in-out
}
.nose__1 {
fill: #111;
animation: head 1s 0.1s infinite alternate ease-in-out
}
.nose__2 {
fill: none;
stroke: #111;
stroke-width: 5px;
animation: head 1s 0.1s infinite alternate ease-in-out
}
@keyframes head {
from { transform: translateY(-20px); }
to { transform: translateY(20px); }
}
.eyes {
animation: eyes 5.5s infinite ease-in-out
}
@keyframes eyes {
0%, 35% { transform: translateX(0); }
15%, 25% { transform: translateX(5px); }
10%, 20% { transform: translateX(-5px); }
}
.nose {
transform-origin: 500px 650px;
animation: nose 5.5s infinite ease-in-out
}
@keyframes nose {
0%, 35% { transform: rotate(0deg); }
15%, 25% { transform: rotate(5deg); }
10%, 20% { transform: rotate(-5deg); }
}
.body__b {
fill: #111;
stroke: #111;
stroke-width: 5px;
animation: body 1s -0.25s infinite alternate ease-in-out
}
.body__w {
fill: #eee;
stroke: #111;
stroke-width: 5px;
animation: body 1s -0.5s infinite alternate ease-in-out
}
@keyframes body {
from { transform: translateY(-5px); }
to {.........完整代码请登录后点击上方下载按钮下载查看
网友评论0