-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
403 lines (323 loc) · 25.3 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./style.css">
<script src="https://cdn.jsdelivr.net/npm/js-cookie@beta/dist/js.cookie.min.js"></script>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" />
<title>Idle game</title>
</head>
<body onload="gameUpdate()" class="bg-5">
<div class="container-fluid">
<div class="container mt-3">
<!--Stats header-->
<div class="row bg-4 rounded py-3">
<div class="col-lg-4 col-sm-12 small-alignment d-flex flex-column justify-content-center align-items-lg-start">
<h2 class="color-1">
Gold: <span id="gold">0</span>
</h2>
<h2 class="color-1">
Gold per second: <span id="goldPerSecond">0</span>
</h2>
</div>
<div class="col-lg-4 col-sm-12 small-alignment d-flex flex-column justify-content-center align-items-lg-center">
<h2 class="color-1">Mine</h2>
<button class="rounded btn btn-shadow btn-hover btn-sheen bg-2" id="mine" onclick="mine()"><img id="pickaxe" class="button-mine" src="./resources/images/pickAxe.png" alt=""></button>
</div>
<div class="col-lg-4 col-sm-12 small-alignment d-flex flex-column justify-content-center align-items-lg-end">
<button class="btn mb-2 btn-shadow btn-hover btn-sheen bg-2 color-1"><i class="fas fa-cog fa-3x"></i></button>
<!--Config-->
</div>
<div class="col-12 mt-2 w-100 align-items-center justify-content-end">
<div class="row justify-content-center align-items-center">
<button onclick="showMaterialsModal()" class="col-2 text-center mx-2 btn btn-shadow btn-hover btn-sheen bg-2 color-1">Materials</button>
<button onclick="showAchievModal()" class="col-2 text-center mx-2 btn btn-shadow btn-hover btn-sheen bg-2 color-1">Achievements</button>
<button id="ascend-btn" onclick="ascend()" class="col-2 text-center hide-ascen-btn mx-2 btn btn-shadow btn-hover btn-sheen bg-2 color-1">Ascend</button>
<button id="perks-btn" onclick="showAscensionModal()" class="col-2 hide-ascen-btn text-center mx-2 btn btn-shadow btn-hover btn-sheen bg-2 color-1">Perks</button>
</div>
</div>
</div>
<!--Upgrades-->
<div id="upgradesContainer" class="row py-5">
<div id="upgradeOne" class="col-12 my-2 rounded bg-4 upgrade-opacity upgrade">
<div class="row">
<div class="col-lg-6 col-sm-12 py-2 d-flex justify-content-center align-items-center">
<img class="small-img" src="https://via.placeholder.com/630x144" alt="">
</div>
<div class="col-lg-4 col-sm-12 text-center py-2">
<h4 id="upgradeOneName" class="color-1">Copper Mine</h4>
<div class="row mt-4 text-center">
<p id="upgradeOneGps" class="m-0 color-1">Gold per second: 1</p>
<p id="upgradeOneMineChance" class="m-0 color-1">Copper mine chance: 0.001%</p>
<p id="upgradeOneAmount" class="m-0 color-1">Amount: 0</p>
</div>
</div>
<div class="col-lg-2 col-sm-12 d-flex flex-column align-items-center justify-content-center py-2">
<span id="upgradeOnePrice" class="mb-2 fw-bold color-1">Price: 10 gold</span>
<button class="btn btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold" onclick="buy('upgradeOne')" id="upgradeOneBuyBtn">Buy</button>
</div>
</div>
</div>
<div id="upgradeTwo" class="col-12 my-2 rounded bg-4 upgrade-opacity upgrade">
<div class="row">
<div class="col-lg-6 col-sm-12 py-2 d-flex justify-content-center align-items-center">
<img class="small-img" src="https://via.placeholder.com/630x144" alt="">
</div>
<div class="col-lg-4 col-sm-12 text-center py-2">
<h4 id="upgradeTwoName" class="color-1">Silver Mine</h4>
<div class="row mt-4 text-center">
<p id="upgradeTwoGps" class="m-0 color-1">Gold per second: 10</p>
<p id="upgradeTwoMineChance" class="m-0 color-1">Silver mine chance: 0.001%</p>
<p id="upgradeTwoAmount" class="m-0 color-1">Amount: 0</p>
</div>
</div>
<div class="col-lg-2 col-sm-12 d-flex flex-column align-items-center justify-content-center py-2">
<span id="upgradeTwoPrice" class="mb-2 fw-bold color-1">Price: 100 gold</span>
<button class="btn btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold" onclick="buy('upgradeTwo')" id="upgradeTwoBuyBtn">Buy</button>
</div>
</div>
</div>
<div id="upgradeThree" class="col-12 my-2 rounded bg-4 upgrade-opacity upgrade">
<div class="row">
<div class="col-lg-6 col-sm-12 py-2 d-flex justify-content-center align-items-center">
<img class="small-img" src="https://via.placeholder.com/630x144" alt="">
</div>
<div class="col-lg-4 col-sm-12 text-center py-2">
<h4 id="upgradeThreeName" class="color-1">Gold Mine</h4>
<div class="row mt-4 text-center">
<p id="upgradeThreeGps" class="m-0 color-1">Gold per second: 100</p>
<p id="upgradeThreeMineChance" class="m-0 color-1">Gold mine chance: 0.001%</p>
<p id="upgradeThreeAmount" class="m-0 color-1">Amount: 0</p>
</div>
</div>
<div class="col-lg-2 col-sm-12 d-flex flex-column align-items-center justify-content-center py-2">
<span id="upgradeThreePrice" class="mb-2 fw-bold color-1">Price: 1000 gold</span>
<button class="btn btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold" onclick="buy('upgradeThree')" id="upgradeThreeBuyBtn">Buy</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Achievement Modal-->
<div id="achievModal" class="container pos-modal-small position-fixed bg-2 text-center rounded modal-position modal-borders modal-container">
<div class="row justify-content-center align-items-center">
<div class="col-12">
<div class="row justify-content-center align-items-center mt-3">
<div class="col-9 col-sm-10 col-lg-11">
<h1 class="mb-0 color-1 bg-4 rounded py-2 fw-bold">Achievements</h1>
</div>
<div class="col-lg-1 col-3 col-sm-2">
<button onclick="closeAchievModal()" class="py-2 btn bg-4 btn-shadow btn-hover btn-sheen d-flex justify-content-center align-items-center">
<i class="far fa-times-circle color-1 fa-2x"></i>
</button>
</div>
</div>
</div>
<div class="col-12 my-3 ">
<div id="achievContainer" class="row rounded p-3 justify-content-start flex-wrap align-items-center">
<!--Code gets inserted here from modal open function-->
</div>
</div>
</div>
</div>
<!--Materials Modal-->
<div id="materialsModal" class="container position-fixed pos-modal-small bg-2 text-center rounded modal-position modal-borders modal-container">
<div class="row justify-content-center align-items-center text-center mt-3">
<div class="col-9 col-sm-10 col-lg-11">
<h1 class="color-1 bg-4 rounded py-2 fw-bold mb-0">Materials</h1>
</div>
<div class="col-lg-1 col-3 col-sm-2">
<button onclick="closeMaterialsModal()" class="py-2 btn bg-4 btn-shadow btn-hover btn-sheen d-flex justify-content-center align-items-center">
<i class="far fa-times-circle color-1 fa-2x"></i>
</button>
</div>
<div id="materialsContainer" class="col-12 my-3 ">
<!--Materials code is added here-->
</div>
</div>
</div>
<!--Cover the screen on black opacity when modal is opened-->
<div id="modalCover" class="bg-5">
</div>
<!--Achievement Toast Modal-->
<div id="achievementContainer"></div>
<div id="ascenModalHeader" class="bg-3 py-3 ascen-modal-header text-center fixed-top w-100">
<h1 class=" color-1 d-inline ">Perks</h1>
<div class="d-inline-block float-end me-3">
<button onclick="closeAscensionModal()" class="py-2 btn bg-4 btn-shadow btn-hover btn-sheen d-flex justify-content-center align-items-center ">
<i class="far fa-times-circle color-1 fa-2x "></i>
</button>
</div>
</div>
<!--Ascension UI Modal-->
<div id="ascensionModal" class="container-fluid bg-5 p-0 ascension-modal color-4 fw-bold">
<div class="desired-width">
<div class="perk-line perk-line-one"></div>
<div class="perk-line perk-line-two"></div>
<div class="perk-line perk-line-three"></div>
<div class="perk-line perk-line-four"></div>
<div class="perk-line perk-line-five"></div>
<div class="perk-line perk-line-six"></div>
<div class="d-flex position-relative align-items-baseline justify-content-around margin-top">
<div class="zoom click-overdrive card-show card-perk-size d-flex justify-content-center position-relative">
<div id="clickOverdrive" class="perk-bought color-1 bg-2 d-flex justify-content-center align-items-center">
<i class="far fa-check-circle"></i>
</div>
<div class="product-focus-shadow color-1 card-borders-animation card-width ">
<div class="card bg-3 b-radius d-flex justify-content-center align-items-center border-0 rounded-top ">
<a class="image-borders "><img src="https://via.placeholder.com/286x160 " class="pt-2 card-img-size " alt="... "></a>
<h4 class="color-black align-self-stretch bg-4 my-2 p-1 text-center mx-2 ">"Click Overdrive"</h4>
</div>
<div class="bg-3 card-body card-content-colapse border-0 card-content-borders rounded-bottom card-margin-offset d-flex justify-content-center align-items-center flex-column ">
<p class="card-text text-center color-black ">Doubles the ammount of gold recived per click</p>
<p class="card-text color-black ">Price: 10 copper, 5 silver</p>
<button disabled id="clickOverdriveBtn" onclick="buyPerk(clicker.ascension.perks.clickOverdrive, 'clickOverdrive') " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold perk-btn-zindex ">Buy</button>
</div>
<span class="badge bg-4 color-1 tier-badge position-absolute">Tier 1</span>
</div>
</div>
<div class="zoom click-mastery card-show card-perk-size d-flex justify-content-center position-relative">
<div id="clickMastery" class="perk-bought color-1 bg-2 d-flex justify-content-center align-items-center">
<i class="far fa-check-circle"></i>
</div>
<div class="product-focus-shadow color-1 card-borders-animation card-width ">
<div class="card bg-3 b-radius d-flex justify-content-center align-items-center border-0 rounded-top ">
<a class="image-borders "><img src="https://via.placeholder.com/286x160 " class="pt-2 card-img-size " alt="... "></a>
<h4 class="color-black align-self-stretch bg-4 my-2 p-1 text-center mx-2 ">"Click Mastery"</h4>
</div>
<div class="bg-3 card-body card-content-colapse border-0 card-content-borders rounded-bottom card-margin-offset d-flex justify-content-center align-items-center flex-column ">
<p class="card-text text-center color-black ">Gain an extra ten gold per click</p>
<p class="card-text color-black ">Price: 5 copper, 3 silver, 1 gold</p>
<button disabled id="clickMasteryBtn" onclick="buyPerk(clicker.ascension.perks.clickMastery, 'clickMastery') " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold perk-btn-zindex ">Buy</button>
</div>
<span class="badge bg-4 color-1 tier-badge position-absolute">Tier 1</span>
</div>
</div>
</div>
<div class="d-flex position-relative align-items-baseline justify-content-around my-5 ">
<div class="zoom gold-mastery card-show card-perk-size d-flex justify-content-center position-relative">
<div id="goldMastery" class="perk-bought color-1 bg-2 d-flex justify-content-center align-items-center">
<i class="far fa-check-circle"></i>
</div>
<div class="product-focus-shadow color-1 card-borders-animation card-width ">
<div class="card bg-3 b-radius d-flex justify-content-center align-items-center border-0 rounded-top ">
<a class="image-borders "><img src="https://via.placeholder.com/286x160 " class="pt-2 card-img-size " alt="... "></a>
<h4 class="color-black align-self-stretch bg-4 my-2 p-1 text-center mx-2 ">"Gold Mastery"</h4>
</div>
<div class="bg-3 card-body card-content-colapse border-0 card-content-borders rounded-bottom card-margin-offset d-flex justify-content-center align-items-center flex-column ">
<p class="card-text text-center color-black ">Gold mines are twice as efficient</p>
<p class="card-text color-black ">Price: 20 gold</p>
<button disabled id="goldMasteryBtn" onclick="buyPerk(clicker.ascension.perks.goldMastery, 'goldMastery') " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold perk-btn-zindex ">Buy</button>
</div>
<span class="badge bg-4 color-1 tier-badge position-absolute">Tier 2</span>
</div>
</div>
<div class="zoom silver-mastery card-show card-perk-size d-flex justify-content-center position-relative">
<div id="silverMastery" class="perk-bought color-1 bg-2 d-flex justify-content-center align-items-center">
<i class="far fa-check-circle"></i>
</div>
<div class="product-focus-shadow color-1 card-borders-animation card-width ">
<div class="card bg-3 b-radius d-flex justify-content-center align-items-center border-0 rounded-top ">
<a class="image-borders "><img src="https://via.placeholder.com/286x160 " class="pt-2 card-img-size " alt="... "></a>
<h4 class="color-black align-self-stretch bg-4 my-2 p-1 text-center mx-2 ">"Silver Mastery"</h4>
</div>
<div class="bg-3 card-body card-content-colapse border-0 card-content-borders rounded-bottom card-margin-offset d-flex justify-content-center align-items-center flex-column ">
<p class="card-text text-center color-black ">Silver mines are twice as efficient</p>
<p class="card-text color-black ">Price: 20 silver</p>
<button disabled id="silverMasteryBtn" onclick="buyPerk(clicker.ascension.perks.silverMastery, 'silverMastery') " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold perk-btn-zindex ">Buy</button>
</div>
<span class="badge bg-4 color-1 tier-badge position-absolute">Tier 2</span>
</div>
</div>
<div class="zoom copper-mastery card-show card-perk-size d-flex justify-content-center position-relative">
<div id="copperMastery" class="perk-bought color-1 bg-2 d-flex justify-content-center align-items-center">
<i class="far fa-check-circle"></i>
</div>
<div class="product-focus-shadow color-1 card-borders-animation card-width ">
<div class="card bg-3 b-radius d-flex justify-content-center align-items-center border-0 rounded-top ">
<a class="image-borders "><img src="https://via.placeholder.com/286x160 " class="pt-2 card-img-size " alt="... "></a>
<h4 class="color-black align-self-stretch bg-4 my-2 p-1 text-center mx-2 ">"Copper Mastery"</h4>
</div>
<div class="bg-3 card-body card-content-colapse border-0 card-content-borders rounded-bottom card-margin-offset d-flex justify-content-center align-items-center flex-column ">
<p class="card-text text-center color-black ">Copper mines are twice as efficient</p>
<p class="card-text color-black ">Price: 20 copper</p>
<button disabled id="copperMasteryBtn" onclick="buyPerk(clicker.ascension.perks.copperMastery, 'copperMastery') " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold perk-btn-zindex ">Buy</button>
</div>
<span class="badge bg-4 color-1 tier-badge position-absolute">Tier 2</span>
</div>
</div>
</div>
<div class="d-flex position-relative align-items-baseline justify-content-around mb-5 ">
<div class="zoom click-overdrive card-show card-perk-size d-flex justify-content-center position-relative">
<div id="achieveGreatness" class="perk-bought color-1 bg-2 d-flex justify-content-center align-items-center">
<i class="far fa-check-circle"></i>
</div>
<div class="product-focus-shadow color-1 card-borders-animation card-width ">
<div class="card bg-3 b-radius d-flex justify-content-center align-items-center border-0 rounded-top ">
<a class="image-borders "><img src="https://via.placeholder.com/286x160 " class="pt-2 card-img-size " alt="... "></a>
<h4 class="color-black align-self-stretch bg-4 my-2 p-1 text-center mx-2 ">"Achieve greatness"</h4>
</div>
<div class="bg-3 card-body card-content-colapse border-0 card-content-borders rounded-bottom card-margin-offset d-flex justify-content-center align-items-center flex-column ">
<p class="card-text text-center color-black ">Gain 1% gold per second for every achievement unlocked</p>
<p class="card-text color-black ">Price: 30 copper, 20 silver, 15 gold</p>
<button disabled id="achieveGreatnessBtn" onclick="buyPerk(clicker.ascension.perks.achieveGreatness, 'achieveGreatness') " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold perk-btn-zindex ">Buy</button>
</div>
<span class="badge bg-4 color-1 tier-badge position-absolute">Tier 3</span>
</div>
</div>
<div class="zoom click-mastery card-show card-perk-size d-flex justify-content-center position-relative">
<div id="insaneMining" class="perk-bought color-1 bg-2 d-flex justify-content-center align-items-center">
<i class="far fa-check-circle"></i>
</div>
<div class="product-focus-shadow color-1 card-borders-animation card-width ">
<div class="card bg-3 b-radius d-flex justify-content-center align-items-center border-0 rounded-top ">
<a class="image-borders "><img src="https://via.placeholder.com/286x160 " class="pt-2 card-img-size " alt="... "></a>
<h4 class="color-black align-self-stretch bg-4 my-2 p-1 text-center mx-2 ">"Insane Mining"</h4>
</div>
<div class="bg-3 card-body card-content-colapse border-0 card-content-borders rounded-bottom card-margin-offset d-flex justify-content-center align-items-center flex-column ">
<p class="card-text text-center color-black ">Triples the chance of mining ores</p>
<p class="card-text color-black ">Price: 25 copper, 25 silver, 25 gold</p>
<button disabled id="insaneMiningBtn" onclick="buyPerk(clicker.ascension.perks.insaneMining, 'insaneMining') " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold perk-btn-zindex ">Buy</button>
</div>
<span class="badge bg-4 color-1 tier-badge position-absolute">Tier 3</span>
</div>
</div>
</div>
</div>
</div>
<div class="container config-modal bg-4 w-15 rounded">
<div class="row flex-column w-100 p-2 position-relative">
<button onclick="" class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold ">Volume</button>
<button onclick="" class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold ">Reset</button>
<button onclick="" class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold ">Color theme</button>
<button onclick="" class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold ">Credits</button>
<button onclick="" class="btn btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold config-close-btn"><i class="fas fa-times"></i></button>
</div>
</div>
<!--Debbug Tools-->
<div class="container bg-4 rounded my-5 ">
<div class="row justify-content-center align-items-center p-2 ">
<div class="col-12 text-center ">
<h1 class="color-1 ">Debbug Tools</h1>
</div>
<div class="col-12 col-sm-12 col-md-2 d-flex justify-content-center align-items-center "><button onclick="ascend() " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold ">Ascend</button></div>
<div class="col-12 col-sm-12 col-md-2 d-flex justify-content-center align-items-center "><button onclick="gameReset() " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold ">reset game</button></div>
<div class="col-12 col-sm-12 col-md-2 d-flex justify-content-center align-items-center "><button onclick="achDebbug() " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold ">Call achievements</button></div>
<div class="col-12 col-sm-12 col-md-2 d-flex justify-content-center align-items-center "><button onclick="materialsDebbug() " class="btn m-2 btn-shadow btn-hover btn-sheen bg-2 color-1 fw-bold ">Materials debbug</button></div>
</div>
</div>
<script src="https://cdn.rawgit.com/erosson/swarm-numberformat/v0.1.0/dist/swarm-numberformat.min.js "></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js " integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin=" anonymous "></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js " integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf " crossorigin="anonymous "></script>
<script src="./scripts/ascend.js"></script>
<script src="./scripts/config.js"></script>
<script src="./scripts/materials.js"></script>
<script src="./scripts/achievement.js"></script>
<script src="./scripts/index.js"></script>
</body>
</html>