Skip to content

Commit

Permalink
Redesign color scheme & update ruby gems
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Jackson committed Feb 23, 2015
1 parent 8822f0f commit eca36a7
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 139 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,3 +5,4 @@
/css/.sass-cache/*
/rakefile
/build
*.DS_Store
1 change: 1 addition & 0 deletions .ruby-version
@@ -0,0 +1 @@
1.9.3-p551
4 changes: 3 additions & 1 deletion Gemfile
@@ -1,4 +1,6 @@
source 'http://rubygems.org'

gem 'middleman'
gem 'middleman', '~> 3.3'
gem 'therubyracer'

gem 'compass-blueprint'
194 changes: 105 additions & 89 deletions Gemfile.lock
@@ -1,107 +1,123 @@
GEM
remote: http://rubygems.org/
specs:
activesupport (3.1.0)
multi_json (~> 1.0)
addressable (2.2.6)
chunky_png (1.2.1)
coffee-script (2.2.0)
activesupport (4.1.9)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
celluloid (0.16.0)
timers (~> 4.0.0)
chunky_png (1.3.4)
coffee-script (2.3.0)
coffee-script-source
execjs
coffee-script-source (1.1.2)
compass (0.11.5)
coffee-script-source (1.9.1)
compass (1.0.3)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
daemons (1.1.4)
em-websocket (0.3.1)
addressable (>= 2.1.1)
eventmachine (>= 0.12.9)
eventmachine (0.12.10)
execjs (1.2.4)
compass-core (~> 1.0.2)
compass-import-once (~> 1.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
sass (>= 3.3.13, < 3.5)
compass-blueprint (1.0.0)
compass
compass-core (1.0.3)
multi_json (~> 1.0)
fssm (0.2.7)
guard (0.6.3)
thor (~> 0.14.6)
guard-livereload (0.3.1)
em-websocket (>= 0.2.0)
guard (>= 0.4.0)
multi_json (~> 1.0.3)
haml (3.1.3)
hike (1.2.1)
http_router (0.10.2)
rack (>= 1.0.0)
url_mount (~> 0.2.1)
i18n (0.6.0)
libv8 (3.3.10.2)
maruku (0.6.0)
syntax (>= 1.0.0)
middleman (2.0.8)
coffee-script (~> 2.2.0)
compass (~> 0.11.3)
guard (~> 0.6.2)
haml (~> 3.1.0)
maruku (~> 0.6.0)
middleman-livereload (~> 0.2.0)
padrino-core (~> 0.10.2)
padrino-helpers (~> 0.10.2)
rack (~> 1.3.0)
rack-test (~> 0.6.1)
rb-fsevent (~> 0.4.2)
sass (~> 3.1.7)
sinatra (~> 1.2.6)
slim (~> 1.0.1)
sprockets (~> 2.0.0)
thin (~> 1.2.11)
thor (~> 0.14.0)
tilt (~> 1.3.1)
uglifier (~> 1.0.0)
middleman-livereload (0.2.0)
guard-livereload (~> 0.3.0)
multi_json (1.0.3)
padrino-core (0.10.2)
activesupport (~> 3.1.0)
http_router (~> 0.10.2)
sinatra (~> 1.2.6)
thor (~> 0.14.3)
tilt (~> 1.3.0)
padrino-helpers (0.10.2)
i18n (~> 0.6)
padrino-core (= 0.10.2)
rack (1.3.2)
rack-test (0.6.1)
sass (>= 3.3.0, < 3.5)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
erubis (2.7.0)
execjs (2.3.0)
ffi (1.9.6)
haml (4.0.6)
tilt
hike (1.2.3)
hitimes (1.2.2)
hooks (0.4.0)
uber (~> 0.0.4)
i18n (0.7.0)
json (1.8.2)
kramdown (1.5.0)
libv8 (3.16.14.7)
listen (2.8.5)
celluloid (>= 0.15.2)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
middleman (3.3.9)
coffee-script (~> 2.2)
compass (>= 1.0.0, < 2.0.0)
compass-import-once (= 1.0.5)
execjs (~> 2.0)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-core (= 3.3.9)
middleman-sprockets (>= 3.1.2)
sass (>= 3.4.0, < 4.0)
uglifier (~> 2.5)
middleman-core (3.3.9)
activesupport (~> 4.1.0)
bundler (~> 1.1)
erubis
hooks (~> 0.3)
i18n (~> 0.7.0)
listen (>= 2.7.9, < 3.0)
padrino-helpers (~> 0.12.3)
rack (>= 1.4.5, < 2.0)
rack-test (~> 0.6.2)
thor (>= 0.15.2, < 2.0)
tilt (~> 1.4.1, < 2.0)
middleman-sprockets (3.4.1)
middleman-core (>= 3.3)
sprockets (~> 2.12.1)
sprockets-helpers (~> 1.1.0)
sprockets-sass (~> 1.3.0)
minitest (5.5.1)
multi_json (1.10.1)
padrino-helpers (0.12.4)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.12.4)
tilt (~> 1.4.1)
padrino-support (0.12.4)
activesupport (>= 3.1)
rack (1.6.0)
rack-test (0.6.3)
rack (>= 1.0)
rb-fsevent (0.4.3.1)
sass (3.1.7)
sinatra (1.2.6)
rack (~> 1.1)
tilt (>= 1.2.2, < 2.0)
slim (1.0.2)
temple (~> 0.3.3)
tilt (~> 1.3.2)
sprockets (2.0.0)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
ref (1.0.5)
sass (3.4.12)
sprockets (2.12.3)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
syntax (1.0.0)
temple (0.3.4)
therubyracer (0.9.4)
libv8 (~> 3.3.10)
thin (1.2.11)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thor (0.14.6)
tilt (1.3.3)
uglifier (1.0.3)
sprockets-helpers (1.1.0)
sprockets (~> 2.0)
sprockets-sass (1.3.1)
sprockets (~> 2.0)
tilt (~> 1.1)
therubyracer (0.12.1)
libv8 (~> 3.16.14.0)
ref
thor (0.19.1)
thread_safe (0.3.4)
tilt (1.4.1)
timers (4.0.1)
hitimes
tzinfo (1.2.2)
thread_safe (~> 0.1)
uber (0.0.13)
uglifier (2.7.0)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
url_mount (0.2.1)
rack
json (>= 1.8.0)

PLATFORMS
ruby

DEPENDENCIES
middleman
compass-blueprint
middleman (~> 3.3)
therubyracer
4 changes: 3 additions & 1 deletion README.md
Expand Up @@ -9,6 +9,8 @@ Why? Because maze generation is fun to watch!
If you want to fork it and fool around, it's easy. The site runs on [middleman](https://github.com/tdreyno/middleman),
a simple static site generator.

It runs on ruby 1.9.3.

gem install bundler
bundle install

Expand All @@ -21,4 +23,4 @@ That's it! Your server is now running and can be accessed at:

localhost:4567

Your generated site is now in /build.
Your generated site is now in /build.
29 changes: 9 additions & 20 deletions source/index.html.haml
Expand Up @@ -5,35 +5,21 @@
/[if lt IE 9]
%script(src="//html5shim.googlecode.com/svn/trunk/html5.js")
%link{ :type => 'text/css', :href => 'stylesheets/layout.css', :rel=>'stylesheet' }
%script(src='http://use.typekit.com/ayf8rml.js')
%link{ :type => 'text/css', :href => 'http://fonts.googleapis.com/css?family=Open+Sans:400,300,700', :rel => 'stylesheet' }
%script{:src => '//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js',
:type => 'text/javascript' }
%script{:type => 'text/javascript',
:src => 'javascripts/mazery.js'}
:javascript
try{Typekit.load();}catch(e){}
:javascript
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2995032-2']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();


%title mazery by Steve Jackson
%title mazery by Steve Jackson

%body
<a href="https://github.com/stevejackson/mazery"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://a248.e.akamai.net/assets.github.com/img/4c7dc970b89fd04b81c8e221ba88ff99a06c6b61/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f77686974655f6666666666662e706e67" alt="Fork me on GitHub"></a>
%header
.primary_layout
%span.bigger
%a{ :href => '/', :alt => "mazery" } mazery
%span.smaller
%a{ :href => 'http://sjackson.net' } a js/coffeescript/html5 canvas thing by Steve Jackson
%a{ :href => 'http://sjackson.net' } random maze generation visualization

%hr.space

Expand All @@ -44,9 +30,12 @@
%input#fps{ :name => 'fps', :type => 'text', :value => '60', :size => 2, :maxlength => 2 }
%label{ :for => 'cellsize' }Cell Size
%input#cellsize{ :name => 'cellsize', :type => 'text', :value => '35', :size => 2, :maxlength => 2 }
%span.warning Lower cell size values might crash your browser. :)
%a.right#twitter{ :href => 'http://twitter.com/_sjackson', :alt => "Follow me on twitter" }
Follow this guy on twitter.
%a.left-buffer{ :href => 'https://github.com/stevejackson/mazery', :alt => "Open source on GitHub" }
Open source on GitHub.
%span.left-buffer
Written by
%a{ :href => 'http://www.sjackson.net' }
Steve Jackson.
%hr.space
%canvas#mazecanvas{ :width => 900, :height => 900 }
Maze Canvas.
17 changes: 11 additions & 6 deletions source/javascripts/mazery.js.coffee
Expand Up @@ -6,7 +6,12 @@ $(document).ready ->

# 'Generate' button handler
$('#generate').click ->
mazery()
cellSize = parseInt($('#cellsize').val())
if(cellSize <= 30)
if(confirm("Low cell size values could slow down and crash your browser. Proceed?"))
mazery()
else
mazery()

mazery = ->
# grab the context
Expand Down Expand Up @@ -71,11 +76,11 @@ class Maze

getCellColor: (x, y) ->
if @cells[x][y].visited
return "#161621"
return "#3D586A" # filled in background color
else
return "white"
return "white" # blank background color

"red"
"red" # error

drawCell: (x, y) ->
# draw order:
Expand All @@ -95,14 +100,14 @@ class Maze

# draw the "recently visited" cell color, fades away
if @cells[x][y].recentlyVisited
@context.fillStyle = "#e63c9f"
@context.fillStyle = "#EDEB8C"
@context.globalAlpha = @cells[x][y].visitedAlpha
@context.fillRect(locX, locY, @cellSize, @cellSize)
@context.fill()

# draw the "hunted" cell color, fades away
if @cells[x][y].hunted
@context.fillStyle = "#e63c9f"
@context.fillStyle = "#EDEB8C"
@context.globalAlpha = @cells[x][y].huntedAlpha
@context.fillRect(locX, locY, @cellSize, @cellSize)
@context.fill()
Expand Down

0 comments on commit eca36a7

Please sign in to comment.