Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from urllib.parse import urlparse
|
|
| 8 |
# Hardcoded API endpoint - Updated to correct endpoint
|
| 9 |
API_ENDPOINT = "https://jaybene1-testapicontacts.hf.space/contacts"
|
| 10 |
|
| 11 |
-
# Professional color scheme inspired by
|
| 12 |
theme = gr.themes.Soft(
|
| 13 |
primary_hue="blue",
|
| 14 |
secondary_hue="slate",
|
|
@@ -17,22 +17,22 @@ theme = gr.themes.Soft(
|
|
| 17 |
spacing_size="md",
|
| 18 |
radius_size="md"
|
| 19 |
).set(
|
| 20 |
-
body_background_fill="#
|
| 21 |
-
body_background_fill_dark="#
|
| 22 |
-
block_background_fill="#
|
| 23 |
-
block_background_fill_dark="#
|
| 24 |
-
block_border_color="#
|
| 25 |
-
block_border_color_dark="#
|
| 26 |
-
input_background_fill="#
|
| 27 |
-
input_background_fill_dark="#
|
| 28 |
-
input_border_color="#
|
| 29 |
-
input_border_color_dark="#
|
| 30 |
button_primary_background_fill="#1e40af",
|
| 31 |
-
button_primary_background_fill_hover="#
|
| 32 |
button_primary_text_color="#ffffff",
|
| 33 |
-
button_secondary_background_fill="#
|
| 34 |
-
button_secondary_background_fill_hover="#
|
| 35 |
-
button_secondary_text_color="#
|
| 36 |
)
|
| 37 |
|
| 38 |
def normalize_url(url: str) -> str:
|
|
@@ -352,51 +352,60 @@ def create_sample_data():
|
|
| 352 |
*Search completed at: 2025-01-15 10:30:00*'''
|
| 353 |
|
| 354 |
# Create the Gradio interface
|
| 355 |
-
with gr.Blocks(theme=theme, title="Contact Search
|
| 356 |
.gradio-container {
|
| 357 |
max-width: 1200px !important;
|
| 358 |
margin: 0 auto !important;
|
| 359 |
}
|
| 360 |
.header {
|
| 361 |
-
background: linear-gradient(135deg, #
|
| 362 |
color: white;
|
| 363 |
padding: 2rem;
|
| 364 |
border-radius: 0.5rem;
|
| 365 |
margin-bottom: 2rem;
|
| 366 |
text-align: center;
|
|
|
|
| 367 |
}
|
| 368 |
.header h1 {
|
| 369 |
margin: 0;
|
| 370 |
font-size: 2.5rem;
|
| 371 |
font-weight: 700;
|
| 372 |
margin-bottom: 0.5rem;
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
margin: 0;
|
| 376 |
-
font-size: 1.2rem;
|
| 377 |
-
opacity: 0.9;
|
| 378 |
}
|
| 379 |
.info-box {
|
| 380 |
-
background: #
|
| 381 |
-
border: 1px solid #
|
| 382 |
border-radius: 0.5rem;
|
| 383 |
padding: 1rem;
|
| 384 |
margin: 1rem 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 385 |
}
|
| 386 |
.footer {
|
| 387 |
text-align: center;
|
| 388 |
margin-top: 2rem;
|
| 389 |
padding-top: 2rem;
|
| 390 |
-
border-top: 1px solid #
|
| 391 |
-
color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 392 |
}
|
| 393 |
""") as demo:
|
| 394 |
|
| 395 |
# Header
|
| 396 |
gr.HTML("""
|
| 397 |
<div class="header">
|
| 398 |
-
<h1>Contact Search Tool</h1>
|
| 399 |
-
<p>Professional contact discovery powered by AI</p>
|
| 400 |
</div>
|
| 401 |
""")
|
| 402 |
|
|
@@ -425,7 +434,6 @@ with gr.Blocks(theme=theme, title="Contact Search - Kwekel Companies", css="""
|
|
| 425 |
|
| 426 |
with gr.Row():
|
| 427 |
search_btn = gr.Button("Search Contacts", variant="primary", scale=2)
|
| 428 |
-
demo_btn = gr.Button("Show Demo", variant="secondary", scale=1)
|
| 429 |
clear_btn = gr.Button("Clear", variant="secondary", scale=1)
|
| 430 |
|
| 431 |
with gr.Row():
|
|
@@ -449,11 +457,6 @@ with gr.Blocks(theme=theme, title="Contact Search - Kwekel Companies", css="""
|
|
| 449 |
outputs=[results_output, json_output]
|
| 450 |
)
|
| 451 |
|
| 452 |
-
demo_btn.click(
|
| 453 |
-
fn=lambda: (create_sample_data(), '{"contacts": [{"name": "John Smith", "email": "john.smith@example.com", "title": "CEO"}]}'),
|
| 454 |
-
outputs=[results_output, json_output]
|
| 455 |
-
)
|
| 456 |
-
|
| 457 |
clear_btn.click(
|
| 458 |
fn=lambda: ("", ""),
|
| 459 |
outputs=[url_input, results_output]
|
|
@@ -462,7 +465,7 @@ with gr.Blocks(theme=theme, title="Contact Search - Kwekel Companies", css="""
|
|
| 462 |
# Footer
|
| 463 |
gr.HTML("""
|
| 464 |
<div class="footer">
|
| 465 |
-
<p>© 2025 Contact Search Tool
|
| 466 |
</div>
|
| 467 |
""")
|
| 468 |
|
|
|
|
| 8 |
# Hardcoded API endpoint - Updated to correct endpoint
|
| 9 |
API_ENDPOINT = "https://jaybene1-testapicontacts.hf.space/contacts"
|
| 10 |
|
| 11 |
+
# Professional color scheme inspired by sale leaseback theme
|
| 12 |
theme = gr.themes.Soft(
|
| 13 |
primary_hue="blue",
|
| 14 |
secondary_hue="slate",
|
|
|
|
| 17 |
spacing_size="md",
|
| 18 |
radius_size="md"
|
| 19 |
).set(
|
| 20 |
+
body_background_fill="#1a1a1a",
|
| 21 |
+
body_background_fill_dark="#1a1a1a",
|
| 22 |
+
block_background_fill="#2d2d2d",
|
| 23 |
+
block_background_fill_dark="#2d2d2d",
|
| 24 |
+
block_border_color="#404040",
|
| 25 |
+
block_border_color_dark="#404040",
|
| 26 |
+
input_background_fill="#2d2d2d",
|
| 27 |
+
input_background_fill_dark="#2d2d2d",
|
| 28 |
+
input_border_color="#555555",
|
| 29 |
+
input_border_color_dark="#555555",
|
| 30 |
button_primary_background_fill="#1e40af",
|
| 31 |
+
button_primary_background_fill_hover="#2563eb",
|
| 32 |
button_primary_text_color="#ffffff",
|
| 33 |
+
button_secondary_background_fill="#404040",
|
| 34 |
+
button_secondary_background_fill_hover="#555555",
|
| 35 |
+
button_secondary_text_color="#ffffff"
|
| 36 |
)
|
| 37 |
|
| 38 |
def normalize_url(url: str) -> str:
|
|
|
|
| 352 |
*Search completed at: 2025-01-15 10:30:00*'''
|
| 353 |
|
| 354 |
# Create the Gradio interface
|
| 355 |
+
with gr.Blocks(theme=theme, title="Kwekel Companies Contact Search Tool", css="""
|
| 356 |
.gradio-container {
|
| 357 |
max-width: 1200px !important;
|
| 358 |
margin: 0 auto !important;
|
| 359 |
}
|
| 360 |
.header {
|
| 361 |
+
background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
|
| 362 |
color: white;
|
| 363 |
padding: 2rem;
|
| 364 |
border-radius: 0.5rem;
|
| 365 |
margin-bottom: 2rem;
|
| 366 |
text-align: center;
|
| 367 |
+
border: 1px solid #404040;
|
| 368 |
}
|
| 369 |
.header h1 {
|
| 370 |
margin: 0;
|
| 371 |
font-size: 2.5rem;
|
| 372 |
font-weight: 700;
|
| 373 |
margin-bottom: 0.5rem;
|
| 374 |
+
color: #ffffff;
|
| 375 |
+
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
|
|
|
|
|
|
|
|
|
|
| 376 |
}
|
| 377 |
.info-box {
|
| 378 |
+
background: #2d2d2d;
|
| 379 |
+
border: 1px solid #1e40af;
|
| 380 |
border-radius: 0.5rem;
|
| 381 |
padding: 1rem;
|
| 382 |
margin: 1rem 0;
|
| 383 |
+
color: #ffffff;
|
| 384 |
+
}
|
| 385 |
+
.info-box h3 {
|
| 386 |
+
color: #ffffff;
|
| 387 |
+
margin-top: 0;
|
| 388 |
}
|
| 389 |
.footer {
|
| 390 |
text-align: center;
|
| 391 |
margin-top: 2rem;
|
| 392 |
padding-top: 2rem;
|
| 393 |
+
border-top: 1px solid #404040;
|
| 394 |
+
color: #cccccc;
|
| 395 |
+
}
|
| 396 |
+
body {
|
| 397 |
+
background-color: #1a1a1a !important;
|
| 398 |
+
color: #ffffff !important;
|
| 399 |
+
}
|
| 400 |
+
.dark {
|
| 401 |
+
background-color: #1a1a1a !important;
|
| 402 |
}
|
| 403 |
""") as demo:
|
| 404 |
|
| 405 |
# Header
|
| 406 |
gr.HTML("""
|
| 407 |
<div class="header">
|
| 408 |
+
<h1>Kwekel Companies Contact Search Tool</h1>
|
|
|
|
| 409 |
</div>
|
| 410 |
""")
|
| 411 |
|
|
|
|
| 434 |
|
| 435 |
with gr.Row():
|
| 436 |
search_btn = gr.Button("Search Contacts", variant="primary", scale=2)
|
|
|
|
| 437 |
clear_btn = gr.Button("Clear", variant="secondary", scale=1)
|
| 438 |
|
| 439 |
with gr.Row():
|
|
|
|
| 457 |
outputs=[results_output, json_output]
|
| 458 |
)
|
| 459 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 460 |
clear_btn.click(
|
| 461 |
fn=lambda: ("", ""),
|
| 462 |
outputs=[url_input, results_output]
|
|
|
|
| 465 |
# Footer
|
| 466 |
gr.HTML("""
|
| 467 |
<div class="footer">
|
| 468 |
+
<p>© 2025 Kwekel Companies Contact Search Tool</p>
|
| 469 |
</div>
|
| 470 |
""")
|
| 471 |
|