Spaces:
Running on Zero
Running on Zero
update app
Browse files
app.py
CHANGED
|
@@ -217,7 +217,6 @@ async def download_file(filename: str):
|
|
| 217 |
@app.get("/api/download-zip")
|
| 218 |
async def download_zip(std: str, small: str):
|
| 219 |
"""Packages both generated images into a single ZIP file and streams it."""
|
| 220 |
-
# Prevent path traversal by taking only the filename
|
| 221 |
std_name = Path(std).name
|
| 222 |
small_name = Path(small).name
|
| 223 |
|
|
@@ -574,14 +573,53 @@ async def homepage(request: Request):
|
|
| 574 |
border-radius: 20px; font-size: 13px; backdrop-filter: blur(4px);
|
| 575 |
}}
|
| 576 |
|
|
|
|
| 577 |
.loader {{
|
| 578 |
-
position: absolute; inset: 0;
|
| 579 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 580 |
}}
|
| 581 |
-
|
| 582 |
-
|
| 583 |
-
border-top-color: var(--ub-orange); border-radius: 50%;
|
| 584 |
-
animation: spin 1s linear infinite; margin-bottom: 15px;
|
| 585 |
}}
|
| 586 |
|
| 587 |
/* Examples */
|
|
@@ -599,8 +637,6 @@ async def homepage(request: Request):
|
|
| 599 |
.ex-card-img-wrap img {{ height: 100%; object-fit: cover; }}
|
| 600 |
.ex-card p {{ padding: 12px; margin: 0; font-size: 13px; color: var(--ub-muted); line-height: 1.4; }}
|
| 601 |
|
| 602 |
-
@keyframes spin {{ to {{ transform: rotate(360deg); }} }}
|
| 603 |
-
|
| 604 |
@media (max-width: 900px) {{
|
| 605 |
.layout {{ grid-template-columns: 1fr; height: auto; }}
|
| 606 |
.panel-body-slider {{ height: 450px; flex: none; }}
|
|
@@ -712,8 +748,12 @@ async def homepage(request: Request):
|
|
| 712 |
<div class="slider-handle" id="sliderHandle"></div>
|
| 713 |
|
| 714 |
<div class="loader" id="loader">
|
| 715 |
-
<div class="spinner">
|
| 716 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 717 |
</div>
|
| 718 |
</div>
|
| 719 |
</div>
|
|
|
|
| 217 |
@app.get("/api/download-zip")
|
| 218 |
async def download_zip(std: str, small: str):
|
| 219 |
"""Packages both generated images into a single ZIP file and streams it."""
|
|
|
|
| 220 |
std_name = Path(std).name
|
| 221 |
small_name = Path(small).name
|
| 222 |
|
|
|
|
| 573 |
border-radius: 20px; font-size: 13px; backdrop-filter: blur(4px);
|
| 574 |
}}
|
| 575 |
|
| 576 |
+
/* UPDATED LOADER ANIMATION */
|
| 577 |
.loader {{
|
| 578 |
+
position: absolute; inset: 0;
|
| 579 |
+
background: rgba(20, 0, 10, 0.7); /* dark aubergine tint */
|
| 580 |
+
backdrop-filter: blur(6px);
|
| 581 |
+
display: none; flex-direction: column;
|
| 582 |
+
align-items: center; justify-content: center; z-index: 20;
|
| 583 |
+
}}
|
| 584 |
+
.spinner-container {{
|
| 585 |
+
position: relative;
|
| 586 |
+
width: 65px; height: 65px;
|
| 587 |
+
margin-bottom: 25px;
|
| 588 |
+
}}
|
| 589 |
+
.spinner-ring {{
|
| 590 |
+
position: absolute;
|
| 591 |
+
width: 100%; height: 100%;
|
| 592 |
+
border-radius: 50%;
|
| 593 |
+
border: 3px solid transparent;
|
| 594 |
+
border-top-color: var(--ub-orange);
|
| 595 |
+
animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
|
| 596 |
+
}}
|
| 597 |
+
.spinner-ring:nth-child(2) {{
|
| 598 |
+
width: 75%; height: 75%;
|
| 599 |
+
top: 12.5%; left: 12.5%;
|
| 600 |
+
border-top-color: #f77c4d; /* lighter orange */
|
| 601 |
+
animation-duration: 1.5s;
|
| 602 |
+
animation-direction: reverse;
|
| 603 |
+
}}
|
| 604 |
+
.spinner-ring:nth-child(3) {{
|
| 605 |
+
width: 50%; height: 50%;
|
| 606 |
+
top: 25%; left: 25%;
|
| 607 |
+
border-top-color: #ffffff;
|
| 608 |
+
animation-duration: 0.9s;
|
| 609 |
+
}}
|
| 610 |
+
.loader-text {{
|
| 611 |
+
font-weight: 500;
|
| 612 |
+
font-size: 15px;
|
| 613 |
+
color: #ffffff;
|
| 614 |
+
letter-spacing: 1px;
|
| 615 |
+
animation: pulse 1.5s ease-in-out infinite;
|
| 616 |
+
}}
|
| 617 |
+
@keyframes pulse {{
|
| 618 |
+
0%, 100% {{ opacity: 1; }}
|
| 619 |
+
50% {{ opacity: 0.4; }}
|
| 620 |
}}
|
| 621 |
+
@keyframes spin {{
|
| 622 |
+
to {{ transform: rotate(360deg); }}
|
|
|
|
|
|
|
| 623 |
}}
|
| 624 |
|
| 625 |
/* Examples */
|
|
|
|
| 637 |
.ex-card-img-wrap img {{ height: 100%; object-fit: cover; }}
|
| 638 |
.ex-card p {{ padding: 12px; margin: 0; font-size: 13px; color: var(--ub-muted); line-height: 1.4; }}
|
| 639 |
|
|
|
|
|
|
|
| 640 |
@media (max-width: 900px) {{
|
| 641 |
.layout {{ grid-template-columns: 1fr; height: auto; }}
|
| 642 |
.panel-body-slider {{ height: 450px; flex: none; }}
|
|
|
|
| 748 |
<div class="slider-handle" id="sliderHandle"></div>
|
| 749 |
|
| 750 |
<div class="loader" id="loader">
|
| 751 |
+
<div class="spinner-container">
|
| 752 |
+
<div class="spinner-ring"></div>
|
| 753 |
+
<div class="spinner-ring"></div>
|
| 754 |
+
<div class="spinner-ring"></div>
|
| 755 |
+
</div>
|
| 756 |
+
<div class="loader-text">Running both decoders...</div>
|
| 757 |
</div>
|
| 758 |
</div>
|
| 759 |
</div>
|