Spaces:
Running
Running
feat: adjust html preview size
Browse files
app.py
CHANGED
|
@@ -513,12 +513,15 @@ def update_preview_from_html(html_content: str) -> str:
|
|
| 513 |
safe_html_content = html_content.replace('"', """)
|
| 514 |
preview_html = f"""
|
| 515 |
<div style='padding: 20px; width:100%; height:520px; background: #fff; border: 1px solid #eee; border-radius: 8px; display: block;'>
|
| 516 |
-
<
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
|
|
|
|
|
|
|
|
|
| 522 |
</div>
|
| 523 |
"""
|
| 524 |
return preview_html
|
|
|
|
| 513 |
safe_html_content = html_content.replace('"', """)
|
| 514 |
preview_html = f"""
|
| 515 |
<div style='padding: 20px; width:100%; height:520px; background: #fff; border: 1px solid #eee; border-radius: 8px; display: block;'>
|
| 516 |
+
<div style='display: block; align-items: center; margin-bottom: 10px;'>
|
| 517 |
+
</div>
|
| 518 |
+
<div id='animation-container' style='height: 100%; display: block; justify-content: center; align-items: center; background: #fafafa; border-radius: 4px; padding: 20px; box-sizing: border-box;'>
|
| 519 |
+
<iframe srcdoc="{safe_html_content}"
|
| 520 |
+
width="100%" height="100%"
|
| 521 |
+
style="border:none; border-radius:8px; overflow:hidden;"
|
| 522 |
+
sandbox="allow-scripts allow-same-origin">
|
| 523 |
+
</iframe>
|
| 524 |
+
</div>
|
| 525 |
</div>
|
| 526 |
"""
|
| 527 |
return preview_html
|