From 58c1e1185b2c12b210d2d958468ba92a20d81d6f Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Sun, 24 Feb 2019 04:35:56 +0000 Subject: [PATCH] some styles --- main.rb | 10 +++++++--- public/main.css | 42 ++++++++++++++++++++++++++++++++++++++++++ views/index.erb | 27 +++++++++++++++------------ 3 files changed, 64 insertions(+), 15 deletions(-) create mode 100644 public/main.css diff --git a/main.rb b/main.rb index bf65dc2..6932ef8 100755 --- a/main.rb +++ b/main.rb @@ -24,7 +24,6 @@ LEDS.each do |led| IO.set_low led end -# IO.reset get '/' do @led_status = led_status @@ -35,11 +34,11 @@ get '/cycle' do clear 5.times do |i| - sleep 0.5 + sleep 0.3 IO.set_high LEDS[i] IO.set_low LEDS[i - 1] end - + sleep 0.3 clear redirect to('/') end @@ -51,6 +50,11 @@ get '/led/:color' do |led| redirect to('/') end +get '/clear' do + clear + redirect to('/') +end + def pick led case led when 'blue' diff --git a/public/main.css b/public/main.css new file mode 100644 index 0000000..26652a9 --- /dev/null +++ b/public/main.css @@ -0,0 +1,42 @@ +html { + box-sizing: border-box; + font-size: 16px; +} + +*, *:before, *:after { + box-sizing: inherit; +} + +.container { + margin: 15px auto; + max-width: 450px; +} + +ul.switches { + display: flex; + margin: 0 0 15px; + padding: 0; + list-style: none; +} + +.switches li { + margin: 5px; +} + +.switches a { + display: inline-block; + padding: 10px; + border: 1px solid #000; + border-radius: 5px; + text-decoration: none; + color: #000; +} + +.switches a:hover { + background-color: #eee; +} + +.switches a.active { + background-color: #858585; + color: #eee; +} diff --git a/views/index.erb b/views/index.erb index 1fe079f..eae5747 100644 --- a/views/index.erb +++ b/views/index.erb @@ -3,21 +3,24 @@ LED Manager + -

LED Manager

- +
+

LED Manager

-
-    <%= led_status %>
-  
+ + +