Permalink
Browse files

Split out landing page from game page.

  • Loading branch information...
1 parent e5ac4d6 commit 3dc006a5c757cb71f7a0b0ac040d5aaa800d7d3d John Weaver committed Apr 30, 2012
Showing with 76 additions and 61 deletions.
  1. +2 −33 src/_layouts/default.haml
  2. +3 −0 src/_partials/meta.haml
  3. +12 −8 src/css/style.css
  4. +30 −18 src/index.haml
  5. +2 −2 src/js/app.coffee
  6. +1 −0 src/js/scenes/start.coffee
  7. +26 −0 src/play.haml
View
@@ -11,9 +11,7 @@
-# Use the .htaccess and remove these lines to avoid edge case issues. More info: h5bp.com/b/378
%meta{'http-equiv' => "X-UA-Compatible", :content => "IE=edge,chrome=1"}
- %title Default
- %meta{:name => "description", :content => ""}
- %meta{:name => "author", :content => "John David Weaver"}
+ = partial "meta"
-# Copyright (c) 2012 John David Weaver
@@ -53,36 +51,7 @@
%script{:src => "/js/lib/modernizr.js"}
%body
- %a{:href => "http://github.com/saebyn/rain"}
- %img{:style => "position: absolute; top: 0; right: 0; border: 0;", :src => "https://a248.e.akamai.net/camo.github.com/30f550e0d38ceb6ef5b81500c64d970b7fb0f028/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67", :alt => "Fork me on GitHub"}
-
- #container
- %header
- #main{:role => "main"}
- = yield
- %footer
-
- -# Include JS templates
- %script{:type => "text/template", :id => "mobile-device-tmpl"}
- = partial "mobile"
-
- -# JavaScript at the bottom for fast page loading
-
- -# scripts concatenated and minified via build script
- = javascripts "lib/jquery"
- = javascripts "lib/underscore"
- = javascripts "lib/backbone"
- = javascripts "lib/yabble"
- = javascripts "lib/gamejs"
- :javascript
- var $g = {
- ajaxBaseHref: "/assets/",
- resourceBaseHref: "/assets"
- };
- require.setModuleRoot('js');
- require.run('app');
-
- -# end scripts
+ = yield
:javascript
window._gaq = [['_setAccount','UA-6365132-5'],['_trackPageview'],['_trackPageLoadTime']];
View
@@ -0,0 +1,3 @@
+%title Play R.A.I.N.
+%meta{:name => "description", :content => "RAIN is a game"}
+%meta{:name => "author", :content => "John David Weaver"}
View
@@ -273,38 +273,43 @@ td { vertical-align: top; }
/* styles for start scene */
#start-screen .wrapper {
- background-color: black;
+ background-color: #050505;
max-width: 1200px;
margin: 0px auto;
}
#start-screen button {
padding: 15px;
- border: 1px solid black;
- background-color: gray;
+ border: 1px solid #00011e;
+ background-color: #485761;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
color: white;
}
+#start-screen button:hover {
+ background-color: #7B8083;
+}
+
#start-screen button.start {
float: left;
margin: 40px 0 0 40px;
}
#start-screen ul.saved-games {
- margin-left: 40%;
- border-left: 2px solid black;
+ border-left: 2px solid #00011e;
+ float: right;
+ min-width: 400px;
}
#start-screen ul.saved-games li {
list-style: none;
- background-color: #eee;
+ background-color: #D8E0E6;
width: 80%;
height: 100px;
padding: 15px;
- border-bottom: 1px dashed white;
+ border-bottom: 1px dashed #00111E;
}
#start-screen ul.saved-games li .name:before {
@@ -324,7 +329,6 @@ td { vertical-align: top; }
#start-screen ul.saved-games li button {
float: right;
- color: black;
}
/* styles for inventory system */
View
@@ -1,20 +1,32 @@
-%h1 R.A.I.N.
+%a{:href => "http://github.com/saebyn/rain"}
+ %img{:style => "position: absolute; top: 0; right: 0; border: 0;", :src => "https://a248.e.akamai.net/camo.github.com/30f550e0d38ceb6ef5b81500c64d970b7fb0f028/687474703a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6f72616e67655f6666373630302e706e67", :alt => "Fork me on GitHub"}
-#key-defs
- %h2 Keys:
+#container
+ %header
+ #main{:role => "main"}
- %dl
- %dt a
- %dd Move left
- %dt d
- %dd Move right
- %dt hold shift
- %dd Run
- %dt w
- %dd Jump
- %dt i
- %dd Inventory
- %dt space
- %dd Attack
- %dt Escape
- %dd Pause game
+ %h1 R.A.I.N. is a game
+ %p
+ %a{:href => "/play.html"}
+ Play it now
+
+ #key-defs
+ %h2 game keys
+
+ %dl
+ %dt a
+ %dd Move left
+ %dt d
+ %dd Move right
+ %dt shift
+ %dd Run
+ %dt w
+ %dd Jump
+ %dt i
+ %dd Inventory
+ %dt space
+ %dd Attack
+ %dt Escape
+ %dd Pause game
+
+ %footer
View
@@ -24,8 +24,8 @@ gamejs = require 'gamejs'
director = require 'director'
StartScene = require('scenes/start').StartScene
-SCREEN_WIDTH = $(document).width() - 200
-SCREEN_HEIGHT = $(document).height() - 200
+SCREEN_WIDTH = $(document).width() - 25
+SCREEN_HEIGHT = $(document).height() - 25
gamejs.ready ->
@@ -36,6 +36,7 @@ exports.StartScene = Backbone.View.extend(
</li>
<% }); %>
</ul>
+ <div class="clearfix"></div>
</div>')
events:
View
@@ -0,0 +1,26 @@
+#container
+ %header
+ #main{:role => "main"}
+ %footer
+
+-# Include JS templates
+%script{:type => "text/template", :id => "mobile-device-tmpl"}
+ = partial "mobile"
+
+-# JavaScript at the bottom for fast page loading
+
+-# scripts concatenated and minified via build script
+= javascripts "lib/jquery"
+= javascripts "lib/underscore"
+= javascripts "lib/backbone"
+= javascripts "lib/yabble"
+= javascripts "lib/gamejs"
+:javascript
+ var $g = {
+ ajaxBaseHref: "/assets/",
+ resourceBaseHref: "/assets"
+ };
+ require.setModuleRoot('js');
+ require.run('app');
+
+-# end scripts

0 comments on commit 3dc006a

Please sign in to comment.