-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
78 lines (64 loc) · 3.84 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Diceinator!</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-0evHe/X+R7YkIZDRvuzKMRqM+OrBnVFBL6DOitfPri4tjfHxaWutUpFmBp4vmVor" crossorigin="anonymous">
<link href="styles.css" rel="stylesheet">
</head>
<body>
<head>
</head>
<div class="container">
<h1 id="siteTitle" class="text-center display-1">Diceinator!</h1>
<div id="diceContainer" class="container">
<div class="row row-cols-auto justify-content-center" style="margin-bottom: 1rem;">
<div class="col">
<button id="btnAddDice" class="btn btn-danger" onClick="addDice()">Add dice</button>
</div>
</div>
<div id="diceGrid" class="row row-cols-auto g-1 justify-content-center">
<div id="dice-0" class="col">
<div id="dice" align="center" class="border border-5 rounded-2">
<h2 id="diceTitle">D 6</h2>
<!--The bellow is only added to inserted dice.
This ensure the first dice cannot be removed and there must always be at least one dice-->
<!--<button class="btn-close btn-close-white" style="margin:0.2rem; position:absolute; top:0; right:0;" onclick="removeDice('dice-0')"></button>-->
<br>
<label style="display: block" for="sidesDropdown">Sides:</label>
<select id="sidesDropdown" onchange="dropDownChanged('dice-0')">
<option>2</option>
<option>4</option>
<option selected>6</option>
<option>8</option>
<option>10</option>
<option>12</option>
<option>20</option>
<option>Custom</option>
</select>
<input id="customSides" onchange="customSidesChanged('dice-0')" type="number" style="width:40%; display: none" value="50"></input>
<h5>Result:</h5>
<div id="resultBorder"; align="center" class="justif border border-5 rounded-4 d-flex justify-content-center align-items-center" style="width:6.5rem; height:6.5rem;">
<h5 id="result">0</h5>
</div>
<button id="btnRoll" class="btn btn-light" style="margin: 0.2rem" onclick="roll('dice-0'); rollAnimStart('dice-0'); gotTotal = false; disableAllButtons();">Roll</button>
</div><!--Dice div-->
</div><!--Dice col-->
</div><!--Row-->
<div class="row row-cols-auto justify-content-center">
<div class="col">
<button id="btnRollAll" class="btn btn-light" onClick="rollAll(); gotTotal = false; disableAllButtons();">Roll all</button>
</div>
</div>
<div class="row row-cols-auto justify-content-center">
<div class="col">
<h2 id="totalRoll" style="margin-top:1rem;"></h2>
</div>
</div>
</div><!--Dice container-->
</div><!--Main container-->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0-beta1/dist/js/bootstrap.bundle.min.js" integrity="sha384-pprn3073KE6tl6bjs2QrFaJGz5/SUsLqktiwsUTF55Jfv3qYSDhgCecCxMW52nD2" crossorigin="anonymous"></script>
<script src=".\scripts.js"></script>
</body>
</html>