This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.bubble | |
{ | |
position: relative; | |
width: 250px; | |
height: 280px; | |
padding: 0px; | |
background: #FFFFFF; | |
-webkit-border-radius: 10px; | |
-moz-border-radius: 10px; | |
border-radius: 10px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "go", | |
"description": "a mean stack deployment of the ancient board game 'go'", | |
"keywords": [ | |
"express", | |
"mongoose", | |
"mongodb", | |
"passport", | |
"demo" | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.angular.module('go.controllers.index', []) | |
.controller('IndexController', ['$scope', 'Global', | |
function ($scope, Global) { | |
$scope.global = Global; | |
rows = 6; | |
cols = 6; | |
$scope.board = matrix(rows, cols); | |
$scope.player = "black"; | |
$scope.move = function (cell, col, row) { | |
if (cell.color == "empty") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<section ng-controller="IndexController"> | |
<h1>Welcome {{global.currentUser().name}}</h1> | |
<h2>It's {{player}}'s turn</h2> | |
<div class="board"> GAME | |
<div ng-repeat="row in board"> | |
<div ng-repeat="cell in row" class="space {{cell.color}}" ng-click="move(cell, $parent.$index, $index)"> | |
<!--{{cell.color}} [{{$index}},{{$parent.$index}}]--> | |
<div class="grid">{{cell.id}}</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.angular.module('go.services.global', []) | |
.factory('Global', function() { | |
var current_user = window.user; | |
return { | |
currentUser: function() { | |
return current_user; | |
}, | |
isSignedIn: function() { | |
return !!current_user; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.navbar .nav> li > a.brand { | |
padding-left: 20px; | |
margin-left: 0; | |
} | |
.content { | |
margin-top: 50px; | |
width: 100%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isCorner (col, row, size) { | |
if ((col==0 && row==0) || | |
(col==size-1 && row==size-1) || | |
(col==0 && row==size-1) || | |
(col==size-1 && row==0)) { | |
return true; | |
} | |
} | |
function isEdge (col, row, size) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Clearfix | |
clearfix() | |
content '' | |
display block | |
clear both | |
// Layouts | |
basicLayout(padding, max-width) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reset() | |
* | |
box-sizing border-box | |
html, body | |
height 100% | |
a | |
cursor pointer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dateRange () { | |
return function(items, from, to) { | |
if (items != null) { | |
var inRange = []; | |
angular.forEach(items, function(item) { | |
if (from < item.created && item.created < to) { | |
inRange.push(item); | |
} | |
}); | |
return inRange; |
OlderNewer