Update app.py
Browse files
app.py
CHANGED
@@ -31,10 +31,8 @@ def generate_html_snippet(image_path_prefix):
|
|
31 |
srcset_items = [f"{image_path_prefix}-{w}x{h}.jpg {w}w" for w, h in SIZES]
|
32 |
srcset_str = ",\n ".join(srcset_items)
|
33 |
|
34 |
-
|
35 |
-
|
36 |
-
] + [f"{SIZES[-1][0]}px"]
|
37 |
-
sizes_str = ",\n ".join(sizes_items)
|
38 |
|
39 |
# Use the middle size as default src
|
40 |
default_size = SIZES[4] # 1280x1128
|
@@ -186,5 +184,4 @@ with gr.Blocks(title="Responsive Image Generator") as app:
|
|
186 |
outputs=[output_zip, output_html, output_message]
|
187 |
)
|
188 |
|
189 |
-
|
190 |
-
app.launch(share=True)
|
|
|
31 |
srcset_items = [f"{image_path_prefix}-{w}x{h}.jpg {w}w" for w, h in SIZES]
|
32 |
srcset_str = ",\n ".join(srcset_items)
|
33 |
|
34 |
+
# Using min-width for better responsive behavior
|
35 |
+
sizes_str = "(min-width: 1000px) 45vw, (min-width: 780px) 696px, (min-width: 580px) 480px, calc(100vw - 60px)"
|
|
|
|
|
36 |
|
37 |
# Use the middle size as default src
|
38 |
default_size = SIZES[4] # 1280x1128
|
|
|
184 |
outputs=[output_zip, output_html, output_message]
|
185 |
)
|
186 |
|
187 |
+
app.launch()
|
|