Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Add Game #520

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions projects/AddGame/h.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>
<head>

<script type="text/javascript" src="script.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>

<textarea id="txtSearchProdAssign"></textarea>

<input type="text" name="butAssignProd" placeholder="click here" >
</body>
</html>
145 changes: 145 additions & 0 deletions projects/AddGame/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
<!DOCTYPE html>
<html>
<head>
<title>Add as much as u can </title>
<link rel="shortcut icon" href="add.png" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.16/angular.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script type="text/javascript" src="script.js"></script>
</head>
<body ng-app="addapp">
<div class="container">

<div ng-controller="addctrl" class="container">
<div class="row">
<div class="col-md-6">
<img class="icon pull-left" src="add.png">
<h2 class="heading pull-left">ADD AS MUCH YOU CAN</h2>
</div>
</div>
<div class="row">
<div class="col-md-6 pull-left">
<div ng-hide="showDetails">
<div class="col-md-6">
<input type="text" class="panel-body" ng-model="num1" placeholder="Enter Your no." numbers-only="numbers-only" >
</div>
<div class="col-md-6">
<button class="panel-body btn btn-primary" ng-disabled="!num1" ng-click="a(num1)">click to start</button><br/>
</div>
</div>
</div>
<div class="col-md-6 pull-right">
<div ng-hide="showDetails" class="jumbotron menu_bar">
<h3>Instructions</h3>
<ol>
<li>Enter your desired number to start the game.</li>
<li>Until you are playing good , the game continues.</li>
<li>Once you are wrong the game terminates.</li>
</ol>
<p>!!!!happy playing!!!</p>
</div>
</div>
</div>


<div class="row jumbotron container bg_nice" ng-show="showDetails">
<div class="col-lg-4 col-md-4">
<h2>Your number</h2>
<input type="text" class="panel-body" ng-model="num1" ng-disabled="num1">
</div>

<div class="col-lg-4 col-md-4">
<h2>Random Number</h2>
<input type="text" class="panel-body" ng-model="num2" ng-init="num2=10" ng-disabled="num2">
</div>

<div class="col-lg-4 col-md-4" ng-hide="hideit">
<h2>Your Answer</h2>
<input type="text" class="panel-body" ng-keydown="($event.which === 13 || $event.which === 32) && ans(num1,num2)" ng-model="result"placeholder="press enter after submit">
</div>

<h1 class="score_heading">Score<span class="score"> {{f}}</span></h1>
<a href="app.html"><button class="btn btn-primary" ng-show="playagain">PLAY AGAIN!!!</button></a>

</div>
<div ng-show="comment">
<h2>nice !! Your Last Answer is <span class="score">{{so}}</span></h2>
</div><span ng-bind="message" class="loose"></span>

</div>
</div>
</body>
</html>
<!-- <script type="text/javascript">
var addapp=angular.module('addapp',[]);
addapp.controller('addctrl', ['$scope', function($scope){
$scope.num2="10";
$scope.add=[];
console.log($scope.num2);
$scope.ans=function(num1,num2)
{
$scope.check=parseInt(num2)+parseInt(num1);
console.log($scope.check);
if($scope.check==$scope.result)
{
$scope.add.push($scope.check);
alert('true');
}
}
}]);
</script> -->







<style type="text/css">
.container
{
padding-top: 40px;
}

.score{
color:green;
}
.loose
{
color: red;
font-size: 55px;
}
.icon{
width:10%;
}
.bg_nice{
background-color: #72DCFF;
border:6px solid #0099CC;
box-shadow: 10px 10px 5px #888888;
}
.bg_nice h2{
font-size: 24px;
text-shadow: 2px 2px #55A9A3;
color: #00688B;
}
.heading{
color:#0099CC;
padding-left:10px;
}
.score_heading{
font-size: 40px !important;
}
.score{
color:#00688B;;
}
.menu_bar{
background-color: #8FDEF7;
border: 1px solid #63D1F4;
width: 70%;
}
</style>
63 changes: 63 additions & 0 deletions projects/AddGame/script.js
Original file line number Diff line number Diff line change
@@ -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;
});
}
};
});
1 change: 1 addition & 0 deletions projects/AddGame/thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions projects/AddGame/try.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<html>
<head>
<title>add as much as u can </title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.16/angular.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
<script type="text/javascript" src="script.js"></script>
</head>

<body ng-app="app">

<div ng-controller="HomeCtrl">
<div class="motherBox" ng-repeat="n in news">
<div class="childBox" class="col-md-{{boxSpan}} box">
<a href="#" class="thumbnail">
<img src="{{holderLink}}" height="200px" alt="100x100">
<p class="tBlock"> {{n.title}} </p>
</a>
</div>
</div>
</div>

</body>
</html>

<script type="text/javascript">

var app=amgular.module('app',[]);

app.controller('HomeCtrl', ['$scope', '$http', function($scope,$http) {
$http.get('news/abc.json').success(function(data) {
$scope.news = data;
});
$scope.holderSize = 150;
$scope.holderLink = 'http://placehold.it/'+$scope.holderSize+'x'+$scope.holderSize;
$scope.boxSpan = getRandomSpan();

function getRandomSpan(){
return Math.floor((Math.random()*6)+1);
};
}]);
</script>
11 changes: 11 additions & 0 deletions projects/projects.json
Original file line number Diff line number Diff line change
@@ -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.",