123Sabrina commited on
Commit
49c3e6b
·
verified ·
1 Parent(s): 560c538

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +271 -19
index.html CHANGED
@@ -1,19 +1,271 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="zh-TW">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Hugging Face System 登入</title>
7
+ <style>
8
+ /* 全局與背景 */
9
+ body {
10
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
11
+ margin: 0;
12
+ background-color: #f0f2f5;
13
+ display: flex;
14
+ justify-content: center;
15
+ align-items: center;
16
+ min-height: 100vh;
17
+ padding: 20px 0;
18
+ }
19
+
20
+ /* 登入介面樣式 */
21
+ #login-container {
22
+ background: #ffffff;
23
+ padding: 40px;
24
+ border-radius: 10px;
25
+ box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
26
+ text-align: center;
27
+ width: 90%;
28
+ max-width: 400px;
29
+ transition: opacity 0.5s ease;
30
+ }
31
+
32
+ #login-container h2 {
33
+ margin-bottom: 30px;
34
+ color: #333;
35
+ font-weight: 600;
36
+ }
37
+
38
+ .input-group {
39
+ margin-bottom: 20px;
40
+ text-align: left;
41
+ }
42
+
43
+ .input-group label {
44
+ display: block;
45
+ margin-bottom: 8px;
46
+ color: #555;
47
+ font-weight: 500;
48
+ }
49
+
50
+ .input-group input {
51
+ width: 100%;
52
+ padding: 12px;
53
+ border: 1px solid #ccc;
54
+ border-radius: 6px;
55
+ box-sizing: border-box; /* 包含 padding 在寬度內 */
56
+ transition: border-color 0.3s;
57
+ }
58
+
59
+ .input-group input:focus {
60
+ border-color: #007bff;
61
+ outline: none;
62
+ }
63
+
64
+ #login-button {
65
+ width: 100%;
66
+ padding: 12px;
67
+ background-color: #007bff;
68
+ color: white;
69
+ border: none;
70
+ border-radius: 6px;
71
+ cursor: pointer;
72
+ font-size: 16px;
73
+ font-weight: 600;
74
+ transition: background-color 0.3s, transform 0.1s;
75
+ }
76
+
77
+ #login-button:hover {
78
+ background-color: #0056b3;
79
+ transform: translateY(-1px);
80
+ }
81
+
82
+ #error-message {
83
+ color: #dc3545;
84
+ margin-top: 15px;
85
+ font-weight: 500;
86
+ opacity: 0;
87
+ transition: opacity 0.3s;
88
+ }
89
+
90
+ /* Hugging Face System 框架樣式 (與前一個回答相同,但隱藏於一開始) */
91
+ #system-container {
92
+ display: none; /* 預設隱藏 */
93
+ width: 95%;
94
+ max-width: 1400px;
95
+ background: #ffffff;
96
+ box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
97
+ border-radius: 15px;
98
+ overflow: hidden;
99
+ border: 1px solid #dee2e6;
100
+ }
101
+
102
+ .tab-header {
103
+ display: flex;
104
+ justify-content: flex-end;
105
+ list-style: none;
106
+ padding: 0 30px;
107
+ margin: 0;
108
+ background-color: #e9ecef;
109
+ border-bottom: 3px solid #007bff;
110
+ }
111
+
112
+ .tab-header li {
113
+ padding: 12px 25px;
114
+ cursor: pointer;
115
+ background-color: transparent;
116
+ color: #495057;
117
+ margin-left: 5px;
118
+ border-radius: 10px 10px 0 0;
119
+ transition: background-color 0.3s ease, color 0.3s ease, transform 0.1s ease;
120
+ font-weight: 600;
121
+ border-bottom: none;
122
+ }
123
+
124
+ .tab-header li:hover {
125
+ background-color: #ced4da;
126
+ transform: translateY(-1px);
127
+ }
128
+
129
+ .tab-header li.active {
130
+ background-color: #007bff;
131
+ color: #fff;
132
+ box-shadow: 0 -3px 10px rgba(0, 123, 255, 0.3);
133
+ }
134
+
135
+ .tab-content {
136
+ padding: 20px;
137
+ }
138
+
139
+ .tab-pane {
140
+ display: none;
141
+ }
142
+
143
+ .tab-pane.active {
144
+ display: block;
145
+ }
146
+
147
+ .tab-pane iframe {
148
+ display: block;
149
+ width: 100%;
150
+ height: 650px;
151
+ border: 1px solid #ddd;
152
+ border-radius: 10px;
153
+ box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
154
+ }
155
+ </style>
156
+ </head>
157
+ <body>
158
+
159
+ <div id="login-container">
160
+ <h2>Hugging Face System 登入</h2>
161
+ <div class="input-group">
162
+ <label for="username">帳號</label>
163
+ <input type="text" id="username" placeholder="ROOT2025" required>
164
+ </div>
165
+ <div class="input-group">
166
+ <label for="password">密碼</label>
167
+ <input type="password" id="password" placeholder="123456" required>
168
+ </div>
169
+ <button id="login-button">登入</button>
170
+ <p id="error-message"></p>
171
+ </div>
172
+
173
+ <div id="system-container">
174
+ <ul class="tab-header">
175
+ <li class="tab-link active" data-tab="tab-1">多圖片文字辨識工具(Groq API|CSV/DOCX)</li>
176
+ <li class="tab-link" data-tab="tab-2">ESG爬蟲</li>
177
+ </ul>
178
+
179
+ <div class="tab-content">
180
+ <div id="tab-1" class="tab-pane active">
181
+ <iframe
182
+ src="https://123sabrina-mmml-2025.hf.space"
183
+ frameborder="0"
184
+ ></iframe>
185
+ </div>
186
+
187
+ <div id="tab-2" class="tab-pane">
188
+ <iframe
189
+ src="https://roberta2024-0825esgscraper.hf.space"
190
+ frameborder="0"
191
+ ></iframe>
192
+ </div>
193
+ </div>
194
+ </div>
195
+
196
+ <script>
197
+ document.addEventListener('DOMContentLoaded', () => {
198
+ // --- 登入驗證邏輯 ---
199
+ const CORRECT_USERNAME = 'ROOT2025';
200
+ const CORRECT_PASSWORD = '123456';
201
+
202
+ const loginContainer = document.getElementById('login-container');
203
+ const systemContainer = document.getElementById('system-container');
204
+ const loginButton = document.getElementById('login-button');
205
+ const usernameInput = document.getElementById('username');
206
+ const passwordInput = document.getElementById('password');
207
+ const errorMessage = document.getElementById('error-message');
208
+
209
+ const handleLogin = () => {
210
+ const enteredUsername = usernameInput.value;
211
+ const enteredPassword = passwordInput.value;
212
+
213
+ if (enteredUsername === CORRECT_USERNAME && enteredPassword === CORRECT_PASSWORD) {
214
+ // 登入成功
215
+ loginContainer.style.opacity = '0';
216
+ setTimeout(() => {
217
+ loginContainer.style.display = 'none';
218
+ systemContainer.style.display = 'block';
219
+ // 將頁面置中對齊系統框架
220
+ document.body.style.justifyContent = 'center';
221
+ document.body.style.alignItems = 'flex-start';
222
+ document.body.style.padding = '30px 0';
223
+
224
+ // 執行頁籤切換初始化
225
+ initTabs();
226
+ }, 500);
227
+
228
+ } else {
229
+ // 登入失敗
230
+ errorMessage.textContent = '帳號或密碼錯誤,請重新輸入。';
231
+ errorMessage.style.opacity = '1';
232
+ // 清空密碼欄位
233
+ passwordInput.value = '';
234
+ setTimeout(() => {
235
+ errorMessage.style.opacity = '0';
236
+ }, 3000);
237
+ }
238
+ };
239
+
240
+ // 監聽按鈕點擊
241
+ loginButton.addEventListener('click', handleLogin);
242
+
243
+ // 監聽輸入框的 Enter 鍵
244
+ passwordInput.addEventListener('keypress', (e) => {
245
+ if (e.key === 'Enter') {
246
+ handleLogin();
247
+ }
248
+ });
249
+
250
+ // --- 頁籤切換邏輯 ---
251
+ const initTabs = () => {
252
+ const tabs = document.querySelectorAll('.tab-link');
253
+ const tabPanes = document.querySelectorAll('.tab-pane');
254
+
255
+ tabs.forEach(tab => {
256
+ tab.addEventListener('click', () => {
257
+ const targetTab = tab.getAttribute('data-tab');
258
+
259
+ tabs.forEach(t => t.classList.remove('active'));
260
+ tabPanes.forEach(pane => pane.classList.remove('active'));
261
+
262
+ tab.classList.add('active');
263
+ document.getElementById(targetTab).classList.add('active');
264
+ });
265
+ });
266
+ };
267
+ });
268
+ </script>
269
+
270
+ </body>
271
+ </html>