Improved layout
This commit is contained in:
parent
3fb1b2b469
commit
a842994472
@ -1,8 +1,8 @@
|
||||
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 .marker { width:2px; height:2px; background:#ccc; position:absolute; margin-top:-1px; margin-left:-1px; border-radius:4px; z-index:50;}
|
||||
#dotgrid .marker.block { background:black; }
|
||||
#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:white; margin-top:-5px; margin-left:-5px; position:absolute; z-index:25; border-radius:10px; left:-100px;border:2px solid black;}
|
||||
#dotgrid #cursor_to { width:6px; height:6px; background:white; margin-top:-5px; margin-left:-5px; position:absolute; z-index:25; border-radius:10px; left:-100px; border:2px solid black;}
|
||||
|
@ -33,8 +33,8 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y)
|
||||
for (var y = this.grid_y - 1; y >= 0; y--) {
|
||||
var marker = document.createElement("div");
|
||||
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);
|
||||
marker.style.left = parseInt(x * this.grid_width + (this.grid_width/2));
|
||||
marker.style.top = parseInt(y * this.grid_height + (this.grid_height/2));
|
||||
this.element.appendChild(marker);
|
||||
}
|
||||
}
|
||||
@ -158,6 +158,7 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y)
|
||||
|
||||
this.erase = function()
|
||||
{
|
||||
this.reset();
|
||||
if(vector_element.lastChild === null){ return; }
|
||||
vector_element.removeChild(vector_element.lastChild);
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
dotgrid = new Dotgrid(300,300,13,13,4,4);
|
||||
dotgrid = new Dotgrid(300,300,31,31,5,5);
|
||||
dotgrid.install();
|
||||
|
||||
var keyboard = new Keyboard();
|
||||
|
Loading…
x
Reference in New Issue
Block a user