-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
249 lines (240 loc) · 8.88 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="WhatsApp Sticker Pack JSON Generator | Create JSON for WhatsApp Sticker Pack | Select Images and Get Your JSON for WhatsApp Sticker Pack READY!!" />
<title>WhatsApp Sticker JSON Creator (WAStickerApp)</title>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<style>
body {
background-image: linear-gradient(#eb3349, #f45c43);
height: 100%;
background-size: cover;
font-family: 'Nunito', sans-serif;
}
.progress {
margin: 1.5rem 0;
}
pre {
padding: 25px;
background-color: #F1F3F4;
border: none;
border-radius: 22px;
box-shadow: none;
outline: none;
opacity: 1;
transition: background-color 300ms ease-in-out;
transition: opacity 200ms;
} .string { color: green; }
.number { color: darkorange; }
.boolean { color: blue; }
.null { color: magenta; }
.key { color: red; }
textarea {
position: absolute;
left: -100%;
}
</style>
</head>
<body>
<div class="container">
<div class="card-panel">
<div class="row">
<div class="col">
<a class="github-button" href="https://github.com/pratikbutani" data-show-count="true" aria-label="Follow @pratikbutani on GitHub">Follow @pratikbutani</a>
<a class="github-button" href="https://github.com/pratikbutani/WAStickerApp-JSON-Generator/fork" data-show-count="true" aria-label="Fork pratikbutani/WAStickerApp-JSON-Generator on GitHub">Fork</a>
<a class="github-button" href="https://github.com/pratikbutani/WAStickerApp-JSON-Generator" data-show-count="true" aria-label="Star pratikbutani/WAStickerApp-JSON-Generator on GitHub">Star</a>
</div>
</div>
<div class="row">
<div class="col">
<h4 class="font-bold"> <b>Enter details and Get your JSON Ready for WhatsApp Sticker Pack 😃</b> </h4>
</div>
</div>
<div class="row">
<div class="col">
<h5>(Your JSON will be generated automatically when you type something.)</h5>
</div>
</div>
<div class="row">
<form class="col s12">
<div class="row">
<div class="input-field col s6">
<input type="text" id="identifier" onkeyup="makeJSON()" />
<label for="identifier">Folder Name (Identifier)</label>
</div>
<div class="input-field col s6">
<input type="text" id="name" onkeyup="makeJSON()" />
<label for="name">Sticker Pack Name</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<input type="text" id="publisher" onkeyup="makeJSON()" />
<label for="name">Publisher</label>
</div>
<div class="input-field col s6">
<input type="text" id="tray_image_file" onkeyup="makeJSON()"/>
<label for="name">Tray Image File Name (with .png)</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<input type="text" id="image_data_version" onkeyup="makeJSON()" />
<label for="image_data_version">Version</label>
</div>
<div class="input-field col s6">
<label for="avoid_cache">
<input type="checkbox" class="filled-in" id="avoid_cache" onclick="makeJSON()"/>
<span>Avoid cache</span>
</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<input type="text" id="publisher_email" onkeyup="makeJSON()" />
<label for="name">Publisher Email</label>
</div>
<div class="input-field col s6">
<input type="text" id="publisher_website" onkeyup="makeJSON()" />
<label for="name">Publisher Website</label>
</div>
</div>
<div class="row">
<div class="input-field col s6">
<input type="text" id="privacy_policy_website" onkeyup="makeJSON()" />
<label for="name">Privacy Policy URL</label>
</div>
<div class="input-field col s6">
<input type="text" id="license_agreement_website" onkeyup="makeJSON()"/>
<label for="name">Licence Agreement Website </label>
</div>
</div>
<div class="row">
<div class="file-field input-field col s6">
<div class="btn">
<span>Browse</span>
<input type="file" id="files" multiple accept=".webp" onchange="makeJSON()" />
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text" placeholder="Upload file" />
</div>
</div>
</div>
</form>
</div>
<div class="progress">
<div>
<div class="determinate" style="width: 100%"></div>
</div>
</div>
<div class="btn" id="copyButtonClick" onclick="copyJSON()">
<span>Copy JSON</span>
</div>
 
<div class="btn" id="copyButtonClick" onclick="clearJSON()">
<span>Clear JSON</span>
</div>
<pre id='output'></pre>
<div class="progress">
<div>
<div class="determinate" style="width: 100%"></div>
</div>
</div>
<table>
<tr>
<td>
<h4 class="center-align" style="margin-top: 0"><b> No one has ever become poor by giving.♥♥♥</b></h4>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top" class="center-align">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="46Q5USNZNGKML">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>
</td>
</tr>
</table>
</div>
</div>
<script>
function syntaxHighlight(json) {
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function(match) {
var cls = 'number';
if (/^"/.test(match)) {
if (/:$/.test(match)) {
cls = 'key';
} else {
cls = 'string';
}
} else if (/true|false/.test(match)) {
cls = 'boolean';
} else if (/null/.test(match)) {
cls = 'null';
}
return '<span class="' + cls + '">' + match + '</span>';
});
}
function output(inp) {
document.getElementById('output').innerHTML = inp;
}
function makeJSON() {
jsonObj = [];
mainArray = {};
mainArray.android_play_store_link = "";
mainArray.ios_app_store_link = "";
var fileObj = document.getElementById('files');
if (fileObj.files.length > 30) {
alert("You can only upload a maximum of 30 files");
} else {
for (var i = 0; i < fileObj.files.length; i++) {
item = {};
item["image_file"] = fileObj.files[i].name;
item["emojis"] = [];
item["emojis"].push("");
item["emojis"].push("");
jsonObj.push(item);
}
}
mainArray["sticker_packs"] = [];
innerValue = {};
innerValue["identifier"] = document.getElementById('identifier').value;
innerValue["name"] = document.getElementById('name').value;
innerValue["publisher"] = document.getElementById('publisher').value;
innerValue["tray_image_file"] = document.getElementById('tray_image_file').value;
innerValue["image_data_version"] = document.getElementById('image_data_version').value;
innerValue["avoid_cache"] = document.getElementById('avoid_cache').checked;
innerValue["publisher_email"] = document.getElementById('publisher_email').value;
innerValue["publisher_website"] = document.getElementById('publisher_website').value;
innerValue["privacy_policy_website"] = document.getElementById('privacy_policy_website').value;
innerValue["license_agreement_website"] = document.getElementById('license_agreement_website').value;
innerValue["stickers"] = [];
innerValue["stickers"] = jsonObj;
mainArray["sticker_packs"].push(innerValue);
output(syntaxHighlight(JSON.stringify(mainArray, undefined, 4)));
}
function copyJSON() {
const copyText = document.getElementById("output").textContent;
if(copyText) {
const textArea = document.createElement('textarea');
textArea.textContent = copyText;
document.body.append(textArea);
textArea.select();
document.execCommand("copy");
M.toast({html: 'JSON Copied Successfully.'});
} else {
M.toast({html: 'You can not copy empty JSON'});
}
}
function clearJSON() {
document.getElementById("output").textContent = "";
}
</script>
<!-- Place this tag in your head or just before your close body tag. -->
<script async defer src="https://buttons.github.io/buttons.js"></script>
</body>
</html>