This commit is contained in:
Devine Lu Linvega 2016-12-31 13:37:13 -07:00
parent 608d75c005
commit acb7ae3096
3 changed files with 9 additions and 6 deletions

View File

@ -2,9 +2,10 @@ body { background:#fff; padding:50px;}
#dotgrid { margin:0px auto; position:relative; border:0px solid white; background:white; overflow: hidden}
#dotgrid .marker { width:2px; height:2px; background:#999; position:absolute; margin-top:-1px; margin-left:-1px; border-radius:4px; z-index:50;}
#dotgrid .marker.block { background:black; width:4px; height:4px; margin-left:-2px; margin-top:-2px; }
#dotgrid #cursor { width:6px; height:6px; background:red; margin-top:-3px; margin-left:-3px; position:absolute; z-index:25; border-radius:10px;}
#dotgrid #cursor_from { width:6px; height:6px; background:black; margin-top:-3px; margin-left:-3px; position:absolute; z-index:25; border-radius:10px;}
#dotgrid #cursor_to { width:6px; height:6px; background:black; margin-top:-3px; margin-left:-3px; position:absolute; z-index:25; border-radius:10px;}
#dotgrid #cursor_from { width:6px; height:6px; background:black; margin-top:-3px; margin-left:-3px; position:absolute; z-index:25; border-radius:10px; left:-100px;}
#dotgrid #cursor_to { width:6px; height:6px; background:black; margin-top:-3px; margin-left:-3px; position:absolute; z-index:25; border-radius:10px; left:-100px;}
input { padding:2px 5px; border-radius:20px; margin:0px auto; display:none;}
.vector { position:relative; z-index:900; }
pre { font-family:courier; font-size:11px; position:fixed; left:20px; bottom:20px;}
pre { font-family:courier; font-size:11px; position:fixed; left:0px; bottom:20px;}

View File

@ -1,9 +1,11 @@
function Dotgrid(width,height,grid_x,grid_y)
function Dotgrid(width,height,grid_x,grid_y,block_x,block_y)
{
this.width = width;
this.height = height;
this.grid_x = grid_x;
this.grid_y = grid_y;
this.block_x = block_x;
this.block_y = block_y;
this.element = null;
this.grid_width = this.width/this.grid_x;
@ -30,7 +32,7 @@ function Dotgrid(width,height,grid_x,grid_y)
for (var x = this.grid_x - 1; x >= 0; x--) {
for (var y = this.grid_y - 1; y >= 0; y--) {
var marker = document.createElement("div");
marker.setAttribute("class","marker");
marker.setAttribute("class",(x % this.block_x == 0 && y % this.block_y == 0 ? "marker block" : "marker"));
marker.style.left = x * this.grid_width + (this.grid_width/2);
marker.style.top = y * this.grid_height + (this.grid_height/2);
this.element.appendChild(marker);

View File

@ -1,4 +1,4 @@
dotgrid = new Dotgrid(300,300,21,21);
dotgrid = new Dotgrid(300,300,13,13,4,4);
dotgrid.install();
var keyboard = new Keyboard();