Permalink
Browse files

Add javascript, image and canvas for displaying score

  • Loading branch information...
1 parent e8b575c commit d8fc6b6db9c33d45e732cab19982a85a08d1ce7d @karenc committed Jul 28, 2012
@@ -0,0 +1,12 @@
+function init() {
+ var game = document.getElementById('game');
+ var context = game.getContext('2d');
+ var background = document.getElementById('background');
+
+ context.drawImage(background, 0, 0);
+
+ context.fillStyle = 'black';
+ context.strokeRect(0, 0, HEIGHT, HEIGHT);
+}
+
+document.addEventListener('load', init, true);
@@ -1,4 +1,30 @@
+<%- content_for(:head) do -%>
+ <style type="text/css">
+ canvas {
+ margin: 0 auto;
+ display: block;
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+ }
+ #back-buffer {
+ display: none;
+ }
+ .hidden {
+ display: none;
+ }
+ </style>
+ <script type="text/javascript">
+ var WIDTH = 929;
+ var HEIGHT = 600;
+ </script>
+ <%= javascript_include_tag "fakesnladders.js" %>
+<%- end -%>
+
<h3>Home</h3>
<% @users.each do |user| %>
<p>User: <%=link_to user.name, user %></p>
-<% end %>
+<% end %>
+
+<canvas id="game" width="929" height="600"></canvas>
+<canvas id="back-buffer" width="929" height="600"></canvas>
+
+<%= image_tag 'faded.png', :id => 'background', :class => 'hidden' %>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d8fc6b6

Please sign in to comment.