Update app.py
Browse files
app.py
CHANGED
|
@@ -38,51 +38,17 @@ COUNTER = """
|
|
| 38 |
background: linear-gradient(135deg, #0a0a0a 0%, #FF7A00 35%, #4A90E2 70%, #ffffff 100%);
|
| 39 |
border-radius: 20px;
|
| 40 |
padding: 40px;
|
| 41 |
-
box-shadow: 0
|
| 42 |
text-align: center;
|
| 43 |
max-width: 600px;
|
| 44 |
width: 100%;
|
| 45 |
margin: 0 auto;
|
| 46 |
display: block;
|
| 47 |
-
position: relative;
|
| 48 |
-
}
|
| 49 |
-
.countdown-container::before {
|
| 50 |
-
content: '';
|
| 51 |
-
position: absolute;
|
| 52 |
-
top: 0;
|
| 53 |
-
left: 0;
|
| 54 |
-
right: 0;
|
| 55 |
-
bottom: 0;
|
| 56 |
-
background: rgba(255, 255, 255, 0.85);
|
| 57 |
-
border-radius: 20px;
|
| 58 |
-
z-index: 1;
|
| 59 |
-
}
|
| 60 |
-
/* Dark theme adjustments */
|
| 61 |
-
@media (prefers-color-scheme: dark) {
|
| 62 |
-
.countdown-container::before {
|
| 63 |
-
background: rgba(0, 0, 0, 0.6);
|
| 64 |
-
}
|
| 65 |
-
|
| 66 |
-
.title {
|
| 67 |
-
color: #ffffff;
|
| 68 |
-
}
|
| 69 |
-
|
| 70 |
-
.number {
|
| 71 |
-
color: #ffffff;
|
| 72 |
-
}
|
| 73 |
-
|
| 74 |
-
.label {
|
| 75 |
-
color: #cccccc;
|
| 76 |
-
}
|
| 77 |
-
}
|
| 78 |
-
.countdown-container > * {
|
| 79 |
-
position: relative;
|
| 80 |
-
z-index: 2;
|
| 81 |
}
|
| 82 |
.title {
|
| 83 |
font-size: 28px;
|
| 84 |
font-weight: 600;
|
| 85 |
-
color:
|
| 86 |
margin-bottom: 40px;
|
| 87 |
}
|
| 88 |
.countdown {
|
|
@@ -111,12 +77,12 @@ COUNTER = """
|
|
| 111 |
}
|
| 112 |
.circle-bg {
|
| 113 |
fill: none;
|
| 114 |
-
stroke:
|
| 115 |
stroke-width: 6;
|
| 116 |
}
|
| 117 |
.circle-progress {
|
| 118 |
fill: none;
|
| 119 |
-
stroke:
|
| 120 |
stroke-width: 6;
|
| 121 |
stroke-linecap: round;
|
| 122 |
stroke-dasharray: 283;
|
|
@@ -130,13 +96,13 @@ COUNTER = """
|
|
| 130 |
transform: translate(-50%, -50%);
|
| 131 |
font-size: 32px;
|
| 132 |
font-weight: 700;
|
| 133 |
-
color:
|
| 134 |
font-family: 'Courier New', monospace;
|
| 135 |
}
|
| 136 |
.label {
|
| 137 |
font-size: 16px;
|
| 138 |
font-weight: 500;
|
| 139 |
-
color:
|
| 140 |
text-transform: uppercase;
|
| 141 |
letter-spacing: 1px;
|
| 142 |
}
|
|
@@ -163,7 +129,7 @@ COUNTER = """
|
|
| 163 |
</head>
|
| 164 |
<body>
|
| 165 |
<div class="countdown-container">
|
| 166 |
-
<h1 class="title">
|
| 167 |
<div class="countdown">
|
| 168 |
<div class="time-unit">
|
| 169 |
<div class="circle">
|
|
@@ -212,7 +178,7 @@ COUNTER = """
|
|
| 212 |
</div>
|
| 213 |
<script>
|
| 214 |
// Set target date to November 30, 2025, 11:59 PM UTC
|
| 215 |
-
const targetDate = new Date(Date.UTC(2025, 10,
|
| 216 |
|
| 217 |
function updateCountdown() {
|
| 218 |
const now = new Date();
|
|
@@ -607,36 +573,36 @@ with gr.Blocks(title="Gradio Agents & MCP Hackathon - Winter 2025", css=custom_c
|
|
| 607 |
# Output
|
| 608 |
output = gr.Markdown()
|
| 609 |
|
| 610 |
-
|
| 611 |
-
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
-
# Click event
|
| 620 |
-
submit_btn.click(
|
| 621 |
-
fn=lambda *args: (gr.Button("β³ Processing Registration...", interactive=False, variant="secondary"), ""),
|
| 622 |
-
inputs=[
|
| 623 |
-
full_name, email, github_username, hf_username,
|
| 624 |
-
track_interest, participation_type, teammates,
|
| 625 |
-
acknowledgment, project_description,
|
| 626 |
-
],
|
| 627 |
-
outputs=[submit_btn, output],
|
| 628 |
-
queue=False
|
| 629 |
-
).then(
|
| 630 |
-
fn=handle_registration_with_state,
|
| 631 |
-
inputs=[
|
| 632 |
-
full_name, email, github_username, hf_username,
|
| 633 |
-
track_interest, participation_type, teammates,
|
| 634 |
-
acknowledgment, project_description,
|
| 635 |
-
],
|
| 636 |
-
outputs=[output, submit_btn],
|
| 637 |
-
queue=True
|
| 638 |
-
)
|
| 639 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 640 |
# Footer
|
| 641 |
gr.Markdown("""
|
| 642 |
**Questions?** Join Huggingface [Discord](https://discord.gg/DVzRsYXy) or email: gradio-team@huggingface.co
|
|
|
|
| 38 |
background: linear-gradient(135deg, #0a0a0a 0%, #FF7A00 35%, #4A90E2 70%, #ffffff 100%);
|
| 39 |
border-radius: 20px;
|
| 40 |
padding: 40px;
|
| 41 |
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
| 42 |
text-align: center;
|
| 43 |
max-width: 600px;
|
| 44 |
width: 100%;
|
| 45 |
margin: 0 auto;
|
| 46 |
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
.title {
|
| 49 |
font-size: 28px;
|
| 50 |
font-weight: 600;
|
| 51 |
+
color: white;
|
| 52 |
margin-bottom: 40px;
|
| 53 |
}
|
| 54 |
.countdown {
|
|
|
|
| 77 |
}
|
| 78 |
.circle-bg {
|
| 79 |
fill: none;
|
| 80 |
+
stroke: rgba(255, 255, 255, 0.3);
|
| 81 |
stroke-width: 6;
|
| 82 |
}
|
| 83 |
.circle-progress {
|
| 84 |
fill: none;
|
| 85 |
+
stroke: white;
|
| 86 |
stroke-width: 6;
|
| 87 |
stroke-linecap: round;
|
| 88 |
stroke-dasharray: 283;
|
|
|
|
| 96 |
transform: translate(-50%, -50%);
|
| 97 |
font-size: 32px;
|
| 98 |
font-weight: 700;
|
| 99 |
+
color: white;
|
| 100 |
font-family: 'Courier New', monospace;
|
| 101 |
}
|
| 102 |
.label {
|
| 103 |
font-size: 16px;
|
| 104 |
font-weight: 500;
|
| 105 |
+
color: white;
|
| 106 |
text-transform: uppercase;
|
| 107 |
letter-spacing: 1px;
|
| 108 |
}
|
|
|
|
| 129 |
</head>
|
| 130 |
<body>
|
| 131 |
<div class="countdown-container">
|
| 132 |
+
<h1 class="title">Registrations and Submissions are available until November 30 UTC EOD</h1>
|
| 133 |
<div class="countdown">
|
| 134 |
<div class="time-unit">
|
| 135 |
<div class="circle">
|
|
|
|
| 178 |
</div>
|
| 179 |
<script>
|
| 180 |
// Set target date to November 30, 2025, 11:59 PM UTC
|
| 181 |
+
const targetDate = new Date(Date.UTC(2025, 10, 30, 23, 59, 59)); // Month is 0-indexed (10 = November)
|
| 182 |
|
| 183 |
function updateCountdown() {
|
| 184 |
const now = new Date();
|
|
|
|
| 573 |
# Output
|
| 574 |
output = gr.Markdown()
|
| 575 |
|
| 576 |
+
# Enhanced submit function
|
| 577 |
+
def handle_registration_with_state(*args):
|
| 578 |
+
try:
|
| 579 |
+
result = submit_registration(*args)
|
| 580 |
+
return result, gr.Button("π Register for Hackathon", interactive=True, variant="primary")
|
| 581 |
+
except Exception as e:
|
| 582 |
+
logger.error(f"Registration handling error: {e}")
|
| 583 |
+
return f"β An unexpected error occurred: {str(e)}", gr.Button("π Register for Hackathon", interactive=True, variant="primary")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 584 |
|
| 585 |
+
# Click event
|
| 586 |
+
submit_btn.click(
|
| 587 |
+
fn=lambda *args: (gr.Button("β³ Processing Registration...", interactive=False, variant="secondary"), ""),
|
| 588 |
+
inputs=[
|
| 589 |
+
full_name, email, github_username, hf_username,
|
| 590 |
+
track_interest, participation_type, teammates,
|
| 591 |
+
acknowledgment, project_description,
|
| 592 |
+
],
|
| 593 |
+
outputs=[submit_btn, output],
|
| 594 |
+
queue=False
|
| 595 |
+
).then(
|
| 596 |
+
fn=handle_registration_with_state,
|
| 597 |
+
inputs=[
|
| 598 |
+
full_name, email, github_username, hf_username,
|
| 599 |
+
track_interest, participation_type, teammates,
|
| 600 |
+
acknowledgment, project_description,
|
| 601 |
+
],
|
| 602 |
+
outputs=[output, submit_btn],
|
| 603 |
+
queue=True
|
| 604 |
+
)
|
| 605 |
+
|
| 606 |
# Footer
|
| 607 |
gr.Markdown("""
|
| 608 |
**Questions?** Join Huggingface [Discord](https://discord.gg/DVzRsYXy) or email: gradio-team@huggingface.co
|