webgl+canvas实现水液体涟漪动画效果代码
代码语言:html
所属分类:动画
代码描述:webgl+canvas实现水液体涟漪动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
* {
box-sizing: border-box;
}
html, body {
margin: 0;
min-height: 100vh;
overflow: hidden;
background:black;
touch-action: none;
}
canvas {
width: 100%;
height: auto;
object-fit: contain;
}
.wrapper {
z-index:100;
position:absolute;
width:100%;
height:100%;
background:transparent;
opacity:.3;
}
.wrapper .choral{
z-index:100;
position:absolute;
width:100%;
height:100%;
background-image:url(//repo.bfw.wiki/bfwrepo/images/sea/ocean.jpeg);
opacity:.1;
-webkit-animation: changes infinite;
animation-duration:1000s;
animation-delay:0s;
background-size:300%;
animation-direction: alternate-reverse;
background-repeat: no-repeat;
}
@keyframes changes {0% {opacity:0;}
100% {background-image:url(//repo.bfw.wiki/bfwrepo/images/sea/ocean.jpeg);background-size:400%; }
}
.wrapper .fish {
position:absolute;
top:-5%;
left:-20%;
width:200%;
height:300%;
background-image:url(//repo.bfw.wiki/bfwrepo/images/sea/fish.jpg);
opacity:0;
border-radius:10%;
-webkit-animation: shadows infinite;
animation-duration:22s;
animation-delay:0s;
background-size:100%;
background-repeat: no-repeat;
}
.wrapper .fish2 {
position:absolute;
top:-10%;
left:-20%;
width:160%;
height:150%;
background-image:url(//repo.bfw.wiki/bfwrepo/images/sea/fish.jpg);
opacity:0;
border-radius:5%;
-webkit-animation: shadows infinite;
animation-duration:22s;
animation-delay:25s;
background-size:100%;
background-repeat: no-repeat;
}
.wrapper .fish3 {
position:absolute;
top:-5%;
left:-20%;
width:150%;
height:180%;
border-radius:11%;
background-image:url(//repo.bfw.wiki/bfwrepo/images/sea/fish.jpg);
opacity:0;
-webkit-animation: shadows infinite;
animation-duration:22s;
animation-delay:6s;
background-size:100%;
background-repeat: no-repeat;
}
.wrapper .fish4 {
position:absolute;
top:-20%;
left:-20%;
width:200%;
height:200%;
background-image:url(//repo.bfw.wiki/bfwrepo/images/sea/fish.jpg);
opacity:0;
border-radius:8%;
-webkit-animation: shadows infinite;
animation-duration:22s;
animation-delay:9s;
.........完整代码请登录后点击上方下载按钮下载查看
网友评论0