-
Notifications
You must be signed in to change notification settings - Fork 1
/
games.html
221 lines (199 loc) · 7.74 KB
/
games.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Games</title>
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/images/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<style>
:root {
--dark-bg: #1e293b;
--light-bg: #f3f4f6;
--text-dark: #1e293b;
--text-light: #ffffff;
}
body {
margin: 0;
padding: 0;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
transition: background-color 0.3s ease, color 0.3s ease;
background-color: var(--dark-bg);
color: var(--text-light);
}
body.light-mode {
background-color: var(--light-bg);
color: var(--text-dark);
}
.top-left {
position: fixed;
top: 20px;
left: 20px;
z-index: 10;
}
.back-button {
width: 60px;
height: 60px;
cursor: pointer;
transition: transform 0.2s ease;
}
.back-button:hover {
transform: scale(1.1);
}
.hover-gradient {
background-color: #4f46e5;
transition: background 0.3s ease, transform 0.2s ease;
}
.hover-gradient:hover {
background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1);
transform: translateY(-2px);
}
.toggle-button {
position: fixed;
top: 20px;
right: 20px;
background-color: #4f46e5;
color: white;
font-weight: bold;
padding: 10px 20px;
border-radius: 8px;
cursor: pointer;
z-index: 10;
transition: background-color 0.3s ease, transform 0.2s ease;
}
.toggle-button:hover {
background-color: #4338ca;
transform: translateY(-2px);
}
.custom-select {
appearance: none;
background-color: #4f46e5;
color: white;
padding: 12px;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
width: 100%;
max-width: 300px;
}
.custom-select:hover, .custom-select:focus {
background-color: #4338ca;
transform: translateY(-2px);
}
@media (max-width: 640px) {
.back-button {
width: 50px;
height: 50px;
}
.custom-select, #go {
width: 90%;
max-width: none;
}
}
</style>
</head>
<body>
<div class="top-left">
<a href="index">
<img src="images/back-button.png" alt="Back to Home" class="back-button">
</a>
</div>
<button id="colorToggle" class="toggle-button" aria-label="Toggle dark/light mode">☀️</button>
<div class="flex flex-col space-y-4 items-center w-full max-w-md px-4">
<form id="form1" target="_blank" class="flex flex-col space-y-4 w-full items-center">
<select id="pages" class="custom-select">
<option value="mb/totm">Tomb of the Mask <- tap</option>
<option value="fger/forager/main">Forager</option>
<option value="mb/surf">Surf</option>
<option value="mb/slope">Slope</option>
<option value="hsmc">Henry Stickmin</option>
<option value="#" data-special="blockcraft">BlockCraft</option>
<option value="mb/2048">2048</option>
<option value="monkey">monkey mart</option>
<option value="mb/1v1">1v1</option>
<option value="mb/stik">Stik</option>
<option value="mb/tetris">Tetris</option> <!-- Added Tetris option -->
<option value="mb/bowl">Retro Bowl</option> <!-- Added Bowl option -->
<option value="mb/dino">Chrome Dino</option>
<option value="mb/agar">Agar.io</option>
<option value="mb/time">Superhot</option>
<option value="mb/cold">Supercold</option>
</select>
<button type="submit" id="go" class="hover-gradient text-white font-bold py-3 px-6 rounded-lg shadow-lg transition duration-300 w-full max-w-[300px]">
GO
</button>
</form>
<button class="bg-gray-400 text-gray-800 font-bold py-3 px-6 rounded-lg shadow-lg cursor-not-allowed transition duration-300 w-full max-w-[300px]">
Coming Soon
</button>
</div>
<script>
function setCookie(name, value, days) {
const expires = new Date(Date.now() + days * 864e5).toUTCString();
document.cookie = name + '=' + encodeURIComponent(value) + '; expires=' + expires + '; path=/; SameSite=Lax';
}
function getCookie(name) {
return document.cookie.split('; ').reduce((r, v) => {
const parts = v.split('=');
return parts[0] === name ? decodeURIComponent(parts[1]) : r;
}, '' );
}
const body = document.body;
const colorToggle = document.getElementById('colorToggle');
let darkMode = getCookie('theme') !== 'light';
function setTheme(isDark) {
body.classList.toggle('light-mode', !isDark);
colorToggle.textContent = isDark ? '☀️' : '🌙';
colorToggle.setAttribute('aria-label', isDark ? 'Switch to light mode' : 'Switch to dark mode');
setCookie('theme', isDark ? 'dark' : 'light', 30);
}
setTheme(darkMode);
colorToggle.addEventListener('click', function() {
darkMode = !darkMode;
setTheme(darkMode);
});
function selectBlockCraft() {
const version = prompt("Choose a version:\n1.8\n1.2");
if (version === '1.8') {
return 'mb/eaglarfast';
} else if (version === '1.2') {
return 'vxlc';
} else {
alert("Invalid choice. Please choose 1.8 or 1.2.");
return null;
}
}
document.getElementById("form1").addEventListener("submit", function(e) {
e.preventDefault();
const select = document.getElementById("pages");
const selectedOption = select.options[select.selectedIndex];
if (selectedOption.dataset.special === "blockcraft") {
const blockCraftUrl = selectBlockCraft();
if (blockCraftUrl) {
window.open(blockCraftUrl, '_blank');
}
} else if (selectedOption.value === "tetris") {
window.open("tetris", "_blank"); // Open Tetris link
} else {
window.open(select.value, '_blank');
}
});
document.addEventListener('keydown', function(event) {
if (event.key === 't') {
colorToggle.click();
}
});
</script>
</body>
</html>