diff --git a/links/main.css b/links/main.css index a913be9..9e0186e 100644 --- a/links/main.css +++ b/links/main.css @@ -4,6 +4,10 @@ body { margin:0px; padding:0px; overflow:hidden; font-family:"input_mono_medium" #ronin { background:#ddd; width:100%; height:100%; overflow:hidden; background-image:url(../media/graphics/grid.svg); background-position: 0px 0px;} #frame { width:50vw; height:50vh; overflow:hidden; position:fixed; left: calc(40vw + 15px); top:100px; background-image:url(../media/graphics/void.svg); background-position:0px 0px; } #frame > .layer { position:absolute; top:0px; left:0px; width:100%; height:100%;} + +@keyframes blink { 0% {opacity: 1;} 50% {opacity: 0;} 100% {opacity: 1;} } + +#frame > .layer.blink { animation: blink 0.1s; animation-iteration-count: infinite; } #overlay { position:absolute; z-index:1000;} #frame { cursor:none;} diff --git a/presets/default.rin b/presets/default.rin index 89620a1..c065faa 100644 --- a/presets/default.rin +++ b/presets/default.rin @@ -1,4 +1,4 @@ -frame.resize 300x320 +frame.resize 300x300 layer.fill #000000 path:line_width 28 path:line_cap butt @@ -10,9 +10,5 @@ path:line_cap round path.stroke M120,60 a60,60 0 0,1 60,60 M240,120 a-60,60 0 0,1 -60,60 M180,240 a-60,-60 0 0,1 -60,-60 M60,180 a60,-60 0 0,1 60,-60 path.stroke M120,90 a30,30 0 0,1 30,30 M210,120 a-30,30 0 0,1 -30,30 M180,210 a-30,-30 0 0,1 -30,-30 M90,180 a30,-30 0 0,1 30,-30 magnet.grid 1x1 4,4 -type:size 11 -type:color #ffffff -type:font "DIN Medium" -type.write 45,280 "RONIN" -type:font "DIN" -type.write 85,280 "09" \ No newline at end of file +brush:color #72dec2 +brush:size 10 \ No newline at end of file diff --git a/presets/glyph.rin b/presets/glyph.rin index 2b3fafa..c602c0b 100644 --- a/presets/glyph.rin +++ b/presets/glyph.rin @@ -5,7 +5,7 @@ path:line_width 10 magnet.grid 15x15 4,4 frame.select work ~ OQUONIE -path.stroke M45,60 l210,0 M45,240 l210,0 M255,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M75,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M255,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M75,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M60,75 l0,150 M240,75 l0,150 M60,150 l180,0 +~ path.stroke M45,60 l210,0 M45,240 l210,0 M255,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M75,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M255,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M75,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M60,75 l0,150 M240,75 l0,150 M60,150 l180,0 ~ THOUSAND ROOMS ~ path.stroke M45,60 l210,0 M45,240 l210,0 M255,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M75,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M255,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M75,240 a-15,-15 0 0,1 -15,-15 a-15,15 0 0,1 -15,15 M240,75 l0,150 M60,75 l0,150 M180,60 l0,180 M60,180 l180,0 M195,60 a-15,15 0 0,0 -15,15 a-15,-15 0 0,0 -15,-15 M165,240 a15,-15 0 0,0 15,-15 a15,15 0 0,0 15,15 ~ DONSOL diff --git a/presets/marabu.rin b/presets/marabu.rin new file mode 100644 index 0000000..f9da2ca --- /dev/null +++ b/presets/marabu.rin @@ -0,0 +1,15 @@ +frame.resize 300x300 +layer.fill #000000 +path:line_width 28 +path:line_cap butt +magnet:color #f00 +magnet.grid 15x15 4,4 +frame.select logo +~ path.stroke M60,60 l60,0 a60,60 0 0,1 60,60 M240,60 l0,60 a-60,60 0 0,1 -60,60 M240,240 l-60,0 a-60,-60 0 0,1 -60,-60 M60,240 l0,-60 a60,-60 0 0,1 60,-60 M90,240 l0,-60 a30,-30 0 0,1 30,-30 M60,90 l60,0 a30,30 0 0,1 30,30 M210,60 l0,60 a-30,30 0 0,1 -30,30 M240,210 l-60,0 a-30,-30 0 0,1 -30,-30 +~ path.stroke M45,60 l15,0 M45,90 l15,0 M210,45 l0,15 M240,45 l0,15 M255,210 l-15,0 M255,240 l-15,0 M90,255 l0,-15 M60,255 l0,-15 +~ path:line_cap round +~ path.stroke M120,60 a60,60 0 0,1 60,60 M240,120 a-60,60 0 0,1 -60,60 M180,240 a-60,-60 0 0,1 -60,-60 M60,180 a60,-60 0 0,1 60,-60 +~ path.stroke M120,90 a30,30 0 0,1 30,30 M210,120 a-30,30 0 0,1 -30,30 M180,210 a-30,-30 0 0,1 -30,-30 M90,180 a30,-30 0 0,1 30,-30 +magnet.clear + +brush:color #72dec2 \ No newline at end of file diff --git a/scripts/modules/frame.js b/scripts/modules/frame.js index 6236e87..5a29b23 100644 --- a/scripts/modules/frame.js +++ b/scripts/modules/frame.js @@ -16,7 +16,6 @@ function Frame(rune) this.install = function() { - this.blink(); this.select(new Command("frame.select background")); // Canvas diff --git a/scripts/modules/layer.js b/scripts/modules/layer.js index 730b43c..d7a02c3 100644 --- a/scripts/modules/layer.js +++ b/scripts/modules/layer.js @@ -182,8 +182,6 @@ function Layer(name,manager = null) this.blink = function() { - if(this.is_blinking == false){ return; } - - this.element.style.display = this.element.style.display == "none" ? "block" : "none"; + this.element.setAttribute("class","layer blink") } } \ No newline at end of file diff --git a/scripts/modules/magnet.js b/scripts/modules/magnet.js index 3c1e664..a0755d8 100644 --- a/scripts/modules/magnet.js +++ b/scripts/modules/magnet.js @@ -8,12 +8,13 @@ function Magnet(rune) this.add_setting(new Setting("color","#000000")); this.add_method(new Method("grid",["rect","position"])); + this.add_method(new Method("clear",[])); this.grid = function(cmd,preview = false) { if(!cmd.rect()){ return 0, "Rect?"; } - if(!this.layer){ this.create_layer(); } + if(!this.layer){ this.create_layer(true); } this.layer.clear(); this.draw_grid(cmd.rect(),cmd.position()); @@ -26,6 +27,14 @@ function Magnet(rune) return 1, preview ? "preview" : "ok"; } + this.clear = function(cmd,preview = false) + { + this.layer.clear(); + + this.size = new Rect("1x1"); + this.rate = this.rate; + } + this.draw_grid = function(rect,position) { if(!rect){ rect = new Rect("20x20"); } @@ -69,7 +78,7 @@ function Magnet(rune) this.update_mouse = function(position) { if(this.size.width > 4 || this.size.height > 4){ - if(!this.layer){ this.create_layer(); } + if(!this.layer){ this.create_layer(true); } this.layer.clear(); this.draw_grid(this.size,this.rate); } diff --git a/scripts/modules/module.js b/scripts/modules/module.js index 47df107..92531e8 100644 --- a/scripts/modules/module.js +++ b/scripts/modules/module.js @@ -38,10 +38,11 @@ function Module(rune) return this.get_layer().context(); } - this.create_layer = function() + this.create_layer = function(blink = false) { this.layer = new Layer(this.constructor.name+".Preview",this); this.layer.element.setAttribute("style","z-index:7000"); + if(blink){ this.layer.blink(); } ronin.frame.add_layer(this.layer); } diff --git a/scripts/modules/overlay.js b/scripts/modules/overlay.js index 7134a04..f17758c 100644 --- a/scripts/modules/overlay.js +++ b/scripts/modules/overlay.js @@ -8,7 +8,7 @@ function Overlay(rune) this.draw = function(position,rect) { - if(!this.layer){ this.create_layer(); this.layer.is_blinking = true; } + if(!this.layer){ this.create_layer(true); this.layer.is_blinking = true; } if(!position){ position = new Position("0,0"); } diff --git a/scripts/modules/type.js b/scripts/modules/type.js index cf3ab13..3d4ef79 100644 --- a/scripts/modules/type.js +++ b/scripts/modules/type.js @@ -10,7 +10,7 @@ function Type(rune) this.write = function(cmd,preview = false) { - if(!this.layer){ this.create_layer(); this.layer.is_blinking = true; } + if(!this.layer){ this.create_layer(true); this.layer.is_blinking = true; } this.layer.clear();