Update app.py
Browse files
app.py
CHANGED
@@ -625,16 +625,21 @@ def visualize_color_psychology(brand: Dict) -> str:
|
|
625 |
|
626 |
def visualize_generic_brand(brand: Dict, theory: str) -> str:
|
627 |
"""์ผ๋ฐ์ ์ธ ๋ธ๋๋ ์๊ฐํ"""
|
628 |
-
|
|
|
|
|
|
|
|
|
629 |
<div style="max-width: 700px; margin: 20px auto; padding: 30px; background: #f8f9fa; border-radius: 12px; font-family: -apple-system, sans-serif;">
|
630 |
<h2 style="text-align: center; color: #2c3e50; margin-bottom: 10px;">{brand.get('brand_name', 'Brand')}</h2>
|
631 |
<p style="text-align: center; font-style: italic; color: #7f8c8d; margin-bottom: 30px;">"{brand.get('slogan', '')}"</p>
|
632 |
|
633 |
-
<div style="background: white; padding: 20px; border-radius: 8px;">
|
634 |
-
|
635 |
</div>
|
636 |
</div>
|
637 |
"""
|
|
|
638 |
|
639 |
# Gradio UI
|
640 |
with gr.Blocks(title="Ultimate Brand Theory Generator", theme=gr.themes.Soft()) as demo:
|
|
|
625 |
|
626 |
def visualize_generic_brand(brand: Dict, theory: str) -> str:
|
627 |
"""์ผ๋ฐ์ ์ธ ๋ธ๋๋ ์๊ฐํ"""
|
628 |
+
# JSON์ HTML๋ก ๋ณํ (f-string ๋ฐ์์ ์ฒ๋ฆฌ)
|
629 |
+
json_str = json.dumps(brand, ensure_ascii=False, indent=2)
|
630 |
+
json_html = json_str.replace("\n", "<br>").replace(" ", " ")
|
631 |
+
|
632 |
+
html = f"""
|
633 |
<div style="max-width: 700px; margin: 20px auto; padding: 30px; background: #f8f9fa; border-radius: 12px; font-family: -apple-system, sans-serif;">
|
634 |
<h2 style="text-align: center; color: #2c3e50; margin-bottom: 10px;">{brand.get('brand_name', 'Brand')}</h2>
|
635 |
<p style="text-align: center; font-style: italic; color: #7f8c8d; margin-bottom: 30px;">"{brand.get('slogan', '')}"</p>
|
636 |
|
637 |
+
<div style="background: white; padding: 20px; border-radius: 8px; font-family: monospace; font-size: 0.9em;">
|
638 |
+
<pre style="margin: 0; white-space: pre-wrap;">{json_str}</pre>
|
639 |
</div>
|
640 |
</div>
|
641 |
"""
|
642 |
+
return html
|
643 |
|
644 |
# Gradio UI
|
645 |
with gr.Blocks(title="Ultimate Brand Theory Generator", theme=gr.themes.Soft()) as demo:
|