forked from a456pur/seraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.html
167 lines (138 loc) · 6.48 KB
/
settings.html
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="images/ico.ico" type="image/x-icon">
<link rel="stylesheet" href="storage/css/settings-v2.css">
<title>Settings | Seraph</title>
<meta name="description" content="seraph; an open source unblocked games website hosting 100+ games with downloadable support, a clean and centralised user interface and no iframe embedding">
<meta property="og:site_name" content="seraph">
<meta property="og:title" content="seraph">
<meta property="og:type" content="website">
<meta property="og:description" content="seraph; an open source unblocked games website hosting 100+ games with downloadable support, a clean and centralised user interface and no iframe embedding">
<style>
button {
margin: 2px;
}
</style>
</head>
<body>
<div class="cursor"></div>
<div class="content-side">
<h1>settings</h1>
<a href="index.html" style="font-size: 18px;">go to homepage</a>
<br>
<h2 style="margin: 0;">cloak</h2>
<p> mask seraph with a tab cloak! </p>
<br>
<select id="presetSelect">
<option value="google">google</option>
<option value="googleclassroom">google classroom</option>
<option value="googledrive">google drive</option>
<option value="chrometab">chrome new tab</option>
<option value="gmail">gmail</option>
<option value="bing">bing</option>
<option value="desmos">desmos calculator</option>
<option value="wikipedia">wikipedia</option>
</select>
<button id="saveButton">select preset cloak</button>
<button id="resetButton">reset cloak</button>
<p id="success" style="display: none;">success message here</p>
<br>
<h2 style="margin: 0;">themes</h2>
<p> change the theme of the website here! </p>
<br>
<select id="theme-select">
<option value="seraph">seraph</option>
<option value="azurite">azurite</option>
<option value="retro">retro</option>
<option value="cosmic">cosmic</option>
</select>
<button id="apply-theme">apply theme</button>
<script src="storage/js/cursor.js"></script>
<script src="storage/js/cloak.js"></script>
<script>
function applyTheme() {
const selectedTheme = document.getElementById('theme-select');
if (selectedTheme) {
const themeValue = selectedTheme.value;
document.documentElement.className = `theme-${themeValue}`;
localStorage.setItem('selectedTheme', themeValue);
}
}
const storedTheme = localStorage.getItem('selectedTheme');
if (storedTheme) {
const selectElement = document.getElementById('theme-select');
if (selectElement) {
selectElement.value = storedTheme;
applyTheme();
}
}
const applyButton = document.getElementById('apply-theme');
if (applyButton) {
applyButton.addEventListener('click', applyTheme);
}
</script>
<script>
function setCookie(name, value, options) {
options = options || {};
let expires = options.expires;
if (typeof expires == "number" && expires) {
const d = new Date();
d.setTime(d.getTime() + expires * 24 * 60 * 60 * 1000);
expires = options.expires = d;
}
if (expires && expires.toUTCString) {
options.expires = expires.toUTCString();
}
value = encodeURIComponent(value);
let updatedCookie = name + "=" + value;
for (const propName in options) {
updatedCookie += "; " + propName;
const propValue = options[propName];
if (propValue !== true) {
updatedCookie += "=" + propValue;
}
}
document.cookie = updatedCookie;
}
function getCookie(name) {
const matches = document.cookie.match(new RegExp(
"(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
));
return matches ? decodeURIComponent(matches[1]) : undefined;
}
document.addEventListener("DOMContentLoaded", function() {
const presetSelect = document.getElementById("presetSelect");
const saveButton = document.getElementById("saveButton");
const resetButton = document.getElementById("resetButton");
const successMessage = document.getElementById("success");
const selectedPreset = getCookie("tabCloakPreset");
if (selectedPreset) {
presetSelect.value = selectedPreset;
}
saveButton.addEventListener("click", function() {
const selectedValue = presetSelect.value;
successMessage.textContent = "preset chosen! refresh the page to see changes";
setCookie("tabCloakPreset", selectedValue, { expires: 365 });
successMessage.style.display = "block";
setTimeout(function() {
successMessage.style.display = "none";
}, 3000);
});
resetButton.addEventListener("click", function() {
deleteCookie("tabCloakPreset");
presetSelect.selectedIndex = 0;
successMessage.textContent = "cloaking reset, refresh the page to see changes";
successMessage.style.display = "block";
setTimeout(function() {
successMessage.style.display = "none";
}, 3000);
});
function deleteCookie(name) {
document.cookie = name + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";
}
});
</script>
</body>
</html>