File size: 17,210 Bytes
37d6cb3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Login - EDUrocks 3.0</title>
    <link rel="icon" href="filestorage/photos/favicon.ico" type="image/x-icon">
    <link href="https://fonts.googleapis.com/css2?family=Pacifico&family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
    <script src="https://js.hcaptcha.com/1/api.js" async defer></script>
    <script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
    <script src="./assets/js/aws-detection.js"></script>
    <script src="./assets/js/ip-restriction.js"></script>
    <style type="text/tailwindcss">
        @theme {
            --color-edu-dark: #011627;
            --color-edu-dark-secondary: #3C1642;
            --color-edu-dark-accent: #58355E;
            --color-edu-text: #e8d5e0;
            --color-edu-text-secondary: #c4a5b8;
            --color-edu-pink: #F4154D;
            --color-edu-pink-light: #FA0F71;
            --color-edu-rose: #FF1F84;

            --font-pacifico: 'Pacifico', cursive;
            --font-inter: 'Inter', sans-serif;

            --animate-gradient: gradient 6s ease infinite;
            --animate-fade-in: fadeIn 0.5s ease-in-out;
            --animate-slide-down: slideDown 0.4s ease-out;
            --animate-slide-up: slideUp 0.3s ease-out;

            @keyframes gradient {
                0%, 100% { background-position: 0% 50% }
                50% { background-position: 100% 50% }
            }
            @keyframes fadeIn {
                0% { opacity: 0; transform: translateY(10px) }
                100% { opacity: 1; transform: translateY(0) }
            }
            @keyframes slideDown {
                0% { opacity: 0; transform: translateY(-20px) }
                100% { opacity: 1; transform: translateY(0) }
            }
            @keyframes slideUp {
                0% { opacity: 0; transform: translateY(20px) }
                100% { opacity: 1; transform: translateY(0) }
            }
        }
    </style>
    <style>
        body {
            font-family: 'Inter', sans-serif;
        }
        .gradient-text {
            background: linear-gradient(45deg, #F4154D, #FA0F71, #e8d5e0, #FA0F71, #F4154D);
            background-size: 200% 200%;
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: gradient 6s ease infinite;
        }
        .card-hover {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .card-hover:hover {
            transform: translateY(-8px) scale(1.02);
        }
        /* Quote hyperlink styling */
        #quote-text a {
            color: #FA0F71;
            text-decoration: underline;
            transition: color 0.3s ease;
        }
        #quote-text a:hover {
            color: #e8d5e0;
        }
    </style>
</head>
<body class="bg-edu-dark text-edu-text min-h-screen font-inter flex items-center justify-center p-4">
    
    <nav class="bg-edu-dark-accent border-b-2 border-edu-pink/20 fixed top-0 left-0 right-0 z-40">
        <div class="max-w-7xl mx-auto px-4 py-4">
            <div class="flex flex-col md:flex-row items-center justify-between gap-4">
                <a href="index.html" class="font-pacifico text-2xl md:text-3xl gradient-text">EDUrocks 3.0</a>
                <div class="flex flex-wrap gap-2">
                    <a href="index.html" class="px-4 py-2 rounded-full text-edu-text-secondary hover:bg-edu-pink hover:text-edu-text transition-all">Home</a>
                    <a href="page1.html" class="px-4 py-2 rounded-full text-edu-text-secondary hover:bg-edu-pink hover:text-edu-text transition-all">Gxmes</a>
                    <a href="edum/index.html" class="px-4 py-2 rounded-full text-edu-text-secondary hover:bg-edu-pink hover:text-edu-text transition-all">Movies & TV</a>
                    <a href="#" id="pr0xy-link" class="px-4 py-2 rounded-full text-edu-text-secondary hover:bg-edu-pink hover:text-edu-text transition-all">Site Unblocker</a>
                    <a href="#" id="ai-chat-link" class="px-4 py-2 rounded-full text-edu-text-secondary hover:bg-edu-pink hover:text-edu-text transition-all">AI Chat</a>
                    <a href="page2.html" class="px-4 py-2 rounded-full text-edu-text-secondary hover:bg-edu-pink hover:text-edu-text transition-all">Request</a>
                    <a href="page4.html" class="px-4 py-2 rounded-full text-edu-text-secondary hover:bg-edu-pink hover:text-edu-text transition-all">Updates</a>
                    <a href="page7.html" class="px-4 py-2 rounded-full text-edu-text-secondary hover:bg-edu-pink hover:text-edu-text transition-all">Apps</a>
                    <a href="page6.html" class="px-4 py-2 rounded-full text-edu-text-secondary hover:bg-edu-pink hover:text-edu-text transition-all">Links</a>
                </div>
            </div>
        </div>
    </nav>

    
    <div class="w-full max-w-md mt-20">
        <div class="bg-edu-dark-accent border border-edu-pink/20 rounded-2xl p-8 shadow-2xl">
            
            <div class="text-center mb-8">
                <h1 class="font-pacifico text-4xl gradient-text mb-2">EDUrocks 3.0</h1>
                <p class="text-edu-text-secondary text-sm">Sign in to use Cloud Game Saves</p>
            </div>

            
            <div class="flex gap-2 mb-6 bg-edu-dark rounded-full p-1">
                <button id="loginTab" onclick="showLogin()" class="flex-1 px-4 py-2 rounded-full bg-gradient-to-r from-edu-pink to-edu-pink-light text-edu-text font-medium transition-all">
                    Login
                </button>
                <button id="signupTab" onclick="showSignup()" class="flex-1 px-4 py-2 rounded-full text-edu-text-secondary hover:text-edu-text font-medium transition-all">
                    Sign Up
                </button>
            </div>

            
            <form id="loginForm" class="space-y-4">
                <div>
                    <label class="block text-edu-text text-sm font-medium mb-2">Username</label>
                    <input type="text"
                           class="w-full bg-edu-dark text-edu-text border border-edu-pink/20 rounded-lg px-4 py-3 focus:outline-none focus:border-edu-pink transition-all placeholder-edu-text-secondary/50"
                           placeholder="Enter your username">
                </div>

                <div>
                    <label class="block text-edu-text text-sm font-medium mb-2">Password</label>
                    <input type="password"
                           class="w-full bg-edu-dark text-edu-text border border-edu-pink/20 rounded-lg px-4 py-3 focus:outline-none focus:border-edu-pink transition-all placeholder-edu-text-secondary/50"
                           placeholder="Enter your password">
                </div>

                <div class="flex items-center text-sm">
                    <label class="flex items-center text-edu-text-secondary cursor-pointer">
                        <input type="checkbox" class="mr-2 rounded border-edu-pink/20 text-edu-pink focus:ring-edu-pink">
                        Remember me
                    </label>
                </div>

                <div class="h-captcha" data-sitekey="fdfe3526-83c8-4a12-b386-3164a3eebc64" data-theme="dark"></div>

                <button type="submit"
                        onclick="attemptLogin(event)"
                        class="w-full bg-gradient-to-r from-edu-pink to-edu-pink-light text-edu-text font-semibold py-3 rounded-lg hover:shadow-xl transition-all transform hover:scale-105">
                    Login
                </button>
            </form>

            
            <form id="signupForm" class="space-y-4 hidden">
                <div>
                    <label class="block text-edu-text text-sm font-medium mb-2">Username</label>
                    <input type="text"
                           class="w-full bg-edu-dark text-edu-text border border-edu-pink/20 rounded-lg px-4 py-3 focus:outline-none focus:border-edu-pink transition-all placeholder-edu-text-secondary/50"
                           placeholder="Choose a username">
                </div>

                <div>
                    <label class="block text-edu-text text-sm font-medium mb-2">Password</label>
                    <input type="password"
                           class="w-full bg-edu-dark text-edu-text border border-edu-pink/20 rounded-lg px-4 py-3 focus:outline-none focus:border-edu-pink transition-all placeholder-edu-text-secondary/50"
                           placeholder="Create a password">
                </div>

                <div class="h-captcha" data-sitekey="fdfe3526-83c8-4a12-b386-3164a3eebc64" data-theme="dark"></div>

                <button type="submit"
                        onclick="attemptSignup(event)"
                        class="w-full bg-gradient-to-r from-edu-pink to-edu-pink-light text-edu-text font-semibold py-3 rounded-lg hover:shadow-xl transition-all transform hover:scale-105">
                    Create Account
                </button>
            </form>

            
            <div class="mt-6 p-4 bg-edu-dark/50 border border-edu-pink/10 rounded-lg">
                <p class="text-edu-text-secondary text-xs text-center">
                <span class="font-semibold text-edu-text">Your data is encrypted and stored in our American Data Center.
                </p>
            </div>
        </div>
    </div>

    
    <div id="toast" class="fixed bottom-8 right-8 bg-edu-dark-accent border border-edu-pink/20 rounded-lg px-6 py-4 shadow-2xl transform translate-y-32 transition-transform duration-300 max-w-sm">
        <div class="flex items-center gap-3">
            <div class="w-2 h-2 rounded-full bg-edu-pink animate-pulse"></div>
            <p id="toastMessage" class="text-edu-text"></p>
        </div>
    </div>

    <script type="module">
        import { initNavigationHandlers } from './assets/js/navigation.js';
        import { initChromeOSDetection } from './assets/js/chromeos-detect.js';
        import { Auth } from './assets/js/auth.js';
        import { getCurrentDomain } from './assets/js/domain-utils.js';

        // Make Auth globally available
        window.Auth = Auth;
        window.getCurrentDomain = getCurrentDomain;

        // Check if already logged in
        document.addEventListener('DOMContentLoaded', async () => {
            if (await Auth.verifySession()) {
                // Redirect to home if already logged in
                window.location.href = 'index.html';
            }
        });

        document.getElementById('pr0xy-link').addEventListener('click', function(e) {
            e.preventDefault();
            if (window.openP-r0xyInBypass) {
                window.openP-r0xyInBypass(window.getP-r0xyURL());
            } else {
                window.open(window.getP-r0xyURL(), '_blank');
            }
        });

        document.getElementById('ai-chat-link').addEventListener('click', function(e) {
            e.preventDefault();
            window.location.href = 'aichat/index.html';
        });
    </script>

    <script>
        function showLogin() {
            document.getElementById('loginForm').classList.remove('hidden');
            document.getElementById('signupForm').classList.add('hidden');
            document.getElementById('loginTab').classList.add('bg-gradient-to-r', 'from-edu-pink', 'to-edu-pink-light');
            document.getElementById('loginTab').classList.remove('text-edu-text-secondary');
            document.getElementById('signupTab').classList.remove('bg-gradient-to-r', 'from-edu-pink', 'to-edu-pink-light');
            document.getElementById('signupTab').classList.add('text-edu-text-secondary');
        }

        function showSignup() {
            document.getElementById('loginForm').classList.add('hidden');
            document.getElementById('signupForm').classList.remove('hidden');
            document.getElementById('signupTab').classList.add('bg-gradient-to-r', 'from-edu-pink', 'to-edu-pink-light');
            document.getElementById('signupTab').classList.remove('text-edu-text-secondary');
            document.getElementById('loginTab').classList.remove('bg-gradient-to-r', 'from-edu-pink', 'to-edu-pink-light');
            document.getElementById('loginTab').classList.add('text-edu-text-secondary');
        }

        function showToast(message) {
            const toast = document.getElementById('toast');
            const toastMessage = document.getElementById('toastMessage');
            toastMessage.textContent = message;
            toast.classList.remove('translate-y-32');
            toast.classList.add('translate-y-0');

            setTimeout(() => {
                toast.classList.remove('translate-y-0');
                toast.classList.add('translate-y-32');
            }, 3000);
        }

        async function attemptLogin(event) {
            event.preventDefault();

            const form = document.getElementById('loginForm');
            const username = form.querySelector('input[type="text"]').value.trim();
            const password = form.querySelector('input[type="password"]').value;

            if (!username || !password) {
                showToast('⚠️ Please enter username and password');
                return false;
            }

            // Get hCaptcha token
            const hcaptchaResponse = form.querySelector('.h-captcha textarea')?.value;
            if (!hcaptchaResponse) {
                showToast('⚠️ Please complete the captcha');
                return false;
            }

            try {
                const button = form.querySelector('button[type="submit"]');
                button.disabled = true;
                button.textContent = 'Logging in...';

                await Auth.login(username, password, hcaptchaResponse);

                showToast('✅ Login successful! Redirecting...');

                setTimeout(() => {
                    window.location.href = 'index.html';
                }, 1000);

            } catch (error) {
                showToast('❌ ' + error.message);
                const button = form.querySelector('button[type="submit"]');
                button.disabled = false;
                button.textContent = 'Login';
                // Reset hCaptcha
                if (window.hcaptcha) {
                    window.hcaptcha.reset();
                }
            }

            return false;
        }

        async function attemptSignup(event) {
            event.preventDefault();

            const form = document.getElementById('signupForm');
            const username = form.querySelectorAll('input[type="text"]')[0].value.trim();
            const password = form.querySelector('input[type="password"]').value;

            if (!username || !password) {
                showToast('⚠️ Please enter username and password');
                return false;
            }

            if (username.length < 3 || username.length > 20) {
                showToast('⚠️ Username must be 3-20 characters');
                return false;
            }

            if (password.length < 6) {
                showToast('⚠️ Password must be at least 6 characters');
                return false;
            }

            if (!/^[a-zA-Z0-9_]+$/.test(username)) {
                showToast('⚠️ Username can only contain letters, numbers, and underscores');
                return false;
            }

            // Get hCaptcha token
            const hcaptchaResponse = form.querySelector('.h-captcha textarea')?.value;
            if (!hcaptchaResponse) {
                showToast('⚠️ Please complete the captcha');
                return false;
            }

            try {
                const button = form.querySelector('button[type="submit"]');
                button.disabled = true;
                button.textContent = 'Creating Account...';

                await Auth.register(username, password, hcaptchaResponse);

                showToast('✅ Account created! Please login');

                // Switch to login form
                setTimeout(() => {
                    showLogin();
                    form.querySelector('input[type="text"]').value = '';
                    form.querySelector('input[type="password"]').value = '';
                    // Reset hCaptcha
                    if (window.hcaptcha) {
                        window.hcaptcha.reset();
                    }
                }, 1500);

            } catch (error) {
                showToast('❌ ' + error.message);
                // Reset hCaptcha
                if (window.hcaptcha) {
                    window.hcaptcha.reset();
                }
            } finally {
                const button = form.querySelector('button[type="submit"]');
                button.disabled = false;
                button.textContent = 'Create Account';
            }

            return false;
        }
    </script>
</body>
</html>