Spaces:
Running
Running
Commit
·
ac00fba
1
Parent(s):
00d3f67
Refine UI layout
Browse files
app.py
CHANGED
@@ -244,7 +244,7 @@ def process_and_generate(image_input, image_path_from_state, sidebar_prompt, hea
|
|
244 |
return layout_preview, final_preview, final_code, layout_code, final_code, gr.update(value=package_url, visible=True)
|
245 |
|
246 |
|
247 |
-
with gr.Blocks(css="""
|
248 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
249 |
|
250 |
* {
|
@@ -368,26 +368,28 @@ with gr.Blocks(css="""
|
|
368 |
|
369 |
with gr.Column(scale=2):
|
370 |
gr.Markdown("## Preview Area")
|
371 |
-
gr.Markdown("**Tips**: \n- Use the sliders below to adjust the preview size and zoom level for better viewing experience. \n- Adjust the page's viewing angle by swiping up, down, left, or right. \n- Click the button
|
372 |
-
with gr.
|
373 |
-
with gr.
|
374 |
-
with gr.
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
|
|
|
|
391 |
|
392 |
gr.Examples(
|
393 |
examples=example_rows,
|
|
|
244 |
return layout_preview, final_preview, final_code, layout_code, final_code, gr.update(value=package_url, visible=True)
|
245 |
|
246 |
|
247 |
+
with gr.Blocks(theme=gr.theme.soft(), css="""
|
248 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
249 |
|
250 |
* {
|
|
|
368 |
|
369 |
with gr.Column(scale=2):
|
370 |
gr.Markdown("## Preview Area")
|
371 |
+
gr.Markdown("**Tips**: \n- Use the sliders below to adjust the preview size and zoom level for better viewing experience. \n- Adjust the page's viewing angle by swiping up, down, left, or right. \n- Click the download button on the right to download the generated package.")
|
372 |
+
with gr.Row():
|
373 |
+
with gr.Column(scale=4):
|
374 |
+
with gr.Tabs():
|
375 |
+
with gr.TabItem("Preview With Placeholder"):
|
376 |
+
with gr.Row():
|
377 |
+
scale_slider = gr.Slider(0.2, 1.5, value=0.55, step=0.05, label="Zoom")
|
378 |
+
width_slider = gr.Slider(400, 2000, value=1920, step=50, label="Canvas Width (px)")
|
379 |
+
height_slider = gr.Slider(300, 1200, value=1080, step=50, label="Canvas Height (px)")
|
380 |
+
|
381 |
+
html_preview = gr.HTML(label="Rendered HTML", show_label=False)
|
382 |
+
with gr.TabItem("Preview"):
|
383 |
+
with gr.Row():
|
384 |
+
scale_slider_with_placeholder = gr.Slider(0.2, 1.5, value=0.55, step=0.05, label="Zoom")
|
385 |
+
width_slider_with_placeholder = gr.Slider(400, 2000, value=1920, step=100, label="Canvas Width (px)")
|
386 |
+
height_slider_with_placeholder = gr.Slider(300, 1200, value=1080, step=50, label="Canvas Height (px)")
|
387 |
+
|
388 |
+
html_preview_with_placeholder = gr.HTML(label="Rendered HTML", show_label=False)
|
389 |
+
with gr.TabItem("Code"):
|
390 |
+
html_code_output = gr.Code(label="Generated HTML", language="html")
|
391 |
+
with gr.Column(scale=1):
|
392 |
+
download_button = gr.Button("Download Package", visible=False, variant="secondary", size="sm")
|
393 |
|
394 |
gr.Examples(
|
395 |
examples=example_rows,
|