forked from therealgliz/blooket-hacks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfooter.js
32 lines (29 loc) · 1.38 KB
/
footer.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
function footer() {
let element = document.createElement('div');
element.style = `font-family: "Nunito", sans-serif; font-size: 14px; height: 65px; width: 175px; border: 4px solid rgb(15, 15, 15); background: rgb(240, 240, 240); position: absolute; top: 20x; left: 20px; border-radius: 10px; color: rgb(0, 0, 0); text-align: center;`;
element.innerHTML = `<p>Made by gliz <br> My <a style="color: #0000ff;" href="https://twitter.com/glizuwu" target="_blank">twitter</a></p>`;
document.body.appendChild(element);
var pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
element.onmousedown = ((e = window.event) => {
e.preventDefault();
pos3 = e.clientX;
pos4 = e.clientY;
document.onmouseup = (() => {
document.onmouseup = null;
document.onmousemove = null;
});
document.onmousemove = ((e) => {
e = e || window.event;
e.preventDefault();
pos1 = pos3 - e.clientX;
pos2 = pos4 - e.clientY;
pos3 = e.clientX;
pos4 = e.clientY;
let top = (element.offsetTop - pos2) > 0 ? (element.offsetTop - pos2) : 0;
let left = (element.offsetLeft - pos1) > 0 ? (element.offsetLeft - pos1) : 0;
element.style.top = top + "px";
element.style.left = left + "px";
});
});
};
footer();