From acb7ae30964c6a2f4a914f73f490b44ebbc0780b Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 31 Dec 2016 13:37:13 -0700 Subject: [PATCH] Guides --- links/main.css | 7 ++++--- scripts/dotgrid.js | 6 ++++-- scripts/init.js | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/links/main.css b/links/main.css index ae9ae1c..5990b34 100644 --- a/links/main.css +++ b/links/main.css @@ -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;} \ No newline at end of file +pre { font-family:courier; font-size:11px; position:fixed; left:0px; bottom:20px;} \ No newline at end of file diff --git a/scripts/dotgrid.js b/scripts/dotgrid.js index 6133aa5..e805867 100644 --- a/scripts/dotgrid.js +++ b/scripts/dotgrid.js @@ -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); diff --git a/scripts/init.js b/scripts/init.js index a0f0f2c..48a8872 100644 --- a/scripts/init.js +++ b/scripts/init.js @@ -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();