codelion commited on
Commit
e41c5b1
·
verified ·
1 Parent(s): becc01f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
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
- sizes_items = [
35
- f"(max-width: {w}px) {w}px" for w, _ in SIZES[:-1]
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
- # Launch the app with share=True for public access
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()