diff --git a/projects/AddGame/h.html b/projects/AddGame/h.html new file mode 100644 index 00000000..16f948b5 --- /dev/null +++ b/projects/AddGame/h.html @@ -0,0 +1,15 @@ + + + + + + +JS Bin + + + + + + + + diff --git a/projects/AddGame/index.html b/projects/AddGame/index.html new file mode 100644 index 00000000..46ab5f7e --- /dev/null +++ b/projects/AddGame/index.html @@ -0,0 +1,145 @@ + + + + Add as much as u can + + + + + + +
+ +
+
+
+ +

ADD AS MUCH YOU CAN

+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ + +
+
+

Your number

+ +
+ +
+

Random Number

+ +
+ +
+

Your Answer

+ +
+ +

Score {{f}}

+ + +
+
+

nice !! Your Last Answer is {{so}}

+
+ +
+
+ + + + + + + + + + + diff --git a/projects/AddGame/script.js b/projects/AddGame/script.js new file mode 100644 index 00000000..1cb68cc5 --- /dev/null +++ b/projects/AddGame/script.js @@ -0,0 +1,63 @@ +var addapp=angular.module('addapp',[]); + addapp.controller('addctrl', ['$scope','$rootScope', function($scope,$rootScope){ + + $scope.add=[]; + $scope.count=0; + $scope.a=function(num1) + { + $scope.number=num1; + $scope.showDetails=true; + } + $scope.getRandomSpan = function(){ + return Math.floor((Math.random()*6)+1); + } + $scope.ans=function(num1,num2) + { + $rootScope.check=parseInt(num2)+parseInt(num1); + if($rootScope.check==$scope.result) + { + $scope.count=$scope.count+1; + $scope.add.push($scope.result); + $scope.so=$scope.result; + $scope.comment=true; + + /*$scope.num2=Math.floor((Math.random()*15)+125);*/ + $scope.num2=(($scope.result*3)-13%3); + $scope.f=$scope.count; + delete $scope.result; + } + + else + { + $scope.message="SORRY!!! YOU LOSE"; + $scope.hideit=true; + $scope.playagain=true; + delete $scope.result; + } + } + + + }]); + + + +addapp.directive('numbersOnly', function(){ + return { + require: 'ngModel', + link: function(scope, element, attrs, modelCtrl) { + modelCtrl.$parsers.push(function (inputValue) { + // this next if is necessary for when using ng-required on your input. + // In such cases, when a letter is typed first, this parser will be called + // again, and the 2nd time, the value will be undefined + if (inputValue == undefined) return '' + var transformedInput = inputValue.replace(/[^0-9]/g, ''); + if (transformedInput!=inputValue) { + modelCtrl.$setViewValue(transformedInput); + modelCtrl.$render(); + } + + return transformedInput; + }); + } + }; +}); diff --git a/projects/AddGame/thumb.png b/projects/AddGame/thumb.png new file mode 100644 index 00000000..5ba64c89 --- /dev/null +++ b/projects/AddGame/thumb.png @@ -0,0 +1 @@ +https://cdn4.iconfinder.com/data/icons/meBaze-Freebies/512/add.png diff --git a/projects/AddGame/try.html b/projects/AddGame/try.html new file mode 100644 index 00000000..8793fd78 --- /dev/null +++ b/projects/AddGame/try.html @@ -0,0 +1,41 @@ + + + add as much as u can + + + + + + + +
+
+ +
+
+ + + + + diff --git a/projects/projects.json b/projects/projects.json index f92b527e..80c52d2c 100644 --- a/projects/projects.json +++ b/projects/projects.json @@ -2,6 +2,17 @@ "featured": "YouTube on PS3", "projects": [ { + "name": "Add Game", + "thumb": "AddGame/thumb.png", + "desc": "Add as much as you can", + "submitter": "ParveenB", + "submissionDate": "2015-06-24", + "tags": [ + "Demo", + "Game", + "No jQuery" + ] +}, { "name": "APWGL", "thumb": "apwgl/thumb.png", "desc": "Fan made ARTPOP WebGL App. Renders WebGL to Gif.",