-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
127 lines (107 loc) · 3.69 KB
/
script.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
95Windows - JavaScript Scripts
A web-based Windows 95 product key generator.
GitHub Repo: https://github.com/MaxWasTakenYT/95Windows/
*/
function generateProductKey() {
function GF3() {
while (true) {
let num = Math.floor(Math.random() * 999) + 1;
if (![333, 444, 555, 666, 777, 888, 999].includes(num)) {
return num;
}
}
}
let F3 = GF3();
let U4 = "-";
function GL7() {
while (true) {
let number = Array.from({ length: 7 }, () => Math.floor(Math.random() * 9));
if (number.reduce((a, b) => a + b, 0) % 7 === 0) {
return parseInt(number.join(''));
}
}
}
let L7 = GL7();
let F3_str = F3.toString().padStart(3, '0');
let FPK = F3_str + U4 + L7;
return FPK;
}
function generateSecondProductKey() {
function GF3X() {
var ddd = Math.floor(Math.random() * (366 - 100 + 1)) + 100;
return ddd;
}
var F3X = GF3X();
function GY2X() {
var yy = Math.floor(Math.random() * (99 - 95 + 1)) + 95;
return yy;
}
var Y2X = GY2X();
var SEPO = "-OEM-";
var IX = '00';
var SEPT = "-";
function GSSX() {
while (true) {
var sevx = Math.floor(Math.random() * (99999 - 10000 + 1)) + 10000;
var sevsum = Array.from(String(sevx), Number).reduce((a, b) => a + b, 0);
if (sevsum % 7 === 0) {
return sevx;
}
}
}
var SSX = GSSX();
function GLFX() {
var lsfv = Math.floor(Math.random() * (99999 - 10000 + 1)) + 10000;
return lsfv;
}
var LFX = GLFX();
var FPKX = F3X.toString() + Y2X.toString() + SEPO + IX + SSX.toString() + SEPT + LFX.toString();
return FPKX;
}
function handleGenerateButtonClick() {
let productKey = generateProductKey();
let secondProductKey = generateSecondProductKey();
let productKeyElement = document.getElementById('productKey');
let secondProductKeyElement = document.getElementById('secondProductKey');
productKeyElement.textContent = "Generated type 'A' Product Key: " + productKey;
secondProductKeyElement.textContent = "Generated type 'B/C' Product Key: " + secondProductKey;
}
document.getElementById('generateBtn').addEventListener('click', handleGenerateButtonClick);
function darkMode() {
var element = document.body;
var darkModeButton = document.getElementById('darkMode');
var darkButton = document.getElementById('darkButton');
var badge = document.querySelector('.badge');
element.classList.toggle("dbody");
element.classList.toggle("body");
darkModeButton.classList.toggle("drktgl");
darkModeButton.classList.toggle("dtgl");
darkButton.classList.toggle("dbutton");
badge.classList.toggle("dbadge");
var isDarkMode = element.classList.contains("dbody");
document.cookie = "darkMode=" + (isDarkMode ? "true" : "false") + ";path=/";
}
function acceptCookies() {
var cookieBanner = document.getElementById("cookieBanner");
cookieBanner.parentNode.removeChild(cookieBanner);
document.cookie = "cookiesAccepted=true;path=/";
}
window.onload = function() {
var cookiesAccepted = getCookie("cookiesAccepted");
if (!cookiesAccepted) {
// Show cookie banner if cookies are not accepted
var cookieBanner = document.getElementById("cookieBanner");
cookieBanner.style.display = "block";
}
}
function getCookie(name) {
var cookieArr = document.cookie.split(";");
for(var i = 0; i < cookieArr.length; i++) {
var cookiePair = cookieArr[i].split("=");
if(name == cookiePair[0].trim()) {
return decodeURIComponent(cookiePair[1]);
}
}
return null;
}