Spaces:
Running

File size: 13,243 Bytes
8a345e4
67b9043
 
 
 
 
 
 
8a345e4
67b9043
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8a345e4
67b9043
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>欢迎登录 | 您的网站</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        .gradient-bg {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .input-focus:focus {
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
        }
        .shake {
            animation: shake 0.5s;
        }
        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            20%, 60% { transform: translateX(-5px); }
            40%, 80% { transform: translateX(5px); }
        }
        .floating {
            animation: floating 3s ease-in-out infinite;
        }
        @keyframes floating {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0px); }
        }
    </style>
</head>
<body class="font-sans bg-gray-50">
    <div class="min-h-screen flex flex-col md:flex-row">
        <!-- 左侧背景图 -->
        <div class="md:w-1/2 gradient-bg flex items-center justify-center p-10 text-white relative overflow-hidden">
            <div class="absolute inset-0 bg-black opacity-10"></div>
            <div class="relative z-10 text-center max-w-md">
                <div class="floating mb-8">
                    <i class="fas fa-user-shield text-6xl"></i>
                </div>
                <h1 class="text-4xl font-bold mb-4">欢迎回来</h1>
                <p class="text-xl mb-6">登录您的账户,探索更多精彩内容</p>
                <div class="flex justify-center space-x-4">
                    <button class="bg-white text-indigo-700 px-6 py-2 rounded-full font-medium hover:bg-gray-100 transition">
                        了解更多
                    </button>
                </div>
            </div>
            <div class="absolute bottom-4 left-0 right-0 text-center text-white text-sm opacity-80">
                © 2023 您的公司. 保留所有权利.
            </div>
        </div>

        <!-- 右侧登录表单 -->
        <div class="md:w-1/2 flex items-center justify-center p-10">
            <div class="w-full max-w-md">
                <div class="text-center mb-10">
                    <h2 class="text-3xl font-bold text-gray-800">登录账户</h2>
                    <p class="text-gray-600 mt-2">请输入您的凭据以继续</p>
                </div>

                <form id="loginForm" class="space-y-6">
                    <div>
                        <label for="email" class="block text-sm font-medium text-gray-700 mb-1">电子邮箱</label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fas fa-envelope text-gray-400"></i>
                            </div>
                            <input type="email" id="email" name="email" 
                                   class="pl-10 w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:border-indigo-500 input-focus transition"
                                   placeholder="your@email.com" required>
                        </div>
                        <p id="emailError" class="mt-1 text-sm text-red-600 hidden"></p>
                    </div>

                    <div>
                        <label for="password" class="block text-sm font-medium text-gray-700 mb-1">密码</label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fas fa-lock text-gray-400"></i>
                            </div>
                            <input type="password" id="password" name="password" 
                                   class="pl-10 w-full px-4 py-3 rounded-lg border border-gray-300 focus:outline-none focus:border-indigo-500 input-focus transition"
                                   placeholder="••••••••" required>
                            <button type="button" id="togglePassword" class="absolute inset-y-0 right-0 pr-3 flex items-center">
                                <i class="fas fa-eye text-gray-400 hover:text-gray-600 cursor-pointer"></i>
                            </button>
                        </div>
                        <p id="passwordError" class="mt-1 text-sm text-red-600 hidden"></p>
                    </div>

                    <div class="flex items-center justify-between">
                        <div class="flex items-center">
                            <input id="remember" name="remember" type="checkbox" 
                                   class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded">
                            <label for="remember" class="ml-2 block text-sm text-gray-700">
                                记住我
                            </label>
                        </div>
                        <div class="text-sm">
                            <a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">
                                忘记密码?
                            </a>
                        </div>
                    </div>

                    <div>
                        <button type="submit" 
                                class="w-full flex justify-center py-3 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition">
                            登录
                        </button>
                    </div>
                </form>

                <div class="mt-6">
                    <div class="relative">
                        <div class="absolute inset-0 flex items-center">
                            <div class="w-full border-t border-gray-300"></div>
                        </div>
                        <div class="relative flex justify-center text-sm">
                            <span class="px-2 bg-white text-gray-500">
                                或者使用社交账号登录
                            </span>
                        </div>
                    </div>

                    <div class="mt-6 grid grid-cols-3 gap-3">
                        <button type="button" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition">
                            <i class="fab fa-google text-red-500"></i>
                        </button>
                        <button type="button" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition">
                            <i class="fab fa-facebook-f text-blue-600"></i>
                        </button>
                        <button type="button" class="w-full inline-flex justify-center py-2 px-4 border border-gray-300 rounded-md shadow-sm bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 transition">
                            <i class="fab fa-twitter text-blue-400"></i>
                        </button>
                    </div>
                </div>

                <div class="mt-6 text-center text-sm text-gray-600">
                    还没有账户? 
                    <a href="#" class="font-medium text-indigo-600 hover:text-indigo-500">
                        立即注册
                    </a>
                </div>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const loginForm = document.getElementById('loginForm');
            const emailInput = document.getElementById('email');
            const passwordInput = document.getElementById('password');
            const togglePassword = document.getElementById('togglePassword');
            const emailError = document.getElementById('emailError');
            const passwordError = document.getElementById('passwordError');
            let isPasswordVisible = false;

            // 切换密码可见性
            togglePassword.addEventListener('click', function() {
                isPasswordVisible = !isPasswordVisible;
                passwordInput.type = isPasswordVisible ? 'text' : 'password';
                togglePassword.innerHTML = isPasswordVisible 
                    ? '<i class="fas fa-eye-slash text-gray-400 hover:text-gray-600 cursor-pointer"></i>' 
                    : '<i class="fas fa-eye text-gray-400 hover:text-gray-600 cursor-pointer"></i>';
            });

            // 表单验证
            loginForm.addEventListener('submit', function(e) {
                e.preventDefault();
                let isValid = true;

                // 重置错误状态
                emailError.classList.add('hidden');
                passwordError.classList.add('hidden');
                emailInput.classList.remove('border-red-500');
                passwordInput.classList.remove('border-red-500');

                // 验证邮箱
                if (!emailInput.value) {
                    emailError.textContent = '请输入电子邮箱';
                    emailError.classList.remove('hidden');
                    emailInput.classList.add('border-red-500', 'shake');
                    isValid = false;
                } else if (!/\S+@\S+\.\S+/.test(emailInput.value)) {
                    emailError.textContent = '请输入有效的电子邮箱';
                    emailError.classList.remove('hidden');
                    emailInput.classList.add('border-red-500', 'shake');
                    isValid = false;
                }

                // 验证密码
                if (!passwordInput.value) {
                    passwordError.textContent = '请输入密码';
                    passwordError.classList.remove('hidden');
                    passwordInput.classList.add('border-red-500', 'shake');
                    isValid = false;
                } else if (passwordInput.value.length < 6) {
                    passwordError.textContent = '密码至少需要6个字符';
                    passwordError.classList.remove('hidden');
                    passwordInput.classList.add('border-red-500', 'shake');
                    isValid = false;
                }

                // 移除抖动动画
                setTimeout(() => {
                    emailInput.classList.remove('shake');
                    passwordInput.classList.remove('shake');
                }, 500);

                // 如果验证通过,模拟登录
                if (isValid) {
                    // 这里可以添加实际的登录逻辑
                    console.log('登录信息:', {
                        email: emailInput.value,
                        password: passwordInput.value,
                        remember: document.getElementById('remember').checked
                    });

                    // 显示成功消息
                    alert('登录成功! 即将跳转到首页...');
                    // window.location.href = '/dashboard'; // 实际应用中跳转到仪表盘
                }
            });

            // 输入时实时验证
            emailInput.addEventListener('input', function() {
                if (this.value && /\S+@\S+\.\S+/.test(this.value)) {
                    this.classList.remove('border-red-500');
                    emailError.classList.add('hidden');
                }
            });

            passwordInput.addEventListener('input', function() {
                if (this.value && this.value.length >= 6) {
                    this.classList.remove('border-red-500');
                    passwordError.classList.add('hidden');
                }
            });
        });
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=EchoPixel/magic" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>