-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
209 lines (196 loc) · 7.28 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
<!doctype html>
<html class="h-full" lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="theme-color" content="#ffffff" />
<!-- Title -->
<title>Connect Four Game</title>
<!-- Styles -->
<link rel="stylesheet" href="css/style.css" />
</head>
<body class="h-full bg-electric-indigo font-grotesk">
<!-- Loader -->
<div class="loader-wrapper" id="loader">
<span class="loader"></span>
</div>
<!-- Start game modal -->
<section
class="fixed inset-0 z-[888] bg-royal-blue transition-opacity"
id="startGameWindow"
>
<div class="flex h-full items-center justify-center">
<h2 class="visually-hidden">Start game</h2>
<div
class="flex w-full max-w-[480px] flex-col rounded-[40px] border-[3px] border-black bg-electric-indigo px-10 pb-[60px] pt-[70px] shadow-box"
>
<img
class="mx-auto mb-[79px] block h-[52px] w-[52px] object-contain"
src="img/badge.svg"
alt="Badge"
width="52"
height="52"
/>
<!-- Play VS CPU -->
<button
class="mb-[30px] rounded-[20px] border-[3px] border-black bg-spicy-pink px-5 py-[13px] text-[24px] font-bold uppercase text-white shadow-box transition-colors hover:border-royal-blue hover:shadow-royal-blue"
id="playVsCpuButton"
>
<span class="flex items-center justify-between">
<span>Play vs Cpu</span>
<img src="img/player-vs-cpu.svg" alt="" />
</span>
</button>
<!-- Play VS Player -->
<button
class="mb-[30px] rounded-[20px] border-[3px] border-black bg-goldenrod px-5 py-[13px] text-[24px] font-bold uppercase shadow-box transition-colors hover:border-royal-blue hover:shadow-royal-blue"
id="playVsPlayerButton"
>
<span class="flex items-center justify-between">
<span>Play vs Player</span>
<img src="img/player-vs-player.svg" alt="" />
</span>
</button>
<!-- Game rules -->
<button
class="rounded-[20px] border-[3px] border-black bg-white p-5 text-left text-[24px] font-bold uppercase shadow-box transition-colors hover:border-royal-blue hover:shadow-royal-blue"
id="showGameRuleButton"
>
Game rules
</button>
</div>
</div>
</section>
<!-- Header -->
<header>
<div
class="py mx-auto flex w-full max-w-[662px] items-center justify-between px-[15px] py-[52px]"
>
<button
class="whitespace-nowrap rounded-[20px] bg-royal-blue px-5 py-[10px] font-bold uppercase text-white transition-colors hover:bg-spicy-pink"
>
Menu
</button>
<img
class="block h-[52px] w-[52px] object-contain"
src="img/badge.svg"
alt="Badge"
width="52"
height="52"
/>
<button
class="whitespace-nowrap rounded-[20px] bg-royal-blue px-5 py-[10px] font-bold uppercase text-white transition-colors hover:bg-spicy-pink"
>
Restart
</button>
</div>
</header>
<section>
<div class="mx-auto w-full max-w-[662px] px-[15px]">
<h2 class="visually-hidden">Board</h2>
<div class="relative select-none">
<!-- White -->
<picture>
<source
media="(max-width: 375px)"
srcset="img/board-layer-white-small.svg"
/>
<img
class="absolute z-50"
src="img/board-layer-white-large.svg"
alt="Board"
width="632"
height="584"
/>
</picture>
<!-- Black -->
<picture>
<source
media="(max-width: 375px)"
srcset="img/board-layer-black-small.svg"
/>
<img
class="absolute z-30"
src="img/board-layer-black-large.svg"
alt="Board"
width="632"
height="584"
/>
</picture>
</div>
</div>
</section>
<!-- Game rule modal -->
<dialog id="gameRuleModal" class="modal select-none bg-electric-indigo">
<div class="relative">
<div
class="modal-box relative flex w-full max-w-[480px] flex-col rounded-[40px] border-[3px] border-black py-[34px] pb-[54px] pt-[30px] shadow-box"
>
<h2 class="mb-[29px] text-center text-[56px] font-bold uppercase">
Rules
</h2>
<div class="mb-8">
<h3
class="mb-4 text-[20px] font-bold uppercase text-electric-indigo"
>
Objective
</h3>
<p class="text-[16px] text-black opacity-60">
Be the first player to connect 4 of the same colored discs in a
row (either vertically, horizontally, or diagonally).
</p>
</div>
<div>
<h3
class="mb-4 text-[20px] font-bold uppercase text-electric-indigo"
>
How to Play
</h3>
<!-- Rules -->
<ol class="rules flex flex-col gap-3">
<li class="rule flex items-start">
<p class="text-[16px] text-black opacity-60">
Red goes first in the first game.
</p>
</li>
<li class="rule flex items-start">
<p class="text-[16px] text-black opacity-60">
Players must alternate turns, and only one disc can be dropped
in each turn.
</p>
</li>
<li class="rule flex items-start">
<p class="text-[16px] text-black opacity-60">
The game ends when there is a 4-in-a-row or a stalemate.
</p>
</li>
<li class="rule flex items-start">
<p class="text-[16px] text-black opacity-60">
The starter of the previous game goes second on the next game.
</p>
</li>
</ol>
</div>
</div>
<form method="dialog">
<button
class="absolute bottom-0 left-2/4 h-16 w-16 -translate-x-2/4 translate-y-2/4 rounded-full border-[3px] border-black bg-spicy-pink shadow-box transition-colors hover:border-royal-blue hover:shadow-royal-blue"
>
<span class="flex items-center justify-center">
<img src="img/check.svg" alt="" aria-hidden="true" />
</span>
</button>
</form>
</div>
</dialog>
<!-- JS -->
<script type="module" src="js/main.js"></script>
</body>
</html>