html
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>404 particle text</title>
<style>
/* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */
body {
background: #2196F3;
}
#notFound {
position: fixed;
top: 50%;
left: 50%;
transform: translateY(-50%) translateX(-50%) scale(1.2);
width: 80%;
height: auto;
}
</style>
</head>
<body>
<script src='js/pixi.js'></script>
<script src="js/index.js"></script>
</body>
</html>
JS页面
//animation frame polyfill
(function () {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
}
if (!window.requestAnimationFrame)
window.requestAnimationFrame = function (callback, element) {
var currTime = new Date().getTime();
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
var id = window.setTimeout(function () {
callback(currTime + timeToCall);
},
timeToCall);
lastTime = currTime + timeToCall;
return id;
};
if (!window.cancelAnimationFrame)
window.cancelAnimationFrame = function (id