Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -355,6 +355,11 @@ def main_ui():
|
|
| 355 |
with gr.Blocks(
|
| 356 |
title="AI Image Generator",
|
| 357 |
theme=gr.themes.Base(),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 358 |
css="""
|
| 359 |
.info-box {
|
| 360 |
background-color: #f8f4f0;
|
|
@@ -897,6 +902,7 @@ def main_ui():
|
|
| 897 |
info_components = [child for child in demo.children if child != content_area]
|
| 898 |
|
| 899 |
|
|
|
|
| 900 |
start_btn.click(
|
| 901 |
fn=lambda: gr.update(visible=True),
|
| 902 |
inputs=None,
|
|
@@ -905,8 +911,12 @@ def main_ui():
|
|
| 905 |
fn=lambda: [gr.update(visible=False) for _ in info_components],
|
| 906 |
inputs=None,
|
| 907 |
outputs=info_components
|
|
|
|
|
|
|
|
|
|
| 908 |
)
|
| 909 |
-
|
|
|
|
| 910 |
|
| 911 |
return demo
|
| 912 |
|
|
|
|
| 355 |
with gr.Blocks(
|
| 356 |
title="AI Image Generator",
|
| 357 |
theme=gr.themes.Base(),
|
| 358 |
+
js="""
|
| 359 |
+
function scrollToTop() {
|
| 360 |
+
window.scrollTo(0, 0);
|
| 361 |
+
}
|
| 362 |
+
""",
|
| 363 |
css="""
|
| 364 |
.info-box {
|
| 365 |
background-color: #f8f4f0;
|
|
|
|
| 902 |
info_components = [child for child in demo.children if child != content_area]
|
| 903 |
|
| 904 |
|
| 905 |
+
|
| 906 |
start_btn.click(
|
| 907 |
fn=lambda: gr.update(visible=True),
|
| 908 |
inputs=None,
|
|
|
|
| 911 |
fn=lambda: [gr.update(visible=False) for _ in info_components],
|
| 912 |
inputs=None,
|
| 913 |
outputs=info_components
|
| 914 |
+
).then(
|
| 915 |
+
fn=None,
|
| 916 |
+
js="scrollToTop" # 👈 DIESE ZEILE HINZUFÜGEN
|
| 917 |
)
|
| 918 |
+
|
| 919 |
+
|
| 920 |
|
| 921 |
return demo
|
| 922 |
|