forked from rocketacademy/basics-blackjack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
251 lines (223 loc) Β· 6.72 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Custom font -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Mali&display=swap"
rel="stylesheet"
/>
<style>
body {
font-family: "Mali", cursive;
}
</style>
<!-- Page setup configurations -->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Favicon configuration -->
<link
rel="apple-touch-icon"
sizes="180x180"
href="https://ra-web-files.s3.ap-southeast-1.amazonaws.com/all/favicons/apple-touch-icon.png?v=2"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="https://ra-web-files.s3.ap-southeast-1.amazonaws.com/all/favicons/favicon-32x32.png?v=2"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="https://ra-web-files.s3.ap-southeast-1.amazonaws.com/all/favicons/favicon-16x16.png?v=2"
/>
<link rel="manifest" href="/site.webmanifest?v=2" />
<link
rel="mask-icon"
href="https://ra-web-files.s3.ap-southeast-1.amazonaws.com/all/favicons/safari-pinned-tab.svg?v=2"
color="#e73c3e"
/>
<link
rel="shortcut icon"
href="https://ra-web-files.s3.ap-southeast-1.amazonaws.com/all/favicons/favicon.ico?v=2"
/>
<meta name="apple-mobile-web-app-title" content="Rocket Academy" />
<meta name="application-name" content="Rocket Academy" />
<meta name="msapplication-TileColor" content="#2b5797" />
<meta name="theme-color" content="#ffffff" />
<!-- sharing configuration -->
<!-- Primary Meta Tags -->
<title>Blackjack - Basics - Rocket Academy</title>
<meta name="title" content="Iffah's BlackJack Game!" />
<meta name="description" content="A fun card game I made myself! ππͺπ" />
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website" />
<meta
property="og:url"
content="https://rocketacademy.github.io/basics-blackjack/index.html"
/>
<meta property="og:title" content="Iffah's BlackJack Game!" />
<meta
property="og:description"
content="A fun card game I made myself! ππͺπ"
/>
<meta
property="og:image"
content="https://ra-web-files.s3.ap-southeast-1.amazonaws.com/basics/basics-blackjack-share-small.jpeg"
/>
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image" />
<meta
name="twitter:url"
content="https://rocketacademy.github.io/basics-blackjack/index.html"
/>
<meta name="twitter:title" content="Iffah's BlackJack Game!" />
<meta
name="twitter:description"
content="A fun card game I made myself! ππͺπ"
/>
<meta
name="twitter:image"
content="https://ra-web-files.s3.ap-southeast-1.amazonaws.com/basics/basics-blackjack-share-small.jpeg"
/>
<meta name="twitter:site" content="@rocketacademyco" />
<meta name="twitter:creator" content="@rocketacademyco" />
<!-- fonts -->
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Open+Sans"
/>
<!-- CSS -->
<style>
* {
box-sizing: border-box;
}
body {
font-family: "Mali", cursive;
text-align: center;
margin-left: 30px;
margin-right: 30px;
background-color: #fadadd;
color: black; /* sets the font color */
background-image: url("https://r4.wallpaperflare.com/wallpaper/908/631/590/hello-kitty-1440x900-anime-hello-kitty-hd-art-wallpaper-e3549616334100162111a3a17d1099c8.jpg"); /* The image used */
background-position: center; /* Center the image */
background-repeat: no-repeat;
background-attachment: fixed;
background-size: auto;
}
#output-div img {
display: block;
max-width: 100%;
max-height: 200px;
margin-left: auto;
margin-right: auto;
width: 40%;
}
.header {
text-align: center;
font-size: 1.1rem;
margin-bottom: 3rem;
}
#container {
background-color: lavenderblush;
margin: 40px auto;
max-width: 800px;
padding: 38px 31px;
}
input {
font-size: 21px;
line-height: 33px;
margin: 0 0 23px 0;
padding: 0 9px;
width: 100%;
}
button {
font-size: 21px;
line-height: 33px;
margin: 0 0 23px 0;
padding: 0 6px;
background-color: #f1ffd4;
}
#output-div {
background-color: lavenderblush;
margin: 20px auto;
padding: 20px;
width: 100%;
}
.logo-img {
height: 49px;
position: relative;
top: 22px;
}
#dealer-cards img {
height: 175px;
width: 125 px;
margin: 1px;
}
#player-cards img {
height: 175px;
width: 125 px;
margin: 1px;
}
#hit {
width: 100px;
height: 50px;
font-size: 20px;
font-family: "Mali", cursive;
}
#stay {
width: 100px;
height: 50px;
font-size: 20px;
font-family: "Mali", cursive;
}
#submit-button {
font-family: "Mali", cursive;
}
/* increase header font size on wider screens */
@media screen and (min-width: 600px) {
.header {
font-size: 2rem;
}
}
</style>
</head>
<body>
<h1 class="header"></h1>
<h1 class="header"></h1>
<h2>Dealer: <span id="dealer-sum"></span></h2>
<div id="dealer-cards"><img id="hidden" src="./cards/BACK.png" /></div>
<h2>Player: <span id="player-sum"></span></h2>
<div id="player-cards"></div>
<br />
<p id="results"></p>
<div id="container">
<p></p>
<input id="input-field" />
<br />
<button id="submit-button">Start</button>
<p></p>
<div id="output-div"></div>
</div>
<!-- Import program logic -->
<script src="script.js"></script>
<!-- Define button click functionality -->
<script>
var button = document.querySelector("#submit-button");
button.addEventListener("click", function () {
// Set result to input value
var input = document.querySelector("#input-field");
var result = main(input.value);
// Display result in output element
var output = document.querySelector("#output-div");
output.innerHTML = result;
// Reset input value
input.value = "";
});
</script>
</body>
</html>