Skip to content

Commit aa5aa40

Browse files
committed
添加测试数据
1 parent 8ce76b2 commit aa5aa40

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

consistency_hash/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8">
5+
<script type="text/javascript">
6+
if (/Android (\d+\.\d+)/.test(navigator.userAgent)) {
7+
var version = parseFloat(RegExp.$1);
8+
if (version > 2.3) {
9+
var phoneScale = parseInt(window.screen.width) / 640;
10+
document.write('<meta name="viewport" content="width=640, minimum-scale = ' + phoneScale + ', maximum-scale = ' + phoneScale + ', target-densitydpi=device-dpi">');
11+
} else {
12+
document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">');
13+
}
14+
} else {
15+
document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">');
16+
}
17+
</script>
18+
<title></title>
19+
<meta name="apple-mobile-web-app-capable" content="yes">
520
<title>Document</title>
621
<script src="//cdn.bootcss.com/jquery/3.1.0/jquery.js"></script>
722
<script src="js/canvas.js"></script>
@@ -25,6 +40,8 @@
2540
</head>
2641
<body>
2742
<input type="text" id="serverval"><input type="button" id="addserver" value="addserver">
43+
<br>
44+
<br>
2845
<input type="text" id="keyval"><input type="button" id="addkey" value="addkey">
2946
<div id="div1"></div>
3047
</body>

consistency_hash/js/hash.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ window.onload = function (){
22
//创建canvas对象
33
var canvasObj = new Canvas('div1')
44
var utils = new Utils()
5-
canvasObj.width = 1000
6-
canvasObj.height = 890
5+
canvasObj.width = 600
6+
canvasObj.height = 600
77
//生成canvas标签
88
canvasObj.c()
99
var ctx = canvasObj.getInstance()
@@ -46,7 +46,7 @@ window.onload = function (){
4646
//添加文字
4747
function addText(){
4848
ctx.save()
49-
ctx.font = '60px impact'
49+
ctx.font = '35px impact'
5050
ctx.textBaseLine = 'top'
5151
ctx.fillStyle = 'rgba(57,9,9,0.7)'
5252
ctx.shadowOffsetX = 10

0 commit comments

Comments
 (0)