style to fit into site

This commit is contained in:
Torsten Ruger 2018-04-16 21:23:29 +03:00
parent 4ce6aab51c
commit 2e3475e040
4 changed files with 17 additions and 45 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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