JaishnaCodz commited on
Commit
d233c20
Β·
verified Β·
1 Parent(s): febcb2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -28
app.py CHANGED
@@ -142,26 +142,27 @@ async def review_blog(text_input, url_input):
142
 
143
  # Custom CSS for hover effect, loading state, and Inter font
144
  custom_css = """
145
- @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
146
  .gradio-container {
147
  font-family: 'Inter', sans-serif !important;
 
148
  }
149
  .review-btn {
150
  transition: all 0.3s ease;
151
- font-weight: 500;
152
- background-color: #2c3e50;
 
153
  color: white;
154
- border-radius: 8px;
155
- padding: 10px 20px;
156
- position: relative;
157
  }
158
  .review-btn:hover {
159
- background-color: #4CAF50;
160
- color: white;
161
- transform: scale(1.05);
162
  }
163
  .review-btn:disabled {
164
- opacity: 0.7;
165
  cursor: not-allowed;
166
  }
167
  .review-btn:disabled::before {
@@ -169,7 +170,7 @@ custom_css = """
169
  display: inline-block;
170
  width: 16px;
171
  height: 16px;
172
- border: 2px solid #fff;
173
  border-radius: 50%;
174
  border-top-color: transparent;
175
  animation: spin 1s linear infinite;
@@ -180,33 +181,50 @@ custom_css = """
180
  0% { transform: rotate(0deg); }
181
  100% { transform: rotate(360deg); }
182
  }
183
- .tab-nav button {
184
- font-family: 'Inter', sans-serif;
185
- font-weight: 500;
186
- }
187
  input, textarea {
188
  font-family: 'Inter', sans-serif;
 
 
 
189
  }
190
  """
191
 
192
- # Gradio UI with Tabs
193
- with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as demo:
194
- gr.Markdown("# πŸ“ AI Blog Reviewer")
195
- gr.Markdown("Enter blog text or a URL to review for grammar, legal issues, crude language, and sensitive topics. The report is generated in markdown format.")
 
 
 
 
 
 
 
 
196
 
197
  with gr.Tabs():
198
- with gr.TabItem("Text"):
199
- text_input = gr.Textbox(lines=8, label="Blog Content", placeholder="Paste your blog text here...")
200
- with gr.TabItem("URL"):
201
- url_input = gr.Textbox(lines=1, label="Blog URL", placeholder="Enter the blog URL here...")
202
-
203
- status_button = gr.Button(value="Review Blog", elem_classes=["review-btn"])
 
 
 
 
 
 
 
 
 
 
204
 
205
  gr.Markdown("### πŸ“„ Review Report")
206
- report_output = gr.Markdown()
207
- download_btn = gr.File(label="Download Report", visible=False)
208
 
209
- # Bind the review button to process inputs
210
  status_button.click(
211
  fn=review_blog,
212
  inputs=[text_input, url_input],
 
142
 
143
  # Custom CSS for hover effect, loading state, and Inter font
144
  custom_css = """
145
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
146
  .gradio-container {
147
  font-family: 'Inter', sans-serif !important;
148
+ background-color: #f9f9f9;
149
  }
150
  .review-btn {
151
  transition: all 0.3s ease;
152
+ font-weight: 600;
153
+ font-size: 16px;
154
+ background-color: #1f2937;
155
  color: white;
156
+ border-radius: 12px;
157
+ padding: 12px 24px;
158
+ margin-top: 10px;
159
  }
160
  .review-btn:hover {
161
+ background-color: #10b981;
162
+ transform: scale(1.03);
 
163
  }
164
  .review-btn:disabled {
165
+ opacity: 0.6;
166
  cursor: not-allowed;
167
  }
168
  .review-btn:disabled::before {
 
170
  display: inline-block;
171
  width: 16px;
172
  height: 16px;
173
+ border: 3px solid #fff;
174
  border-radius: 50%;
175
  border-top-color: transparent;
176
  animation: spin 1s linear infinite;
 
181
  0% { transform: rotate(0deg); }
182
  100% { transform: rotate(360deg); }
183
  }
 
 
 
 
184
  input, textarea {
185
  font-family: 'Inter', sans-serif;
186
+ font-size: 15px;
187
+ padding: 10px;
188
+ border-radius: 8px;
189
  }
190
  """
191
 
192
+ with gr.Blocks(theme=gr.themes.Base(), css=custom_css) as demo:
193
+ gr.Markdown("## πŸ“ AI Blog Reviewer", elem_id="title")
194
+ gr.Markdown(
195
+ """
196
+ <div style="font-size: 16px; color: #444; line-height: 1.6;">
197
+ πŸ“Œ Enter your blog text or a blog URL below.<br>
198
+ βœ… The AI will check for grammar, legal issues, crude language, and sensitive content.<br>
199
+ 🧾 A detailed report will be shown and available to download.
200
+ </div>
201
+ """,
202
+ elem_id="description"
203
+ )
204
 
205
  with gr.Tabs():
206
+ with gr.TabItem("✍️ Text Input"):
207
+ text_input = gr.Textbox(
208
+ lines=10,
209
+ label="Your Blog Content",
210
+ placeholder="Paste your blog text here...",
211
+ show_label=True
212
+ )
213
+ with gr.TabItem("🌐 URL Input"):
214
+ url_input = gr.Textbox(
215
+ lines=1,
216
+ label="Blog URL",
217
+ placeholder="Enter the blog URL here...",
218
+ show_label=True
219
+ )
220
+
221
+ status_button = gr.Button(value="πŸš€ Review Blog", elem_classes=["review-btn"])
222
 
223
  gr.Markdown("### πŸ“„ Review Report")
224
+ report_output = gr.Markdown(elem_id="report-markdown")
225
+ download_btn = gr.File(label="πŸ“₯ Download Markdown Report", visible=False)
226
 
227
+ # Bind button click
228
  status_button.click(
229
  fn=review_blog,
230
  inputs=[text_input, url_input],