Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -66,7 +66,7 @@ def fetch_search_results(query):
|
|
| 66 |
|
| 67 |
@app.route('/', methods=['GET'])
|
| 68 |
def search_page():
|
| 69 |
-
"""Serve the initial page or process search with a
|
| 70 |
query = request.args.get('query', '')
|
| 71 |
page = request.args.get('page', '1')
|
| 72 |
btn = request.args.get('btn', 'LLM Search')
|
|
@@ -107,12 +107,12 @@ def search_page():
|
|
| 107 |
.search-buttons { text-align: center; }
|
| 108 |
.progress-container { display: none; max-width: 584px; margin: 20px auto; }
|
| 109 |
.progress-bar {
|
| 110 |
-
width:
|
| 111 |
-
border-radius: 10px; animation:
|
| 112 |
}
|
| 113 |
-
@keyframes
|
| 114 |
-
from { width:
|
| 115 |
-
to { width:
|
| 116 |
}
|
| 117 |
</style>
|
| 118 |
<script>
|
|
@@ -182,6 +182,11 @@ def search_page():
|
|
| 182 |
.search-buttons {{ text-align: center; }}
|
| 183 |
.error {{ color: red; text-align: center; }}
|
| 184 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 185 |
</head>
|
| 186 |
<body onload="hideProgress()">
|
| 187 |
<div class="header">
|
|
@@ -215,17 +220,17 @@ def search_page():
|
|
| 215 |
<style>
|
| 216 |
.progress-container {{ max-width: 584px; margin: 20px auto; }}
|
| 217 |
.progress-bar {{
|
| 218 |
-
width:
|
| 219 |
-
border-radius: 10px; animation:
|
| 220 |
}}
|
| 221 |
-
@keyframes
|
| 222 |
</style>
|
| 223 |
</head>
|
| 224 |
<body>
|
| 225 |
<div class="progress-container" id="progress">
|
| 226 |
<div class="progress-bar"></div>
|
| 227 |
</div>
|
| 228 |
-
<p>Redirecting to {first_url}...</p>
|
| 229 |
<script>
|
| 230 |
setTimeout(function() {{ window.location.href = "{first_url}"; }}, 100);
|
| 231 |
</script>
|
|
@@ -268,6 +273,11 @@ def search_page():
|
|
| 268 |
}}
|
| 269 |
.search-buttons {{ text-align: center; }}
|
| 270 |
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 271 |
</head>
|
| 272 |
<body onload="hideProgress()">
|
| 273 |
<div class="header">
|
|
@@ -332,14 +342,14 @@ def search_page():
|
|
| 332 |
color: #1a0dab; font-size: 14px; margin: 0 8px; text-decoration: none;
|
| 333 |
}}
|
| 334 |
.pagination a:hover {{ text-decoration: underline; }}
|
| 335 |
-
.progress-container {{ display: none; max-width: 584px; margin: 20px auto; }}
|
| 336 |
.progress-bar {{
|
| 337 |
-
width:
|
| 338 |
-
border-radius: 10px; animation:
|
| 339 |
}}
|
| 340 |
-
@keyframes
|
| 341 |
-
from {{ width:
|
| 342 |
-
to {{ width:
|
| 343 |
}}
|
| 344 |
</style>
|
| 345 |
<script>
|
|
|
|
| 66 |
|
| 67 |
@app.route('/', methods=['GET'])
|
| 68 |
def search_page():
|
| 69 |
+
"""Serve the initial page or process search with a left-to-right progress bar."""
|
| 70 |
query = request.args.get('query', '')
|
| 71 |
page = request.args.get('page', '1')
|
| 72 |
btn = request.args.get('btn', 'LLM Search')
|
|
|
|
| 107 |
.search-buttons { text-align: center; }
|
| 108 |
.progress-container { display: none; max-width: 584px; margin: 20px auto; }
|
| 109 |
.progress-bar {
|
| 110 |
+
width: 0%; height: 20px; background-color: #4285f4;
|
| 111 |
+
border-radius: 10px; animation: progress 30s ease-out forwards;
|
| 112 |
}
|
| 113 |
+
@keyframes progress {
|
| 114 |
+
from { width: 0%; }
|
| 115 |
+
to { width: 100%; }
|
| 116 |
}
|
| 117 |
</style>
|
| 118 |
<script>
|
|
|
|
| 182 |
.search-buttons {{ text-align: center; }}
|
| 183 |
.error {{ color: red; text-align: center; }}
|
| 184 |
</style>
|
| 185 |
+
<script>
|
| 186 |
+
function hideProgress() {{
|
| 187 |
+
document.getElementById('progress').style.display = 'none';
|
| 188 |
+
}}
|
| 189 |
+
</script>
|
| 190 |
</head>
|
| 191 |
<body onload="hideProgress()">
|
| 192 |
<div class="header">
|
|
|
|
| 220 |
<style>
|
| 221 |
.progress-container {{ max-width: 584px; margin: 20px auto; }}
|
| 222 |
.progress-bar {{
|
| 223 |
+
width: 0%; height: 20px; background-color: #4285f4;
|
| 224 |
+
border-radius: 10px; animation: progress 30s ease-out forwards;
|
| 225 |
}}
|
| 226 |
+
@keyframes progress {{ from {{ width: 0%; }} to {{ width: 100%; }} }}
|
| 227 |
</style>
|
| 228 |
</head>
|
| 229 |
<body>
|
| 230 |
<div class="progress-container" id="progress">
|
| 231 |
<div class="progress-bar"></div>
|
| 232 |
</div>
|
| 233 |
+
<p style="text-align: center;">Redirecting to {first_url}...</p>
|
| 234 |
<script>
|
| 235 |
setTimeout(function() {{ window.location.href = "{first_url}"; }}, 100);
|
| 236 |
</script>
|
|
|
|
| 273 |
}}
|
| 274 |
.search-buttons {{ text-align: center; }}
|
| 275 |
</style>
|
| 276 |
+
<script>
|
| 277 |
+
function hideProgress() {{
|
| 278 |
+
document.getElementById('progress').style.display = 'none';
|
| 279 |
+
}}
|
| 280 |
+
</script>
|
| 281 |
</head>
|
| 282 |
<body onload="hideProgress()">
|
| 283 |
<div class="header">
|
|
|
|
| 342 |
color: #1a0dab; font-size: 14px; margin: 0 8px; text-decoration: none;
|
| 343 |
}}
|
| 344 |
.pagination a:hover {{ text-decoration: underline; }}
|
| 345 |
+
.progress-container {{ display: none; max-width: 584px; margin: 20px auto; border: 1px solid #dfe1e5; border-radius: 10px; }}
|
| 346 |
.progress-bar {{
|
| 347 |
+
width: 0%; height: 20px; background-color: #4285f4;
|
| 348 |
+
border-radius: 10px; animation: progress 30s ease-out forwards;
|
| 349 |
}}
|
| 350 |
+
@keyframes progress {{
|
| 351 |
+
from {{ width: 0%; }}
|
| 352 |
+
to {{ width: 100%; }}
|
| 353 |
}}
|
| 354 |
</style>
|
| 355 |
<script>
|