-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain0.js
34 lines (29 loc) · 1.09 KB
/
main0.js
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
(function(){
var oldLog = console.log;
console.log = function (message) {
document.getElementById('a').value += message
oldLog.apply(arguments);
};
})();
function download(filename, text) {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
var textarea = document.getElementById('a')
if (navigator.userAgent.indexOf('Mobile') !== -1) { document.getElementById('save').style.display = "none"; textarea.style.height = "100px";
}//resize for mobile
getGiftCode = function () {
let code = '';
let dict = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
for(var i = 0; i < 16; i++){
code = code + dict.charAt(Math.floor(Math.random() * dict.length));
}
console.log('[GEN] ' + code + "\n");
code += '\n'
document.getElementById('b').value += code;
} //generates codes