svg+js实现视觉差异立体鱼塘金鱼游动动画效果代码
代码语言:html
所属分类:视觉差异
代码描述:svg+js实现视觉差异立体鱼塘金鱼游动动画效果代码
代码标签: svg js 视觉差异 立体 鱼塘 金鱼 游动 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
HTML {
overflow: hidden;
}
body {
margin: 0;
width: 100%;
height: 100%;
}
.page {
width: 100vw;
height: 100vh;
background-color: #fff;
color: #fff;
font-weight: bold;
text-align: center;
padding: 30px;
}
.cls-1 {
fill: #8dcbdc;
}
.cls-2 {
fill: #fff;
}
.cls-3 {
fill: #68bad1;
}
.cls-4 {
fill: #00559c;
}
.cls-5 {
fill: #3aa5c2;
}
.cls-6 {
fill: #2a8bbe;
}
svg {
display: block;
width: 500px;
height: 500px;
fill: #fff;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
overflow: hidden;
}
svg.base {
transform: translate(-50%, -50%) perspective(200px) translateZ(-200px);
}
svg.cover {
transform: translate(-50%, -50%) perspective(200px) translateZ(75px);
}
svg .fish {
filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.5));
transform-origin: 250px 250px;
animation-name: fishAll;
animation-duration: 80s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
svg .fish2 {
transform-origin: 250px 250px;
animation-name: fishAll2;
animation-duration: 80s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
svg .fish2 .fish-body {
animation-direction: alternate-reverse;
}
svg .fish2 .fish-tail {
animation-direction: alternate;
}
svg .fish-body {
fill: #e74e19;
transform-origin: 327.66px 264.13px;
animation-name: fishSwim;
animation-direction: alternate;
animation-timing-function: ease-in;
animation-duration: 2.5s;
animation-iteration-count: infinite;
}
svg .fish-tail {
fill: #dc4817;
transform-origin: 327.66px 264.13px;
animation-name: fishSwim;
animation-direction: alternate-reverse;
animation-timing-function: ease-in;
animation-duration: 2.5s;
animation-iteration-count: infinite;
}
svg:nth-child(1) {
filter: drop-.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0