-
Notifications
You must be signed in to change notification settings - Fork 0
/
hidden.js
86 lines (76 loc) · 3.11 KB
/
hidden.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
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
// Base64 encoded secret message
var encodedMessage = "VGhlIHNpdGUgd2FzIG1hZGUgYnkgdHdvIHBlb3BsZSBmcm9tIFJlemVrbmVzIFRlaG5pa3VtcywgMkFQIGNvdXJzZS4gRWxpYXNzIGFuZCBFbmlqYSA6RCAh";
// Function to decode Base64 message
function decodeMessage(encodedMessage) {
return atob(encodedMessage);
}
// Function to create and insert the hidden message
function createHiddenMessage() {
var helpMessage = document.createElement("div");
helpMessage.id = "helpMessage";
helpMessage.style.display = "none";
helpMessage.style.position = "fixed";
helpMessage.style.top = "50%";
helpMessage.style.left = "50%";
helpMessage.style.transform = "translate(-50%, -50%)";
helpMessage.style.backgroundColor = "#fff";
helpMessage.style.padding = "20px";
helpMessage.style.borderRadius = "5px";
helpMessage.style.boxShadow = "0 0 10px rgba(0, 0, 0, 0.5)";
helpMessage.style.zIndex = "9999";
helpMessage.style.color = "#000"; // Set text color to black
var hiddenMessageElement = document.createElement("p");
hiddenMessageElement.innerText = decodeMessage(encodedMessage);
helpMessage.appendChild(hiddenMessageElement);
var twitchLink = document.createElement("a");
twitchLink.href = "https://www.twitch.tv/s_shush";
twitchLink.id = "twitchLink";
twitchLink.target = "_blank";
twitchLink.innerText = "https://www.twitch.tv/s_shush";
helpMessage.appendChild(twitchLink);
// Add a space between the links
var space = document.createTextNode(" ");
helpMessage.appendChild(space);
var instagramLink = document.createElement("a");
instagramLink.href = "https://www.instagram.com/actualdottore/";
instagramLink.id = "instagramLink";
instagramLink.target = "_blank";
instagramLink.innerText = "https://www.instagram.com/actualdottore/";
helpMessage.appendChild(instagramLink);
var copyButton = document.createElement("button");
copyButton.id = "copyButton";
copyButton.innerText = "Copy";
copyButton.style.marginTop = "10px";
copyButton.style.padding = "5px 10px";
copyButton.style.backgroundColor = "#007bff";
copyButton.style.color = "#fff";
copyButton.style.border = "none";
copyButton.style.borderRadius = "3px";
copyButton.style.cursor = "pointer";
copyButton.addEventListener("click", copyToClipboard);
helpMessage.appendChild(copyButton);
document.body.appendChild(helpMessage);
}
// Function to copy the link to clipboard
function copyToClipboard() {
var link = document.getElementById("twitchLink").innerText;
navigator.clipboard.writeText(link)
.then(function() {
console.log("Link copied to clipboard!");
})
.catch(function(error) {
console.error("Error copying link: ", error);
});
}
// Event listener for the "h" key to show the help message
document.addEventListener("keypress", function(event) {
var key = event.key;
if (key === "h" || key === "H") {
var helpMessage = document.getElementById("helpMessage");
if (!helpMessage) {
createHiddenMessage();
helpMessage = document.getElementById("helpMessage");
}
helpMessage.style.display = "block";
}
});