-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
295 lines (276 loc) · 9.23 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
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>D4LF Filter Editor</title>
<link rel="stylesheet" href="./css/normalize.css"
media="screen"/>
<link rel="stylesheet" href="./css/sakura.css" media="screen"/>
<link rel="stylesheet" href="./css/main.css" media="screen"/>
<script src="./js/_versions.js"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"
integrity="sha512-CSBhVREyzHAjAFfBlIBakjoRUKp5h7VSweP0InR/pAJyptH7peuhCsqAI/snV+TwZmXZqoUklpXp6R6wMnYf5Q=="
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"
integrity="sha512-Qlv6VSKh1gDKGoJbnyA5RMXYcvnpIqhO++MhIM2fStMcGT9i2T//tSwYFlcyoRRDcDZ+TYHpH8azBBCyhpSeqw=="
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
</head>
<body>
<h1 id="header">
<a href="index.html">
Diablo 4 Loot Filter Editor
</a>
</h1>
<div id="start">
<div>
<p id="explain">
A simple tool to open up <code>.yaml</code> filters for
<a href="https://github.com/d4lfteam/d4lf"
target="_blank">D4LF</a>
and edit them visually.
</p>
</div>
<div class="buttons">
<a onclick="to_editor(new_filter)">
New Filter
</a>
<a onclick="to_editor(existing_filter)">
Open Existing Filter
</a>
<a href="guide.html"
class="smaller">
Usage Guide
</a>
<a href="https://github.com/d4lfteam/d4lf#gui"
class="smaller"
target="_blank">
How to Import a Build
</a>
</div>
<div>
<p id="locate">
Your existing filters can be found in <code>%userprofile%/.d4lf/profiles</code>.
<br>
<small style="font-size: 65%;">
Only <code>Uniques</code> and <code>Affixes</code>
sections are supported, with 1 item type per filter, and 1 filter per gear
slot.
</small>
</p>
</div>
<h4>Pre-Made Filters</h4>
<div class="buttons muted">
<a href="/premade_filters/sigils.yaml" class="smaller" download>
Maxroll Top Sigils Filter
</a>
<a href="/premade_filters/3greater.yaml" class="smaller" download>
3 or more Greater Filter
</a>
</div>
</div>
<div id="editor" style="display:none">
<!--region Filter templates-->
<div id="base-filter" style="display: none">
<div>
<!--region Title, MinPower-->
<div style="line-height: 1.75em">
<u>Unknown Item</u>
<label style="float: right" data-key="minPower">
<small>Minimum Power </small>
<input type="number" min="0" max="800"
style="width: 4em; padding: 2px 6px" value="0">
</label>
</div>
<!--endregion-->
<!--region ItemType-->
<label class="select-item-type" style="display: none"
data-key="itemType">
<small>Item Type</small>
<select class="item-list" style="float: right"
onchange="toggle_unique_or_item($(this))">
<option value="" selected></option>
</select>
</label>
<!--endregion-->
<!--region Unique-->
<label class="unique-selection" data-key="aspect">
<small>Unique?</small>
<select class="unique-list"
style="float: right;width:16em"
onchange="toggle_unique_or_item($(this));toggle_unique_aspect($(this))">
<option value="" selected>No</option>
</select>
</label>
<!--endregion-->
<!--region Unique Aspect Comparison/Value-->
<label class="unique-roll" style="display: none"
data-key="aspect-value">
<small>Minimum Unique Aspect roll</small>
<input type="number" min="0" max="3000"
style="width:4em;padding: 2px 6px 3px;
border-top-left-radius:0;
border-bottom-left-radius: 0;" value="0">
<span class="comparison button" data-current="larger"
data-key="aspect-comparison"
onclick="change_comparison($(this))"
style="float: right">
❯
</span>
</label>
<!--endregion-->
<!--region Affixes-->
<div class="affix-group" data-key="affixPool">
<!--region MinGreaterAffixCount-->
<label data-key="minGreaterAffixCount">
<small>Minimum Greater Affixes from Below</small>
<input type="number" min="0" max="5" value="0">
</label>
<!--endregion-->
<!--region minCount-->
<label data-key="minCount">
<small>Minimum Affixes from Below</small>
<input type="number" min="0" max="5" value="0">
</label>
<!--endregion-->
<!--region Affix Adding-->
<label>
<small>Add desired</small>
<select class="affix-list">
<option value="" selected disabled hidden>
Affix
</option>
</select>
<button onclick="add_affix($(this).parent())">Add
</button>
</label>
<!--endregion-->
<small class="affixes" data-key="count">
<!-- Affixes will be added here -->
</small>
</div>
<!--endregion-->
</div>
</div>
<div id="blank" style="display: none">
<div style="height: 1px" ignore></div>
</div>
<!--region Affix Template-->
<code id="base-affix" style="display: none"
data-key="error_affix">
<p class="affix">
unknown affix
</p>
<span class="comparison button" data-current="larger"
data-key="affix-comparison"
onclick="change_comparison($(this))">
❯
</span>
<input type="number" min="0" max="3000" value="0"
data-key="affix-value">
<span class="state button" data-current="one-of"
title="Any of these affixes, according to the Minimum count, can be present"
data-key="affix-pooling"
onclick="change_affix_state($(this))">
•
</span>
<span class="close"
onclick="$(this).parent().remove()"></span>
</code>
<!--endregion-->
<span id="base-unique-close" class="close"
onclick="$(this).parent().parent().remove()"
style="display:none;padding-right:10px"></span>
<!--region Unique Move Template-->
<span id="base-unique-move" class="move"
style="display:none;position:absolute;top:-22px">
<small style="padding:0 2px;background:#222">
Move
<select class="move-to" style="width: 5em;padding: 2px 5px"
onchange="move_unique($(this))">
<option value="" selected disabled>To ...</option>
<option value="helm">Helm</option>
<option value="chest">Chest</option>
<option value="gloves">Gloves</option>
<option value="pants">Pants</option>
<option value="boots">Boots</option>
<option value="main_hand">Main-Hand</option>
<option value="off_hand">Off-Hand</option>
<option value="left_hand">Left-Hand</option>
<option value="right_hand">Right-Hand</option>
<option value="amulet">Amulet</option>
<option value="ring">Ring</option>
<option value="other_ring">Other Ring</option>
</select></small></span>
<!--endregion-->
<!--endregion-->
<div id="filters">
<!-- Filters will be added here -->
<!--region Editor Controls-->
<div id="controls" ignore>
<br>
<br>
<a class="button"
href="https://github.com/d4lfteam/d4lf/blob/main/assets/lang/enUS/affixes.json"
target="_blank">Open Affix List</a>
<br>
<button onclick="to_home()">Restart</button>
<br>
<button onclick="save_filter()">Save</button>
</div>
<div id="uniques" ignore>
<br>
<br>
<h3>Extra Uniques</h3>
<br>
<button onclick="add_unique()">Add</button>
<br>
<a class="button"
href="https://github.com/d4lfteam/d4lf/blob/main/assets/lang/enUS/uniques.json"
target="_blank">Open Unique List</a>
</div>
<!--endregion-->
</div>
</div>
<div id="footer">
<!--region Debugging YAML-->
<!--
<hr><br>
<div
style="display:grid;grid-template-columns:1fr 1fr;grid-template-rows: 220px 1fr;">
<pre id="og-json"
style="text-align:left;max-height:200px"></pre>
<pre id="ns-json"
style="text-align:left;max-height:200px"></pre>
<pre id="og-yaml"
style="text-align:left;max-height:200px"></pre>
<pre id="ns-yaml"
style="text-align:left;max-height:200px"></pre>
</div>
-->
<!--endregion-->
<hr>
<small>
Version <code class="version"></code>.
Made by <a href="https://zbee.codes" target="_blank">zbee</a>
2024.
Code available on
<a href="https://github.com/zbee/d4lf-editor"
target="_blank">GitHub</a>.
<br>
Updated for <a href="https://github.com/d4lfteam/d4lf"
target="_blank">D4LF</a>
<code class="supported-d4lf"></code>.
</small>
</div>
</body>
<script src="./js/_selectors.js"></script>
<script src="./js/editor.js"></script>
</html>