windhamdavid 9 years ago
parent
commit
a00fa29a62

+ 1 - 1
README.md

@@ -6,7 +6,7 @@ romanmatiasko/reti-chess)
 ```sh  
 npm install  
 node server.js  
-localhost:3000
+localhost:8888
 ```
 
 #####Built With

+ 1 - 1
public/images/chat.svg

@@ -11,7 +11,7 @@ You may NOT sub-license, resell, rent, redistribute or otherwise transfer the ic
 
 	 width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
 
-<path id="speech-bubble-14-icon" fill="#299cad" d="M440.704,391.771C454.312,375.362,462,354.216,462,332.679c0-35.26-19.864-65.01-49.435-83.766
+<path id="speech-bubble-14-icon" fill="#777777" d="M440.704,391.771C454.312,375.362,462,354.216,462,332.679c0-35.26-19.864-65.01-49.435-83.766
 
 	c4.186-13.053,6.395-26.594,6.395-40.27c0-90.207-87.645-155.312-184.479-155.312C137.037,53.331,50,118.929,50,208.644
 

+ 27 - 0
public/images/king.svg

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="45" height="45">
+  <g style="fill:none; fill-opacity:1; fill-rule:evenodd; stroke:#000000; stroke-width:1.5; stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4; stroke-dasharray:none; stroke-opacity:1;">
+    <path
+      d="M 22.5,11.63 L 22.5,6"
+      style="fill:none; stroke:#000000; stroke-linejoin:miter;" />
+    <path
+      d="M 20,8 L 25,8"
+      style="fill:none; stroke:#000000; stroke-linejoin:miter;" />
+    <path
+      d="M 22.5,25 C 22.5,25 27,17.5 25.5,14.5 C 25.5,14.5 24.5,12 22.5,12 C 20.5,12 19.5,14.5 19.5,14.5 C 18,17.5 22.5,25 22.5,25"
+      style="fill:#ffffff; stroke:#000000; stroke-linecap:butt; stroke-linejoin:miter;" />
+    <path
+      d="M 11.5,37 C 17,40.5 27,40.5 32.5,37 L 32.5,30 C 32.5,30 41.5,25.5 38.5,19.5 C 34.5,13 25,16 22.5,23.5 L 22.5,27 L 22.5,23.5 C 19,16 9.5,13 6.5,19.5 C 3.5,25.5 11.5,29.5 11.5,29.5 L 11.5,37 z "
+      style="fill:#ffffff; stroke:#000000;" />
+    <path
+      d="M 11.5,30 C 17,27 27,27 32.5,30"
+      style="fill:none; stroke:#000000;" />
+    <path
+      d="M 11.5,33.5 C 17,30.5 27,30.5 32.5,33.5"
+      style="fill:none; stroke:#000000;" />
+    <path
+      d="M 11.5,37 C 17,34 27,34 32.5,37"
+      style="fill:none; stroke:#000000;" />
+  </g>
+</svg>

+ 5 - 5
public/javascripts/app.js

@@ -1,16 +1,16 @@
 var $URL, $socket;
   
 $(function () {
-  //var ENV = 'openshift';
+  //var ENV = 'code';
   var ENV = 'dev';
   var $WS;
 
   if (ENV === 'dev') {
-    $URL = 'http://localhost:3000';
+    $URL = 'http://macs.local:8888';
     $WS = $URL;
-  } else if (ENV === 'openshift') {
-    $URL = 'http://www.retichess.com';
-    $WS = 'ws://www.retichess.com:8000/';
+  } else if (ENV === 'code') {
+    $URL = 'http://code.davidawindham.com:8888';
+    $WS = 'ws://code.davidawindham.com:8888/';
   }
 
   $socket = io.connect($WS);

+ 1 - 1
public/javascripts/play.js

@@ -460,7 +460,7 @@ $(function() {
   $('#clock li').each(function() {
     $(this).text($time + ':00');
   });
-  $('#game-type').text($time + '|' + $increment);
+  $('#game-type').text($time + ' | ' + $increment);
 
   function movePieceFromHandler(e) {
     var piece = $(this);

+ 37 - 54
public/stylesheets/style.css

@@ -68,13 +68,12 @@ p {
   font-size: 1rem; }
 
 h1.knight {
-  height: 122px;
-  width: 122px;
-  background: url("../images/knight.png") no-repeat;
-  margin: 2em auto 0.5em auto; }
+  height: 45px;
+  width: 45px;
+  background: url("../images/king.svg") no-repeat;
+  margin: 50px auto 10px; }
 
 h2 {
-  font-family: 'Cherry Swash';
   font-weight: 400;
   font-size: 2rem;
   text-align: center;
@@ -154,14 +153,14 @@ h3 {
 
 .chat {
   text-decoration: none;
-  color: #248a99;
+  color: #777;
   margin-right: 1em;
   line-height: 50px;
   float: right !important;
   cursor: pointer;
   font-weight: 600; }
   .chat:hover {
-    color: #299cad; }
+    color: #cecece; }
     .chat:hover .new-message {
       color: #d12521; }
   .chat img {
@@ -238,12 +237,13 @@ span#game-type {
   margin: 0 auto; }
   #form fieldset {
     border: 0;
-    text-align: right;
-    margin-bottom: 1em;
+    text-align: left;
+    margin-top: 1em;
+	margin-left: 250px;
     width: 80%; }
     #form fieldset input {
       margin-left: 1em;
-      width: 100px;
+      width: 60px;
       outline: none;
       height: 40px;
       line-height: 30px;
@@ -251,40 +251,34 @@ span#game-type {
       font-size: 1.125rem;
       color: #424242;
       border: 2px solid #2b222c;
-      border-left: 4px solid #2eafc2; }
+}
     #form fieldset label {
       position: relative; }
       #form fieldset label:before {
         position: absolute;
-        content: 'Up to 50';
+        content: '';
         top: 0;
         right: 2em;
         margin-top: -2.5em;
         font-size: 0.75rem; }
 
-input, button {
-  font-family: 'Open Sans'; }
 
 input.game_link {
-  width: 80%;
+  width: 70%;
   height: 50px;
   line-height: 50px;
   font-size: 1.125rem;
-  color: #fff;
-  border: 0;
-  border-bottom: 2px solid #2b222c;
-  border-left: 4px solid #2eafc2;
-  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
-  background: #423443;
+  color: #000;
+  border: 2px solid #2b222c;
   padding: 0 1em;
-  float: left;
-  border-radius: 2px;
-  box-shadow: inset 0 -2px #2b222c; }
+  float: right;
+  margin-right:80px;
+  margin-bottom: 1em;
+}
 
 .game_link:hover {
-  background: #4a3b4c;
-  border-bottom: 2px solid #3a2d3a;
-  box-shadow: inset 0 -2px #3a2d3a;
+  background: #f1f1f1;
+  border: 2px solid #2b222c;
   -moz-transition: all 0.2s ease-in-out;
   -webkit-transition: all 0.2s ease-in-out;
   -o-transition: all 0.2s ease-in-out;
@@ -292,28 +286,23 @@ input.game_link {
   transition: all 0.2s ease-in-out; }
 
 .game_link:focus {
-  color: #eee; }
+  color: #222; }
 
 .button {
-  width: 15%;
-  height: 50px;
-  display: block;
-  font-size: 1.125rem;
-  border-radius: 2px;
-  border: 0;
-  border-bottom: 2px solid #299cad;
-  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
-  background: #2eafc2;
-  color: white;
-  cursor: pointer;
-  float: right;
-  box-shadow: inset 0 -2px #299cad;
-  position: relative; }
+	background: white;
+	width: 15%;
+	height: 50px;
+	display: block;
+	border: 2px solid #2b222c;
+	font-size: 1.125rem;
+	color: #000;
+	cursor: pointer;
+	float: right;
+	position: relative; 
+}
 
 .button:hover {
-  background: #39bdd0;
-  border-bottom: 2px solid #2ca8ba;
-  box-shadow: inset 0 -2px #2ca8ba;
+	background: #de322e;
   -moz-transition: all 0.2s ease-in-out;
   -webkit-transition: all 0.2s ease-in-out;
   -o-transition: all 0.2s ease-in-out;
@@ -336,14 +325,11 @@ a.button:hover {
   margin-right: 10px; }
 
 .button--red {
-  background: #d12521;
-  border-color: #bb211e;
-  box-shadow: inset 0 -2px #bb211e;
+  background: white;
+  border-color: #000;
   margin-right: 10px; }
   .button--red:hover {
     background: #de322e;
-    border-bottom: 2px solid #c82320;
-    box-shadow: inset 0 -2px #c82320;
     -moz-transition: all 0.2s ease-in-out;
     -webkit-transition: all 0.2s ease-in-out;
     -o-transition: all 0.2s ease-in-out;
@@ -354,12 +340,11 @@ a.button:hover {
   display: none; }
 
 p#waiting {
-  font-family: 'Cherry Swash';
   font-size: 1.275rem;
   color: #bb211e;
   width: 100%;
   text-align: center;
-  margin: 15px 0px 0px 0px;
+  margin: 10px 0px;
   display: none;
   float: left; }
 
@@ -399,7 +384,6 @@ footer {
   border: 4px solid #fff;
   background: #e6e3e0; }
   #chat-wrapper h4 {
-    font-family: 'Cherry Swash';
     font-size: 1.225rem;
     height: 3em;
     line-height: 3em;
@@ -522,7 +506,6 @@ table#moves {
   float: left; }
 
 #moves thead {
-  font-family: 'Cherry Swash';
   width: 270px;
   height: 3em;
   line-height: 3em;

+ 1 - 14
server.js

@@ -8,8 +8,7 @@ var express = require('express')
 var app = express();
 
 app.configure(function() {
-  app.set('ipaddress', process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1');
-  app.set('port', process.env.OPENSHIFT_NODEJS_PORT || 3000);
+  app.set('port', process.env.OPENSHIFT_NODEJS_PORT || 8888);
   app.set('views', __dirname + '/views');
   app.set('view engine', 'jade');
   app.use(express.favicon());
@@ -59,18 +58,6 @@ var server = http.createServer(app).listen(app.get('port'), app.get('ipaddress')
 var games = {};
 var timer;
 
-/** 
- * Winston logger
- */
-winston.add(winston.transports.File, {
-  filename: __dirname + '/logs/games.log',
-  handleExceptions: true,
-  exitOnError: false,
-  json: false
-});
-winston.remove(winston.transports.Console);
-winston.handleExceptions(new winston.transports.Console());
-winston.exitOnError = false;
 
 /**
  * Sockets

+ 7 - 14
views/index.jade

@@ -2,25 +2,18 @@ extends layout
 
 block content
   h1.knight
-  h2 Reti Chess
-  p.margin-fifty.center A lightweight real-time chess app built in Node.js, Express framework and Socket.IO
+  h2 How about a nice game of chess?
 
   div#form
     form#create_form(action='')
-      fieldset
-        label Minutes per side: 
-          input#minutes(type='number', value='30', min='1', max='50', required)
-        label(style='padding-left: 2em;') Increment in seconds:
-          input#seconds(type='number', value='0', min='0', max='50', required)
-      input#game_link.game_link(type='text', readonly, value='Game link will be generated here.')
+      input#game_link.game_link(type='text', readonly, value='')
       button.button#play(type='submit') Play
-  
     p#waiting Generating game link.
+    fieldset
+      label Minutes: 
+        input#minutes(type='number', value='30', min='1', max='50', required)
+      label(style='padding-left: 2em;') Increment:
+        input#seconds(type='number', value='30', min='0', max='50', required)
   
-  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
-    a(href='/about', class='alpha') Read more about Reti Chess
-
 block scripts
   script(type='text/javascript', src='/javascripts/start.js')

+ 2 - 16
views/layout.jade

@@ -2,19 +2,14 @@ doctype 5
 html
   head
     - if (typeof(title) !== 'undefined')
-      title #{title} | Reti Chess
+      title #{title} | Chess-IO
     - else
-      title Reti Chess
+      title Chess-IO
     meta(charset='utf-8')
-    meta(name='robots', content='index, follow')
-    meta(itemprop='name=Reti Chess')
-    meta(name='description', content='Reti Chess is a lightweight real-time chess app built in Node.js with use of Express framework and Socket.IO')
     meta(name='viewport', content='width=device-width, initial-scale=1')
-    link(rel='shortcut icon', href='/images/logo.png')
     link(rel='stylesheet', href='/stylesheets/style.css')
     script(type='text/javascript', src='/socket.io/socket.io.js')
     block head
-    link(href='http://fonts.googleapis.com/css?family=Cherry+Swash|Open+Sans:400,600', rel='stylesheet', type='text/css')
     //if IE
       script(src='http://html5shiv.googlecode.com/svn/trunk/html5.js')
   body
@@ -43,17 +38,8 @@ html
     #container_wrapper.clearfix
       #container.clearfix
         block content
-        
-    footer
-      #footer.clearfix
-        p.center 2013 - 2014. Reti Chess is available under 
-          a(href='http://opensource.org/licenses/MIT')  the MIT License (MIT)
-          . Fork me on 
-          a(href='http://github.com/romanmatiasko/reti-chess')  Github
-          .
 
     script(type='text/javascript', src='/javascripts/jquery.js')
-    script(type='text/javascript', src='/javascripts/jquery.stickyFooter.js')
     script(type='text/javascript', src='/javascripts/chess.js')
     script(type='text/javascript', src='/javascripts/app.js')
     block scripts

+ 1 - 1
views/play.jade

@@ -28,7 +28,7 @@ block content
     h4 Chat
     a.close x
     ul#chat
-    span Write your message:
+    
     form#sendMessage
       input