ginipick commited on
Commit
a27cdb1
·
verified ·
1 Parent(s): f14f5bc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -9
app.py CHANGED
@@ -65,7 +65,7 @@ example_prompts = {
65
  ]
66
  }
67
 
68
- # CSS style: prevent example Accordion from expanding into the sidebar
69
  css = """
70
  * {
71
  box-sizing: border-box;
@@ -83,7 +83,7 @@ body {
83
  padding: 30px 40px;
84
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
85
  margin: 40px auto;
86
- max-width: 1200px;
87
  }
88
  .sidebar {
89
  background: rgba(255, 255, 255, 0.98);
@@ -107,15 +107,20 @@ button:hover, .btn:hover {
107
  transform: scale(1.05);
108
  }
109
  .example-accordion {
 
110
  max-width: 100% !important;
111
  }
 
 
 
 
112
  """
113
 
114
- with gr.Blocks(css=css, title="Business Agent") as demo:
115
  gr.Markdown(
116
  """
117
  <div style="text-align:center;">
118
- <h1>Business Agent</h1>
119
  <p>Generate design concepts and workflow diagrams for your business needs using our multi-tab interface.</p>
120
  <p><strong>AI Spaces:</strong> Product Design, Flowchart, Infographic, Mockup, Diagram</p>
121
  </div>
@@ -138,7 +143,12 @@ with gr.Blocks(css=css, title="Business Agent") as demo:
138
  with gr.Tabs():
139
  # First tab: Product Design
140
  with gr.Tab("Product Design"):
141
- pd_prompt = gr.Textbox(label="Product Design Prompt", placeholder="Enter a product design concept...", lines=5)
 
 
 
 
 
142
  pd_generate = gr.Button("Generate Product Design")
143
  pd_image = gr.Image(label="Generated Product Design")
144
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):
@@ -147,7 +157,12 @@ with gr.Blocks(css=css, title="Business Agent") as demo:
147
 
148
  # Second tab: Flowchart
149
  with gr.Tab("Flowchart"):
150
- flow_prompt = gr.Textbox(label="Flowchart Prompt", placeholder="Enter a flowchart description...", lines=5)
 
 
 
 
 
151
  flow_generate = gr.Button("Generate Flowchart")
152
  flow_image = gr.Image(label="Generated Flowchart")
153
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):
@@ -156,7 +171,12 @@ with gr.Blocks(css=css, title="Business Agent") as demo:
156
 
157
  # Third tab: Infographic
158
  with gr.Tab("Infographic"):
159
- info_prompt = gr.Textbox(label="Infographic Prompt", placeholder="Enter an infographic description...", lines=5)
 
 
 
 
 
160
  info_generate = gr.Button("Generate Infographic")
161
  info_image = gr.Image(label="Generated Infographic")
162
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):
@@ -165,7 +185,12 @@ with gr.Blocks(css=css, title="Business Agent") as demo:
165
 
166
  # Fourth tab: Mockup
167
  with gr.Tab("Mockup"):
168
- mock_prompt = gr.Textbox(label="Mockup Prompt", placeholder="Enter a mockup description...", lines=5)
 
 
 
 
 
169
  mock_generate = gr.Button("Generate Mockup")
170
  mock_image = gr.Image(label="Generated Mockup")
171
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):
@@ -174,7 +199,12 @@ with gr.Blocks(css=css, title="Business Agent") as demo:
174
 
175
  # Fifth tab: Diagram
176
  with gr.Tab("Diagram"):
177
- diag_prompt = gr.Textbox(label="Diagram Prompt", placeholder="Enter a diagram description...", lines=5)
 
 
 
 
 
178
  diag_generate = gr.Button("Generate Diagram")
179
  diag_image = gr.Image(label="Generated Diagram")
180
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):
 
65
  ]
66
  }
67
 
68
+ # CSS style: fixed container width and prevent examples from expanding the layout
69
  css = """
70
  * {
71
  box-sizing: border-box;
 
83
  padding: 30px 40px;
84
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
85
  margin: 40px auto;
86
+ width: 1200px;
87
  }
88
  .sidebar {
89
  background: rgba(255, 255, 255, 0.98);
 
107
  transform: scale(1.05);
108
  }
109
  .example-accordion {
110
+ width: 100% !important;
111
  max-width: 100% !important;
112
  }
113
+ .example-accordion button {
114
+ width: auto !important;
115
+ white-space: normal !important;
116
+ }
117
  """
118
 
119
+ with gr.Blocks(css=css, title="Workflow Canvas") as demo:
120
  gr.Markdown(
121
  """
122
  <div style="text-align:center;">
123
+ <h1>Workflow Canvas</h1>
124
  <p>Generate design concepts and workflow diagrams for your business needs using our multi-tab interface.</p>
125
  <p><strong>AI Spaces:</strong> Product Design, Flowchart, Infographic, Mockup, Diagram</p>
126
  </div>
 
143
  with gr.Tabs():
144
  # First tab: Product Design
145
  with gr.Tab("Product Design"):
146
+ pd_prompt = gr.Textbox(
147
+ label="Product Design Prompt",
148
+ placeholder="Enter a product design concept...",
149
+ lines=5,
150
+ value=example_prompts["Product Design"][0]
151
+ )
152
  pd_generate = gr.Button("Generate Product Design")
153
  pd_image = gr.Image(label="Generated Product Design")
154
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):
 
157
 
158
  # Second tab: Flowchart
159
  with gr.Tab("Flowchart"):
160
+ flow_prompt = gr.Textbox(
161
+ label="Flowchart Prompt",
162
+ placeholder="Enter a flowchart description...",
163
+ lines=5,
164
+ value=example_prompts["Flowchart"][0]
165
+ )
166
  flow_generate = gr.Button("Generate Flowchart")
167
  flow_image = gr.Image(label="Generated Flowchart")
168
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):
 
171
 
172
  # Third tab: Infographic
173
  with gr.Tab("Infographic"):
174
+ info_prompt = gr.Textbox(
175
+ label="Infographic Prompt",
176
+ placeholder="Enter an infographic description...",
177
+ lines=5,
178
+ value=example_prompts["Infographic"][0]
179
+ )
180
  info_generate = gr.Button("Generate Infographic")
181
  info_image = gr.Image(label="Generated Infographic")
182
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):
 
185
 
186
  # Fourth tab: Mockup
187
  with gr.Tab("Mockup"):
188
+ mock_prompt = gr.Textbox(
189
+ label="Mockup Prompt",
190
+ placeholder="Enter a mockup description...",
191
+ lines=5,
192
+ value=example_prompts["Mockup"][0]
193
+ )
194
  mock_generate = gr.Button("Generate Mockup")
195
  mock_image = gr.Image(label="Generated Mockup")
196
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):
 
199
 
200
  # Fifth tab: Diagram
201
  with gr.Tab("Diagram"):
202
+ diag_prompt = gr.Textbox(
203
+ label="Diagram Prompt",
204
+ placeholder="Enter a diagram description...",
205
+ lines=5,
206
+ value=example_prompts["Diagram"][0]
207
+ )
208
  diag_generate = gr.Button("Generate Diagram")
209
  diag_image = gr.Image(label="Generated Diagram")
210
  with gr.Accordion("Example Prompts", open=False, elem_classes="example-accordion"):