-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
324 lines (274 loc) · 13 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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/map.css">
<link rel="stylesheet" type="text/css" href="css/menu.css">
<link rel="stylesheet" type="text/css" href="css/element.css"> <!-- Icons ajustment -->
<link rel="stylesheet" type="text/css" href="css/faction.css">
<link rel="stylesheet" type="text/css" href="css/fog.css">
<link rel="stylesheet" type="text/css" href="css/border.css">
<link rel="stylesheet" type="text/css" href="css/contextMenu.css">
<link rel="stylesheet" type="text/css" href="css/checkbox.css">
<link rel="stylesheet" type="text/css" href="css/font.css">
<link rel="stylesheet" type="text/css" href="css/pics.css"> <!-- Font -->
<link rel="stylesheet" type="text/css" href="css/plugin.css">
<link rel="icon" type="image/png" sizes="96x96" href="font-icons/favicon.png"> <!-- Favicon -->
<!-- Plugins -->
<script type="text/javascript" src="plugin/jquery.3.2.1.js"></script>
<script type="text/javascript" src="plugin/jquery.ddslick.min.js"></script>
<script type="text/javascript" src="plugin/interact.js"></script>
<link rel="stylesheet" type="text/css" href="plugin/tooltipster/tooltipster.bundle.css" />
<script type="text/javascript" src="plugin/tooltipster/tooltipster.bundle.js"></script>
<link rel="stylesheet" type="text/css" href="plugin/farbtastic/farbtastic.css" />
<script type="text/javascript" src="plugin/farbtastic/farbtastic.js"></script>
<!-- Plugins -->
<script type="text/javascript" src="js/jsExt.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/map.js"></script>
<script type="text/javascript" src="js/menu.js"></script>
<script type="text/javascript" src="js/tooltip.js"></script>
<script type="text/javascript" src="js/interact.js"></script>
<script type="text/javascript" src="js/ddslick.js"></script>
<script type="text/javascript" src="js/contextMenu.js"></script>
<script type="text/javascript" src="js/faction.js"></script>
<script type="text/javascript" src="js/fileOpen.js"></script>
<script type="text/javascript" src="js/fileSave.js"></script>
<script type="text/javascript" src="js/element.js"></script>
</head>
<body>
<ul id="filelist"></ul>
<div class="img">
<img src="images/map.png" class="background" />
</div>
<div id="player"></div>
<!-- layer on the map when we do stuff -->
<div class="editorBackground"></div>
<!-- Right click menu -->
<ul class='custom-menu menu contextMenu'></ul>
<ul class='sub-custom-menu menu contextMenu'></ul>
<!-- Open / Create a map -->
<div class="openOrCreateMap hide menu hideableMenu">
<div class="newMap" onclick="createNew()">
<div class="file gimmeSpace icon-map-new bigIcon newMap" title="Create a new map"></div>
<input id="createNew" class="hide" type="file" value="data/empty.map" />
</div>
<div class="openMap">
<div class="file gimmeSpace icon-map-load bigIcon openMap" title="Load existing map" onclick="loadFile()"></div>
<input id="openData" class="hide" type="file" />
</div>
</div>
<!-- Edit element -->
<div class="editMapDecoration menu hide inFront hideableMenu">
<input id="decorationToChange" style="display:none" />
<select id="editDecorationDdlType" class="decorationType decorationDdl gimmeSpace"></select>
<select id="editDecorationDdl" class="decorationDdl gimmeSpace"></select>
<div class="field gimmeFullSpace">
<input id="titleMapDecoration" />
</div>
<div class="field gimmeFullSpace">
<i class="icon-faction"></i>
<select id="editDecorationDdlFaction" class="decorationFaction decorationDdl gimmeSpace"></select>
</div>
<div class="gimmeFullSpace fr">
<input type="button" class="save" value="Save changes" onclick="editElement()" />
</div>
<div class="gimmeFullSpace">
<i class="icon icon-delete deleteDecoration" onclick="deleteElement()"></i>
</div>
</div>
<!-- Add element -->
<div class="addElement menu hide hideableMenu">
<select id="decorationDdlType" class="decorationType decorationDdl"></select>
<select id="decorationDdl" class="decorationDdl"></select>
<div class="field gimmeFullSpace">
<input id="addTitleMapDecoration" class="inputStyling elementName" placeholder="Element Name"/>
</div>
<div class="field gimmeFullSpace">
<i class="icon-faction"></i>
<select id="decorationDdlFaction" class="decorationFaction decorationDdl gimmeSpace"></select>
</div>
<input id="addClassMapDecoration" class="hide" value="tooltip tap-target draggable inFront" />
<div class="gimmeFullSpace">
<input type="button" value="Create element" onclick="createDecoration()" />
</div>
</div>
<!-- Color Picker -->
<div class="colorPicker hide menu hideableMenu">
<div class="testBkg">
<div class="villagePicker icon-village demoVillage"></div>
<svg class="border ne" style="top:6px; left:15px">
<polygon class="demoBorder" points="115,1 229,67 229,69 113,2" style="fill:rgb(0, 0, 0)" /></polygon>
</svg>
<svg class="border e" style="top:6px; left:15px">
<polygon class="demoBorder" points="229,67 229,200 227,201 227,66" style="fill:rgb(0, 0, 0)"></polygon>
</svg>
<svg class="border se" style="top:6px; left:15px">
<polygon class="demoBorder" points="229,200 115,264 113,263 229,198" style="fill:rgb(0, 0, 0)"></polygon>
</svg>
<svg class="border sw" style="top:6px; left:15px">
<polygon class="demoBorder" points="115,264 1,200 1,198 117,263" style="fill:rgb(0, 0, 0)"></polygon>
</svg>
<svg class="border w" style="top:6px; left:15px">
<polygon class="demoBorder" points="1,200 1,67 3,66 3,201" style="fill:rgb(0, 0, 0)"></polygon>
</svg>
<svg class="border nw" style="top:6px; left:15px">
<polygon class="demoBorder" points="1,67 115,1 117,2 1,69" style="fill:rgb(0, 0, 0)"></polygon>
</svg>
</div>
<input id="demoPicker" class="hide" />
<div id="colorPicker"></div>
<label id="factionName" class="hide"></label>
<div class="field gimmeFullSpace">
<i class="icon-faction"></i>
<select id="editFactionDdlFaction" class="decorationFaction decorationDdl gimmeSpace"></select>
</div>
<div class="gimmeFullSpace">
<button onclick="saveColor()">Save color</button>
</div>
</div>
<!-- Left menu -->
<div class="menu wrapper wrapperLeft">
<!-- Save Map -->
<div>
<div class="gimmeFullSpace">
<i class="icon-download saveTitle"></i>
<label class="title">Save map</label>
</div>
<div class="saveMap">
<div class="file centerSave icon-map-save bigIcon" title="Save current map" onclick="saveFile()"></div>
<input id="saveData" class="hide" />
</div>
</div>
<!-- Config -->
<hr>
<div class="gimmeFullSpace">
<i class="icon-gear"></i>
<label class="title factionTitle">Config</label>
<div class="slidecontainer">
<label class="subtitle">Fog opacity</label>
<input class="fogOpacity" type="range" min="0" max="1" step="0.01" value="0.90" onchange="changeFogOpacity()">
</div>
<div class="slidecontainer">
<label class="subtitle">Menu opacity</label>
<input class="menuOpacity" type="range" min="0" max="1" step="0.01" value="0.80" onchange="changeMenuOpacity()">
</div>
<div>
<label class="subtitle">Hex number</label>
<div>
<input type="radio" id="narl" name="hexNumber" value="narl" checked onclick="displayHexNumber('narl');">
<label for="narl" class="subtitle">Narl</label>
<input type="radio" id="all" name="hexNumber" value="all" onclick="displayHexNumber('all');">
<label for="all" class="subtitle">All</label>
</div>
</div>
</div>
<!-- About -->
<hr>
<div class="gimmeFullSpace">
<div class="askQuestion" onclick="displayQuestion();">
<i class="icon-question"></i>
<label class="title factionTitle">About</label>
</div>
</div>
</div>
<!-- Right menu -->
<div class="menu wrapper wrapperRight">
<!-- Checkbox displayer -->
<div class="displayer">
<div class="gimmeFullSpace">
<i class="icon-visibility visibilityTitle"></i>
<label class="title">Visibility</label>
</div>
<div class="gimmeOtherSpace">
<label for="building" class="container elementType">Buildings
<input id="building" type="checkbox" name="display-building" checked="checked" />
<span class="checkmark"></span>
</label>
</div>
<div class="gimmeOtherSpace">
<label for="resources" class="container gimmeOtherSpace elementType">Resources
<input id="resources" type="checkbox"name="display-resources" checked="checked" />
<span class="checkmark"></span>
</label>
</div>
<div class="gimmeOtherSpace">
<label for="armies" class="container gimmeOtherSpace elementType">Armies
<input id="armies" type="checkbox" name="display-armies" checked="checked"/>
<span class="checkmark"></span>
</label>
</div>
<div class="gimmeOtherSpace">
<label for="misc" class="container gimmeOtherSpace elementType">Misc
<input id="misc" type="checkbox" name="display-misc" />
<span class="checkmark"></span>
</label>
</div>
</div>
<hr>
<!-- Factions -->
<div>
<div class="gimmeFullSpace">
<i class="icon-faction"></i>
<label class="title">Factions</label>
</div>
<!-- This will contains the factions information -->
<div class="factions"></div>
<div>
<div>
<i class="icon-add add" onclick="addFaction()"></i>
</div>
<div class="gimmeSpaceButTop">
<input type="text" class="factionBox inputStyling" style="background-color:white" disabled />
<input type="text" class="factionName inputStyling correctPos newFactionName" placeholder="Add faction" />
</div>
</div>
</div>
</div>
<div class="question menu hide hideableMenu">
<p class="gimmeFullSpace">
Map done by <a href="https://www.deviantart.com/jonpintar" target="_blank">Jon Pintar</a>.
</p>
<p class="gimmeFullSpace">
Check the code on my <a href="https://github.com/daviddechaux/Kingmaker" target="_blank">Github</a>.
</p>
<p class="gimmeFullSpace">
GDPR stuff : I don't care about your personnal information. No cookie on this website.
</p>
</div>
<div class="mapDecoration">
</div>
<input id='file-input' type='file' multiple>
</body>
<script>
$(document).ready(function () {
idElement = 1;
idSelectedElement = 0;
isMapLoaded = false;
elementType = ["building", "resources", "misc", "armies"];
factions = [];
createPos = {x:0, y:0};
// Checkbox
displayElement("building");
displayElement("resources");
displayElement("misc");
displayElement("armies");
// interactjs
dragAndDrop();
tapTarget();
// Display OpenCreate map
displayMapOpenner();
$(window).resize(function () {
displayMapOpenner();
});
$(window).scroll(function () {
displayMapOpenner();
});
// Dropdownlists
displayNiceDropdownList();
$(".editorBackground").show();
$(".wrapper").hide();
// Contextmenu
bindMenu();
});
</script>
</html>