Spaces:
Running
Running
Update app.py
Browse files
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;
|
146 |
.gradio-container {
|
147 |
font-family: 'Inter', sans-serif !important;
|
|
|
148 |
}
|
149 |
.review-btn {
|
150 |
transition: all 0.3s ease;
|
151 |
-
font-weight:
|
152 |
-
|
|
|
153 |
color: white;
|
154 |
-
border-radius:
|
155 |
-
padding:
|
156 |
-
|
157 |
}
|
158 |
.review-btn:hover {
|
159 |
-
background-color: #
|
160 |
-
|
161 |
-
transform: scale(1.05);
|
162 |
}
|
163 |
.review-btn:disabled {
|
164 |
-
opacity: 0.
|
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:
|
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 |
-
|
193 |
-
|
194 |
-
gr.Markdown(
|
195 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
|
197 |
with gr.Tabs():
|
198 |
-
with gr.TabItem("Text"):
|
199 |
-
text_input = gr.Textbox(
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
204 |
|
205 |
gr.Markdown("### π Review Report")
|
206 |
-
report_output = gr.Markdown()
|
207 |
-
download_btn = gr.File(label="Download Report", visible=False)
|
208 |
|
209 |
-
# Bind
|
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],
|