DawnC commited on
Commit
cad3a94
โ€ข
1 Parent(s): cc6e1f1

Update search_history.py

Browse files
Files changed (1) hide show
  1. search_history.py +39 -23
search_history.py CHANGED
@@ -182,37 +182,57 @@ def create_history_tab(history_component: SearchHistoryComponent):
182
  with gr.TabItem("Recommendation Search History"):
183
  gr.HTML("""
184
  <style>
185
- .history-btn {
186
- font-size: 0.9em !important;
187
- padding: 8px 16px !important;
188
- border-radius: 6px !important;
189
  border: none !important;
190
  font-weight: 500 !important;
191
  transition: all 0.2s ease !important;
192
  color: white !important;
193
- text-transform: none !important;
 
 
 
194
  }
195
 
196
- /* Clear History ๆŒ‰้ˆ•ๆจฃๅผ */
197
  .clear-btn {
198
- background: linear-gradient(135deg, rgba(244, 67, 54, 0.85), rgba(255, 152, 0, 0.85)) !important;
 
199
  }
200
 
201
- /* Refresh ๆŒ‰้ˆ•ๆจฃๅผ */
202
- .refresh-btn {
203
- background: linear-gradient(135deg, rgba(66, 165, 245, 0.85), rgba(38, 166, 154, 0.85)) !important;
 
 
 
 
 
 
 
 
 
204
  }
205
 
206
- /* ๆ‡ธๆตฎๆ•ˆๆžœ */
207
- .history-btn:hover {
 
 
 
 
 
 
 
208
  transform: translateY(-1px);
209
- box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
210
  }
211
 
212
- /* ้ปžๆ“Šๆ•ˆๆžœ */
213
- .history-btn:active {
214
  transform: translateY(1px) scale(0.98);
215
- box-shadow: none !important;
 
216
  }
217
  </style>
218
 
@@ -256,18 +276,14 @@ def create_history_tab(history_component: SearchHistoryComponent):
256
  with gr.Column(scale=1):
257
  clear_history_btn = gr.Button(
258
  "๐Ÿ—‘๏ธ Clear History",
259
- variant="primary",
260
- size="sm",
261
- elem_id="clear-btn",
262
- elem_classes="custom-history-btn"
263
  )
264
  with gr.Column(scale=1):
265
  refresh_btn = gr.Button(
266
  "๐Ÿ”„ Refresh",
267
  variant="primary",
268
- size="sm",
269
- elem_id="refresh-btn",
270
- elem_classes="custom-history-btn"
271
  )
272
 
273
  history_display.value = history_component.format_history_html()
 
182
  with gr.TabItem("Recommendation Search History"):
183
  gr.HTML("""
184
  <style>
185
+ .custom-btn {
186
+ padding: 10px 20px !important;
187
+ border-radius: 8px !important;
 
188
  border: none !important;
189
  font-weight: 500 !important;
190
  transition: all 0.2s ease !important;
191
  color: white !important;
192
+ font-size: 1em !important;
193
+ cursor: pointer !important;
194
+ width: 100% !important;
195
+ min-height: 45px !important;
196
  }
197
 
198
+ /* Clear History ๆŒ‰้ˆ• - ็ด…่‰ฒๆผธๅฑค */
199
  .clear-btn {
200
+ background: linear-gradient(135deg, #FF6B6B, #FF8E72) !important;
201
+ box-shadow: 0 2px 4px rgba(255, 107, 107, 0.2) !important;
202
  }
203
 
204
+ /* Clear History ๆŒ‰้ˆ•ๆ‡ธๆตฎๆ•ˆๆžœ */
205
+ .clear-btn:hover {
206
+ background: linear-gradient(135deg, #FF5252, #FF7B69) !important;
207
+ transform: translateY(-1px);
208
+ box-shadow: 0 4px 8px rgba(255, 107, 107, 0.3) !important;
209
+ }
210
+
211
+ /* Clear History ๆŒ‰้ˆ•้ปžๆ“Šๆ•ˆๆžœ */
212
+ .clear-btn:active {
213
+ transform: translateY(1px) scale(0.98);
214
+ background: linear-gradient(135deg, #FF4242, #FF6B59) !important;
215
+ box-shadow: 0 1px 2px rgba(255, 107, 107, 0.2) !important;
216
  }
217
 
218
+ /* Refresh ๆŒ‰้ˆ• - ่—็ถ ่‰ฒๆผธๅฑค */
219
+ .refresh-btn {
220
+ background: linear-gradient(135deg, #4FACFE, #00F2FE) !important;
221
+ box-shadow: 0 2px 4px rgba(79, 172, 254, 0.2) !important;
222
+ }
223
+
224
+ /* Refresh ๆŒ‰้ˆ•ๆ‡ธๆตฎๆ•ˆๆžœ */
225
+ .refresh-btn:hover {
226
+ background: linear-gradient(135deg, #4295EA, #00E1FE) !important;
227
  transform: translateY(-1px);
228
+ box-shadow: 0 4px 8px rgba(79, 172, 254, 0.3) !important;
229
  }
230
 
231
+ /* Refresh ๆŒ‰้ˆ•้ปžๆ“Šๆ•ˆๆžœ */
232
+ .refresh-btn:active {
233
  transform: translateY(1px) scale(0.98);
234
+ background: linear-gradient(135deg, #3285DA, #00D1EE) !important;
235
+ box-shadow: 0 1px 2px rgba(79, 172, 254, 0.2) !important;
236
  }
237
  </style>
238
 
 
276
  with gr.Column(scale=1):
277
  clear_history_btn = gr.Button(
278
  "๐Ÿ—‘๏ธ Clear History",
279
+ variant="primary",
280
+ elem_classes="custom-btn clear-btn"
 
 
281
  )
282
  with gr.Column(scale=1):
283
  refresh_btn = gr.Button(
284
  "๐Ÿ”„ Refresh",
285
  variant="primary",
286
+ elem_classes="custom-btn refresh-btn"
 
 
287
  )
288
 
289
  history_display.value = history_component.format_history_html()