Added content & functionality

Added a top banner, current score lines for top and bottom, imported bootstrap for responsive functionality.
This commit is contained in:
RyanNeilson
2018-01-28 15:23:22 -04:00
committed by GitHub
parent bfd9caee20
commit 894212f5a9

View File

@@ -1,3 +1,4 @@
<!DOCTYPE html>
<!--
Copyright (c) 2013 Fabrice ECAILLE aka Febbweiss
@@ -7,7 +8,7 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -21,79 +22,66 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link href='http://fonts.googleapis.com/css?family=Zeyada' rel='stylesheet' type='text/css'>
<link href="https://fonts.googleapis.com/css?family=Fredericka+the+Great" rel="stylesheet">
<script src="lib/jquery-1.7.1.min.js" type="text/javascript" ></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<link href="css/yahtzee.css" type="text/css" rel="stylesheet" media="screen, projection" />
</head>
<body>
<div style="width: 50%;float: left;">
<div class="dice empty" id="dice1"></div>
<div class="dice empty" id="dice2"></div>
<div class="dice empty" id="dice3"></div>
<div class="dice empty" id="dice4"></div>
<div class="dice empty" id="dice5"></div>
<div class="dice empty" id="dice6"></div>
<div class="clear"></div>
<div>
<span>Launch</span>
<span id="launch"></span>
<div id="banner"class="col-xs-12">
<h1>FEBBWEISS' YAHTZEE!</h1>
</div>
<a href="javascript:void(0)" id="launchBtn">Launch</a>
<div class="container">
<div class="row">
<div class="col-xs-12 col-xl-4">
<div>
<dl>
<dl><br>
<dt>Three of a kind</dt>
<dd>Three dice showing the same face</dd>
<dd>Sum of all dice</dd>
<dd>Three dice showing the same face (Ex. Three 3's)</dd>
<dd>Scoring: Sum of all dice</dd>
<br>
<dt>Four of a kind</dt>
<dd>Four dice showing the same face</dd>
<dd>Sum of all dice</dd>
<dt>Full</dt>
<dd>A three-of-a-kind and a pair</dd>
<dd>25 points</dd>
<dd>Four dice showing the same face (Ex. Four 5's)</dd>
<dd>Scoring: Sum of all dice</dd>
<br>
<dt>Full House</dt>
<dd>A three-of-a-kind and a pair (Ex. Three 1's and Two 4's)</dd>
<dd>Scoring: 25 points</dd>
<br>
<dt>Small straight</dt>
<dd>Four sequential dice</dd>
<dd>30 points</dd>
<dd>Four sequential dice (Ex. 2, 3, 4, 5)</dd>
<dd>Scoring: 30 points</dd>
<br>
<dt>Large straight</dt>
<dd>Five sequential dice</dd>
<dd>40 points</dd>
<dd>Five sequential dice (Ex. 2, 3, 4, 5, 6)</dd>
<dd>Scoring: 40 points</dd>
<br>
<dt>Yahtzee</dt>
<dd>Five dice showing the same face</dd>
<dd>50 points</dd>
<dd>Five dice showing the same face (Ex. Five 4's)</dd>
<dd>Scoring: 50 points</dd>
<br>
<dt>Chance</dt>
<dd>Sum of all dice</dd>
<dd>Scoring: Sum of all dice</dd>
</dl>
</div>
<div id="scorePanel" style="display: none;">
<table class="table table-bordered">
<tr>
<td>Upper grid score</td>
<td id="upperScore" style="text-align: center"></td>
</tr>
<tr>
<td>Bonus</td>
<td id="bonus" style="text-align: center"></td>
</tr>
<tr>
<td>Lower grid score</td>
<td id="lowerScore" style="text-align: center"></td>
</tr>
<tr>
<td><b>Total</b></td>
<td id="totalScore" style="text-align: center"><b></b></td>
</tr>
</table>
</div>
</div>
<div style="width: 50%;float: left;">
<div class="col-xs-12 col-xl-4">
<table border="1">
<thead>
<tr>
<th style="text-align: center;">Combinaison</th>
<th style="text-align: center;">Combination</th>
<th style="text-align: center;" width="84px">
Score
</th>
<th style="text-align: center;" width="100px"></th>
<th style="text-align: center;" width="100px">Options</th>
</tr>
</thead>
<tbody>
@@ -101,7 +89,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<tr>
<td>
<span id="oneLabel">
One
Ones
</span>
</td>
<td style="text-align: center;">
@@ -116,7 +104,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<tr>
<td>
<span id="twoLabel">
Two
Twos
</span>
</td>
<td style="text-align: center;">
@@ -131,7 +119,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<tr>
<td>
<span id="threeLabel">
Three
Threes
</span>
</td>
<td style="text-align: center;">
@@ -146,7 +134,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<tr>
<td>
<span id="fourLabel">
Four
Fours
</span>
</td>
<td style="text-align: center;">
@@ -161,7 +149,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<tr>
<td>
<span id="fiveLabel">
Five
Fives
</span>
</td>
<td style="text-align: center;">
@@ -176,7 +164,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<tr>
<td>
<span id="sixLabel">
Six
Sixes
</span>
</td>
<td style="text-align: center;">
@@ -187,19 +175,61 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<a href="javascript:void(0)"id="sixTrash" data-id="six" class="trash">Trash</a>
</td>
</tr>
<tr>
<td>
<span>
Upper Score
</span>
</td>
<td style="text-align: center;">
<span class="score" id="topScore"></span>
</td>
</tr>
</tbody>
</table>
<br>
<div id="btn">
<a href="javascript:void(0)" id="launchBtn">Roll the Dice</a>
</div>
<br>
<div>
<span>Dice Roll #:</span>
<span id="launch"></span>
</div>
<br>
<div>
<div class="dice empty" id="dice1"></div>
<div class="dice empty" id="dice2"></div>
<div class="dice empty" id="dice3"></div>
<div class="dice empty" id="dice4"></div>
<div class="dice empty" id="dice5"></div>
<div class="dice empty" id="dice6"></div>
<div class="clear"></div>
</div>
<div>
</div>
</div>
<div class="col-xs-12 col-xl-4">
<table border="1">
<thead>
<tr>
<th style="text-align: center;">Combinaison</th>
<th style="text-align: center;">Combination</th>
<th style="text-align: center;">Probability</th>
<th style="text-align: center;" width="84px">
Score
</th>
<th style="text-align: center;" width="100px"></th>
<th style="text-align: center;" width="100px">Options</th>
</tr>
</thead>
<tbody>
@@ -249,7 +279,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<tr>
<td>
<span id="fullLabel">
Full
Full House
</span>
</td>
<td>
@@ -270,7 +300,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<tr>
<td>
<span id="smallStraightLabel">
Small straight
Small Straight
</span>
</td>
<td>
@@ -291,7 +321,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<tr>
<td>
<span id="largeStraightLabel">
Large straight
Large Straight
</span>
</td>
<td>
@@ -350,38 +380,81 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
<a href="javascript:void(0)"id="luckTrash" data-id="luck" class="trash">Trash</a>
</td>
</tr>
<tr>
<td>
<span>
Lower Score
</span>
</td>
<td>
</td>
<td style="text-align: center;">
<span id="bottomScore" class="score"></span>
</td>
</tr>
</tbody>
</table>
<br>
<div id="scorePanel" style="display: none;">
<table class="table table-bordered">
<tr>
<th>Final Score</th>
</tr>
<tr>
<td>Upper grid score</td>
<td id="upperScore" style="text-align: center"></td>
</tr>
<tr>
<td>Bonus</td>
<td id="bonus" style="text-align: center"></td>
</tr>
<tr>
<td>Lower grid score</td>
<td id="lowerScore" style="text-align: center"></td>
</tr>
<tr>
<td><b>Total</b></td>
<td id="totalScore" style="text-align: center"><b></b></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div> <!-- End of span9 -->
<script src="js/yahtzee.js" type="text/javascript" ></script>
<script type="text/javascript">
$(document).ready(function () {
$(".dice").click(function(evt) {
$(document).ready(function ()
{
$(".dice").click(function(evt)
{
if( $(this).hasClass("selected") )
$(this).removeClass("selected");
else
$(this).addClass("selected");
});
$(".keep").click(function(evt) {
$(".keep").click(function(evt)
{
console.log("Keeping " + $(this).attr('data-id'));
Yahtzee.keep($(this).attr('data-id'));
});
$(".trash").click(function(evt) {
$(".trash").click(function(evt)
{
console.log("Trashing " + $(this).attr('data-id'));
Yahtzee.trash($(this).attr('data-id'));
});
$("#launchBtn").click(function() {
$("#launchBtn").click(function()
{
Yahtzee.shuffle();
Yahtzee.findCombinaisons();
Yahtzee.findCombinations();
if( Yahtzee.launch < 3 )
Yahtzee.findPossibilities();
});