js彩色雨滴下雨动画效果代码
代码语言:html
所属分类:粒子
代码描述:js彩色雨滴下雨动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<html lang="en"><head>
<meta charset="UTF-8">
<style>
* {
box-sizing: border-box;
}
body {
background-color: black;
transition: background-color 1000ms linear;
}
canvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
footer {
position: absolute;
height: 50px;
left: 0;
bottom: 0;
width: 100%;
text-align: right;
padding: 10px;
color: grey;
font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono,
DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;
}
</style>
</head>
<body>
<canvas id="main" width="834" height="518"></canvas>
<canvas id="middle" width="834" height="518"></canvas>
<canvas id="final" width="834" height="518"></canvas>
<footer>
<span>
<p>@weirdyang</p>
</span>
</footer>
<script >
// mouse
const mouse = {
x: 0,
y: 0,
prevX: 0,
prevY: 0,
dead: false,
right() {
return this.x >= this.prevX;
} };
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0