-
Notifications
You must be signed in to change notification settings - Fork 0
/
Blackjack.html
134 lines (129 loc) · 5.57 KB
/
Blackjack.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!--Nav Template Start-->
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<title>SyndiShanX - Blackjack (21)</title>
<link rel="stylesheet" href="Fonts/Font_Awesome.min.css">
<link rel="icon" href="Images/Global/Icon_Tab.webp">
<link rel="stylesheet" href="GlobalCSS.css">
<style type="text/css">
button {
border: none;
background: none;
}
#Hit img, #Stand img, #Play_Again img, #New_Game img {
width: 74px;
height: 116px;
padding: 10px;
}
.card {
width: 8%;
background-color: transparent;
}
textarea {
font-size: 25px;
color: #fff;
border: none;
resize:none;
text-align: center;
background-image: var(--bgImageLight)!important;
background-clip: border-box!important;
background-origin: padding-box!important;
background-attachment: scroll!important;
background-repeat: repeat!important;
background-size: auto!important;
background-position: left top!important;
}
.MainWrapper {
margin-bottom: 0px!important;
}
</style>
</head>
<body lang="">
<div class="MainWrapper" align="center">
<!--Nav Template End-->
<textarea rows="1" cols="73" disabled>Rules: Ace = 1, Dealer Stands at 17, Payouts: 1:1, Blackjack Payout 2:1</textarea>
<textarea id='Status' rows="1" cols="30" disabled>Status: Waiting on Input...</textarea><br>
<textarea id='PlayerTotal' rows="1" cols="10" disabled>Total: 0</textarea>
<textarea id='Coins' rows="1" cols="12" disabled>Coins: 100</textarea>
<button id='-' onclick='{ decreaseBet() }' style='padding-right: 0px; position: relative; left: 5px;'><img src='Images/Cards/Back_Button.png'></img></button>
<textarea rows="1" cols="16" disabled>Bet Adjustment</textarea>
<button id='+' onclick='{ increaseBet() }' style='padding-left: 0px; position: relative; right: 5px;'><img src='Images/Cards/Forward_Button.png'></img></button>
<textarea id='Bet' rows="1" cols="17" disabled>Current Bet: 10</textarea><br>
<img id='Card1' class='card'></img>
<img id='Card2' class='card'></img>
<img id='Card3' class='card'></img>
<img id='Card4' class='card'></img>
<img id='Card5' class='card'></img>
<img id='Card6' class='card'></img>
<img id='Card7' class='card'></img><br>
<textarea id='DealerTotal' rows="1" cols="10" disabled>Total: 0</textarea><br>
<img id='DealerCard1' class='card'></img>
<img id='DealerCard2' class='card'></img>
<img id='DealerCard3' class='card'></img>
<img id='DealerCard4' class='card'></img>
<img id='DealerCard5' class='card'></img>
<img id='DealerCard6' class='card'></img>
<img id='DealerCard7' class='card'></img><br>
<button id='Hit' onclick='{ playerHit() }'><img src='Images/Cards/Hit_Button.png'></img></button>
<button id='Stand' onclick='{ playerStand() }'><img src='Images/Cards/Stand_Button.png'></img></button>
<button id='Play_Again' onclick='{ playAgain() }' disabled=true><img src='Images/Cards/Play_Again_Button.png'></img></button>
<button id='New_Game' onclick='{ newGame() }'><img src='Images/Cards/New_Game_Button.png'></img></button>
<!--Nav Template Start-->
</div>
<script>
function checkButtonStatus() {
if (document.getElementById("Hit").disabled == true) {
document.getElementById("Hit").children[0].src = 'Images/Cards/Hit_Button_Disabled.png'
} else {
document.getElementById("Hit").children[0].src = 'Images/Cards/Hit_Button.png'
}
if (document.getElementById("Stand").disabled == true) {
document.getElementById("Stand").children[0].src = 'Images/Cards/Stand_Button_Disabled.png'
} else {
document.getElementById("Stand").children[0].src = 'Images/Cards/Stand_Button.png'
}
if (document.getElementById("Play_Again").disabled == true) {
document.getElementById("Play_Again").children[0].src = 'Images/Cards/Play_Again_Button_Disabled.png'
} else {
document.getElementById("Play_Again").children[0].src = 'Images/Cards/Play_Again_Button.png'
}
if (document.getElementById("New_Game").disabled == true) {
document.getElementById("New_Game").children[0].src = 'Images/Cards/New_Game_Button_Disabled.png'
} else {
document.getElementById("New_Game").children[0].src = 'Images/Cards/New_Game_Button.png'
}
if (document.getElementById("-").disabled == true) {
document.getElementById("-").children[0].src = 'Images/Cards/Back_Button_Disabled.png'
} else {
document.getElementById("-").children[0].src = 'Images/Cards/Back_Button.png'
}
if (document.getElementById("+").disabled == true) {
document.getElementById("+").children[0].src = 'Images/Cards/Forward_Button_Disabled.png'
} else {
document.getElementById("+").children[0].src = 'Images/Cards/Forward_Button.png'
}
document.getElementById('Status').cols = document.getElementById('Status').value.length + 2
document.getElementById('PlayerTotal').cols = document.getElementById('PlayerTotal').value.length + 2
document.getElementById('Coins').cols = document.getElementById('Coins').value.length + 2
document.getElementById('Bet').cols = document.getElementById('Bet').value.length + 2
document.getElementById('DealerTotal').cols = document.getElementById('DealerTotal').value.length + 2
if (coins <= 0) {
document.getElementById('Status').value = 'Status: No Coins Remaining...'
document.getElementById("Hit").disabled = true;
document.getElementById("Stand").disabled = true;
document.getElementById("Play_Again").disabled = true;
document.getElementById("New_Game").disabled = false;
document.getElementById("-").disabled = true;
document.getElementById("+").disabled = true;
}
}
const interval = setInterval(function() { checkButtonStatus() }, 500);
</script>
<script src="Blackjack.js"></script>
<script src="GlobalNavbar.js"></script>
<script src="GlobalNavbarFixer.js"></script>
</body>
</html>
<!--Nav Template End-->