mikao007 commited on
Commit
5ff3aaa
·
verified ·
1 Parent(s): 9026b7c

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +203 -84
index.html CHANGED
@@ -5,148 +5,267 @@
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>LLM+ Web scraping Application</title>
7
  <style>
8
- body {
9
- font-family: Arial, sans-serif;
10
- display: flex;
11
- height: 100vh;
12
  margin: 0;
13
- flex-direction: column;
14
- background-color: #f4f4f9;
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  }
16
 
17
  .header {
18
  text-align: center;
19
- padding: 20px;
20
- background-color: #fff;
21
- border-bottom: 2px solid #ddd;
22
  }
23
 
24
- .header h1 {
25
- margin: 0;
26
- font-size: 2.5em;
27
- color: #333;
 
28
  }
29
 
30
- .header h2 {
31
- margin: 5px 0 0;
32
- font-size: 1em;
33
- color: #777;
34
  }
35
 
36
- .container {
37
  display: flex;
38
- flex-grow: 1;
 
 
 
 
39
  }
40
 
41
  .sidebar {
42
- width: 250px;
43
- background-color: #333;
44
- color: white;
45
- padding: 20px;
46
- box-shadow: 2px 0 5px rgba(0,0,0,0.1);
47
  }
48
 
49
- .sidebar ul {
50
- list-style-type: none;
51
- padding: 0;
 
 
 
 
 
 
 
 
 
52
  }
53
 
54
- .sidebar li {
55
- margin-bottom: 10px;
 
56
  }
57
 
58
- .sidebar button {
59
- background-color: #555;
60
- color: white;
61
- border: none;
62
- padding: 15px;
63
- text-align: left;
64
- width: 100%;
65
- font-size: 1.1em;
66
- cursor: pointer;
67
- transition: background-color 0.3s ease;
68
  }
69
 
70
- .sidebar button:hover, .sidebar button.active {
71
- background-color: #007bff;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  }
73
 
74
  .content {
75
- flex-grow: 1;
76
- padding: 20px;
77
- display: flex;
78
- justify-content: center;
79
- align-items: center;
80
- background-color: #e9ecef;
81
  }
82
 
83
- .iframe-container {
84
  display: none;
85
  width: 100%;
86
  height: 100%;
87
- max-width: 850px;
88
- max-height: 450px;
89
- border: 2px solid #ccc;
90
- border-radius: 8px;
91
- overflow: hidden;
92
- background-color: #fff;
93
  }
94
 
95
- .iframe-container.active {
96
  display: block;
97
  }
98
 
 
 
 
 
 
 
 
 
 
99
  iframe {
100
  width: 100%;
101
  height: 100%;
102
  border: none;
103
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  </style>
105
  </head>
106
  <body>
107
- <div class="header">
108
- <h1>LLM+ Web scraping Application</h1>
109
- <h2>cj huang@2025copyright</h2>
110
- </div>
111
-
112
  <div class="container">
113
- <div class="sidebar">
114
- <ul>
115
- <li><button onclick="showIframe('iframe01')" class="active">ESG 爬蟲</button></li>
116
- <li><button onclick="showIframe('iframe02')">多模態 API 應用</button></li>
117
- </ul>
118
  </div>
119
- <div class="content">
120
- <div id="iframe01" class="iframe-container active">
121
- <iframe src="https://cjian2025-0824-demo.hf.space" frameborder="0"></iframe>
 
 
 
 
 
 
 
 
122
  </div>
123
- <div id="iframe02" class="iframe-container">
124
- <iframe src="https://cjian2025-groq-api-gradio.hf.space" frameborder="0"></iframe>
 
 
 
 
 
 
 
 
 
 
 
 
 
125
  </div>
126
  </div>
127
  </div>
128
 
129
  <script>
130
- function showIframe(iframeId) {
131
- // 隱藏所有 iframe
132
- const iframes = document.querySelectorAll('.iframe-container');
133
- iframes.forEach(iframe => {
134
- iframe.classList.remove('active');
135
  });
136
 
137
- // 顯示點擊的 iframe
138
- const activeIframe = document.getElementById(iframeId);
139
- activeIframe.classList.add('active');
140
-
141
- // 移除所有按鈕的 active 狀態
142
- const buttons = document.querySelectorAll('.sidebar button');
143
  buttons.forEach(button => {
144
  button.classList.remove('active');
145
  });
146
 
147
- // 為被點擊的按鈕添加 active 狀態
148
- event.currentTarget.classList.add('active');
 
 
 
149
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  </script>
151
  </body>
152
- </html>
 
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
  <title>LLM+ Web scraping Application</title>
7
  <style>
8
+ * {
 
 
 
9
  margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ body {
15
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
16
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
17
+ min-height: 100vh;
18
+ }
19
+
20
+ .container {
21
+ max-width: 1400px;
22
+ margin: 0 auto;
23
+ padding: 20px;
24
+ min-height: 100vh;
25
  }
26
 
27
  .header {
28
  text-align: center;
29
+ margin-bottom: 30px;
30
+ color: white;
 
31
  }
32
 
33
+ .main-title {
34
+ font-size: 2.5rem;
35
+ font-weight: 700;
36
+ margin-bottom: 10px;
37
+ text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
38
  }
39
 
40
+ .subtitle {
41
+ font-size: 1.1rem;
42
+ opacity: 0.9;
43
+ font-weight: 300;
44
  }
45
 
46
+ .app-container {
47
  display: flex;
48
+ background: white;
49
+ border-radius: 15px;
50
+ box-shadow: 0 20px 40px rgba(0,0,0,0.2);
51
+ overflow: hidden;
52
+ min-height: 600px;
53
  }
54
 
55
  .sidebar {
56
+ width: 300px;
57
+ background: linear-gradient(180deg, #2c3e50 0%, #34495e 100%);
58
+ padding: 0;
59
+ display: flex;
60
+ flex-direction: column;
61
  }
62
 
63
+ .tab-button {
64
+ padding: 25px 30px;
65
+ border: none;
66
+ background: transparent;
67
+ color: #ecf0f1;
68
+ font-size: 1.1rem;
69
+ font-weight: 500;
70
+ cursor: pointer;
71
+ text-align: left;
72
+ transition: all 0.3s ease;
73
+ border-bottom: 1px solid rgba(255,255,255,0.1);
74
+ position: relative;
75
  }
76
 
77
+ .tab-button:hover {
78
+ background: rgba(255,255,255,0.1);
79
+ transform: translateX(5px);
80
  }
81
 
82
+ .tab-button.active {
83
+ background: rgba(74, 144, 226, 0.3);
84
+ border-left: 4px solid #4a90e2;
 
 
 
 
 
 
 
85
  }
86
 
87
+ .tab-button.active::before {
88
+ content: '';
89
+ position: absolute;
90
+ right: 0;
91
+ top: 50%;
92
+ transform: translateY(-50%);
93
+ width: 0;
94
+ height: 0;
95
+ border-top: 10px solid transparent;
96
+ border-bottom: 10px solid transparent;
97
+ border-right: 10px solid white;
98
+ }
99
+
100
+ .tab-title {
101
+ font-weight: 600;
102
+ margin-bottom: 5px;
103
+ }
104
+
105
+ .tab-description {
106
+ font-size: 0.9rem;
107
+ opacity: 0.8;
108
+ line-height: 1.4;
109
  }
110
 
111
  .content {
112
+ flex: 1;
113
+ padding: 0;
114
+ background: #f8f9fa;
115
+ position: relative;
 
 
116
  }
117
 
118
+ .tab-content {
119
  display: none;
120
  width: 100%;
121
  height: 100%;
122
+ padding: 20px;
 
 
 
 
 
123
  }
124
 
125
+ .tab-content.active {
126
  display: block;
127
  }
128
 
129
+ .iframe-container {
130
+ width: 100%;
131
+ height: 560px;
132
+ border-radius: 10px;
133
+ overflow: hidden;
134
+ box-shadow: 0 10px 20px rgba(0,0,0,0.1);
135
+ background: white;
136
+ }
137
+
138
  iframe {
139
  width: 100%;
140
  height: 100%;
141
  border: none;
142
  }
143
+
144
+ .loading {
145
+ display: flex;
146
+ justify-content: center;
147
+ align-items: center;
148
+ height: 100%;
149
+ color: #666;
150
+ font-size: 1.1rem;
151
+ }
152
+
153
+ .loading::before {
154
+ content: '';
155
+ width: 20px;
156
+ height: 20px;
157
+ border: 2px solid #ddd;
158
+ border-top: 2px solid #4a90e2;
159
+ border-radius: 50%;
160
+ animation: spin 1s linear infinite;
161
+ margin-right: 10px;
162
+ }
163
+
164
+ @keyframes spin {
165
+ 0% { transform: rotate(0deg); }
166
+ 100% { transform: rotate(360deg); }
167
+ }
168
+
169
+ @media (max-width: 768px) {
170
+ .app-container {
171
+ flex-direction: column;
172
+ }
173
+
174
+ .sidebar {
175
+ width: 100%;
176
+ flex-direction: row;
177
+ overflow-x: auto;
178
+ }
179
+
180
+ .tab-button {
181
+ min-width: 200px;
182
+ white-space: nowrap;
183
+ }
184
+
185
+ .iframe-container {
186
+ height: 400px;
187
+ }
188
+
189
+ .main-title {
190
+ font-size: 2rem;
191
+ }
192
+ }
193
  </style>
194
  </head>
195
  <body>
 
 
 
 
 
196
  <div class="container">
197
+ <div class="header">
198
+ <h1 class="main-title">LLM+ Web scraping Application</h1>
199
+ <p class="subtitle">mikao07@2025copyright</p>
 
 
200
  </div>
201
+
202
+ <div class="app-container">
203
+ <div class="sidebar">
204
+ <button class="tab-button active" onclick="showTab('tab1')">
205
+ <div class="tab-title">ESG爬蟲</div>
206
+ <div class="tab-description">環境、社會與治理數據爬蟲工具</div>
207
+ </button>
208
+ <button class="tab-button" onclick="showTab('tab2')">
209
+ <div class="tab-title">多模態API應用</div>
210
+ <div class="tab-description">整合多種模態的API應用介面</div>
211
+ </button>
212
  </div>
213
+
214
+ <div class="content">
215
+ <div id="tab1" class="tab-content active">
216
+ <div class="iframe-container">
217
+ <div class="loading">載入中...</div>
218
+ <iframe src="https://mikao007-g-space-st.hf.space" onload="hideLoading(this)"></iframe>
219
+ </div>
220
+ </div>
221
+
222
+ <div id="tab2" class="tab-content">
223
+ <div class="iframe-container">
224
+ <div class="loading">載入中...</div>
225
+ <iframe src="https://mikao007-groq-api-gradio.hf.space" onload="hideLoading(this)"></iframe>
226
+ </div>
227
+ </div>
228
  </div>
229
  </div>
230
  </div>
231
 
232
  <script>
233
+ function showTab(tabId) {
234
+ // 隱藏所有內容
235
+ const contents = document.querySelectorAll('.tab-content');
236
+ contents.forEach(content => {
237
+ content.classList.remove('active');
238
  });
239
 
240
+ // 移除所有按鈕的active狀態
241
+ const buttons = document.querySelectorAll('.tab-button');
 
 
 
 
242
  buttons.forEach(button => {
243
  button.classList.remove('active');
244
  });
245
 
246
+ // 顯示選中的內容
247
+ document.getElementById(tabId).classList.add('active');
248
+
249
+ // 添加選中按鈕的active狀態
250
+ event.target.closest('.tab-button').classList.add('active');
251
  }
252
+
253
+ function hideLoading(iframe) {
254
+ const container = iframe.parentElement;
255
+ const loading = container.querySelector('.loading');
256
+ if (loading) {
257
+ loading.style.display = 'none';
258
+ }
259
+ iframe.style.display = 'block';
260
+ }
261
+
262
+ // 初始化載入動畫
263
+ document.addEventListener('DOMContentLoaded', function() {
264
+ const iframes = document.querySelectorAll('iframe');
265
+ iframes.forEach(iframe => {
266
+ iframe.style.display = 'none';
267
+ });
268
+ });
269
  </script>
270
  </body>
271
+ </html>