Roberta2024 commited on
Commit
3572f18
·
verified ·
1 Parent(s): 6aea680

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +167 -40
index.html CHANGED
@@ -12,6 +12,7 @@
12
  --light-bg: #f8f9fa;
13
  --white-bg: #ffffff;
14
  --shadow-color: rgba(0, 0, 0, 0.08);
 
15
  }
16
 
17
  body {
@@ -20,11 +21,91 @@
20
  padding: 0;
21
  background-color: var(--light-bg);
22
  display: flex;
23
- flex-direction: column;
24
  align-items: center;
25
  min-height: 100vh;
26
  }
27
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  .header {
29
  width: 100%;
30
  padding: 40px 0;
@@ -131,53 +212,99 @@
131
  </head>
132
  <body>
133
 
134
- <div class="header">
135
- <h1>Hugging Face System</h1>
136
- <h3>cjhuang@2025copyright</h3>
137
- </div>
138
-
139
- <div class="container">
140
- <div class="tab-container">
141
- <button class="tab-button active" onclick="showTab('tab1')">ESG爬蟲</button>
142
- <button class="tab-button" onclick="showTab('tab2')">GEMINI 對話機器人</button>
 
 
 
 
 
143
  </div>
144
 
145
- <div class="content-container">
146
- <div id="tab1" class="iframe-wrapper active">
147
- <iframe
148
- src="https://roberta2024-0825esgscraper.hf.space"
149
- frameborder="0"
150
- width="850"
151
- height="450"
152
- ></iframe>
153
  </div>
154
- <div id="tab2" class="iframe-wrapper">
155
- <iframe
156
- src="https://roberta2024-geminiapi.hf.space"
157
- frameborder="0"
158
- width="850"
159
- height="450"
160
- ></iframe>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  </div>
162
  </div>
163
- </div>
164
 
165
- <script>
166
- function showTab(tabId) {
167
- const allIframes = document.querySelectorAll('.iframe-wrapper');
168
- allIframes.forEach(iframe => {
169
- iframe.classList.remove('active');
170
- });
 
171
 
172
- const allButtons = document.querySelectorAll('.tab-button');
173
- allButtons.forEach(button => {
174
- button.classList.remove('active');
175
- });
176
 
177
- document.getElementById(tabId).classList.add('active');
178
- document.querySelector(`[onclick="showTab('${tabId}')"]`).classList.add('active');
179
- }
180
- </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
 
182
  </body>
183
  </html>
 
12
  --light-bg: #f8f9fa;
13
  --white-bg: #ffffff;
14
  --shadow-color: rgba(0, 0, 0, 0.08);
15
+ --red-color: #dc3545;
16
  }
17
 
18
  body {
 
21
  padding: 0;
22
  background-color: var(--light-bg);
23
  display: flex;
24
+ justify-content: center;
25
  align-items: center;
26
  min-height: 100vh;
27
  }
28
 
29
+ /* Login Container */
30
+ #login-container {
31
+ width: 90%;
32
+ max-width: 400px;
33
+ padding: 40px;
34
+ background-color: var(--white-bg);
35
+ border-radius: 12px;
36
+ box-shadow: 0 10px 30px var(--shadow-color);
37
+ text-align: center;
38
+ transition: opacity 0.5s ease-in-out;
39
+ }
40
+
41
+ #login-container h2 {
42
+ color: var(--text-color);
43
+ margin-bottom: 30px;
44
+ font-size: 1.8rem;
45
+ }
46
+
47
+ .input-group {
48
+ margin-bottom: 20px;
49
+ text-align: left;
50
+ }
51
+
52
+ .input-group label {
53
+ display: block;
54
+ margin-bottom: 8px;
55
+ font-weight: 600;
56
+ color: #495057;
57
+ }
58
+
59
+ .input-group input {
60
+ width: 100%;
61
+ padding: 12px 15px;
62
+ border: 1px solid #ced4da;
63
+ border-radius: 8px;
64
+ font-size: 1rem;
65
+ box-sizing: border-box;
66
+ transition: border-color 0.3s;
67
+ }
68
+
69
+ .input-group input:focus {
70
+ outline: none;
71
+ border-color: var(--primary-color);
72
+ }
73
+
74
+ #error-message {
75
+ color: var(--red-color);
76
+ margin-top: -10px;
77
+ margin-bottom: 20px;
78
+ font-weight: 500;
79
+ visibility: hidden; /* 預設隱藏 */
80
+ opacity: 0;
81
+ transition: opacity 0.3s;
82
+ }
83
+
84
+ #login-btn {
85
+ width: 100%;
86
+ padding: 12px;
87
+ border: none;
88
+ background-color: var(--primary-color);
89
+ color: var(--white-bg);
90
+ border-radius: 8px;
91
+ font-size: 1rem;
92
+ font-weight: 600;
93
+ cursor: pointer;
94
+ transition: background-color 0.3s;
95
+ }
96
+
97
+ #login-btn:hover {
98
+ background-color: #0056b3;
99
+ }
100
+
101
+ /* Main Content Container (from previous design) */
102
+ #main-content {
103
+ display: none; /* 預設隱藏主畫面 */
104
+ width: 100%;
105
+ flex-direction: column;
106
+ align-items: center;
107
+ }
108
+
109
  .header {
110
  width: 100%;
111
  padding: 40px 0;
 
212
  </head>
213
  <body>
214
 
215
+ <div id="login-container">
216
+ <h2>系統登入</h2>
217
+ <form id="loginForm">
218
+ <div class="input-group">
219
+ <label for="username">帳號</label>
220
+ <input type="text" id="username" name="username" placeholder="請輸入帳號" required>
221
+ </div>
222
+ <div class="input-group">
223
+ <label for="password">密碼</label>
224
+ <input type="password" id="password" name="password" placeholder="請輸入密碼" required>
225
+ </div>
226
+ <p id="error-message">帳號或密碼錯誤,請重新輸入。</p>
227
+ <button type="submit" id="login-btn">登入</button>
228
+ </form>
229
  </div>
230
 
231
+ <div id="main-content">
232
+ <div class="header">
233
+ <h1>Hugging Face System</h1>
234
+ <h3>cjhuang@2025copyright</h3>
 
 
 
 
235
  </div>
236
+ <div class="container">
237
+ <div class="tab-container">
238
+ <button class="tab-button active" onclick="showTab('tab1')">ESG爬蟲</button>
239
+ <button class="tab-button" onclick="showTab('tab2')">GEMINI 對話機器人</button>
240
+ </div>
241
+ <div class="content-container">
242
+ <div id="tab1" class="iframe-wrapper active">
243
+ <iframe
244
+ src="https://roberta2024-0825esgscraper.hf.space"
245
+ frameborder="0"
246
+ width="850"
247
+ height="450"
248
+ ></iframe>
249
+ </div>
250
+ <div id="tab2" class="iframe-wrapper">
251
+ <iframe
252
+ src="https://roberta2024-geminiapi.hf.space"
253
+ frameborder="0"
254
+ width="850"
255
+ height="450"
256
+ ></iframe>
257
+ </div>
258
+ </div>
259
  </div>
260
  </div>
 
261
 
262
+ <script>
263
+ // 頁籤切換邏輯 (從前一個版本繼承)
264
+ function showTab(tabId) {
265
+ const allIframes = document.querySelectorAll('.iframe-wrapper');
266
+ allIframes.forEach(iframe => {
267
+ iframe.classList.remove('active');
268
+ });
269
 
270
+ const allButtons = document.querySelectorAll('.tab-button');
271
+ allButtons.forEach(button => {
272
+ button.classList.remove('active');
273
+ });
274
 
275
+ document.getElementById(tabId).classList.add('active');
276
+ document.querySelector(`[onclick="showTab('${tabId}')"]`).classList.add('active');
277
+ }
278
+
279
+ // 登入驗證邏輯
280
+ document.getElementById('loginForm').addEventListener('submit', function(event) {
281
+ event.preventDefault(); // 阻止表單提交導致的頁面刷新
282
+
283
+ const usernameInput = document.getElementById('username').value;
284
+ const passwordInput = document.getElementById('password').value;
285
+ const errorMessage = document.getElementById('error-message');
286
+ const loginContainer = document.getElementById('login-container');
287
+ const mainContent = document.getElementById('main-content');
288
+
289
+ // 設定正確的帳號和密碼
290
+ const correctUsername = 'ROOT2025';
291
+ const correctPassword = '123456';
292
+
293
+ if (usernameInput === correctUsername && passwordInput === correctPassword) {
294
+ // 登入成功
295
+ errorMessage.style.visibility = 'hidden';
296
+ errorMessage.style.opacity = '0';
297
+
298
+ // 隱藏登入區塊並顯示主畫面
299
+ loginContainer.style.display = 'none';
300
+ mainContent.style.display = 'flex'; // 使用 flex 讓內容置中
301
+ } else {
302
+ // 登入失敗
303
+ errorMessage.style.visibility = 'visible';
304
+ errorMessage.style.opacity = '1';
305
+ }
306
+ });
307
+ </script>
308
 
309
  </body>
310
  </html>