style to fit into site
This commit is contained in:
parent
4ce6aab51c
commit
2e3475e040
@ -4,6 +4,10 @@
|
|||||||
|
|
||||||
$susy: ( columns: 5 , gutter-position: split )
|
$susy: ( columns: 5 , gutter-position: split )
|
||||||
|
|
||||||
|
body
|
||||||
|
background-color: black
|
||||||
|
color: white
|
||||||
|
|
||||||
.one_class
|
.one_class
|
||||||
margin: 10px
|
margin: 10px
|
||||||
|
|
||||||
@ -59,26 +63,18 @@ $susy: ( columns: 5 , gutter-position: split )
|
|||||||
text-align: right
|
text-align: right
|
||||||
|
|
||||||
|
|
||||||
.act
|
.next , .run , .wizz
|
||||||
background-color: #00B3FF
|
border-radius: 7px
|
||||||
-moz-border-radius: 7px
|
font-size: 1em
|
||||||
-webkit-border-radius: 7px
|
|
||||||
font-size: 100%
|
|
||||||
|
|
||||||
.crawl
|
.next
|
||||||
background-color: #009900
|
background-color: #00FF66
|
||||||
-moz-border-radius: 7px
|
|
||||||
-webkit-border-radius: 7px
|
|
||||||
|
|
||||||
.run
|
.run
|
||||||
background-color: #00CC33
|
background-color: #00CC33
|
||||||
-moz-border-radius: 7px
|
|
||||||
-webkit-border-radius: 7px
|
|
||||||
|
|
||||||
.wizz
|
.wizz
|
||||||
background-color: #00FF66
|
background-color: #009900
|
||||||
-moz-border-radius: 7px
|
|
||||||
-webkit-border-radius: 7px
|
|
||||||
|
|
||||||
|
|
||||||
.bright
|
.bright
|
||||||
|
@ -9,8 +9,8 @@ body
|
|||||||
float: left
|
float: left
|
||||||
width: 190px
|
width: 190px
|
||||||
border-radius: 8px
|
border-radius: 8px
|
||||||
background: #fff
|
background: black
|
||||||
border: 1px solid #C3D46A
|
border: 3px solid #C3D46A
|
||||||
|
|
||||||
|
|
||||||
#nav li /* all list items */
|
#nav li /* all list items */
|
||||||
@ -35,10 +35,8 @@ body
|
|||||||
padding-left: 5px
|
padding-left: 5px
|
||||||
width: 180px
|
width: 180px
|
||||||
display: block
|
display: block
|
||||||
color: black
|
|
||||||
font-weight: bold
|
|
||||||
text-decoration: none
|
text-decoration: none
|
||||||
background-color: white
|
background-color: black
|
||||||
border-radius: 7px
|
border-radius: 7px
|
||||||
|
|
||||||
|
|
||||||
|
23
config.ru
23
config.ru
@ -6,31 +6,12 @@ require "opal"
|
|||||||
require 'opal-browser'
|
require 'opal-browser'
|
||||||
|
|
||||||
Opal.use_gem("rubyx")
|
Opal.use_gem("rubyx")
|
||||||
Opal.use_gem("ast")
|
|
||||||
Risc.machine.boot
|
|
||||||
|
|
||||||
class DebugServer < Opal::Server
|
run Opal::Sprockets::Server.new do |s|
|
||||||
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|
|
|
||||||
s.main = 'debugger.js.rb'
|
s.main = 'debugger.js.rb'
|
||||||
s.append_path 'lib'
|
s.append_path 'lib'
|
||||||
s.append_path 'assets'
|
s.append_path 'assets'
|
||||||
s.debug = !ENV["DEBUG"].nil?
|
s.debug = !ENV["DEBUG"].nil?
|
||||||
# s.source_map = true
|
|
||||||
s.index_path = "index.html.erb"
|
s.index_path = "index.html.erb"
|
||||||
s.sprockets.cache = Sprockets::Cache::MemoryStore.new(10000)
|
s.sprockets.cache = Sprockets::Cache::MemoryStore.new(10000)
|
||||||
}
|
end
|
||||||
|
@ -10,8 +10,7 @@ class StatusView < ElementView
|
|||||||
def draw
|
def draw
|
||||||
@element = div(".status_view") <<
|
@element = div(".status_view") <<
|
||||||
div("h4" , "Interpreter" ) <<
|
div("h4" , "Interpreter" ) <<
|
||||||
div("button.act" , "Next") <<
|
div("button.next" , "Next") <<
|
||||||
div("button.crawl" , "Crawl") <<
|
|
||||||
div("button.run" , "Run") <<
|
div("button.run" , "Run") <<
|
||||||
div("button.wizz" , "Wizz") <<
|
div("button.wizz" , "Wizz") <<
|
||||||
div( "br") <<
|
div( "br") <<
|
||||||
@ -23,11 +22,9 @@ class StatusView < ElementView
|
|||||||
div( "br" , "Stdout") <<
|
div( "br" , "Stdout") <<
|
||||||
div("span.stdout")
|
div("span.stdout")
|
||||||
# set up event handler
|
# set up event handler
|
||||||
@element.at_css(".act").on("click") { self.update }
|
@element.at_css(".next").on("click") { self.update }
|
||||||
@element.at_css(".crawl").on("mousedown") { self.start( 0.5 ) }
|
|
||||||
@element.at_css(".run").on("mousedown") { self.start( 0.1 ) }
|
@element.at_css(".run").on("mousedown") { self.start( 0.1 ) }
|
||||||
@element.at_css(".wizz").on("mousedown") { self.start( 0.0 ) }
|
@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(".run").on("mouseup") { self.stop }
|
||||||
@element.at_css(".wizz").on("mouseup") { self.stop }
|
@element.at_css(".wizz").on("mouseup") { self.stop }
|
||||||
return @element
|
return @element
|
||||||
|
Loading…
x
Reference in New Issue
Block a user