-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
598 lines (571 loc) · 20.9 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
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="https://warthunder.com/i/favicons/mstile-144x144.png" />
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>WT Tech-Tree Maker</title>
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
<link rel="stylesheet" href="style.css" title="WT_TECH_TREE_MAKER_STYLES" />
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-2MXHJ2WEKE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-2MXHJ2WEKE');
</script>
</head>
<body>
<label id="techTreeNameLabel" for="techTreeName">
<h3>Tech tree name:</h3>
</label>
<input type="text" id="techTreeName" name="techTreeName" />
<label id="techTreeMainDescLabel" for="techTreeMainDesc">
<h3>Tech tree description:</h3>
</label>
<textarea id="techTreeMainDesc"
name="techTreeMainDesc">Here you can write description of your tech tree as a whole.</textarea>
<br /><br />
<nav>
<div id="navAdd">Add vehicle</div>
<div id="navEdit">Edit vehicle</div>
<div id="navDel">Delete vehicle</div>
<div id="navOrder">Vehicle ordering</div>
<div id="navBackup">Backup</div>
<div id="navExport">Export tree</div>
<div id="navClone">Clone WT Wiki</div>
<div id="navSettings">Settings</div>
<div id="navHide">Hide Menu</div>
</nav>
<div id="addModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Add new vehicle</h2>
</div>
<div class="modal-body">
<form id="newForm">
<div id="nameInputDiv">
<label for="vehicleName">Name:</label>
<input type="text" name="vehicleName" id="vehicleName" maxlength="50" />
<div class="tooltip">
❓
<span class="tooltipText">Name of the vehicle.<br /><br />Required.</span>
</div>
<br />
</div>
<div class="flexWrapper">
<span class="flexTitle">Vehicle data</span>
<div class="inputModalFlex">
<div class="inputModalFlexChild">
<label for="vehicleType">Type:</label>
<select name="vehicleType" id="vehicleType">
<option value="researchable">Researchable</option>
<option value="reserve">Reserve</option>
<option value="premium">Premium</option>
<option value="event">Event</option>
<option value="squadron">Squadron</option>
</select>
<div class="tooltip">
❓
<span class="tooltipText">Type of the vehicle. Non-researchable vehicles will be
automatically placed on premium sidebar of the tech-tree.</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleBr">Battle rating:</label>
<input type="number" name="vehicleBr" id="vehicleBr" min="1" max="99" />
<div class="tooltip">
❓
<span class="tooltipText">Battle rating of the vehicle.<br /><br />It must have one
or zero decimal places, and be a non-negative number less than
100.<br /><br />Unlike in game, you can put any .X you like, not just .0 / .3 /
.7<br /><br />If left empty, will be defaulted
to 0.<br /><br />Examples of valid BR: <br />[3] [3.3] [15] [40.5]
</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleThumbnail">Thumbnail:</label>
<input type="text" name="vehicleThumbnail" id="vehicleThumbnail" />
<div class="tooltip">
❓
<span class="tooltipText">Small image that displays on the tech
tree.<br /><br />Optional.</span>
</div>
</div>
</div>
</div>
<div class="flexWrapper">
<span class="flexTitle">Tech-tree placement</span>
<div class="inputModalFlex">
<div class="inputModalFlexChild">
<label for="vehicleRank">Rank:</label>
<input type="number" name="vehicleRank" id="vehicleRank" min="1" max="99" />
<div class="tooltip">
❓
<span class="tooltipText">Rank of the vehicle. It has to be a whole number between 1
and 99.<br /><br />Required.</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleBranch">Branch:</label>
<input type="number" name="vehicleBranch" id="vehicleBranch" min="1" max="9" />
<div class="tooltip">
❓
<span class="tooltipText">Defines which branch the vehicle belongs to (left to right
vertical lines of vehicles). It has to be a whole number between 1
and 9.<br /><br />
Required.</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleConnection">Connected:</label>
<select name="vehicleConnection" id="vehicleConnection">
<option value="yes">Yes</option>
<option value="no">No</option>
<option value="folder">Folder</option>
</select>
<div class="tooltip">
❓
<span class="tooltipText">Defines relation to the previous vehicle in the branch.
Folder only applies as long as there is vehicle above in the rank.
Connection only when there is one in a branch.</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleFollow">Follow:</label>
<select id="vehicleFollow" name="vehicleFollow"></select>
<div class="tooltip">
❓
<span class="tooltipText">This setting allows you to override ordering of vehicles
by BR, and instead attach this vehicle after another vehicle.<br /><br />
In order for this to work, both vehicles need to be in the same rank and
branch.</span>
</div>
</div>
</div>
</div>
<div style="float: left;padding: 15px;">
Class:
<div class="tooltip">
❓
<span class="tooltipText">Class icon to display on vehicle badge.<br /><br />
None by default.</span>
</div>
</div>
<div id="vehicleClassIcons"></div><br>
<label for="vehicleImageList">Images:</label>
<div class="tooltip">
❓
<span class="tooltipText">Images to display after clicking on the vehicle.<br /><br />
Optional</span>
</div>
<br />
<button id="vehicleImageListAdd">Add image <b style="color: green">+</b></button>
<ol id="vehicleImageList"></ol>
<label for="vehicleDescription">Description:</label>
<div class="tooltip">
❓
<span class="tooltipText">Description of the vehicle <br /><br />
Optional - although would be nice to have some ;)</span>
</div>
<br />
<textarea name="vehicleDescription" id="vehicleDescription"
placeholder="This vehicle is awesome!"></textarea>
</form>
<button id="addButton">Add vehicle</button>
</div>
</div>
</div>
<div id="editModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Edit vehicle</h2>
</div>
<div class="modal-body">
<div id="editSelectDiv">
Select vehicle to edit:
<select id="editionSelect"></select>
</div>
<form id="editForm">
<div id="nameInputDiv">
<label for="vehicleNameEdit">Name:</label>
<input type="text" name="vehicleNameEdit" id="vehicleNameEdit" maxlength="50" />
<div class="tooltip">
❓
<span class="tooltipText">Name of the vehicle.<br /><br />Required.</span>
</div>
</div>
<div class="flexWrapper">
<span class="flexTitle">Vehicle data</span>
<div class="inputModalFlex">
<div class="inputModalFlexChild">
<label for="vehicleTypeEdit">Type:</label>
<select name="vehicleTypeEdit" id="vehicleTypeEdit">
<option value="researchable">Researchable</option>
<option value="reserve">Reserve</option>
<option value="premium">Premium</option>
<option value="event">Event</option>
<option value="squadron">Squadron</option>
</select>
<div class="tooltip">
❓
<span class="tooltipText">Type of the vehicle. Non-researchable vehicles will be
automatically placed on premium sidebar of the tech-tree.</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleBrEdit">Battle rating:</label>
<input type="number" name="vehicleBrEdit" id="vehicleBrEdit" min="1" max="99" />
<div class="tooltip">
❓
<span class="tooltipText">Battle rating of the vehicle.<br /><br />It must have one
or zero decimal places, and be a non-negative number less than
100.<br /><br />Unlike in game, you can put any .X you like, not just .0 / .3 /
.7<br /><br />If left empty, will be defaulted
to 0.<br /><br />Examples of valid BR: <br />[3] [3.3] [15] [40.5]
</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleThumbnailEdit">Thumbnail:</label>
<input type="text" name="vehicleThumbnailEdit" id="vehicleThumbnailEdit" />
<div class="tooltip">
❓
<span class="tooltipText">Small image that displays on the tech
tree.<br /><br />Optional.</span>
</div>
</div>
</div>
</div>
<div class="flexWrapper">
<span class="flexTitle">Tech-tree placement</span>
<div class="inputModalFlex">
<div class="inputModalFlexChild">
<label for="vehicleRankEdit">Rank:</label>
<input type="number" name="vehicleRankEdit" id="vehicleRankEdit" min="1" max="99" />
<div class="tooltip">
❓
<span class="tooltipText">Rank of the vehicle. It has to be a whole number between 1
and 99.<br /><br />Required.</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleBranchEdit">Branch:</label>
<input type="number" name="vehicleBranchEdit" id="vehicleBranchEdit" min="1" max="9" />
<div class="tooltip">
❓
<span class="tooltipText">Defines which branch the vehicle belongs to (left to right
vertical lines of vehicles). It has to be a whole number between 1
and 9.<br /><br />
Required.</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleConnectionEdit">Connected:</label>
<select name="vehicleConnectionEdit" id="vehicleConnectionEdit">
<option value="yes">Yes</option>
<option value="no">No</option>
<option value="folder">Folder</option>
</select>
<div class="tooltip">
❓
<span class="tooltipText">Defines relation to the previous vehicle in the branch.
Folder only applies as long as there is vehicle above in the rank.
Connection only when there is one in a branch.</span>
</div>
</div>
<div class="inputModalFlexChild">
<label for="vehicleFollowEdit">Follow:</label>
<select id="vehicleFollowEdit" name="vehicleFollowEdit"></select>
<div class="tooltip">
❓
<span class="tooltipText">This setting allows you to override ordering of vehicles
by BR, and instead attach this vehicle after another vehicle.<br /><br />
In order for this to work, both vehicles need to be in the same rank and
branch.</span>
</div>
</div>
</div>
</div>
<div style="float: left;padding: 15px;">
Class:
<div class="tooltip">
❓
<span class="tooltipText">Class icon to display on vehicle badge.<br /><br />
None by default.</span>
</div>
</div>
<div id="vehicleClassIconsEdit"></div><br>
<label for="vehicleImageListEdit">Images:</label>
<div class="tooltip">
❓
<span class="tooltipText">Images to display after clicking on the vehicle.<br /><br />
Optional</span>
</div>
<br />
<button id="vehicleImageListEditAdd">Add image <b style="color: green">+</b></button>
<ol id="vehicleImageListEdit"></ol>
<br />
<label for="vehicleDescriptionEdit">Description:</label>
<div class="tooltip">
❓
<span class="tooltipText">Description of the vehicle <br /><br />
Optional - although would be nice to have some ;)</span>
</div>
<textarea name="vehicleDescriptionEdit" id="vehicleDescriptionEdit" rows="10" cols="50"
placeholder="This vehicle is awesome!"></textarea>
</form>
<button id="editButton">Apply changes to the vehicle</button>
</div>
</div>
</div>
<div id="delModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Delete vehicles</h2>
</div>
<div class="modal-body">
<button id="deleteAllButton">CLEAR TECH TREE</button>
<br /><br /><br />
<div id="deleteSelectDiv">
<select id="deleteVehicleSelect"></select>
<button id="deleteVehicleButton">Delete vehicle</button>
</div>
<div id="vehicleDeleteDisplay"></div>
</div>
</div>
</div>
<div id="orderModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Vehicle ordering</h2>
</div>
<div class="modal-body">
<p>
There you can remove custom ordering of vehicles that overrides their ordering by BR. To add new
connections, edit individual vehicle and
pick option in "follow" field.
</p>
<p id="followLoopWarning"><b>WARNING!</b> There is a loop of vehicles following each other!</p>
<p id="multipleFollowWarning"></p>
<table>
<tbody id="vehicleOrderList"></tbody>
</table>
<p>
Having trouble? Read the
<a href="https://github.com/przemyslaw-zan/WT-Tech-Tree-Maker#vehicle-ordering"
target="_blank">guide</a>!
</p>
</div>
</div>
</div>
<div id="backupModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Download & Upload backup</h2>
</div>
<div class="modal-body">
<button id="backupDownload">Download Tech Tree Backup</button><br /><br />
Here, you can download backup that you can load back later for further editing. Use it for:
<ul>
<li>Securing your work from accidental loss while clearing your browser.</li>
<li>Moving your work to a different computer.</li>
<li>Working on multiple projects.</li>
</ul>
<br /><br />
Upload Tech Tree Backup: <input id="backupUpload" type="file" accept=".json" /> <br /><br />
<button id="loadBackup">Load the backup</button>
</div>
</div>
</div>
<div id="exportModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Export Tech Tree</h2>
</div>
<div class="modal-body">
Get your ready tech tree here:
<br />
<button id="exportTechTreeButton">Export the Tech Tree</button>
<br />
<br />
<a href="https://neocities.org/" target="_blank">Neocities</a> is a great place where you can host your
tech tree for free ;)
<br />
<br />
If you'd like to have your Tech-Tree featured in the
<a href="https://zanju.neocities.org/" target="_blank">Official Library</a>,
just message me on
<a href="https://www.reddit.com/user/zanju13" target="_blank">Reddit</a>
and I will include a link to your creation. Even if your tech tree is work in progress, you can message
me anyway and show me - knowing that someone enjoys my tool really motivates me to continue my work on
improving the tool :)
</div>
</div>
</div>
<div id="cloneModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Clone WT Wiki</h2>
</div>
<div class="modal-body">
<h3>Work in progress</h3>
This is an experimental function that allows you to clone tech trees from WT's wiki. Some things will
not work properly <b>yet</b>:
<ul>
<li>Connections are not taken into consideration, and all vehicles in the tech tree will be
connected, and all vehicles
in the premium tab will not</li>
<li>Helicopter trees are messed up - this is hard to fix in code, and easy to fix by the user by
simply editing vehicles</li>
</ul>
<hr>
This utility allows you to clone tech tree from WT Wiki page. Each vehicle will have:
<ul>
<li>Name</li>
<li>Battle Rating</li>
<li>Thumbnail</li>
<li>Correct Branch/Rank Placement</li>
<li>Type (researchable / premium / squadron / event)</li>
<li>Folder (if it has one in the tree)</li>
</ul>
Tech tree page on the wiki sadly does not display some vehicle data, and this utility will not provide
you with:
<ul>
<li>Class</li>
</ul>
<h3>Step by step guide</h3>
<ol>
<li>Click here to → <button id="copyCloneUtility">Copy the utility</button></li>
<li>Visit your desired tech tree (eg.
<a href="https://wiki.warthunder.com/ground?v=t&t_c=germany" target="_blank">
Germany ground vehicles)</a>
</li>
<li>Open the console
<ul>
<li><b class="codeFont">F12</b> on most browsers <i>or</i>
</li>
<li><b class="codeFont">ctrl + shift + c</b> on Chrome
<i>or</i>
</li>
<li><b class="codeFont">ctrl + shift + i</b> on Firefox
</li>
</ul>
</li>
<li>Console is usually represented by
<b class="codeFont">></b> or
<b class="codeFont">>></b> symbols.
You can type there freely and execute commands by pressing
<b class="codeFont">enter</b>
- <i>do not worry</i>, anything you might break here will go back to normal as soon as
you refresh the page you're on!
</li>
<li>Paste the utility into the console
<ul>
<li><b class="codeFont">ctrl + v</b> <i>or</i></li>
<li><b class="codeFont">right click + paste</b></li>
</ul>
</li>
<li>Press <b class="codeFont">enter</b> to run the utility</li>
<li>This should download a backup file on your computer that you can upload to the tech tree maker!
</li>
</ol>
</div>
</div>
</div>
<div id="settingsModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2>Settings</h2>
</div>
<div class="modal-body">
<label>
Screenshot mode
<input type="checkbox" name="screenshotMode" autocomplete="off">
</label>
<p>Thumbnail image style:</p>
<label>
Fit below name
<input type="radio" name="thumbnailStyle" value="0" autocomplete="off" checked>
</label>
<label>
Fit full tile
<input type="radio" name="thumbnailStyle" value="1" autocomplete="off">
</label>
<label>
Stretch full tile
<input type="radio" name="thumbnailStyle" value="2" autocomplete="off">
</label>
<p>Vehicle badge layout:</p>
<label>
Default
<input type="radio" name="badgeStyle" value="0" autocomplete="off" checked>
</label>
<label>
Faithful
<input type="radio" name="badgeStyle" value="1" autocomplete="off">
</label>
</div>
</div>
</div>
<span id="techTreeHint">Hint: You can insert <b class="codeFont">///</b> into branch header to break the
line.</span>
<div id="techTreeWrapper">
<div id="techTree"></div>
</div>
<footer>
<div>
<a href="https://github.com/przemyslaw-zan/WT-Tech-Tree-Maker" target="_blank">
<b>Github</b>
<img src="./images/github.png">
</a>
<i>See source code</i>
</div>
<div>
<a href="https://www.reddit.com/user/zanju13" target="_blank">
<b>Reddit</b>
<img src="./images/reddit.png">
</a>
<i>Contact tool developer</i>
</div>
<div>
<a href="https://zanju.neocities.org/" target="_blank">
<b>Examples</b>
<img src="./images/ribbon.png">
<!-- https://icons-for-free.com/ribbon+icon-1320087269980093187/ -->
</a>
<i>See works of others</i>
</div>
</footer>
<div id="vehicleDisplayModal" class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close">×</span>
<h2 id="modal_title"></h2>
</div>
<div class="modal-gallery">
<div class="galleria" id="galleria"></div>
</div>
<div class="modal-body" id="modalDesc"></div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.js"
integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.6.1/galleria.min.js"></script>
<script src="https://cdn.ckeditor.com/4.16.1/standard/ckeditor.js"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
<script src="template.js"></script>
<script src="script.js"></script>
</body>
</html>