From 00914ca4da5496cd544075ada0d88ec322142196 Mon Sep 17 00:00:00 2001 From: Tawfik Kahwaje Date: Sat, 27 Aug 2016 16:57:48 +0300 Subject: [PATCH 1/5] (refactor) Refactor auth file --- client/app/auth/auth.js | 284 ++++++++++++++++++++-------------------- 1 file changed, 140 insertions(+), 144 deletions(-) diff --git a/client/app/auth/auth.js b/client/app/auth/auth.js index 0162eb8..262deee 100644 --- a/client/app/auth/auth.js +++ b/client/app/auth/auth.js @@ -4,107 +4,106 @@ angular.module('TeamUp.auth', []) /* facrbook Auth */ //=============================================================================================== $scope.facebookUser = {}; - $scope.wrong=true; + $scope.wrong = true; - $scope.fbLogin = function () { - FB.login(function (response) { - if (response.authResponse) { - if(response.status === "connected"){ - getUserInfo(); - $scope.facebookUser.fb_ID = response.authResponse.userID - } - } else { - console.log('User cancelled login or did not fully authorize.'); - } - }, {scope: 'email,user_photos,user_birthday,user_location,user_hometown'}); - - function getUserInfo() { - // get basic info - FB.api('/me',{ locale: 'en_US', fields: 'name, location, email' }, function (response) { - $scope.facebookUser.username = response.email; - $scope.facebookUser.firstName = response.name.split(" ")[0] - $scope.facebookUser.lastName = response.name.split(" ")[1] - $scope.facebookUser.password = response.email; - $scope.facebookUser.email = response.email; - - // get profile picture - FB.api('/me/picture?type=normal', function (picResponse) { - $scope.facebookUser.picture = picResponse.data.url; - }); + $scope.fbLogin = function() { + FB.login( function(response) { + if (response.authResponse) { + if (response.status === 'connected' ) { + getUserInfo(); + $scope.facebookUser.fb_ID = response.authResponse.userID; + } + } else { + console.log('User cancelled login or did not fully authorize.'); + } + }, + {scope: 'email,user_photos,user_birthday,user_location,user_hometown'}); - // to get friends - FB.api("/me/friends", function (response) { - if (response && !response.error) { - $scope.facebookUser.friends = response.data - } - } - ); - UserAuth.fbSignin({fb_ID:$scope.facebookUser.fb_ID}) - .then(function(user){ - if(!user){ - $scope.signup($scope.facebookUser); - }else{ - $scope.wrong=false; - $window.localStorage['userInfo'] = JSON.stringify(user); - $window.localStorage['token'] = user.token; - $window.localStorage['userId'] = user['user']._id; - $window.localStorage['isLogin'] = true; - $location.path('/home'); - $window.location.reload(); - } - }) - .then(function () { - $scope.islogin(); - $location.path('/'); - }) - .catch(function (error) { - console.error(error) - }) + getUserInfo = function () { + // get basic info + FB.api('/me', { locale: 'en_US', fields: 'name, location, email' }, function (response) { + $scope.facebookUser.username = response.email; + $scope.facebookUser.firstName = response.name.split(' ')[0]; + $scope.facebookUser.lastName = response.name.split(' ')[1]; + $scope.facebookUser.password = response.email; + $scope.facebookUser.email = response.email; + + // get profile picture + FB.api('/me/picture?type=normal', function (picResponse) { + $scope.facebookUser.picture = picResponse.data.url; + }); - }); - } + // to get friends + FB.api('/me/friends', function (response) { + if (response && !response.error) { + $scope.facebookUser.friends = response.data; + } + }); + UserAuth.fbSignin( {fb_ID: $scope.facebookUser.fb_ID}) + .then(function(user) { + if (!user) { + $scope.signup($scope.facebookUser); + } else { + $scope.wrong = false; + $window.localStorage['userInfo'] = JSON.stringify(user); + $window.localStorage['token'] = user.token; + $window.localStorage['userId'] = user['user']._id; + $window.localStorage['isLogin'] = true; + $location.path('/home'); + $window.location.reload(); + } + }) + .then(function () { + $scope.islogin(); + $location.path('/'); + }) + .catch(function (error) { + console.error(error); + }); + }); + }; }; // Google Plus Login $scope.gplusLogin = function () { - var myParams = { - // Replace client id with yours - 'clientid': '18301237550-3vlqoed2en4lvq6uuhh88o2h1l9m70tr.apps.googleusercontent.com', - 'cookiepolicy': 'single_host_origin', - 'callback': loginCallback, - 'approvalprompt': 'force', - 'scope': 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.profile.emails.read' - }; - gapi.auth.signIn(myParams); - //console.log(myParams) - function loginCallback(result) { - if (result['status']['signed_in']) { - var request = gapi.client.plus.people.get({'userId': 'me'}); - request.execute(function (resp) { - console.log('Google+ Login RESPONSE: ' + angular.toJson(resp)); - var userEmail; - if (resp['emails']) { - for (var i = 0; i < resp['emails'].length; i++) { - if (resp['emails'][i]['type'] == 'account') { - userEmail = resp['emails'][i]['value']; - } - } - } - // store data to DB - var user = {}; - user.name = resp.displayName; - user.email = userEmail; - if(resp.gender) { - resp.gender.toString().toLowerCase() === 'male' ? user.gender = 'M' : user.gender = 'F'; - } else { - user.gender = ''; - } - user.profilePic = resp.image.url; - $cookieStore.put('userInfo', user); - $state.go('dashboard'); - }); + var myParams = { + // Replace client id with yours + 'clientid': '18301237550-3vlqoed2en4lvq6uuhh88o2h1l9m70tr.apps.googleusercontent.com', + 'cookiepolicy': 'single_host_origin', + 'callback': loginCallback, + 'approvalprompt': 'force', + 'scope': 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.profile.emails.read' + }; + gapi.auth.signIn(myParams); + //console.log(myParams) + loginCallback = function(result) { + if (result['status']['signed_in']) { + var request = gapi.client.plus.people.get({'userId': 'me'}); + request.execute( function (resp) { + console.log('Google+ Login RESPONSE: ' + angular.toJson(resp)); + var userEmail; + if (resp['emails']) { + for (var i = 0; i < resp['emails'].length; i++) { + if (resp['emails'][i]['type'] === 'account') { + userEmail = resp['emails'][i]['value']; + } + } } + // store data to DB + var user = {}; + user.name = resp.displayName; + user.email = userEmail; + if (resp.gender) { + resp.gender.toString().toLowerCase() === 'male' ? user.gender = 'M' : user.gender = 'F'; + } else { + user.gender = ''; + } + user.profilePic = resp.image.url; + $cookieStore.put('userInfo', user); + $state.go('dashboard'); + }); } + }; }; //=============================================================================================== @@ -113,73 +112,70 @@ angular.module('TeamUp.auth', []) $scope.signin = function (user) { UserAuth.signUser(user) .then(function (data) { - $scope.wrong=false; + $scope.wrong = false; $window.localStorage['token'] = data.token; $window.localStorage['userId'] = data.userId; $window.localStorage['isLogin'] = true; $location.path('/home'); $window.location.reload(); }) - .then(function () { + .then( function () { $scope.islogin(); $location.path('/'); - }) + }) .catch(function (err) { console.log(err); - $scope.wrong=false; - $scope.username=""; - $scope.password=""; - }) + $scope.wrong = false; + $scope.username = ''; + $scope.password = ''; + }); }; - - $scope.picture = "https://thebenclark.files.wordpress.com/2014/03/facebook-default-no-profile-pic.jpg"; + $scope.picture = 'https://thebenclark.files.wordpress.com/2014/03/facebook-default-no-profile-pic.jpg'; $scope.signup = function (newUser) { - $scope.msgB = false; - newUser.picture = $scope.picture; - console.log(newUser) - UserAuth.addNewUser(newUser) - .then(function (user) { - $scope.signin({ - username:newUser.username, - password:newUser.password - }); - }) - .catch(function (err) { - $scope.msgB = true; - $scope.msg = "User already exists" - }) - } - + $scope.msgB = false; + newUser.picture = $scope.picture; + console.log(newUser); + UserAuth.addNewUser(newUser) + .then(function (user) { + $scope.signin({ + username: newUser.username, + password: newUser.password + }); + }) + .catch(function (err) { + $scope.msgB = true; + $scope.msg = 'User already exists'; + }); + }; $scope.islogin = function () { - if($window.localStorage['token'] || $window.localStorage['facebookState'] === "connected"){ + if ( $window.localStorage['token'] || $window.localStorage['facebookState'] === 'connected') { $window.islogin = true; - }else{ + } else { $window.islogin = false; } - console.log($window.islogin) - } - $scope.submit = function(){ //function to call on upload - if ($scope.file) { //check if file is loaded - $scope.upload($scope.file); //call upload function + console.log($window.islogin); + }; + $scope.submit = function () { //function to call on upload + if ($scope.file) { //check if file is loaded + $scope.upload($scope.file); //call upload function + } + }; + $scope.upload = function (file) { //upload an image to the game + Upload.upload({ + url: '/api/upload', //webAPI exposed to upload the file + data: {file: file} //pass file as data, should be user ng-model + }) + .then(function (resp) { //upload function returns a promise + if (resp.data.error_code === 0) { //validate success + $scope.picture = 'http://localhost:3000/uploads/' + resp.data.file.filename; + } else { + $window.alert('an error occured'); } - } - $scope.upload = function (file) {//upload an image to the game - Upload.upload({ - url: '/api/upload', //webAPI exposed to upload the file - data:{file:file} //pass file as data, should be user ng-model - }).then(function (resp) { //upload function returns a promise - if(resp.data.error_code === 0){ //validate success - $scope.picture='http://localhost:3000/uploads/'+resp.data.file.filename; - } else { - $window.alert('an error occured'); - } - }, function (resp) { //catch error - $window.alert('Error status: ' + resp.status); - }, function (evt) { - var progressPercentage = parseInt(100.0 * evt.loaded / evt.total); - $scope.progress = 'progress: ' + progressPercentage + '% '; // capture upload progress - }); + }, function (resp) { //catch error + $window.alert('Error status: ' + resp.status); + }, function (evt) { + var progressPercentage = parseInt(100.0 * evt.loaded / evt.total); + $scope.progress = 'progress: ' + progressPercentage + '% '; // capture upload progress + }); }; -}) - - + }); \ No newline at end of file From 66c3ddb3736fcd8e030ca0407efcb41bc015427a Mon Sep 17 00:00:00 2001 From: Tawfik Kahwaje Date: Sat, 27 Aug 2016 16:58:10 +0300 Subject: [PATCH 2/5] (refactor) Refactor category file --- client/app/category/category.js | 96 ++++++++++++++++----------------- 1 file changed, 46 insertions(+), 50 deletions(-) diff --git a/client/app/category/category.js b/client/app/category/category.js index 15ea4b1..1c63baa 100644 --- a/client/app/category/category.js +++ b/client/app/category/category.js @@ -1,52 +1,48 @@ -angular.module('TeamUp.category',[]) -.controller('categoryController', function($scope, Category, Game, $location, $window, $routeParams, $interval){ - $scope.categories = [] - $scope.games = [] - $scope.type = {value: '', filter: false} - $scope.cat = {value: '', filter: false} +angular.module('TeamUp.category', []) +.controller('categoryController', function($scope, Category, Game, $location, $window, $routeParams, $interval) { + $scope.categories = []; + $scope.games = []; + $scope.type = {value: '', filter: false}; + $scope.cat = {value: '', filter: false}; - $scope.initialize = function(){ - Category.getAll() - .then(function(categories){ - $scope.categories = categories - }) - .then(function(){ - $scope.getGames() - }) - .catch(function(err){ - console.log(err) - }) - } + $scope.initialize = function() { + Category.getAll() + .then(function(categories) { + $scope.categories = categories; + }) + .then(function() { + $scope.getGames(); + }) + .catch(function(err) { + console.log(err); + }); + }; + $scope.byCategoryOrType = function(game) { + if ($scope.type.filter) { + return game.type === $scope.type.value; + } else if ($scope.cat.filter) { + return game.category === $scope.cat.value; + } + }; + $scope.getCat = function(categoryId) { + $scope.type.filter = false; + $scope.cat.value = categoryId; + $scope.cat.filter = true; + }; + $scope.getType = function(type) { + $scope.cat.filter = false; + $scope.type.value = type; + $scope.type.filter = true; + }; - $scope.byCategoryOrType = function(game){ - if($scope.type.filter){ - return game.type === $scope.type.value - } else if ($scope.cat.filter){ - return game.category === $scope.cat.value - } - } - - $scope.getCat = function(categoryId){ - $scope.type.filter = false - $scope.cat.value = categoryId - $scope.cat.filter = true - } - - $scope.getType = function(type){ - $scope.cat.filter = false - $scope.type.value = type - $scope.type.filter = true - } - - $scope.getGames = function(){ - Game.getAll() - .then(function(games){ - $scope.games = games - }) - .catch(function(err){ - throw err - }) - } - - $scope.initialize() -}) \ No newline at end of file + $scope.getGames = function() { + Game.getAll() + .then(function(games) { + $scope.games = games; + }) + .catch(function(err) { + throw err; + }); + }; + $scope.initialize(); +}); \ No newline at end of file From 78162c6d5613a5a00cdb0408d7b5edf128472e8e Mon Sep 17 00:00:00 2001 From: Tawfik Kahwaje Date: Sat, 27 Aug 2016 16:58:35 +0300 Subject: [PATCH 3/5] (refactor) Refactor find file --- client/app/find/find.js | 106 +++++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 55 deletions(-) diff --git a/client/app/find/find.js b/client/app/find/find.js index 52bf0be..7b024e7 100644 --- a/client/app/find/find.js +++ b/client/app/find/find.js @@ -1,58 +1,54 @@ -angular.module('TeamUp.find',[]) - -.controller('searchController',function($scope, $window, $location, Game, User){ - $scope.data={}; - $scope.type=''; - $scope.initialize = function () { - Game.getAll() - .then(function (games) { - $scope.data.games = games; - $scope.data.types=[]; - $scope.data.types.push('All'); - for (var i = 0; i < games.length; i++) { - if($scope.data.types.indexOf(games[i].type)===-1) - $scope.data.types.push(games[i].type); - } - }) - .catch(function (err) { - console.log(err); - }); - User.getAll() - .then(function (users) { - $scope.data.users = users; - $scope.getResult(); - }) - .catch(function (err) { - console.log(err); - }) - }; - $scope.getResult = function(str){ - var users = $scope.data.users; - var games = $scope.data.games; - var searchStr = str || $window.localStorage.query.toLowerCase(); - console.log(searchStr); - $scope.result = { - games:[], - users:[] - }; - for( var key in games){ - if(games[key].name.toLowerCase().indexOf(searchStr) !== -1){ - $scope.result.games.push(games[key]); - } - } - for( var key in users){ - if(users[key].firstName.toLowerCase().indexOf(searchStr) !== -1 || users[key].username.toLowerCase().indexOf(searchStr) !== -1 || users[key].lastName.toLowerCase().indexOf(searchStr) !== -1){ - $scope.result.users.push(users[key]); - } +angular.module('TeamUp.find', []) +.controller('searchController', function($scope, $window, $location, Game, User) { + $scope.data = {}; + $scope.type = ''; + $scope.initialize = function () { + Game.getAll() + .then(function (games) { + $scope.data.games = games; + $scope.data.types = []; + $scope.data.types.push('All'); + for (var i = 0; i < games.length; i++) { + if ($scope.data.types.indexOf(games[i].type) === -1) { + $scope.data.types.push(games[i].type); } - console.log($scope.result) + } + }) + .catch(function (err) { + console.log(err); + }); + User.getAll() + .then(function (users) { + $scope.data.users = users; + $scope.getResult(); + }) + .catch(function (err) { + console.log(err); + }); + }; + $scope.getResult = function(str) { + var users = $scope.data.users; + var games = $scope.data.games; + var searchStr = str || $window.localStorage.query.toLowerCase(); + console.log(searchStr); + $scope.result = { + games: [], + users: [] + }; + for ( var key in games) { + if (games[key].name.toLowerCase().indexOf(searchStr) !== -1) { + $scope.result.games.push(games[key]); + } } - - - $scope.search = function(str){ - $scope.getResult(str); + for ( var key in users) { + if (users[key].firstName.toLowerCase().indexOf(searchStr) !== -1 || users[key].username.toLowerCase().indexOf(searchStr) !== -1 || users[key].lastName.toLowerCase().indexOf(searchStr) !== -1) { + $scope.result.users.push(users[key]); + } } - - $scope.initialize(); - -}) + console.log($scope.result); + }; + $scope.search = function(str) { + $scope.getResult(str); + }; + $scope.initialize(); +}); \ No newline at end of file From a73006fe1eaf01b4b0cfbba439a6b93753375341 Mon Sep 17 00:00:00 2001 From: Tawfik Kahwaje Date: Sat, 27 Aug 2016 16:59:12 +0300 Subject: [PATCH 4/5] (refactor) Refactor games file --- client/app/game/games.js | 357 ++++++++++++++++++--------------------- 1 file changed, 168 insertions(+), 189 deletions(-) diff --git a/client/app/game/games.js b/client/app/game/games.js index 2728078..5f94d21 100644 --- a/client/app/game/games.js +++ b/client/app/game/games.js @@ -1,194 +1,173 @@ -angular.module('TeamUp.games',[]) -.controller('gamesController',function($scope, $location, Game, User, $window,Like,facebook,$routeParams){ - - $scope.data={}; - $scope.type=''; - $scope.needPlayer=0; - $scope.loved="red"; - $scope.isLogIn=false; - $scope.filterDate; - - $scope.initaize = function () { - if($window.localStorage.userId) - $scope.isLogIn=true; - Game.getAll() - .then(function (games) { - $scope.data.games = games; - for (var i = 0; i < games.length; i++) { - if(games[i].likes.indexOf($window.localStorage.userId)!==-1) - $scope.data.games[i].loved='red' - else - $scope.data.games[i].loved='black' - } - $scope.data.types=[]; - $scope.data.types.push('All'); - for (var i = 0; i < games.length; i++) { - if($scope.data.types.indexOf(games[i].type)===-1) - $scope.data.types.push(games[i].type); - } - }).then(function(){ - $scope.locate(); - }) - .catch(function (err) { - console.log(err); - }); - }; - - $scope.viewGame = function (gameId) { - $location.path('/game/'+gameId); - } - - $scope.showType = function ($event) { - if($event.target.id==="All") - $scope.type=''; - else - $scope.type=$event.target.id; - } - - $scope.getLove = function (event) { - for (var i = 0; i < $scope.data.games.length; i++) { - if($scope.data.games[i]._id===event.target.id){ - if($scope.data.games[i].loved==='black'){ - $scope.data.games[i].loved='red'; - Like.likeGame($scope.data.games[i]._id,$window.localStorage.userId) - .then(function (res) { - $scope.initaize(); - }) - .catch (function (err) { - console.log(err) - }) - } - else { - $scope.data.games[i].loved='black'; - Like.dislike($scope.data.games[i]._id,$window.localStorage.userId) - .then(function (res) { - $scope.initaize(); - }) - .catch (function (err) { - console.log(err) - }) - } - } - } - } - - $scope.fbshare = function(event){ - for (var i = 0; i < $scope.data.games.length; i++) { - if($scope.data.games[i]._id===event.target.id){ - facebook.share($routeParams.id, $scope.data.games[i].picture, $scope.data.games[i].name); - } - } - }; - - $scope.today = new Date() - $scope.tomorrow = new Date() - $scope.thisWeek = new Date() - $scope.nextWeek = new Date() - - $scope.yesterday = new Date() - - $scope.yesterday.setDate($scope.yesterday.getDate() - 1) - $scope.tomorrow.setDate($scope.tomorrow.getDate() + 1); - $scope.thisWeek.setDate($scope.thisWeek.getDate() + 7); - $scope.nextWeek.setDate($scope.nextWeek.getDate() + 14); - - $scope.allGames = function(game){ - return Date.parse(game.date) > Date.parse($scope.yesterday) - } - - $scope.gamesToday = function(game){ - return Date.parse(game.date) > Date.parse($scope.yesterday) && Date.parse(game.date) <= Date.parse($scope.today) - } - - $scope.gamesTomorrow = function(game){ - return Date.parse(game.date) > Date.parse($scope.today) && Date.parse(game.date) <= Date.parse($scope.tomorrow) - } - - $scope.gamesThisWeek = function(game){ - return Date.parse(game.date) > Date.parse($scope.tomorrow) && Date.parse(game.date) <= Date.parse($scope.thisWeek) - } - - $scope.gamesNextWeek = function(game){ - return Date.parse(game.date) > Date.parse($scope.thisWeek) && Date.parse(game.date) <= Date.parse($scope.nextWeek) - } - - $scope.moreGames = function(game){ - return Date.parse(game.date) > Date.parse($scope.nextWeek) - } - - $scope.initaize(); - - $scope.search = function(str){ - $window.localStorage.query = str; - $location.path('/find'); - } - - $scope.locate = function(){ - var options = { - enableHighAccuracy: true - }; - navigator.geolocation.getCurrentPosition(function(pos) { - $scope.position = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude); - $scope.position = JSON.stringify($scope.position) - $scope.position = JSON.parse($scope.position) - }, - function(error) { - alert('Unable to get location: ' + error.message); - }, options); +angular.module('TeamUp.games', []) +.controller('gamesController', function($scope, $location, Game, User, $window, Like, facebook, $routeParams ) { + $scope.data = {}; + $scope.type = ''; + $scope.needPlayer = 0; + $scope.loved = 'red'; + $scope.isLogIn = false; + $scope.filterDate; + $scope.initaize = function () { + if ($window.localStorage.userId) { + $scope.isLogIn = true; } - - $scope.calculateDistance = function(gameloc){ - - function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) { - var R = 6371; // Radius of the earth in km - var dLat = deg2rad(lat2-lat1); // deg2rad below - var dLon = deg2rad(lon2-lon1); - var a = - Math.sin(dLat/2) * Math.sin(dLat/2) + - Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * - Math.sin(dLon/2) * Math.sin(dLon/2) - ; - var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); - var d = R * c; // Distance in km - return d; - } - - function deg2rad(deg) { - return deg * (Math.PI/180) - } - - return getDistanceFromLatLonInKm($scope.position.lat, $scope.position.lng, gameloc.lat, gameloc.lng) + Game.getAll() + .then(function (games) { + $scope.data.games = games; + for (var i = 0; i < games.length; i++) { + if (games[i].likes.indexOf($window.localStorage.userId) !== -1) { + $scope.data.games[i].loved = 'red'; + } else { + $scope.data.games[i].loved = 'black'; + } + } + $scope.data.types = []; + $scope.data.types.push('All'); + for (var i = 0; i < games.length; i++) { + if ($scope.data.types.indexOf(games[i].type) === -1) { + $scope.data.types.push(games[i].type); + } + } + }).then(function() { + $scope.locate(); + }) + .catch(function (err) { + console.log(err); + }); + }; + $scope.viewGame = function (gameId) { + $location.path('/game/' + gameId); + }; + $scope.showType = function ($event) { + if ($event.target.id === 'All') { + $scope.type = ''; + } else { + $scope.type = $event.target.id; } - - $scope.distance = 'Any Distance'; - - $scope.distances = { - - '2 km' : distance2km = function(game) { - return $scope.calculateDistance(game.locationID) <= 2 - }, - '5 km' : distance5km = function(game) { - return $scope.calculateDistance(game.locationID) <= 5 - }, - '10 km': distance10km = function(game) { - return $scope.calculateDistance(game.locationID) <= 10 - }, - '25 km': distance25km = function(game) { - return $scope.calculateDistance(game.locationID) <= 25 - }, - '50 km' : distance50km = function(game) { - return $scope.calculateDistance(game.locationID) <= 50 - }, - '100 km' : distance100km = function(game) { - return $scope.calculateDistance(game.locationID) <= 100 - }, - 'Any Distance' : anyDistance = function(game){ - return true - } + }; + $scope.getLove = function (event) { + for (var i = 0; i < $scope.data.games.length; i++) { + if ($scope.data.games[i]._id === event.target.id) { + if ($scope.data.games[i].loved === 'black') { + $scope.data.games[i].loved = 'red'; + Like.likeGame($scope.data.games[i]._id, $window.localStorage.userId) + .then(function (res) { + $scope.initaize(); + }) + .catch (function (err) { + console.log(err); + }); + } else { + $scope.data.games[i].loved = 'black'; + Like.dislike($scope.data.games[i]._id, $window.localStorage.userId) + .then(function (res) { + $scope.initaize(); + }) + .catch (function (err) { + console.log(err); + }); + } + } } - - $scope.filterDistance = function(game){ - return $scope.distances[$scope.distance](game) + }; + $scope.fbshare = function(event) { + for (var i = 0; i < $scope.data.games.length; i++) { + if ($scope.data.games[i]._id === event.target.id) { + facebook.share($routeParams.id, $scope.data.games[i].picture, $scope.data.games[i].name); + } } - + }; + + $scope.today = new Date(); + $scope.tomorrow = new Date(); + $scope.thisWeek = new Date(); + $scope.nextWeek = new Date(); + $scope.yesterday = new Date(); + $scope.yesterday.setDate($scope.yesterday.getDate() - 1); + $scope.tomorrow.setDate($scope.tomorrow.getDate() + 1); + $scope.thisWeek.setDate($scope.thisWeek.getDate() + 7); + $scope.nextWeek.setDate($scope.nextWeek.getDate() + 14); + + $scope.allGames = function(game) { + return Date.parse(game.date) > Date.parse($scope.yesterday); + }; + $scope.gamesToday = function(game) { + return Date.parse(game.date) > Date.parse($scope.yesterday) && Date.parse(game.date) <= Date.parse($scope.today); + }; + $scope.gamesTomorrow = function(game) { + return Date.parse(game.date) > Date.parse($scope.today) && Date.parse(game.date) <= Date.parse($scope.tomorrow); + }; + $scope.gamesThisWeek = function(game) { + return Date.parse(game.date) > Date.parse($scope.tomorrow) && Date.parse(game.date) <= Date.parse($scope.thisWeek); + }; + $scope.gamesNextWeek = function(game) { + return Date.parse(game.date) > Date.parse($scope.thisWeek) && Date.parse(game.date) <= Date.parse($scope.nextWeek); + }; + $scope.moreGames = function(game) { + return Date.parse(game.date) > Date.parse($scope.nextWeek); + }; + $scope.initaize(); + + $scope.search = function(str) { + $window.localStorage.query = str; + $location.path('/find'); + }; + + $scope.locate = function() { + var options = { + enableHighAccuracy: true + }; + navigator.geolocation.getCurrentPosition( function(pos) { + $scope.position = new google.maps.LatLng(pos.coords.latitude, pos.coords.longitude); + $scope.position = JSON.stringify($scope.position); + $scope.position = JSON.parse($scope.position); + }, + function(error) { + alert('Unable to get location: ' + error.message); + }, options); + }; + $scope.calculateDistance = function(gameloc) { + var getDistanceFromLatLonInKm = function (lat1, lon1, lat2, lon2) { + var R = 6371; // Radius of the earth in km + var dLat = deg2rad(lat2 - lat1); // deg2rad below + var dLon = deg2rad(lon2 - lon1); + var a = + Math.sin(dLat / 2) * Math.sin(dLat / 2) + + Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) * + Math.sin(dLon / 2) * Math.sin(dLon / 2); + var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); + var d = R * c; // Distance in km + return d; + }; + var deg2rad = function (deg) { + return deg * (Math.PI / 180); + }; + return getDistanceFromLatLonInKm($scope.position.lat, $scope.position.lng, gameloc.lat, gameloc.lng); + }; + $scope.distance = 'Any Distance'; + $scope.distances = { + '2 km': distance2km = function(game) { + return $scope.calculateDistance(game.locationID) <= 2; + }, + '5 km': distance5km = function(game) { + return $scope.calculateDistance(game.locationID) <= 5; + }, + '10 km': distance10km = function(game) { + return $scope.calculateDistance(game.locationID) <= 10; + }, + '25 km': distance25km = function(game) { + return $scope.calculateDistance(game.locationID) <= 25; + }, + '50 km': distance50km = function(game) { + return $scope.calculateDistance(game.locationID) <= 50; + }, + '100 km': distance100km = function(game) { + return $scope.calculateDistance(game.locationID) <= 100; + }, + 'Any Distance': anyDistance = function(game) { + return true; + } + }; + $scope.filterDistance = function(game) { + return $scope.distances[$scope.distance](game); + }; }); \ No newline at end of file From 71bc31c6de812236bd9137f9ae7d65657b8a7ba5 Mon Sep 17 00:00:00 2001 From: Tawfik Kahwaje Date: Sat, 27 Aug 2016 16:59:41 +0300 Subject: [PATCH 5/5] (style) Add new style --- client/styles/style.min.css | 1 + 1 file changed, 1 insertion(+) diff --git a/client/styles/style.min.css b/client/styles/style.min.css index e69de29..acdfee9 100644 --- a/client/styles/style.min.css +++ b/client/styles/style.min.css @@ -0,0 +1 @@ +.gameCounter,.page-title,.portfolio-menu ul,.pricing-title,.single-promotion{text-align:center}.fbutton,.readmore:hover,.single-promotion a:hover,li a{text-decoration:none}.fix,.image-cropper,ul{overflow:hidden}.pricing-header h2,.pricing-header h3{margin-bottom:10px}.form-content input[type=text],.form-content input[type=date],.form-content input[type=number],.form-content input[type=email],.form-content input[type=submit],.form-content select,.form-content textarea{border:1px solid #ddd;padding:10px;width:100%;margin-bottom:30px}input[type=submit]{border:none;color:#fff;padding:10px 30px;text-transform:uppercase}input[type=submit]:hover{background-color:#000}.featured .pricing-footer a.btn-filled,.featured .pricing-header h2,.mainmenu ul.navbar-nav li.active a,.mainmenu ul.navbar-nav li:hover a,.portfolio-link-wrap a,.readmore,.single-address,.single-promotion:hover .icon-holder,.social-footer a,input[type=submit]{background-color:#9b59b6;transition:.3s}.u-form-group input[type=text],.u-form-group input[type=email],.u-form-group input[type=password]{width:100%;opacity:.5;height:45px;outline:0;border:1px solid #ddd;padding:0 10px;border-radius:2px;color:#333;font-size:20px;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}#respond input[type=text],#respond input[type=email],#respond input[type=url]{display:block;width:100%;height:38px;font-size:12px;border:1px solid #e2e2e2;background:#fff;margin-bottom:24px;padding:0 15px;color:#aaa;border-radius:0}#respond input:focus[type=text],#respond input:focus[type=email],#respond input:focus[type=url],#respond textarea:focus{outline:0;border-color:#ff6c6c}.bypostauthor{display:block}.form-submit input[type=button]{background-color:transparent;color:#1f1f1f;text-transform:uppercase;font-size:13px;padding:7px 22px;border:1px solid #1f1f1f;letter-spacing:.5px}.form-submit input[type=button]:hover{background-color:#5ba1d5;border-color:#5ba1d5;color:#FFF}.countDown{display:inline}.lb-loader,.lightbox{text-align:center;line-height:0}body:after{content:url(../img/close.png) url(../img/loading.gif) url(../img/prev.png) url(../img/next.png);display:none}.lb-dataContainer:after,.lb-outerContainer:after{content:"";clear:both}.lightboxOverlay{position:absolute;top:0;left:0;z-index:9999;background-color:#000;filter:alpha(Opacity=80);opacity:.8;display:none}.lightbox{position:absolute;left:0;width:100%;z-index:10000;font-weight:400}.lightbox .lb-image{display:block;height:auto;max-width:inherit;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;-o-border-radius:3px;border-radius:3px}.lightbox a img{border:none}.lb-outerContainer{position:relative;background-color:#fff;width:250px;height:250px;margin:0 auto;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px;border-radius:4px}.lb-loader,.lb-nav{position:absolute;left:0}.lb-outerContainer:after{display:table}.lb-container{padding:4px}.lb-loader{top:43%;height:25%;width:100%}.lb-cancel{display:block;width:32px;height:32px;margin:0 auto;background:url(../img/loading.gif) no-repeat}.lb-nav{top:0;height:100%;width:100%;z-index:10}.lb-container>.nav{left:0}.lb-nav a{outline:0;background-image:url(data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)}.lb-next,.lb-prev{height:100%;cursor:pointer;display:block}.lb-nav a.lb-prev{width:34%;left:0;float:left;background:url(../img/prev.png) left 48% no-repeat;filter:alpha(Opacity=0);opacity:0;-webkit-transition:opacity .6s;-moz-transition:opacity .6s;-o-transition:opacity .6s;transition:opacity .6s}.lb-nav a.lb-prev:hover{filter:alpha(Opacity=100);opacity:1}.lb-nav a.lb-next{width:64%;right:0;float:right;background:url(../img/next.png) right 48% no-repeat;filter:alpha(Opacity=0);opacity:0;-webkit-transition:opacity .6s;-moz-transition:opacity .6s;-o-transition:opacity .6s;transition:opacity .6s}.lb-nav a.lb-next:hover{filter:alpha(Opacity=100);opacity:1}.lb-dataContainer{margin:0 auto;padding-top:5px;width:100%;-moz-border-radius-bottomleft:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px}.lb-dataContainer:after{display:table}.lb-data{padding:0 4px;color:#ccc}.lb-data .lb-details{width:85%;float:left;text-align:left;line-height:1.1em}.lb-data .lb-caption{font-size:13px;font-weight:700;line-height:1em}.lb-data .lb-number{display:block;clear:left;padding-bottom:1em;font-size:12px;color:#999}.lb-data .lb-close{display:block;float:right;width:30px;height:30px;background:url(../img/close.png) top right no-repeat;text-align:right;outline:0;filter:alpha(Opacity=70);opacity:.7;-webkit-transition:opacity .2s;-moz-transition:opacity .2s;-o-transition:opacity .2s;transition:opacity .2s}.form-signin,.form-signin-heading,.page-title,.portfolio-link-wrap a,.portfolio-menu ul,.pricing-title,.single-pricing,.single-promotion,.slide-text,.social-footer a,.u-form-group{text-align:center}.lb-data .lb-close:hover{cursor:pointer;filter:alpha(Opacity=100);opacity:1}.overlay-bg::after,.portfolio-detail::after{opacity:.6;content:""}@media only screen and (min-width:992px) and (max-width:1280px){.single-pricing.featured{width:320px}.single-pricing{width:295px}}@media only screen and (min-width:768px) and (max-width:991px){.copyright-text,.logo h1,.mainmenu,.social-footer{text-align:center}.logo h1{margin:10px 0}.mainmenu{margin-bottom:12px}.mainmenu .navbar-right{float:none!important}.mainmenu ul.navbar-nav li{float:none;display:inline-block}.single-portfolio{width:50%}.single-pricing.featured{padding:20px 10px;width:240px}.single-pricing{padding:30px 10px;width:225px}.pricing-content ul{font-size:15px}.featured .pricing-content ul{font-size:16px}.social-footer{margin-bottom:25px;margin-top:0}}@media only screen and (max-width:767px){.copyright-text,.social-footer{text-align:center}.logo h1{float:left;font-size:25px;margin:10px 0}.navbar-toggle{border-color:#222;float:none;margin:10px auto}.navbar-toggle .icon-bar{background:#222}.navbar-header{float:right}.logo{overflow:hidden}.mainmenu{background:#fff;margin-top:0;position:relative;z-index:99}.mainmenu ul.navbar-nav li a{margin-left:10px;margin-right:10px}.section-padding{padding:50px 0}.single-promotion{margin:35px 0}.page-title{margin-bottom:40px}.portfolio-menu ul li{margin:0 5px 13px}.single-portfolio{width:100%}.single-pricing,.single-pricing.featured{margin:0 0 30px;width:100%}.social-footer{margin-bottom:25px;margin-top:0}}.floatleft{float:left}.floatright{float:right}.alignleft{float:lef t;margin-right:15px}.alignright{float:right;margin-left:15px}.aligncenter{display:block;margin:0 auto 15px}a:focus{outline:solid 0}img{max-width:100%;height:auto}h1,h2,h3,h4,h5,h6{font-weight:700;margin:0 0 15px;font-family:'Roboto Condensed',sans-serif}body{font-family:'Titillium Web',sans-serif;font-size:15px;font-weight:300}.section-padding{padding:50px 0}a:hover{color:#7a3995}.logo h1{font-size:30px;margin:20px 0}.header-area{background:#fff;width:100%;z-index:999}.mainmenu ul.navbar-nav li a{color:#222;font-size:15px;font-weight:500;text-transform:uppercase;margin-left:10px}.mainmenu ul.navbar-nav li.active a,.mainmenu ul.navbar-nav li:hover a{color:#fff}.mainmenu{margin-top:12px}.slider-area{position:relative}.slide-text-wrapper,.slider-area{height:500px}.overlay-bg,.overlay-bg::after{height:100%;position:absolute;width:100%;left:0;top:0}.overlay-bg{background-size:cover;background-position:center center}.overlay-bg::after{background:#000}.slide-bg{background-image:url(img/slide-bg.jpg)}.slide-text-wrapper{display:table;width:100%}.slide-text{display:table-cell;vertical-align:middle;color:#fff;font-size:18px}.slide-text h2{font-size:40px}.tes-control.left{margin-left:-40px}.tes-control.right{margin-left:10px}.readmore{color:#fff;display:inline-block;margin-top:15px;padding:10px 25px;text-transform:uppercase}.readmore:hover{background:#000;color:#fff}.icon-holder{border:1px solid #cfcfcf;border-radius:50%;display:inline-block;font-size:50px;height:110px;margin-bottom:35px;padding-top:16px;width:110px}.single-promotion h2{font-family:titillium web;font-size:20px;margin-bottom:30px}.single-promotion:hover .icon-holder{color:#fff}.portfolio-area{background:#fbfbfb}.page-title{margin-bottom:60px}.portfolio-menu ul{list-style:none;margin:0 0 50px;padding:0}.portfolio-menu ul li{border:1px solid #ddd;display:inline-block;margin:0 5px;padding:10px 20px;cursor:pointer}.portfolio-menu ul li.active{font-weight:400}.single-portfolio{position:relative}.single-portfolio img.portfolio-thumb{width:100%}.portfolio-detail{height:100%;left:0;padding:20px;position:absolute;top:0;width:100%}.portfolio-detail h2{border-bottom:1px solid;color:#fff;font-family:inherit;font-size:20px;font-weight:300;padding:0 0 5px;z-index:9;position:absolute;top:-20%;left:20px;width:85%}.portfolio-link-wrap a{color:#fff;font-size:10px;height:30px;margin-right:25px;padding-top:7px;display:inline-block;width:30px;border-radius:20px}.portfolio-link-wrap a:hover{background-color:#000}.portfolio-link-wrap{bottom:-20%;left:25px;position:absolute;z-index:9;transition:.3s}.portfolio-detail::after{background:#000;height:100%;left:-100%;position:absolute;top:0;width:100%;transition:.3s}.single-portfolio{overflow:hidden;width:25%;float:left}.single-portfolio:hover .portfolio-detail h2{top:20px}.single-portfolio:hover .portfolio-detail::after{left:0}.single-portfolio:hover .portfolio-link-wrap{bottom:25px}.pricing-area{position:relative;color:#fff}.pricing-title{font-size:25px;margin-bottom:50px}.pricing-title h2{margin-bottom:20px}.single-pricing{background:#fff;color:#636363;float:left;margin-top:20px;padding:30px;width:360px}.single-pricing.featured{box-shadow:0 0 5px #666;margin:0 15px;padding:20px 30px;position:relative;width:390px;z-index:99}.pricing-header h2,.pricing-header h3{margin-bottom:10px}.pricing-header h2{font-size:24px;padding-bottom:10px;position:relative}.pricing-header h2:before{bottom:0;content:"";height:3px;left:50%;margin-left:-45px;position:absolute;width:90px}.pricing-content ul{border-top:1px dashed #ddd;color:#888;font-size:16px;list-style:none;margin:0;padding:0}.pricing-content ul li{border-bottom:1px dashed #ddd;padding:10px}a.btn-filled{background:#999;border-radius:0;color:#fff}a.btn-filled:hover{color:#fff;opacity:.7;filter:alpha(opacity=70)}.pricing-footer a.btn-filled{display:block;font-size:18px;margin:15px 0;padding:8px;text-transform:uppercase;color:#fff}.featured .pricing-header h2{color:#fff;margin:15px 0;padding:10px}.featured .pricing-content ul{font-size:18px}.featured .pricing-content ul li{line-height:30px}.form-content label{display:block;margin-bottom:10px}.form-content input[type=date],.form-content input[type=email],.form-content input[type=number],.form-content input[type=submit],.form-content input[type=text],.form-content select,.form-content textarea{border:1px solid #ddd;padding:10px;width:100%;margin-bottom:30px}.form-content textarea{height:130px}input[type=submit]{border:none;color:#fff;padding:10px 30px;text-transform:uppercase}input[type=submit]:hover{background-color:#000}.our-address{margin-top:80px}.single-address{color:#fff;font-size:20px;margin-bottom:20px;padding:25px 15px 25px 80px;position:relative}.single-address p{margin:0}.single-address a{color:#fff}.single-address i{font-size:39px;left:20px;margin-top:-19px;opacity:.6;position:absolute;top:50%}.single-address:hover{opacity:.7}.form-content h2,.our-address h2{font-weight:500;margin-bottom:30px}.footer-copyright{background:#222;color:#fff;font-size:14px}.copyright-text p{letter-spacing:1px;margin:0;padding:30px 0}.social-footer a{color:#fff;display:inline-block;font-size:18px;height:35px;margin-left:10px;padding-top:5px;width:35px}.fbutton,.form-control,.form-signin-control{font-size:16px;text-align:center}.social-footer{margin-top:25px}.social-footer a:hover{background:#fff}.icon-holder,.portfolio-menu ul li.active,.social-footer a:hover,a{color:#9b59b6;transition:.3s}.featured .pricing-footer a.btn-filled,.featured .pricing-header h2,.mainmenu ul.navbar-nav li.active a,.mainmenu ul.navbar-nav li:hover a,.portfolio-link-wrap a,.readmore,.single-address,.single-promotion:hover .icon-holder,.social-footer a,input[type=submit]{background-color:#9b59b6;transition:.3s}.portfolio-detail h2,.portfolio-menu ul li.active,.single-promotion:hover .icon-holder{border-color:#9b59b6;transition:.3s}.fbutton{background-color:#008CBA;border-radius:4px;border:none;color:#fff;padding:15px 32px;display:inline-block}.animate-enter,.animate-leave{-webkit-transition:10s cubic-bezier(.25,.25,.75,.75) all;-moz-transition:10s cubic-bezier(.25,.25,.75,.75) all;-ms-transition:10s cubic-bezier(.25,.25,.75,.75) all;-o-transition:10s cubic-bezier(.25,.25,.75,.75) all;transition:10s cubic-bezier(.25,.25,.75,.75) all;position:relative;display:block}.animate-enter.animate-enter-active,.animate-leave{opacity:1;top:0;height:30px}.animate-enter,.animate-leave.animate-leave-active{opacity:0;top:-50px;height:0}video{position:fixed;top:50%;left:50%;min-width:100%;min-height:100%;width:auto;height:auto;z-index:-100;transform:translateX(-50%) translateY(-50%);background-size:cover;transition:1s opacity;opacity:.3}.form-control{position:relative;height:auto;padding:10px}.wrapper{margin-top:80px;margin-bottom:20px}.form-signin{max-width:420px;padding:30px 38px 66px;margin:0 auto;background-color:#eee;border:3px dotted rgba(0,0,0,.1)}.form-signin-heading{margin-bottom:30px}.form-signin-control{position:relative;height:auto;padding:10px}.signin-img{width:50%}.facebook-button{width:100%;background-color:#446799;border-radius:4px;padding:0}.google-button{padding:0;width:100%;border-radius:4px;background-color:#B5403A}.u-form-group{width:100%;margin-bottom:10px}.u-form-group input[type=email],.u-form-group input[type=password],.u-form-group input[type=text]{width:100%;opacity:.5;height:45px;outline:0;border:1px solid #ddd;padding:0 10px;border-radius:2px;color:#333;font-size:20px;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.u-form-group input:focus{border-color:#358efb}.u-form-group button{width:100%;background-color:#1CB94E;border:none;outline:0;color:#fff;font-size:20px;font-weight:400;padding:14px 0;border-radius:2px;text-transform:uppercase}.forgot-password{width:50%;text-align:left;text-decoration:underline;color:#888;font-size:.75rem}.card{height:400px}.article:hover h2,.article:hover h4{color:#fff;background-color:#204056}.article:hover{background-color:#204056}.article:hover h2{background-color:transparent}.article{background-color:#}.material-icons.red{color:#9b59b6}.material-icons.black{color:rgba(0,0,0,.54)}#respond #reply-title,.common-title{color:#1f1f1f;margin-bottom:25px;padding-bottom:11px}HTMLJSCSS .tabsdemoDynamicHeight md-content{background-color:transparent!important}.tabsdemoDynamicHeight md-content md-tabs{border:1px solid #e1e1e1}.tabsdemoDynamicHeight md-content md-tabs md-tabs-wrapper{background:#fff}.tabsdemoDynamicHeight md-content h1:first-child{margin-top:0}.fabSpeedDialdemoBasicUsage .text-capitalize{text-transform:capitalize}.fabSpeedDialdemoBasicUsage .md-fab.md-focused,.fabSpeedDialdemoBasicUsage .md-fab:hover{background-color:#000!important}.fabSpeedDialdemoBasicUsage p.note{font-size:1.2rem}.fabSpeedDialdemoBasicUsage .lock-size{min-width:300px;min-height:300px;width:300px;height:300px;margin-left:auto;margin-right:auto}.common-title{font-size:12px;border-bottom:1px solid #eee;margin-top:20px}#respond label{font-size:12px;color:#1F1F1F;font-weight:400}#respond input[type=email],#respond input[type=text],#respond input[type=url]{display:block;width:100%;height:38px;font-size:12px;border:1px solid #e2e2e2;background:#fff;margin-bottom:24px;padding:0 15px;color:#aaa;border-radius:0}#respond input:focus[type=email],#respond input:focus[type=text],#respond input:focus[type=url],#respond textarea:focus{outline:0;border-color:#ff6c6c}#respond textarea{display:block;width:100%;height:70;font-size:12px;border:1px solid #e2e2e2;margin-bottom:24px;color:#aaa;resize:none;padding:10px 15px;border-radius:0}#respond .form-submit{font-size:12px}#respond .logged-in-as{margin-left:15px}#respond #reply-title{font-size:12px;border-bottom:1px solid #eee;margin-top:0;text-transform:uppercase}#respond #reply-title small a{color:#FD3535;margin-left:10px}#comments ul.comment-list{margin:0;padding:0;list-style:none}#comments ul.comment-list ul{list-style:none;padding-left:30px}#comments .comment-reply{float:right}#comments .comment-reply a{color:#999;padding:5px 10px;display:inline-block;font-size:11px;background-color:#eee;line-height:15px}.bypostauthor,.messageBox,.search-box{display:block}#comments .comment-reply a:hover{color:#fff;background-color:#ff6c6c}#comments .comment-reply a i{font-size:8px;margin-left:2px}#comments .comment-author{margin-top:0;margin-bottom:5px;font-family:Montserrat,sans-serif;font-size:14px;letter-spacing:.3px}#comments .comment-author a,#respond .logged-in-as a{color:#222}#comments .comment-author a:hover,#respond .logged-in-as a:hover{color:#ff6c6c}#comments .comment-date{color:#AAA;font-size:11px}#comments .comment-content{margin-top:5px}#comments .comment-canter li{list-style:outside}#comments .comment-content p{margin-bottom:10px}#comments .comment-body{margin-bottom:20px;padding-bottom:20px;border-bottom:1px solid #EEE}#comments .comment-avartar img{border-radius:50%}#comments .edit-link{font-size:12px}.form-submit input[type=button],.sendButton{text-transform:uppercase;font-size:13px;padding:7px 22px;letter-spacing:.5px}.form-submit input[type=button]{background-color:transparent;color:#1f1f1f;border:1px solid #1f1f1f}.form-submit input[type=button]:hover{background-color:#5ba1d5;border-color:#5ba1d5;color:#FFF}.sendButton{background-color:transparent;color:#1f1f1f;border:1px solid #1f1f1f}.messageBox{width:100%;height:40px;font-size:12px;border:1px solid #e2e2e2;color:#aaa;resize:none;padding:10px 15px;border-radius:0}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#9b59b6}.search-box{text-align:left;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.gameCounter,li a{text-align:center}.countDown,.img-circle{display:inline}.countBox,.gameCounter p{color:#fff;font-weight:700}.btn-info:hover{background-color:#9b59b6}.search-bar{padding:2em}.image-cropper{width:20em;height:20em;position:relative;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;-o-border-radius:50%;border-radius:50%;border:2px solid #eee;padding:5px}.img-circle{margin:0 auto;height:100%;width:auto}.countBox{display:inline-block;border:2px solid #eee;background-color:#e91e63}.gameCounter p{background-color:#2b2d7b;height:20%;padding:.5em;margin:.2em}.gameCounter span{font-weight:700;display:block}ul{list-style-type:none;margin:0;padding:0;border:1px solid #e7e7e7;background-color:#f3f3f3}li{float:left}li a{display:block;color:#666;padding:14px 16px;text-decoration:none}li a:hover:not(.active){background-color:#ddd}li a.active{color:#fff;background-color:#4CAF50}#map{width:100%;height:400px} \ No newline at end of file