Spaces:
Running
on
Zero
Running
on
Zero
Update search_history.py
Browse files- 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 |
-
.
|
| 186 |
-
|
| 187 |
-
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
| 194 |
}
|
| 195 |
|
| 196 |
-
/* Clear History
|
| 197 |
.clear-btn {
|
| 198 |
-
background: linear-gradient(135deg,
|
|
|
|
| 199 |
}
|
| 200 |
|
| 201 |
-
/*
|
| 202 |
-
.
|
| 203 |
-
background: linear-gradient(135deg,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 204 |
}
|
| 205 |
|
| 206 |
-
/*
|
| 207 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
transform: translateY(-1px);
|
| 209 |
-
box-shadow: 0
|
| 210 |
}
|
| 211 |
|
| 212 |
-
/*
|
| 213 |
-
.
|
| 214 |
transform: translateY(1px) scale(0.98);
|
| 215 |
-
|
|
|
|
| 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 |
-
|
| 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 |
-
|
| 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()
|