2015-10-25 21:35:44 +08:00
|
|
|
|
<!doctype html>
|
|
|
|
|
<html lang="en-us">
|
2015-10-31 23:32:44 +08:00
|
|
|
|
<head>
|
2015-10-25 21:35:44 +08:00
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
2015-10-31 23:32:44 +08:00
|
|
|
|
<meta name="viewport" content="width=480,user-scalable=no" />
|
|
|
|
|
<title>变态马里奥</title>
|
2015-10-25 21:35:44 +08:00
|
|
|
|
<style>
|
2015-10-31 23:32:44 +08:00
|
|
|
|
body {
|
|
|
|
|
font-family: arial;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
background-color: #282828;
|
|
|
|
|
}
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
#canvas {
|
|
|
|
|
border: 0px none;
|
|
|
|
|
outline: none;
|
|
|
|
|
padding: 0;
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
margin-right: auto;
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
#output {
|
|
|
|
|
width: 470px;
|
|
|
|
|
height: 200px;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
display: block;
|
|
|
|
|
background-color: black;
|
|
|
|
|
color: white;
|
|
|
|
|
font-family: 'Lucida Console', Monaco, monospace;
|
|
|
|
|
outline: none;
|
|
|
|
|
border: none;
|
|
|
|
|
}
|
2015-11-01 14:28:46 +08:00
|
|
|
|
#ad {
|
|
|
|
|
position: absolute;
|
|
|
|
|
padding: 0;
|
|
|
|
|
margin: 0;
|
|
|
|
|
width: 480px;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
2015-10-31 23:32:44 +08:00
|
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
2015-11-01 14:28:46 +08:00
|
|
|
|
<div id="ad" hidden>
|
|
|
|
|
<script type="text/javascript">var cpro_id = "u2379481"</script>
|
|
|
|
|
<script src="http://cpro.baidustatic.com/cpro/ui/cm.js" type="text/javascript"></script>
|
|
|
|
|
</div>
|
2015-11-01 21:45:06 +08:00
|
|
|
|
<canvas id="canvas" width="480" height="420" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
|
|
|
|
|
<!--<textarea id="output" rows="8" readonly></textarea>-->
|
2015-10-31 23:32:44 +08:00
|
|
|
|
<script type='text/javascript'>
|
|
|
|
|
var canvas = document.getElementById('canvas');
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
var Module = {
|
|
|
|
|
preRun: [],
|
|
|
|
|
postRun: [],
|
|
|
|
|
canvas: canvas,
|
|
|
|
|
setStatus: function (text) {
|
|
|
|
|
Module.setStatus.text = text;
|
|
|
|
|
console.log(text);
|
|
|
|
|
},
|
|
|
|
|
print: (function () {
|
|
|
|
|
var element = document.getElementById('output');
|
|
|
|
|
if (element) element.value = '';
|
|
|
|
|
return function (text) {
|
|
|
|
|
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
|
|
|
|
|
console.log(text);
|
|
|
|
|
if (element) {
|
|
|
|
|
element.value += text + "\n";
|
|
|
|
|
element.scrollTop = element.scrollHeight;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
})(),
|
|
|
|
|
};
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
Module.setStatus('Loading...');
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
window.onerror = function (event) {
|
2015-11-01 21:45:06 +08:00
|
|
|
|
document.documentElement.innerHTML = event + event.callstack;
|
2015-10-31 23:32:44 +08:00
|
|
|
|
};
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-11-01 21:45:06 +08:00
|
|
|
|
if (document.documentElement.clientWidth <= 480) {
|
2015-11-01 11:43:34 +08:00
|
|
|
|
var rect = canvas.getBoundingClientRect();
|
2015-11-01 21:45:06 +08:00
|
|
|
|
var height = document.documentElement.clientHeight - rect.top;
|
|
|
|
|
if (height > 600) {
|
|
|
|
|
canvas.height = height;
|
|
|
|
|
}
|
2015-11-01 11:43:34 +08:00
|
|
|
|
}
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
var angle = 0;
|
|
|
|
|
var drawLoading = function () {
|
|
|
|
|
if (Module.setStatus.text == '')
|
|
|
|
|
return;
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
var ctx = canvas.getContext('2d');
|
|
|
|
|
ctx.save();
|
|
|
|
|
ctx.clearRect(0, 0, 480, 420);
|
|
|
|
|
ctx.translate(480 / 2, 420 / 2);
|
|
|
|
|
ctx.font = '12px sans-serif';
|
|
|
|
|
ctx.lineWidth = 4;
|
|
|
|
|
ctx.strokeStyle = 'white';
|
|
|
|
|
ctx.fillStyle = 'white';
|
|
|
|
|
ctx.textAlign = 'center';
|
|
|
|
|
ctx.textBaseline = 'top';
|
|
|
|
|
ctx.globalAlpha = 0.5;
|
|
|
|
|
ctx.fillText('Loading...', 0, 18);
|
2015-10-31 01:28:53 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
var t = Math.PI * 2 * 0.9;
|
|
|
|
|
var step = t / 20;
|
|
|
|
|
ctx.rotate(angle);
|
|
|
|
|
for (var i = 0; i < t; i += step) {
|
|
|
|
|
ctx.globalAlpha = i / t * 0.5;
|
|
|
|
|
ctx.beginPath();
|
|
|
|
|
ctx.arc(0, 0, 10, i, i + step);
|
|
|
|
|
ctx.stroke();
|
|
|
|
|
}
|
|
|
|
|
angle += 0.1;
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
ctx.restore();
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
2015-10-31 23:32:44 +08:00
|
|
|
|
window.requestAnimationFrame(drawLoading);
|
2015-10-25 21:35:44 +08:00
|
|
|
|
}
|
2015-10-31 23:32:44 +08:00
|
|
|
|
|
|
|
|
|
drawLoading();
|
2015-10-25 21:35:44 +08:00
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
<script async type="text/javascript" src="dlm.js"></script>
|
2015-10-31 23:32:44 +08:00
|
|
|
|
</body>
|
2015-10-25 21:35:44 +08:00
|
|
|
|
</html>
|