-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
308 lines (304 loc) · 19.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
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Card Creator</title>
<meta charset="utf-8" />
<link rel="stylesheet" href="./assets/css/main.css" />
<link rel="stylesheet" href="./assets/css/icons.css" />
<meta name="viewport" content="initial-scale=0.6, minimum-scale=0.6, maximum-scale=0.6" /> <!-- yeah i know -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&family=PT+Sans+Narrow:wght@400;700&display=swap" rel="stylesheet" crossorigin="anonymous">
</head>
<body>
<!-- header -->
<div class="header centered">
<button class="save big">Save Card</button>
<label for="loadUpload" id="loadUploadButton" class="button big">Load Card</label>
<button id="render" class="big">Render Image</button>
</div>
<div class="flex" style="justify-content:center;column-gap:16px;row-gap:16px">
<!-- left box -->
<div id="card-container">
<div class="title shadowed" data-tooltip="The name of the card." data-tooltip-pos="l" data-tooltip-x="155px" data-tooltip-y="60px">
<div contenteditable="true">Sherlock Holmes</div>
</div>
<div class="color shadowed" contenteditable="true"
data-tooltip="Explicit card color, for colorblind players and rule resolution." data-tooltip-pos="r" data-tooltip-x="6px" data-tooltip-y="60px">GREEN</div>
<div class="image-container"><label for="portraitUpload" class='image'></label></div>
<div class="topBox flex">
<div>
<div id="franchise" class="fr" contenteditable="true"
data-tooltip="The franchise this card belongs to."
data-tooltip-pos="l" data-tooltip-x="20px" data-tooltip-y="100px">Sherlock Holmes</div>
</div>
<div class="typeContainer">
<div class="typeTitle shadowed" contenteditable="true">Character</div>
<label for="typeUpload" class="type"></label>
</div>
</div>
<div class="stats box">
<span class="a"><span class="icon atk"></span><span contenteditable='true'>4</span></span> <span class="d"><span contenteditable='true'>5</span> <span class="icon def"></span></span>
</div>
<div class="tags box"
data-tooltip="Press "Add Tag" to add a tag. Delete a tag by deleting all the text in it."
data-tooltip-pos="r" data-tooltip-x="195px" data-tooltip-y="135px" data-tooltip-w="250px">
</div>
<button id="addTag">Add Tag</button>
<div class="hidden" id="cheatsheet">
<div class="flex" style="justify-content:space-between;flex-wrap:nowrap">
<div class="flex column">
<p><span class="icon target"></span> [TARGET]<span class="small"> Card must target</span></p>
<p><span class="icon search"></span> [SEARCH]<span class="small"> Search for card</span></p>
<p><span class="icon commander"></span> [COMMANDER]<span class="small"> Effects in commander slot</span></p>
<p><span class="icon energy"></span> [ENERGY]<span class="small"> Energy</span></p>
<p><span class="icon addon"></span> [+]<span class="small"> Additional effect<span class="small"> (Will indent)</span></span></p>
<p><span class="icon atk"></span> [ATK] <span class="icon def"></span> [DEF]</p>
<p class="small" style="margin-left:6ch"> Do +[ATK]#</p>
<p><span class="icon turn"></span> [TURN] <span class="icon token"></span> [TOKEN]</p>
<p><span class="icon faction"></span> [FACTION]</p>
<p><span class="icon item"></span> [ITEM] <span class="icon equip"></span> [EQUIP]</p>
<p><span class="icon character"></span> [CHARACTER]</p><p><span class="icon engine"></span> [ENGINE]</p>
<p><span class="icon instant"></span> [INSTANT] <span class="icon react"></span> [REACT]</p>
<p><span class="icon location"></span> [LOCATION]</p>
</div>
<div class="flex column" style="text-align: right;">
<p><span class="icon die"></span> [DIE]<span class="small"># Roll dice, on # result.<br/><span class="small">(Try [DIE]1-4 or [DIE]<6)</span></span></p>
<p></p>
<p><span style="color:red">#</span>Effect Name<span style="color:red">:</span><span class="small"> It must have the colon!</span></p>
<p><span style="color:red">**</span>Markdown-style BOLD text.<span style="color:red">**</span></p>
<p><span style="color:red">></span>Flavor text blocks<br/><span class="small"> start with a greater-than.</span></p>
<p>Start a line with a space to<br/>super-indent it.</span></p>
<p></p>
<p><span style="color:red">[</span>Tags<span style="color:red">]</span></p>
<p><span style="color:red">{</span>A Franchise<span style="color:red">}</span></p>
<p><span style="color:red">((</span>A Character's Name<span style="color:red">))</span></p>
</div>
</div>
</div>
<div class="bottom">
<style id="desc" scoped>.description > div > div{margin-top:5px;min-height:0.25em;}</style>
<div class="description box"><div><div><span class="bold">Perception:</span> When this card defends successfully, gain 1 <span class="icon token"></span><span class="bold">Clue</span>.</div><div class="centered flavor">Holmes is incredibly observant, moreso than his enemies tend to think.</div><div></div><div><span class="bold">Elementary:</span></div><div class="flex"><span class="icon addon"></span><div>Spend <span class="icon token"></span><span class="bold">Clues</span> equal to opposing card's <span class="icon def"></span>: Discard target immediately.</div></div><div></div><div><span class="bold">Mortal Enemy:</span></div><div class="indented"><div>+<span class="icon atk"></span>2 VS <span class="char">Professor James Moriarty</span> <span class="fr">Sherlock Holmes</span>.</div></div><div class="indented"><div>+<span class="icon atk"></span>1 VS other <span class="t">Criminal</span>s and <span class="t">Mastermind</span>s.</div></div></div></div>
<div class="quote box" contenteditable="true">No man burdens his mind with small matters unless he has some very good reason for doing so.</div>
</div>
<textarea class="hidden" id="markup">#Perception: When this card defends successfully, gain 1 [TOKEN]**Clue**.
>Holmes is incredibly observant, moreso than his enemies tend to think.
#Elementary:
[+]Spend [TOKEN]**Clues** equal to opposing card's [DEF]: Discard target immediately.
#Mortal Enemy:
+[ATK]2 VS ((Professor James Moriarty)) {Sherlock Holmes}.
+[ATK]1 VS other [Criminal]s and [Mastermind]s.</textarea>
<time class="date" datetime="2023-03-28"
data-tooltip="Today's date. This is used to resolve card differences. You can't edit this: we update it automatically for you when you save new versions of cards." data-tooltip-pos="l" data-tooltip-x="6px" data-tooltip-y="530px" data-tooltip-w="260px">2023-03-28</time>
<div class="limit"
data-tooltip="The maximum number of this type of card allowed in a deck." data-tooltip-pos="l" data-tooltip-x="130px" data-tooltip-y="545px" data-tooltip-w="200px">
<div class="i"></div><div contenteditable="true">3</div></div>
<select id="rarity"
data-tooltip="The rarity of this card." data-tooltip-pos="r" data-tooltip-x="6px" data-tooltip-y="600px">
<option value="-1"></option>
<option value="0" selected>Common</option>
<option value="1">Uncommon</option>
<option value="2">Rare</option>
<option value="3">Epic</option>
<option value="4">Legendary</option>
</select>
<div id="tooltip" class="hidden"></div>
</div>
<!-- Right box-->
<div id="form-container" class="container flex column centered">
<div>
<h3>Import Images</h3>
<div class="hidden imageButtons">
<p>Click the button or drag an image onto it.</p>
<div class="flex">
<div>
<label class="button" for="portraitUpload" id="portraitInForm"><span class="middle">Portrait</span></label>
<button>Download</button>
</div>
<div>
<label class="button" for="bgUpload" id="bgInForm"><span class="middle">Background</span></label>
<button>Download</button>
</div>
</div>
</div>
</div>
<div>
<h3>Change Card Type</h3>
<div class="hidden icon-gallery">
<p><img src="/card-creator/assets/dark/character.svg" alt="Character"/>Character</p>
<p><img src="/card-creator/assets/dark/instant.svg" alt="Instant" />Instants</p>
<p><img src="/card-creator/assets/dark/item.svg" alt="Item"/>Items</p>
<p><img src="/card-creator/assets/dark/react.svg" alt="Reaction"/>Reactions</p>
<p><img src="/card-creator/assets/dark/equip.svg" alt="Equip"/>Equipment</p>
<p><img src="/card-creator/assets/dark/location.svg" alt="Location"/>Locations</p>
<p><img src="/card-creator/assets/dark/engine.svg" alt="Engine"/>Engines</p>
</div>
</div>
<div>
<h3>Align Images</h3>
<div class="flex hidden">
<div class="portrait-alignment-box">
<h3>Portrait</h3>
<div class="XY" id="portraitXY"><span class="dot middle"></span></div>
<button class="reset">Center</button>
</div>
<div>
<h3>BG</h3>
<div class="XY" id="bgXY"><span class="dot middle"></span></div>
<button class="reset">Center</button>
</div>
</div>
</div>
<div>
<h3>Toggles</h3>
<div class="flex hidden small">
<div>
<p>Dark mode</p>
<input type="checkbox" class="darkMode"/>
</div>
<div>
<p>ATK/DEF</p>
<input type="checkbox" id="noStats" checked="true"/>
</div>
<div>
<p>Portrait</p>
<input type="checkbox" id="noPortrait" checked="true"/>
</div>
</div>
</div>
<div>
<h3>Card Appearance</h3>
<div class="hidden">
<input type="color" value="#447138"/>
<input data-rgb='r' id="rgbR" type="number" min="0" max="255" value="68" step="1" />
<input data-rgb='g' id="rgbG" type="number" min="0" max="255" value="113" step="1" />
<input data-rgb='b' id="rgbB" type="number" min="0" max="255" value="56" step="1" />
<div class="flex small">
<div>
<p>Desc font size:</p>
<input id="font" type="number" min="0" value="14" step="0.1"/>pt
</div>
<div>
<p>Tag font size:</p>
<input id="tagFont" type="number" min="0" value="14" step="0.1"/>pt
</div>
<div>
<p>Title Squish:</p>
<p><input type="number" id="squish" value="100" min="0" />%</p>
<!-- <button id="scrollReset">Reset Title Scroll</button> -->
</div>
</div>
<div class="flex small">
<div>
<p>Height of an<br/>empty line:</p>
<p><input id="divMinHeight" type="number" min="0" max="100" value="25" step="1"/>%</p>
<p class="small">(Relative to the height<br/>of a line with text in it)</p>
</div>
<div>
<p>Space between<br/>lines:</p>
<p><input type="number" id="divMargins" value="5" min="0" />px</p>
</div>
</div>
<div class="small">
<p class="bold" style="margin-bottom:0;">Additional Padding:</p>
<div class="flex" style="margin:0;">
<div style="margin:0;">
<p>Vertical Padding</p>
<input type="number" id="vpad" value="8" min="0" />px
</div>
<div style="margin:0;">
<p>Horizontal Padding</p>
<input type="number" id="hpad" value="8" min="0" />px
</div>
</div>
<p class="small">For small cards: turn these up to pad out the sides of the description box.</p>
</div>
<div>
<p>Portrait height:</p>
<input type="number" id="portraitHeight" value="2.6" min="0.1" step="0.1" /><span class="small"> inches</span>
</div>
</div>
</div>
<div>
<button id="defaults" class="big">Reset to defaults<div style='font-size:0.5em;margin:2px 0'>(except for color)</div></button>
</div>
</div>
</div>
<!-- Hidden inputs -->
<div class="no">
<input type="file" name="typeUpload" id="typeUpload" accept="image/*"/>
<input type="file" name="portraitUpload" id="portraitUpload" accept="image/*" />
<input type="file" name="bgUpload" id="bgUpload" accept="image/*" />
<input type="file" name="loadUpload" id="loadUpload" accept=".card,application/json" />
</div>
<div id="changelog">
<h3>Changelog</h3>
<time datetime="2023-04-19">2023-04-19</time>
<ul>
<li>The "space between lines" no longer affects the top of the first line.</li>
</ul>
<time datetime="2023-04-17">2023-04-17</time>
<ul>
<li>Completely rewrote the parser to be more secure and easier to edit/add on to in the future.</li>
<li>Regular indentations should make more sense. This is a <b>Breaking Change,</b> but only in the sense that you won't have to do 5 spaces at the start of a line to get 2 indents in anymore, just 2 spaces. Backwards compatibility will not save you.</li>
<li>Indentations for addon text should make more sense. It no longer automatically indents. This is a <b>Breaking Change!</b> If your addon lines look too far to the left, just add an indent on that line.</li>
<li>Flavor text is now signified with a line starting with <code>></code> instead of <code>*</code>. This is a <b>Breaking Change!</b> The loader should apply backwards compatibility automatically for you.</li>
</ul>
<time datetime="2023-04-10">2023-04-10</time>
<ul>
<li>You can now drag a .card file onto the "Load Card" button to load it.</li>
</ul>
<time datetime="2023-04-09">2023-04-09</time>
<ul>
<li>Added some error messages when CORS errors get thrown.</li>
</ul>
<time datetime="2023-04-08">2023-04-08</time>
<ul>
<li><a href="./playground/">Playground</a> Alpha, a way to mess with how cards will appear on the placemat.</li>
<li>Fixed <span class="icon character"></span> not appearing correctly on light mode cards.</li>
</ul>
<time datetime="2023-04-07">2023-04-07</time>
<ul>
<li>I changed the highlight on auxiliary stats (card limit, date, rarity) in an attempt to make it look better. This might not render right on mobile, but who cares.</li>
<li>Fixed card limit not being rendered right when exporting to PNG.</li>
<li>Fixed missing [TURN] icon on light mode cards.</li>
<li>Fixed the cheatsheet being unreadable.</li>
</ul>
<time datetime="2023-04-04">2023-04-04</time>
<ul>
<li>Fixed an issue with loading portraits.</li>
<li>Fixed some weirdness with saving image positions.</li>
<li>Modals now appear onscreen properly.</li>
<li>Tags are now 12pt by default.</li>
<li>You can now change the size of tags.</li>
</ul>
<time datetime="2023-04-03">2023-04-03</time>
<ul>
<li>Fixed an issue with rendering < and > characters.</li>
<li>Added new card icon <span class="icon die"></span>.</li>
<li>Added new card icon <span class="icon energy"></span> and new card type <span class="icon engine"></span>.</li>
<li>[BUG] The color detector will no longer override saved color values.</li>
<li>[BUG] Vertical padding was not being restored correctly on card load.</li>
<li>[BUG] Portraits were only being saved if portraits were *off*, not on. Whoops. Fixed.</li>
<li>Color detection is now more nuanced. (Dark colors no longer get detected as "Black")</li>
<li>[Minor] [Bug] Portrait alignment doesn't show up anymore when portrait is disabled, as was intended.</li>
<li>Added changelog.</li>
<li>Added a button to reset the alignment of images.</li>
<li>Cards no longer save the portrait image if the portrait image is disabled. (This makes .card files smaller.)</li>
</ul>
<time datetime="2023-04-02">2023-04-02</time>
<ul>
<li>Added deferred asynchronous save/load system. This should theoretically make the CPU usage lighter and less likely to bottleneck on low power machines.</li>
<li>Added an icon for the "Commander" card type.</li>
<li>Added an icon for "Search your deck" card effects.</li>
</ul>
</div>
<script src="./assets/js/helperfuncs.js"></script>
<script async src="./assets/js/html-to-image.js"></script>
<script async src="./assets/js/upload.js"></script>
<script async src="./assets/js/parser.js"></script>
<script async src="./assets/js/other.js"></script>
<script async src="./assets/js/saveload.js"></script>
<script async src="./assets/js/render.js"></script>
</body>
</html>