This repository was archived by the owner on Jul 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathscript.js
More file actions
67 lines (56 loc) · 2.05 KB
/
script.js
File metadata and controls
67 lines (56 loc) · 2.05 KB
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
var credit = ["FelixFromDiscord", "TheKodeToad", "eyezah"];
var creditTypes = [
"Site created by {}.",
"Made with the blood and tears of {}.",
"Mostly stolen from stackoverflow by {}.",
"Created using Wnidows 7 proffesionnall by {}.",
"Created using an expiring Adobe Dreamweaver license by {}.",
"Hosted by monkeys and programmed by {}."
];
var downloadButton = document.getElementById("download-button");
var request = new XMLHttpRequest();
request.addEventListener("load", function () {
var response = JSON.parse(request.responseText);
// If the rate limit is exceeded, fall back to the less user friendly page
if (!response[0])
return;
response = response[0];
if (!response.assets)
return;
var asset = response.assets[0];
if (!asset)
return;
if (!asset.browser_download_url)
return;
downloadButton.href = asset.browser_download_url;
});
request.open("GET", "https://api.github.com/repos/Sol-Client/installer/releases");
request.send();
if (window.matchMedia("(hover: hover)").matches) {
var logo = document.querySelector(".logobg");
var rotationMultiplier = 0.2;
logo.style.animation = "initial";
logo.style.transform = "initial";
logo.addEventListener("mousemove", (event) => {
var bounds = logo.getBoundingClientRect();
var rotationX = -(event.clientY - bounds.y - bounds.height / 2) * rotationMultiplier;
var rotationY = (event.clientX - bounds.x - (bounds.width / 2)) * rotationMultiplier;
window.requestAnimationFrame(() => {
logo.style.transform = `perspective(1000px) rotateX(${rotationX}deg) rotateY(${rotationY}deg)`;
});
});
logo.addEventListener("mouseleave", () => {
logo.style.transform = "initial";
});
};
var footer = document.querySelector("small");
var authors = "";
for (var i = 0; i < credit.length; i++) {
authors += credit[i];
if (i == credit.length - 2) {
authors += " and ";
} else if (i != credit.length - 1) {
authors += ", ";
}
}
footer.innerText = creditTypes[Math.floor(Math.random() * creditTypes.length)].replace("{}", authors);