<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>H5lock-A5源码</title>
<style type="text/css">
body {
text-align: center;
background-color: #305066;
}
.title {
color: #22C3AA;
}
</style>
</head>
<body>
<script type="text/javascript" src="H5lock.js"></script>
<script type="text/javascript">
new H5lock({
chooseType: 4
}).init();
</script>
</body>
</html>
(function(){
window.H5lock = function(obj){
this.height = obj.height;
this.width = obj.width;
this.chooseType = Number(window.localStorage.getItem('chooseType')) || obj.chooseType;
};
H5lock.prototype.drawCle = function(x, y) {
this.ctx.strokeStyle = '#CFE6FF';
this.ctx.lineWidth = 2;
this.ctx.beginPath();
this.ctx.arc(x, y, this.r, 0, Math.PI * 2, true);
this.ctx.closePath();
this.ctx.stroke();
}
H5lock.prototype.drawPoint = function() {
for (var i = 0 ; i < this.lastPoint.length ; i++) {
this.ctx.fillStyle = '#CFE6FF';
this.ctx.beginPath();
this.ctx.arc(this.lastPoint[i].x, this.lastPoint[i].y, this.r / 2, 0, Math.PI * 2, true);
this.ctx.closePath();
this.ctx.fill();
}
}
H5lock.prototype.drawStatusPoint = function(type) {
for (var i = 0 ; i < this.lastPoint.length ; i++) {
this.ctx.strokeStyle = type