svg+canvas实现火山口喷发喷射火山灰云朵动画代码
代码语言:html
所属分类:动画
代码描述:svg+canvas实现火山口喷发喷射火山灰云朵动画代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
html, body {
height: 100%;
overflow: hidden;
background-color: #189BBB;
}
canvas {
display: block;
background: transparent;
position: relative;
z-index: 1;
}
.volcano {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%) translateY(20%);
height: 40vh;
z-index: 0;
}
.volcano-front {
z-index: 2;
}
.volcano svg {
display: block;
width: auto;
height: 100%;
position: relative;
z-index: 0;
}
@-webkit-keyframes cloud {
from {
transform: translateX(-100vw);
}
from {
transform: translateX(100vw);
}
}
@keyframes cloud {
from {
transform: translateX(-100vw);
}
from {
transform: translateX(100vw);
}
}
.cloud {
position: absolute;
top: 10px;
left: 0;
width: 100px;
transform: translateX(-100vw);
-webkit-animation: cloud 10s linear infinite alternate;
animation: cloud 10s linear infinite alternate;
z-index: 0;
}
.cloud svg {
width: 100%;
}
.cloud-1 {
top: 70px;
width: 120px;
animation: cloud 16s linear infinite rever.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0