-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.html
executable file
·218 lines (198 loc) · 9.34 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
<html>
<head>
<meta charset="utf-8" />
<title>FortKnight</title>
<link rel="icon" href="images/knight.svg">
</link>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-171629673-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-171629673-2');
</script>
<link rel="stylesheet" href="css/styles.css">
<!-- App Logic -->
<script src="app/app.js" type="module" defer></script>
</head>
<body>
<div class="dark-mode">
<label class="dark-mode-switch">
<input type="checkbox">
<span class="slider"></span>
</label>
</div>
<div class="body-container">
<div>
<header>
<img src="images/logo.webp" alt="logo" />
<div class="title">
<h1>Fortknight</h1>
<h2>Chess Battle Royale</h2>
</div>
</header>
<div class="board">
<div class="ach_modal"
style="position:absolute; top: 0; bottom: 0;left: 0;right: 0; margin: auto; bottom: 200px; opacity: 1; visibility: hidden; z-index:1000">
<div style="text-align: center; display:block; padding: 5px 10px; background: rgba(0,0,0,0.7); color:white"
class="ach_modal_inner">
<h3>Achievement Unlocked!</h3>
<p id="ach_modal_name"><span></span></p>
<h5 id="ach_modal_descr"><span></span></h5>
<button onclick="dismissAchvModal()">Dismiss</button>
</div>
</div>
<!-- generate board here -->
<div class="boardModal">
<div class="loss_modal">
<h1 class="fixed-color" style="color:white">You lost :(</h1>
<p class="fixed-color" style="color:white">Your score: <span class="fixed-color"
style="color:white"></span></p>
</div>
<button onclick="resetGame();">Begin</button>
</div>
</div>
<div id="assets" style="display:none">
<!--insert images here -->
<!-- piece-images -->
<img class="figure" src="images/bishop.svg" id="bishop" />
<img class="figure" src="images/king.svg" id="king" />
<img class="figure" src="images/knight.svg" id="knight" />
<img class="figure" src="images/pawn.svg" id="pawn" />
<img class="figure" src="images/queen.svg" id="queen" />
<img class="figure" src="images/rook.svg" id="rook" />
<img class="figure" src="images/wknight.svg" id="wknight" />
<img id='up_arrow' src='images/up_arrow.svg'>
<img id='down_arrow' src='images/down_arrow.svg'>
<!--end insert images -->
</div>
</div>
<div class="sidebar">
<div class="selected">
<p>Instructions</p>
<div>
<div>
<h2>Score: <span id="score">0</span></h2>
<h3>Highscore: <span id="hiscore"></span></h3>
</div>
<h2>Instructions</h2>
<p>Click on a square to move.</p>
<p>Pieces start small for 3 turns. Small pieces are harmless. Land on pieces to take them, but don't
let them land on you!</p>
<p>To skip a turn, click your knight.</p>
<p>Pieces will move to take your knight if they can; or randomly otherwise</p>
<p>Small pieces block the movement of other pieces, but big pieces don't. However, you can land on
small pieces and if a big piece can't move, it dies. </p>
<p>Pawns move in direction indicated <b>every two turns</b> and can take on forward diagonals in any
turn.</p>
<span id="gmode-help" class="hidden">You must <button class="button"
onclick="forfeitGame()">Forfeit</button> in order to change the game mode</span>
<fieldset class="gmode">
<legend>
<h3>Game Mode Choice</h3>
</legend>
<div id="wrap">
<label>
<input name="diff" value="classic" type="radio" checked />
Classic
</label>
<br>
<label>
<input name="diff" value="pacifist" type="radio" />
Pacifist <text style="color: red"> (No score for kills)</text>
</label>
<br>
<label>
<input name="diff" value="knightmare" type="radio" />
Knightmare <text style="color: red"> (Only knight pieces)</text>
</label>
<br>
<label>
<input name="diff" value="strategist" type="radio" />
Strategist <text style="color: red"> (Pieces have move order)</text>
</label>
<br>
<label>
<input name="diff" value="drunk" type="radio" />
Drunk pieces <text style="color: red"> (Pieces always move randomly)</text>
</label>
<br>
<label>
<input name="diff" value="arcade" type="radio" />
Arcade <text style="color: red"> (Pieces move based on a timer)</text>
</label>
<br>
<label>
<input name="diff" value="loop" type="radio" />
Loop Pieces <text style="color: red"> (Pieces on the edge rotate By 90 degrees
Anti-Clockwise every move)</text>
</label>
</div>
</fieldset>
<h3>Scoring:</h3>
<div class="rules">
<p style="color: #8CA1C5">+1 point for every turn on the field</p>
<p style="color: #467AD5">+2 points for every king taken</p>
<p style="color: #CF469F">+3 points for every knight, bishop, rook taken</p>
<p style="color: #30DE0D">+5 points for every queen taken</p>
</div>
<h3>FAQ</h3>
<p>yes, i know the chessboard only has 7 squares, not 8, but i wanted a centre square</p>
</div>
</div>
<div>
<p>Scores and achievements</p>
<div>
<h2>High scores</h2>
<div class="allhscores">
<!--
-->
</div>
<h2>High scores, by game mode</h2>
<div class="ghscores">
<!--
-->
</div>
<h2>Achievements</h2>
<div class="achv">
<!--
-->
</div>
</div>
</div>
<div class='toggleMovementProjection'>
<input type="checkbox" onclick="projectMovement()">
<label class="labelMovementProjection" id="onbtn">ON</label>
<label class="labelMovementProjection" id="offbtn">OFF</label>
<label style="font-size: 10px"><br>Toggle Knight's<br>possible moves</label>
</div>
<div class='debugTab hidden'>
<p id="show-debug">DEBUG</p>
<div>
<h2>Debug Informations</h2>
<button id="reset-button">ResetLocalStorage</button>
<button id="test-button">TestAch</button>
<pre class="debug"></pre>
</div>
</div>
</div>
</div>
<div class="moveTimerBox" id="timer-box">
<h1> Move Timer: </h1>
<progress value="0" max="2.5" id="timer-bar"></progress>
</div>
<script src="js/utils.js"></script>
<script src="js/arcade.js"></script>
<script src="js/piece_object.js"></script>
<script src="js/main.js"></script>
<script src="js/dark_mode.js"></script>
<script src="js/player_movement_hints.js"></script>
<script src="js/achievements_highscores.js"></script>
<script src="js/dom_events.js"></script>
<script src="js/debug.js"></script>
</body>
</html>