-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
172 lines (172 loc) · 9.48 KB
/
index.html
File metadata and controls
172 lines (172 loc) · 9.48 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SwornForge</title>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="vanillaui.css">
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
<script src="engine.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js" integrity="sha512-BNaRQnYJYiPSqHHDb58B0yaPfCu+Wgds8Gp/gU33kqBtgNS4tSPHuGibyoeqMV/TJlSKda6FXzoEyYGjTe+vXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</head>
<body>
<div
class="sworn-forge-asset-creator"
x-data="swornForgeAssetCreator()"
x-init="transformers.italicizeMoveNames()">
<div class="controls">
<fieldset>
<legend>Asset Options</legend>
<label>
<span>Asset Name</span>
<input type="text" x-model="options.assetName">
</label>
<label>
<span>Asset Description</span>
<input type="text" x-model="options.description">
</label>
<label>
<span>Include Name Fill-in</span>
<input type="checkbox" :checked="options.name" x-model="options.name">
</label>
<label>
<span>Include Health/Resource Track</span>
<input type="checkbox" :checked="options.track" x-model="options.track">
</label>
<label>
<span>Max Health/Resource</span>
<input type="number" min="1" :max="staticOptions.maxTrackSize" x-model.number="options.trackMax">
</label>
<label>
<span>Type</span>
<select x-model="options.type">
<template x-for="option in staticOptions.builtinTypes" :key="option">
<option x-text="option"></option>
</template>
</select>
</label>
<label x-show="options.type == 'Custom'">
<span>Custom Type Name</span>
<input type="text" x-model="options.customType">
</label>
<fieldset>
<legend>Fill-ins</legend>
<template x-for="(fillIn, index) in options.fillIns">
<fieldset>
<legend>Fill-in</legend>
<label class="control">
<span>Fill-in Title</span>
<input type="text" x-model="fillIn.title">
</label>
<button @click="options.fillIns.splice(index, 1)">Remove</button>
</fieldset>
</template>
<button @click="options.fillIns.push({title: 'Fill-in:'})">Add Fill-in</button>
</fieldset>
</fieldset>
<fieldset>
<legend>Power List</legend>
<template x-for="(power, index) in powers">
<fieldset>
<legend>Power</legend>
<label class="control">
<span>Power Title</span>
<input type="text" x-model="power.title">
</label>
<label class="control">
<span>Unlocked</span>
<input type="checkbox" x-model="power.unlocked">
</label>
<label class="control--vertical">
<span>Power Description</span>
<textarea x-model="power.description"></textarea>
</label>
<details>
<summary>Sub-powers / Options</summary>
<fieldset>
<legend>Sub-powers / Options</legend>
<template x-for="(subpower, index) in power.powers">
<fieldset>
<legend>Sub-power/Option</legend>
<label class="control">
<span>Subpower Title</span>
<input type="text" x-model="subpower.title">
</label>
<label class="control">
<span>Unlocked</span>
<input type="checkbox" x-model="subpower.unlocked">
</label>
<label class="control--vertical">
<span>Subpower Description</span>
<textarea x-model="subpower.description"></textarea>
</label>
<button x-on:click="power.powers.splice(index, 1)">Remove</button>
</fieldset>
</template>
<button @click="power.powers.push({title: 'New Subpower', unlocked: false, description: 'Something awesome that this subpower does.'})">Add Subpower</button>
</fieldset>
</details>
<label>
<span>Fill-in</span>
<input type="checkbox" x-model="power.fillin">
</label>
<label x-show="power.fillin">
<span>Fill-in Title</span>
<input type="text" x-model="power.fillinTitle">
</label>
<button x-on:click="powers.splice(index, 1)">Remove</button>
</fieldset>
</template>
<button @click="powers.push({title: 'New Power', unlocked: false, description: 'Something awesome that this power does.'})">Add Power</button>
</fieldset>
</div>
<div class="asset-card-wrapper">
<div class="asset-card-safety-zone">
<div class="asset-card" type="companion">
<div class="asset-card__header">
<p class="asset-card__type" x-text="options.type != 'Custom' ? options.type : options.customType">Companion</p>
<img class="asset-card__icon" />
</div>
<div class="asset-card__body">
<p class="asset-card__title" x-text="options.assetName">Cave Lion</p>
<template x-for="fillIn in options.fillIns">
<p class="asset-card__fillin-wrapper" x-text="fillIn.title"></p>
</template>
<div class="asset-card__description-wrapper" x-show="options.description !== ''">
<p x-text="options.description">Your cat takes down its prey.</p>
</div>
<ul class="asset-card__powers-list">
<template x-for="power in powers">
<li :class="{unlocked: power.unlocked}">
<strong x-text="power.title"></strong><span x-html="' ' +transformers.italicizeMoveNames(power.description, moves)"></span>
<ul x-show="power.powers.length > 0">
<template x-for="subpower in power.powers">
<li :class="{unlocked: subpower.unlocked}"><strong x-text="subpower.title"></strong><span x-html="' ' +transformers.italicizeMoveNames(subpower.description, moves)"></span></li>
</template>
</ul>
<br x-show="power.fillin">
<p class="asset-card__fillin-wrapper" x-show="power.fillin" x-text="power.fillinTitle"></p>
</li>
</template>
</ul>
<div x-show="options.track" class="asset-card__companion-track-wrapper">
<template x-for="i in Array.from({length: options.trackMax}, (v, k) => k)">
<p class="asset-card__companion-track-cell" x-text="'+' + i"></p>
</template>
<template x-for="6 in Array.from({length: staticOptions.maxTrackSize - options.trackMax}, (v, k) => k)">
<p class="asset-card__companion-track-cell-placeholder" data-html2canvas-ignore></p>
</template>
</div>
</div>
</div>
</div>
</div>
<div class="sworn-forge-download-container">
<button @click="methods.download(document.querySelector('.asset-card'))">Generate Image</button>
<div id="output"></div>
<p>Right-click to save or copy this image.</p>
</div>
</div>
</body>
</html>