From 2e3475e040822ee48cfffaadcd019ebd47b43b84 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Mon, 16 Apr 2018 21:23:29 +0300 Subject: [PATCH] style to fit into site --- assets/css/app.css.sass | 24 ++++++++++-------------- assets/css/menu.css.sass | 8 +++----- config.ru | 23 ++--------------------- lib/views/status_view.rb | 7 ++----- 4 files changed, 17 insertions(+), 45 deletions(-) diff --git a/assets/css/app.css.sass b/assets/css/app.css.sass index bd0e8ee..d1780c3 100644 --- a/assets/css/app.css.sass +++ b/assets/css/app.css.sass @@ -4,6 +4,10 @@ $susy: ( columns: 5 , gutter-position: split ) +body + background-color: black + color: white + .one_class margin: 10px @@ -59,26 +63,18 @@ $susy: ( columns: 5 , gutter-position: split ) text-align: right -.act - background-color: #00B3FF - -moz-border-radius: 7px - -webkit-border-radius: 7px - font-size: 100% +.next , .run , .wizz + border-radius: 7px + font-size: 1em -.crawl - background-color: #009900 - -moz-border-radius: 7px - -webkit-border-radius: 7px +.next + background-color: #00FF66 .run background-color: #00CC33 - -moz-border-radius: 7px - -webkit-border-radius: 7px .wizz - background-color: #00FF66 - -moz-border-radius: 7px - -webkit-border-radius: 7px + background-color: #009900 .bright diff --git a/assets/css/menu.css.sass b/assets/css/menu.css.sass index 3d736fe..561ae1a 100644 --- a/assets/css/menu.css.sass +++ b/assets/css/menu.css.sass @@ -9,8 +9,8 @@ body float: left width: 190px border-radius: 8px - background: #fff - border: 1px solid #C3D46A + background: black + border: 3px solid #C3D46A #nav li /* all list items */ @@ -35,10 +35,8 @@ body padding-left: 5px width: 180px display: block - color: black - font-weight: bold text-decoration: none - background-color: white + background-color: black border-radius: 7px diff --git a/config.ru b/config.ru index 7f20042..14a9eb9 100644 --- a/config.ru +++ b/config.ru @@ -6,31 +6,12 @@ require "opal" require 'opal-browser' Opal.use_gem("rubyx") -Opal.use_gem("ast") -Risc.machine.boot -class DebugServer < Opal::Server - def ball(env) - path = env["REQUEST_PATH"] - return super(env) unless path.include?("json") - route = path[1 .. path.index(".") - 1] - [200, { 'Content-Type' => 'text/json' }, code(route) ] - end - - def code at - soml = File.new("codes/#{at}.soml").read - syntax = Parser::Salama.new.parse_with_debug(soml) - parts = Parser::Transform.new.apply(syntax) - [parts.inspect] - end -end - -run Opal::Sprockets::Server.new { |s| +run Opal::Sprockets::Server.new do |s| s.main = 'debugger.js.rb' s.append_path 'lib' s.append_path 'assets' s.debug = !ENV["DEBUG"].nil? -# s.source_map = true s.index_path = "index.html.erb" s.sprockets.cache = Sprockets::Cache::MemoryStore.new(10000) -} +end diff --git a/lib/views/status_view.rb b/lib/views/status_view.rb index ef9ac50..20aeaad 100644 --- a/lib/views/status_view.rb +++ b/lib/views/status_view.rb @@ -10,8 +10,7 @@ class StatusView < ElementView def draw @element = div(".status_view") << div("h4" , "Interpreter" ) << - div("button.act" , "Next") << - div("button.crawl" , "Crawl") << + div("button.next" , "Next") << div("button.run" , "Run") << div("button.wizz" , "Wizz") << div( "br") << @@ -23,11 +22,9 @@ class StatusView < ElementView div( "br" , "Stdout") << div("span.stdout") # set up event handler - @element.at_css(".act").on("click") { self.update } - @element.at_css(".crawl").on("mousedown") { self.start( 0.5 ) } + @element.at_css(".next").on("click") { self.update } @element.at_css(".run").on("mousedown") { self.start( 0.1 ) } @element.at_css(".wizz").on("mousedown") { self.start( 0.0 ) } - @element.at_css(".crawl").on("mouseup") { self.stop } @element.at_css(".run").on("mouseup") { self.stop } @element.at_css(".wizz").on("mouseup") { self.stop } return @element