This repository has been archived by the owner on Jul 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
card_json_form.html
250 lines (232 loc) · 11.2 KB
/
card_json_form.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
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<meta charset="utf-8">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.7/angular.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.control-label text-right {margin-bottom: 15px;}
.form-group {margin-bottom: 5px;}
</style>
</head>
<!-- I use this to quickly create valid json cards for tempinfo.json in spoiler season -->
<body>
<script>
var app = angular.module("app", []);
app.controller("ctrl", function ($scope) {
$scope.nameI = 'Target Dummy';
$scope.nameChanged = function () {
$scope.nameI = $scope.name ? $scope.name.replace(/:/g, '') : 'Target Dummy';
$scope.head = $scope.nameI.toLowerCase().replace(/ /g, '-').replace(/[',]/g , '');
$scope.headI = $scope.head;
};
$scope.manaI = 0;
$scope.manaChanged = function () {
$scope.manaI = $scope.mana === null ? 0 : $scope.mana;
};
$scope.atkI = 'null';
$scope.atkChanged = function () {
$scope.atkI = $scope.atk === null ? 'null' : $scope.atk;
};
$scope.hpI = 'null';
$scope.hpChanged = function () {
$scope.hpI = $scope.hp === null ? 'null' : $scope.hp;
};
$scope.descI = 'null';
$scope.descChanged = function () {
$scope.descI = ! $scope.desc ? 'null' : '"' + $scope.desc.replace(/"/g, '\\"') + '"';
};
$scope.cdnI = 'https://media-hearth.cursecdn.com/avatars/149/57/12288.png';
$scope.cdnChanged = function () {
$scope.cdnI = ! $scope.cdn ? 'https://media-hearth.cursecdn.com/avatars/149/57/12288.png' : $scope.cdn;
};
$scope.hpwnI = 12288;
$scope.hpwnChanged = function () {
$scope.hpwnI = $scope.hpwn === null ? 12288 : $scope.hpwn;
};
$scope.headI = 'target-dummy';
$scope.headChanged = function () {
$scope.headI = ! $scope.head ? 'target-dummy' : $scope.head;
};
$scope.subtypeI = 'null';
$scope.subtypeChanged = function () {
$scope.subtypeI = ! $scope.subtype ? 'null' : '"' + $scope.subtype + '"';
};
});
</script>
<div class="container" ng-controller="ctrl">
<div class="row">
<form class="form-horizontal">
<div class="form-group">
<label class="col-xs-2 control-label text-right">name</label>
<div class="col-xs-10">
<input type="text" class="form-control" ng-model="name" placeholder="name" ng-change="nameChanged()">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">Class</label>
<div class="col-xs-10">
<select ng-model="class" class="form-control" name="class" ng-init="class = 'Neutral'">
<option value="N">Neutral</option>
<option value="DR">Druid</option>
<option value="HT">Hunter</option>
<option value="MA">Mage</option>
<option value="PL">Paladin</option>
<option value="PR">Priest</option>
<option value="RO">Rogue</option>
<option value="SH">Shaman</option>
<option value="WL">Warlock</option>
<option value="WR">Warrior</option>
<option value="DH">Demon Hunter</option>
<option value="Dream">Dream</option>
<option value="Kabal (MPW)">Kabal (MPW)</option>
<option value="Lotus (RSD)">Lotus (RSD)</option>
<option value="Goons (HPW)">Goons (HPW)</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">Mana</label>
<div class="col-xs-10">
<input type="number" class="form-control" ng-model="mana" placeholder="mana" ng-change="manaChanged()">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">atk</label>
<div class="col-xs-10">
<input type="number" class="form-control" ng-model="atk" placeholder="atk" ng-change="atkChanged()">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">hp</label>
<div class="col-xs-10">
<input type="number" class="form-control" ng-model="hp" placeholder="hp" ng-change="hpChanged()">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">desc</label>
<div class="col-xs-10">
<input type="text" class="form-control" ng-model="desc" placeholder="desc" ng-change="descChanged()">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">cdn</label>
<div class="col-xs-10">
<input type="text" class="form-control" ng-model="cdn" placeholder="cdn" ng-change="cdnChanged()">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">hpwn</label>
<div class="col-xs-2">
<a class="btn btn-default" href="http://www.hearthpwn.com/search?search={{name}}#t1:cards" role="button" ng-disabled="! name" target="_blank">Hearthpwn</a>
</div>
<div class="col-xs-8">
<input type="number" class="form-control" ng-model="hpwn" placeholder="hpwn" ng-change="hpwnChanged()">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">head</label>
<div class="col-xs-2">
<a class="btn btn-default" href="http://hearthstone.services.zam.com/v1/card/autocomplete/{{name}}" role="button" ng-disabled="! name" target="_blank">Hearthhead</a>
</div>
<div class="col-xs-8">
<input type="text" class="form-control" ng-model="head" placeholder="head" ng-change="headChanged()">
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">Rarity</label>
<div class="col-xs-10">
<select ng-model="rarity" class="form-control" name="rarity" ng-init="rarity = 'Common'">
<option value="Token">Token</option>
<option value="Common">Common</option>
<option value="Basic">Basic</option>
<option value="Rare">Rare</option>
<option value="Epic">Epic</option>
<option value="Legendary">Legendary</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">set</label>
<div class="col-xs-10">
<select ng-model="set" class="form-control" name="set" ng-init="set = 'Madness at the Darkmoon Faire'">
<option value="Basic">Basic</option>
<option value="Classic">Classic</option>
<option value="Reward">Reward</option>
<option value="Promo">Promo</option>
<option value="Curse of Naxxramas">Curse of Naxxramas</option>
<option value="Goblin vs Gnomes">Goblin vs Gnomes</option>
<option value="Blackrock Mountain">Blackrock Mountain</option>
<option value="The Grand Tournament">The Grand Tournament</option>
<option value="The League of Explorers">The League of Explorers</option>
<option value="Whispers of the Old Gods">Whispers of the Old Gods</option>
<option value="One Night in Karazhan">One Night in Karazhan</option>
<option value="Mean Streets of Gadgetzan">Mean Streets of Gadgetzan</option>
<option value="Journey to Un'Goro">Journey to Un'Goro</option>
<option value="Knights of the Frozen Throne">Knights of the Frozen Throne</option>
<option value="Kobolds and Catacombs">Kobolds and Catacombs</option>
<option value="The Witchwood">The Witchwood</option>
<option value="The Boomsday Project">The Boomsday Project</option>
<option value="Rastakhan's Rumble">Rastakhan's Rumble</option>
<option value="Rise of Shadows">Rise of Shadows</option>
<option value="Saviors of Uldum">Saviors of Uldum</option>
<option value="Descent of Dragons">Descent of Dragons</option>
<option value="Galakrond's Awakening">Galakrond's Awakening</option>
<option value="Demon Hunter Initiate">Demon Hunter Initiate</option>
<option value="Ashes of Outland">Ashes of Outland</option>
<option value="Scholomance Academy">Scholomance Academy</option>
<option value="Madness at the Darkmoon Faire">Madness at the Darkmoon Faire</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">type</label>
<div class="col-xs-10">
<select ng-model="type" class="form-control" name="type" ng-init="type = 'Minion'">
<option value="Minion">Minion</option>
<option value="Spell">Spell</option>
<option value="Weapon">Weapon</option>
<option value="Hero">Hero</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-xs-2 control-label text-right">subtype</label>
<div class="col-xs-10">
<select ng-model="subtype" class="form-control" name="subtype" ng-init="subtype = ''" ng-change="subtypeChanged()">
<option value="">Nothing</option>
<option value="Beast">Beast</option>
<option value="Demon">Demon</option>
<option value="Dragon">Dragon</option>
<option value="Elemental">Elemental</option>
<option value="Mech">Mech</option>
<option value="Murloc">Murloc</option>
<option value="Pirate">Pirate</option>
<option value="Totem">Totem</option>
</select>
</div>
</div>
</form>
</div>
<div class="row"><pre>
,
"{{nameI}}": {
"atk": {{atkI}},
"cdn": "{{cdnI}}",
"class": "{{class}}",
"cost": {{manaI}},
"desc": {{descI}},
"head": "{{headI}}",
"hp": {{hpI}},
"hpwn": {{hpwnI}},
"name": "{{name}}",
"rarity": "{{rarity}}",
"set": "{{set}}",
"subType": {{subtypeI}},
"type": "{{type}}"
}
</pre>
</div>
</div>
</body>