点击摇摆摇晃效果
代码语言:html
所属分类:动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
}
body {
margin: 0;
padding: 0;
color: #fff;
background-color: #000;
}
canvas {
-webkit-tap-highlight-color: transparent;
tap-highlight-color: transparent;
-webkit-user-select: none;
user-select: none;
cursor: pointer;
}
</style>
</head>
<body translate="no">
<canvas></canvas>
<script >
// Wobble by @neave
window.requestAnimationFrame =
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (callback) {
setTimeout(callback, 1000 / 60);
};
Array.prototype.shuffle = function () {
var j, temp;
for (var i = this.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
temp = this[i];.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0