Skip to content

Commit

Permalink
Lots of enhancements. Logout Works. Profile of Player can be seen. Wo…
Browse files Browse the repository at this point in the history
…rks in Mozilla too.
  • Loading branch information
Saheb committed Oct 4, 2015
1 parent 5447dfc commit f4b4815
Show file tree
Hide file tree
Showing 8 changed files with 238 additions and 106 deletions.
45 changes: 42 additions & 3 deletions app/views/createGame.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
var store = window.sessionStorage
function checkLogin() {
if(store.length!=0)
document.getElementById('loginName').innerText = store.getItem("loginName")
document.getElementById('loginName').innerHTML = store.getItem("loginName")
}
store.setItem("joinedPlayersSize", @joinedPlayers.size)
</script>
Expand Down Expand Up @@ -48,13 +48,52 @@
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#rules">Rules</a></li>
<li><a data-target="#rulesModal" data-toggle="modal">Rules</a></li>
<li><a id="loginName" data-target="#loginModal" data-toggle="modal">Login</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>

<div class="modal fade" id="rulesModal" tabindex="-1" role="dialog" aria-labelledby="rulesLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Rules of Liars Poker Game!</h4>
</div>
<div class="panel-body">
<div>
<ol>
<li> Each player has 2-7 cards in their hand</li>
<li> With the knowledge of cards in their hand and other player's bets each player makes a bet</li>
<li> Bets are nothing but poker hands </li>
<ol>
<li>Royal Flush (Highest)</li>
<li>Straight Flush</li>
<li>Four of a Kind</li>
<li>Full House</li>
<li>Flush</li>
<li>Trio</li>
<li>Straight</li>
<li>Double Pair</li>
<li>Pair</li>
<li>High Card (Lowest)</li>
</ol>
<li> Bet should be higher than the previous bet and you can't pass your chance</li>
<li> Bet is challenged only by the next betting player if he thinks the bet won't materialize</li>
<li> Bet would materialize or not would be concluded from cards in all player's hands.</li>
<li> If challenger wins, then Better's cards increase by 1.</li>
<li> If challenger loses, then Challenger's cards increase by 1.</li>
<li> Player is out of the game if their card count is more than Game's max card cound. 5 or 7.</li>
</ol>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Okay!</button>
</div>
</div>
</div>
</div>
<div class="container">
<h2>
@gameName
Expand Down
60 changes: 54 additions & 6 deletions app/views/gameplay.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
#roundResultModal .modal-dialog {height: 70%; width:50%;}
/*#cards {margin: 0 auto; display:block; position:absolute;}*/
#previousBetter{ text-align: center;}
#htmlCanvas {
width : 90%;
height : 60%;
}
#cards {
border-radius: 25px;
border: 2px solid #000000;
padding: 10px;
width: 100%;
height: 25%;
}
#cards > img {
height : inherit;
}
#chatWindow{
height : 80%;
Expand All @@ -27,6 +33,9 @@
#challengeBtn {
width : 100%;
}
#rulesModal{
padding : 20px;
}
</style>
<title>Game Play</title>
<link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
Expand All @@ -36,7 +45,7 @@
var store = window.sessionStorage
function checkLogin() {
if(store.length!=0)
document.getElementById('loginName').innerText = store.getItem("loginName")
document.getElementById('loginName').innerHTML = store.getItem("loginName")
}
</script>
<!-- Web sockets messages and communication -->
Expand Down Expand Up @@ -64,12 +73,51 @@
<a class="navbar-brand" href="#">Liar's Poker Game</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="#rules">Rules</a></li>
<li><a data-target="#rulesModal" data-toggle="modal">Rules</a></li>
<li><a id="loginName" data-target="#loginModal" data-toggle="modal">Login</a></li>
</ul>
</div>
</nav>

<div class="modal fade" id="rulesModal" tabindex="-1" role="dialog" aria-labelledby="rulesLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Rules of Liars Poker Game!</h4>
</div>
<div class="panel-body">
<div>
<ol>
<li> Each player has 2-7 cards in their hand</li>
<li> With the knowledge of cards in their hand and other player's bets each player makes a bet</li>
<li> Bets are nothing but poker hands </li>
<ol>
<li>Royal Flush (Highest)</li>
<li>Straight Flush</li>
<li>Four of a Kind</li>
<li>Full House</li>
<li>Flush</li>
<li>Trio</li>
<li>Straight</li>
<li>Double Pair</li>
<li>Pair</li>
<li>High Card (Lowest)</li>
</ol>
<li> Bet should be higher than the previous bet and you can't pass your chance</li>
<li> Bet is challenged only by the next betting player if he thinks the bet won't materialize</li>
<li> Bet would materialize or not would be concluded from cards in all player's hands.</li>
<li> If challenger wins, then Better's cards increase by 1.</li>
<li> If challenger loses, then Challenger's cards increase by 1.</li>
<li> Player is out of the game if their card count is more than Game's max card cound. 5 or 7.</li>
</ol>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Okay!</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="gameStatusModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog modal-sm" role="document">
<div class="modal-content">
Expand Down Expand Up @@ -211,10 +259,10 @@ <h3 style="margin-top: 0px">
</div>
<div class="col-md-4">
</div>
<div id="canvas-div">
<div id="canvas-div" class="col-md-12">
<canvas id="htmlCanvas" width="450" height="400" style="display : block ;"></canvas>
</div>
<div id="cards">
<div id="cards" class="col-md-12">
<div id="container">

</div>
Expand Down
33 changes: 32 additions & 1 deletion app/views/home.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@
var store = window.sessionStorage
function checkLogin() {
if(store.length!=0)
document.getElementById('loginName').innerText = store.getItem("loginName")
{
document.getElementById('loginName').innerHTML = store.getItem("loginName")
$("#login-btns").get(0).style.display = "none";
$("#logoutBtn").get(0).style.display = "inline-block";
$('#myModalLabel').get(0).innerHTML = "Profile";
$("#profileInfo").get(0).style.display = "inline-block";
$('#profileName').get(0).innerHTML = store.getItem("loginName");
$('#profileEmail').get(0).innerHTML = store.getItem("loginEmail");
$('#profileAccount').get(0).innerHTML = store.getItem("loginBy");
}
}
</script>

Expand Down Expand Up @@ -101,12 +110,34 @@ <h4 class="modal-title" id="myModalLabel">Please Login</h4>
<a href="#"><img id="twitter-login-btn" src="@routes.Assets.at("images/twitter.png")" /></a><br/>
<a href="#"><img id="google-login-btn" src="@routes.Assets.at("images/gplus.png")" /></a><br/>
</div>
<form class="form-horizontal" id="profileInfo" style="display: none;">
<div class="form-group">
<label class="col-md-2 control-label">Name</label>
<div class="col-md-10 control-label">
<p id="profileName" class="form-control-static"></p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Email</label>
<div class="col-md-10 control-label">
<p id="profileEmail" class="form-control-static"></p>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Account</label>
<div class="col-md-10 control-label">
<p id="profileAccount" class="form-control-static"></p>
</div>
</div>
</form>

<form>
<input style="display: none;" id="pin" name="textinput" type="text" placeholder="Enter Twitter Pin" class="form-control input-md">
</form>
</div>
<div class="modal-footer">
<button id="submitPin" style="display: none;" type="button" class="btn btn-primary">Login</button>
<button id="logoutBtn" style="display: none;" type="button" class="btn btn-primary">Logout</button>
</div>
</div>
</div>
Expand Down
44 changes: 42 additions & 2 deletions app/views/joinGame.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
var store = window.sessionStorage
function checkLogin() {
if(store.length!=0)
document.getElementById('loginName').innerText = store.getItem("loginName")
document.getElementById('loginName').innerHTML = store.getItem("loginName")
}
</script>
<title>Joining Game</title>
Expand Down Expand Up @@ -51,13 +51,53 @@
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="#rules">Rules</a></li>
<li><a data-target="#rulesModal" data-toggle="modal">Rules</a></li>
<li><a id="loginName" data-target="#loginModal" data-toggle="modal">Login</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</nav>

<div class="modal fade" id="rulesModal" tabindex="-1" role="dialog" aria-labelledby="rulesLabel">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">Rules of Liars Poker Game!</h4>
</div>
<div class="panel-body">
<div>
<ol>
<li> Each player has 2-7 cards in their hand</li>
<li> With the knowledge of cards in their hand and other player's bets each player makes a bet</li>
<li> Bets are nothing but poker hands </li>
<ol>
<li>Royal Flush (Highest)</li>
<li>Straight Flush</li>
<li>Four of a Kind</li>
<li>Full House</li>
<li>Flush</li>
<li>Trio</li>
<li>Straight</li>
<li>Double Pair</li>
<li>Pair</li>
<li>High Card (Lowest)</li>
</ol>
<li> Bet should be higher than the previous bet and you can't pass your chance</li>
<li> Bet is challenged only by the next betting player if he thinks the bet won't materialize</li>
<li> Bet would materialize or not would be concluded from cards in all player's hands.</li>
<li> If challenger wins, then Better's cards increase by 1.</li>
<li> If challenger loses, then Challenger's cards increase by 1.</li>
<li> Player is out of the game if their card count is more than Game's max card cound. 5 or 7.</li>
</ol>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Okay!</button>
</div>
</div>
</div>
</div>
<div class="container">
<h2>
Active Games
Expand Down
2 changes: 1 addition & 1 deletion app/views/watchGamePlay.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
var store = window.sessionStorage
function checkLogin() {
if(store.length!=0)
document.getElementById('loginName').innerText = store.getItem("loginName")
document.getElementById('loginName').innerHTML = store.getItem("loginName")
}
</script>
<!-- Web sockets messages and communication -->
Expand Down
Loading

0 comments on commit f4b4815

Please sign in to comment.