JaishnaCodz commited on
Commit
210d41a
·
verified ·
1 Parent(s): 1d1f3c9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +53 -43
app.py CHANGED
@@ -129,39 +129,42 @@ async def review_blog(text_input, url_input, progress=gr.Progress()):
129
  except Exception as e:
130
  return "Review Blog", f"Error creating temporary file: {str(e)}", gr.update(visible=False)
131
 
132
- # Enhanced custom CSS for a more attractive UI
133
  custom_css = """
134
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
135
  .gradio-container {
136
  font-family: 'Inter', sans-serif !important;
137
- background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
138
- padding: 20px;
139
- border-radius: 12px;
140
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
 
141
  }
142
  h1, h3 {
143
- color: #1a3c34;
144
  text-align: center;
145
  font-weight: 700;
146
- margin-bottom: 10px;
 
147
  }
148
  .review-btn {
149
- background: linear-gradient(45deg, #2c3e50, #3498db);
150
  color: white;
151
  font-weight: 600;
152
  border: none;
153
- border-radius: 10px;
154
- padding: 12px 24px;
155
  transition: all 0.3s ease;
156
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
 
157
  }
158
  .review-btn:hover {
159
- background: linear-gradient(45deg, #3498db, #2c3e50);
160
- transform: translateY(-2px);
161
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
162
  }
163
  .review-btn:disabled {
164
- opacity: 0.6;
165
  cursor: not-allowed;
166
  transform: none;
167
  box-shadow: none;
@@ -172,56 +175,63 @@ h1, h3 {
172
  .tab-nav button {
173
  font-family: 'Inter', sans-serif;
174
  font-weight: 600;
175
- background: #ffffff;
176
- color: #2c3e50;
177
- border-radius: 8px 8px 0 0;
178
- padding: 10px 20px;
179
  transition: all 0.2s ease;
 
180
  }
181
  .tab-nav button:hover {
182
- background: #3498db;
183
  color: white;
 
184
  }
185
  input, textarea {
186
  font-family: 'Inter', sans-serif;
187
- border: 1px solid #d1d5db;
188
- border-radius: 8px;
189
- padding: 10px;
190
  background: #ffffff;
191
- box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
 
 
192
  }
193
  .gr-textbox textarea {
194
  resize: vertical;
 
195
  }
196
  .gr-progress {
197
- background: #e2e8f0;
198
- border-radius: 10px;
199
  overflow: hidden;
200
- height: 24px;
201
  }
202
  .gr-progress > div {
203
- background: linear-gradient(90deg, #34c759, #4CAF50);
204
  height: 100%;
205
- transition: width 0.4s ease-in-out;
206
  }
207
  .markdown-container {
208
  background: #ffffff;
209
- border-radius: 8px;
210
- padding: 20px;
211
- box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
212
  margin-top: 20px;
 
213
  }
214
  .download-btn {
215
- background: #4CAF50;
216
  color: white;
217
- border-radius: 8px;
218
- padding: 10px 20px;
219
- font-weight: 500;
220
  transition: all 0.3s ease;
 
221
  }
222
  .download-btn:hover {
223
- background: #45a049;
224
- transform: translateY(-2px);
225
  }
226
  """
227
 
@@ -230,7 +240,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as demo:
230
  gr.Markdown(
231
  """
232
  # 📝 AI Blog Reviewer
233
- Analyze your blog content for grammar, legal issues, crude language, and sensitive topics with ease.
234
  """
235
  )
236
  with gr.Row():
@@ -254,9 +264,9 @@ with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as demo:
254
  gr.Markdown(
255
  """
256
  ### How It Works
257
- 1. **Input**: Paste blog text or provide a URL.
258
- 2. **Analysis**: Our AI reviews for grammar, legal issues, and more.
259
- 3. **Report**: Get a detailed markdown report with suggestions.
260
  """
261
  )
262
  status_button = gr.Button("Review Blog", elem_classes=["review-btn"])
@@ -265,7 +275,7 @@ with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as demo:
265
  with gr.Row():
266
  with gr.Column():
267
  report_output = gr.Markdown(elem_classes=["markdown-container"])
268
- download_btn = gr.File(label="Download Report as Markdown", visible=False, elem_classes=["download-btn"])
269
 
270
  status_button.click(
271
  fn=review_blog,
 
129
  except Exception as e:
130
  return "Review Blog", f"Error creating temporary file: {str(e)}", gr.update(visible=False)
131
 
132
+ # Enhanced custom CSS for a more attractive and user-friendly UI
133
  custom_css = """
134
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
135
  .gradio-container {
136
  font-family: 'Inter', sans-serif !important;
137
+ background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
138
+ padding: 30px;
139
+ border-radius: 15px;
140
+ box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
141
+ color: #2d3748;
142
  }
143
  h1, h3 {
144
+ color: #2b6cb0;
145
  text-align: center;
146
  font-weight: 700;
147
+ margin-bottom: 15px;
148
+ text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
149
  }
150
  .review-btn {
151
+ background: linear-gradient(45deg, #4a90e2, #63b3ed);
152
  color: white;
153
  font-weight: 600;
154
  border: none;
155
+ border-radius: 12px;
156
+ padding: 14px 28px;
157
  transition: all 0.3s ease;
158
+ box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
159
+ cursor: pointer;
160
  }
161
  .review-btn:hover {
162
+ background: linear-gradient(45deg, #63b3ed, #4a90e2);
163
+ transform: translateY(-3px);
164
+ box-shadow: 0 6px 15px rgba(74, 144, 226, 0.4);
165
  }
166
  .review-btn:disabled {
167
+ opacity: 0.7;
168
  cursor: not-allowed;
169
  transform: none;
170
  box-shadow: none;
 
175
  .tab-nav button {
176
  font-family: 'Inter', sans-serif;
177
  font-weight: 600;
178
+ background: #edf2f7;
179
+ color: #2d3748;
180
+ border-radius: 10px 10px 0 0;
181
+ padding: 12px 24px;
182
  transition: all 0.2s ease;
183
+ border: 1px solid #e2e8f0;
184
  }
185
  .tab-nav button:hover {
186
+ background: #4a90e2;
187
  color: white;
188
+ border-color: #4a90e2;
189
  }
190
  input, textarea {
191
  font-family: 'Inter', sans-serif;
192
+ border: 2px solid #e2e8f0;
193
+ border-radius: 10px;
194
+ padding: 12px;
195
  background: #ffffff;
196
+ box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
197
+ color: #2d3748;
198
+ font-size: 16px;
199
  }
200
  .gr-textbox textarea {
201
  resize: vertical;
202
+ min-height: 150px;
203
  }
204
  .gr-progress {
205
+ background: #edf2f7;
206
+ border-radius: 12px;
207
  overflow: hidden;
208
+ height: 30px;
209
  }
210
  .gr-progress > div {
211
+ background: linear-gradient(90deg, #48bb78, #38a169);
212
  height: 100%;
213
+ transition: width 0.5s ease;
214
  }
215
  .markdown-container {
216
  background: #ffffff;
217
+ border-radius: 12px;
218
+ padding: 25px;
219
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
220
  margin-top: 20px;
221
+ color: #2d3748;
222
  }
223
  .download-btn {
224
+ background: #48bb78;
225
  color: white;
226
+ border-radius: 10px;
227
+ padding: 12px 24px;
228
+ font-weight: 600;
229
  transition: all 0.3s ease;
230
+ cursor: pointer;
231
  }
232
  .download-btn:hover {
233
+ background: #38a169;
234
+ transform: translateY(-3px);
235
  }
236
  """
237
 
 
240
  gr.Markdown(
241
  """
242
  # 📝 AI Blog Reviewer
243
+ Easily analyze your blog for grammar, legal issues, crude language, and sensitive topics.
244
  """
245
  )
246
  with gr.Row():
 
264
  gr.Markdown(
265
  """
266
  ### How It Works
267
+ 1. **Input**: Paste text or provide a URL.
268
+ 2. **Analysis**: AI checks grammar, legal issues, and more.
269
+ 3. **Report**: Download a detailed markdown report.
270
  """
271
  )
272
  status_button = gr.Button("Review Blog", elem_classes=["review-btn"])
 
275
  with gr.Row():
276
  with gr.Column():
277
  report_output = gr.Markdown(elem_classes=["markdown-container"])
278
+ download_btn = gr.File(label="Download Report", visible=False, elem_classes=["download-btn"])
279
 
280
  status_button.click(
281
  fn=review_blog,