From 645a1e1797513fb73c92773fd4efcac119e75c1d Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Wed, 7 Feb 2018 08:38:59 +1300 Subject: [PATCH] Removed colors from hard-code --- sources/links/main.css | 9 ++++++--- sources/scripts/dotgrid.js | 20 ++++++-------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/sources/links/main.css b/sources/links/main.css index 008fdaf..93999d9 100644 --- a/sources/links/main.css +++ b/sources/links/main.css @@ -47,9 +47,12 @@ body { background:var(--background) !important; } .b_inv { background:var(--b_inv) !important ; ; } .icon { color:var(--f_high) !important; stroke:var(--f_high) !important; } #dotgrid svg.vector { stroke:var(--f_high) !important; } +#dotgrid svg.vector #layer_1 { stroke:var(--f_high) !important; } +#dotgrid svg.vector #layer_2 { stroke:var(--f_med) !important; } +#dotgrid svg.vector #layer_3 { stroke:var(--f_low) !important; } +#dotgrid svg.vector #mirror_layer_1 { stroke:var(--f_high) !important; } +#dotgrid svg.vector #mirror_layer_2 { stroke:var(--f_med) !important; } +#dotgrid svg.vector #mirror_layer_3 { stroke:var(--f_low) !important; } #dotgrid #preview { stroke:var(--f_high) !important; } #dotgrid #cursor { border-color:var(--f_med); } -#dotgrid #cursor_from { background:var(--f_low); border-color:var(--f_low) !important; } -#dotgrid #cursor_to { background:var(--f_low); border-color:var(--f_low) !important; } -#dotgrid #cursor_end { background:var(--f_low); border-color:var(--f_low) !important; } \ No newline at end of file diff --git a/sources/scripts/dotgrid.js b/sources/scripts/dotgrid.js index 47ac31f..16a5946 100644 --- a/sources/scripts/dotgrid.js +++ b/sources/scripts/dotgrid.js @@ -39,12 +39,12 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca this.mirror_el = null; this.mirror = false; this.fill = false; - this.layer_1 = document.createElementNS("http://www.w3.org/2000/svg", "path"); - this.layer_2 = document.createElementNS("http://www.w3.org/2000/svg", "path"); - this.layer_3 = document.createElementNS("http://www.w3.org/2000/svg", "path"); - this.mirror_layer_1 = document.createElementNS("http://www.w3.org/2000/svg", "path"); - this.mirror_layer_2 = document.createElementNS("http://www.w3.org/2000/svg", "path"); - this.mirror_layer_3 = document.createElementNS("http://www.w3.org/2000/svg", "path"); + this.layer_1 = document.createElementNS("http://www.w3.org/2000/svg", "path"); this.layer_1.id = "layer_1" + this.layer_2 = document.createElementNS("http://www.w3.org/2000/svg", "path"); this.layer_2.id = "layer_2" + this.layer_3 = document.createElementNS("http://www.w3.org/2000/svg", "path"); this.layer_3.id = "layer_3" + this.mirror_layer_1 = document.createElementNS("http://www.w3.org/2000/svg", "path"); this.mirror_layer_1.id = "mirror_layer_1" + this.mirror_layer_2 = document.createElementNS("http://www.w3.org/2000/svg", "path"); this.mirror_layer_2.id = "mirror_layer_2" + this.mirror_layer_3 = document.createElementNS("http://www.w3.org/2000/svg", "path"); this.mirror_layer_3.id = "mirror_layer_3" this.scale = 1; this.install = function() @@ -397,14 +397,6 @@ function Dotgrid(width,height,grid_x,grid_y,block_x,block_y,thickness = 3,lineca this.mirror_layer_2.setAttribute("d",paths[1]); this.mirror_layer_3.setAttribute("d",paths[2]); - this.layer_1.style.stroke = this.theme.active.f_high; - this.layer_2.style.stroke = this.theme.active.f_med; - this.layer_3.style.stroke = this.theme.active.f_low; - - this.mirror_layer_1.style.stroke = this.theme.active.f_high; - this.mirror_layer_2.style.stroke = this.theme.active.f_med; - this.mirror_layer_3.style.stroke = this.theme.active.f_low; - this.svg_el.style.width = this.width; this.svg_el.style.height = this.height; this.svg_el.style.stroke = this.color;