Browse Source

fix deleted variables, better feedback messages

romanmatiasko 10 years ago
parent
commit
dc1576150c
4 changed files with 8 additions and 2 deletions
  1. 2 1
      public/javascripts/start.js
  2. 4 0
      public/stylesheets/style.scss
  3. 1 0
      server.js
  4. 1 1
      views/index.jade

+ 2 - 1
public/javascripts/start.js

@@ -3,7 +3,8 @@ $(document).ready(function () {
 
 
   $socket.on('created', function (data) {
   $socket.on('created', function (data) {
     $token = data.token;
     $token = data.token;
-
+    $('#waiting').text('Wating for opponent to connect.');
+    
     $('#game_link').val($URL + '/play/' + $token + '/' + $time + '/' + $increment); // create game link
     $('#game_link').val($URL + '/play/' + $token + '/' + $time + '/' + $increment); // create game link
     $('#game_link').click(function() {
     $('#game_link').click(function() {
       $(this).select(); // when clicked, link is automatically selected for convenience
       $(this).select(); // when clicked, link is automatically selected for convenience

+ 4 - 0
public/stylesheets/style.scss

@@ -292,6 +292,10 @@ input.game_link {
 .button:active{
 .button:active{
   top: 1px;
   top: 1px;
 }
 }
+.button:focus{
+  outline: none;
+}
+
 a.button{
 a.button{
   width: 120px;
   width: 120px;
   line-height: 46px;
   line-height: 46px;

+ 1 - 0
server.js

@@ -162,6 +162,7 @@ io.sockets.on('connection', function (socket) {
 });
 });
 
 
 function runTimer(color, token, socket) {
 function runTimer(color, token, socket) {
+  var player, time_left, game = games[token];
 
 
   for (var i in game.players) {
   for (var i in game.players) {
     player = game.players[i];
     player = game.players[i];

+ 1 - 1
views/index.jade

@@ -16,7 +16,7 @@ block content
       input#game_link.game_link(type='text', readonly, value='Game link will be generated here.')
       input#game_link.game_link(type='text', readonly, value='Game link will be generated here.')
       button.button#play(type='submit') Play
       button.button#play(type='submit') Play
   
   
-    p#waiting Waiting for opponent to connect.
+    p#waiting Generating game link.
   
   
   p.center Click the button play to create a game. Send the link to your friend. Once the link is opened in your friend's browser, game should begin shortly. Colours are picked randomly by computer. 
   p.center Click the button play to create a game. Send the link to your friend. Once the link is opened in your friend's browser, game should begin shortly. Colours are picked randomly by computer.