-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathagent.js
executable file
·39 lines (33 loc) · 1.07 KB
/
agent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
documentWidth = window.screen.availWidth;
gridContainerWidth = 0.92 * documentWidth;
cellSideLength = 0.18 * documentWidth;
cellSpace = 0.04*documentWidth;
function getPosTop( i , j ){
return cellSpace + i*( cellSpace + cellSideLength );
}
function getPosLeft( i , j ){
return cellSpace + j * ( cellSpace + cellSideLength );
}
function getNumberBackgroundColor( number ){
switch( number ){
case 2:return "#eee4da";break;
case 4:return "#ede0c8";break;
case 8:return "#f2b179";break;
case 16:return "#f59563";break;
case 32:return "#f67c5f";break;
case 64:return "#f65e3b";break;
case 128:return "#edcf72";break;
case 256:return "#edcc61";break;
case 512:return "#9c0";break;
case 1024:return "#33b5e5";break;
case 2048:return "#09c";break;
case 4096:return "#a6c";break;
case 8192:return "#93c";break;
}
return "black";
}
function getNumberColor( number ){
if( number <= 4 )
return "#776e65";
return "white";
}