Spaces:
Running
Running
Commit
·
9ae2d27
1
Parent(s):
4ba9361
Enhanced UI
Browse files- gradio_app.py +366 -186
gradio_app.py
CHANGED
@@ -23,212 +23,393 @@ atexit.register(stop_api_server, api_process)
|
|
23 |
|
24 |
custom_css = """
|
25 |
* {
|
26 |
-
font-family: '
|
27 |
-
transition: all 0.3s
|
28 |
}
|
|
|
29 |
.gradio-container {
|
30 |
-
background: #
|
31 |
color: #fff !important;
|
|
|
|
|
32 |
overflow: hidden;
|
33 |
-
transition: all 0.5s ease;
|
34 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
.treat-title {
|
36 |
text-align: center;
|
37 |
-
padding:
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
}
|
45 |
-
|
46 |
-
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
}
|
|
|
49 |
.treat-title h1 {
|
50 |
-
font-size:
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
}
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
}
|
|
|
60 |
.treat-title p {
|
61 |
-
font-size: 1.
|
62 |
-
color:
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
font-weight: bold;
|
68 |
-
transition: color 0.3s ease, transform 0.3s ease;
|
69 |
-
display: inline-block;
|
70 |
}
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
}
|
85 |
-
|
86 |
-
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
|
|
|
|
89 |
.gradio-textbox textarea {
|
90 |
-
background
|
91 |
-
|
92 |
-
border: 1px solid rgb(106, 13, 173) !important;
|
93 |
border-radius: 8px !important;
|
94 |
-
|
95 |
-
font-size:
|
|
|
|
|
96 |
transition: all 0.3s ease;
|
|
|
|
|
97 |
}
|
98 |
-
|
99 |
-
border-color: rgb(106, 13, 173) !important;
|
100 |
-
box-shadow: 0 0 10px rgb(106, 13, 173) !important;
|
101 |
-
}
|
102 |
.gradio-textbox textarea:focus {
|
103 |
-
border-color:
|
104 |
-
box-shadow: 0 0
|
|
|
105 |
transform: translateY(-2px);
|
106 |
}
|
|
|
|
|
107 |
.gradio-button {
|
108 |
-
background
|
109 |
-
|
|
|
|
|
|
|
110 |
border: none !important;
|
111 |
-
border-radius:
|
112 |
-
|
113 |
-
font-
|
114 |
-
|
115 |
-
|
|
|
116 |
position: relative;
|
117 |
overflow: hidden;
|
|
|
|
|
118 |
}
|
|
|
119 |
.gradio-button::before {
|
120 |
content: '';
|
121 |
position: absolute;
|
122 |
-
top: 50%;
|
123 |
-
left: 50%;
|
124 |
-
width:
|
125 |
-
height:
|
126 |
-
background:
|
127 |
-
|
128 |
-
|
129 |
-
|
|
|
130 |
}
|
|
|
131 |
.gradio-button:hover {
|
132 |
-
transform:
|
133 |
-
|
134 |
-
box-shadow: 0 6px 15px rgb(106, 13, 173);
|
135 |
}
|
|
|
136 |
.gradio-button:hover::before {
|
137 |
-
|
138 |
-
height: 300px;
|
139 |
}
|
140 |
-
.gradio-button:active {
|
141 |
-
transform: scale(0.98) translateY(1px);
|
142 |
-
background-color: rgb(106, 13, 173) !important;
|
143 |
|
144 |
-
/*
|
145 |
-
.
|
146 |
-
background
|
147 |
-
border
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
}
|
149 |
|
150 |
-
}
|
151 |
-
label {
|
152 |
-
color: rgb(106, 13, 173) !important;
|
153 |
-
font-weight: 500 !important;
|
154 |
-
margin-bottom: 10px !important;
|
155 |
-
transition: color 0.3s ease;
|
156 |
-
}
|
157 |
-
label:hover {
|
158 |
-
color: #fff !important;
|
159 |
-
}
|
160 |
-
.center-row {
|
161 |
-
display: flex;
|
162 |
-
justify-content: center;
|
163 |
-
align-items: center;
|
164 |
-
}
|
165 |
.footer {
|
166 |
text-align: center;
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
transition: all 0.3s ease;
|
173 |
-
}
|
174 |
-
.footer:hover {
|
175 |
-
transform: translateY(-3px);
|
176 |
}
|
|
|
177 |
.footer p {
|
178 |
-
color:
|
179 |
-
|
|
|
|
|
|
|
180 |
}
|
|
|
181 |
.footer .heart {
|
|
|
182 |
display: inline-block;
|
183 |
-
|
184 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
185 |
}
|
186 |
-
|
187 |
-
|
|
|
|
|
|
|
188 |
}
|
189 |
-
|
190 |
-
|
|
|
191 |
text-decoration: none;
|
192 |
position: relative;
|
193 |
transition: all 0.3s ease;
|
|
|
194 |
}
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
.footer a::after {
|
199 |
-
content: '';
|
200 |
-
position: absolute;
|
201 |
-
width: 0;
|
202 |
-
height: 2px;
|
203 |
-
bottom: -2px;
|
204 |
-
left: 0;
|
205 |
-
background-color: rgb(106, 13, 173);
|
206 |
-
transition: width 0.3s ease;
|
207 |
-
}
|
208 |
-
.footer a:hover::after {
|
209 |
-
width: 100%;
|
210 |
}
|
|
|
211 |
footer {
|
212 |
visibility: hidden;
|
213 |
-
}
|
214 |
|
215 |
-
|
216 |
-
|
217 |
-
|
|
|
|
|
218 |
}
|
219 |
-
|
220 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
221 |
100% { opacity: 1; transform: translateY(0); }
|
222 |
}
|
|
|
223 |
@keyframes fadeInUp {
|
224 |
-
0% { opacity: 0; transform: translateY(
|
225 |
100% { opacity: 1; transform: translateY(0); }
|
226 |
}
|
227 |
-
|
|
|
228 |
0% { transform: scale(1); }
|
229 |
-
|
|
|
|
|
|
|
|
|
230 |
100% { transform: scale(1); }
|
231 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
"""
|
233 |
# Start the API server
|
234 |
def start_api_server():
|
@@ -317,66 +498,67 @@ def analyze_with_loading(text, progress=gr.Progress()):
|
|
317 |
trigger_list = "\n".join([f"• {trigger}" for trigger in triggers])
|
318 |
return f"⚠ Triggers Detected:\n{trigger_list}"
|
319 |
|
320 |
-
# Update the Gradio interface
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
321 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as iface:
|
322 |
gr.HTML("""
|
323 |
<div class="treat-title">
|
324 |
-
<h1>TREAT</h1>
|
325 |
-
<p
|
326 |
-
<span class="highlight">R</span>ecognition for
|
327 |
-
<span class="highlight">E</span>njoyable and
|
328 |
-
<span class="highlight">A</span>ppropriate
|
329 |
-
<span class="highlight">T</span>elevision</p>
|
330 |
</div>
|
331 |
""")
|
332 |
|
333 |
-
with gr.
|
334 |
-
with gr.
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
|
|
|
|
|
|
342 |
search_query = gr.Textbox(
|
343 |
-
label="
|
344 |
-
placeholder="
|
345 |
-
lines=1
|
346 |
-
interactive=True
|
347 |
)
|
|
|
348 |
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
search_button = gr.Button("🔍 Search and Analyze Script")
|
355 |
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
label="Analysis Results",
|
360 |
-
lines=5,
|
361 |
-
interactive=False
|
362 |
-
)
|
363 |
-
status_text = gr.Markdown(
|
364 |
-
label="Status",
|
365 |
-
value=""
|
366 |
-
)
|
367 |
|
|
|
368 |
analyze_btn.click(
|
369 |
fn=analyze_with_loading,
|
370 |
-
inputs=
|
371 |
-
outputs=
|
372 |
-
api_name="analyze"
|
373 |
)
|
374 |
|
375 |
search_button.click(
|
376 |
fn=analyze_with_progress,
|
377 |
-
inputs=
|
378 |
-
outputs=
|
379 |
-
show_progress=True
|
380 |
)
|
381 |
|
382 |
gr.HTML("""
|
@@ -385,8 +567,6 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as iface:
|
|
385 |
</div>
|
386 |
""")
|
387 |
|
388 |
-
# Launch the Gradio interface
|
389 |
-
|
390 |
if __name__ == "__main__":
|
391 |
iface.launch(
|
392 |
share=False,
|
|
|
23 |
|
24 |
custom_css = """
|
25 |
* {
|
26 |
+
font-family: 'Inter', system-ui, sans-serif;
|
27 |
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
28 |
}
|
29 |
+
|
30 |
.gradio-container {
|
31 |
+
background: #0a0a0f !important;
|
32 |
color: #fff !important;
|
33 |
+
min-height: 100vh;
|
34 |
+
position: relative;
|
35 |
overflow: hidden;
|
|
|
36 |
}
|
37 |
+
|
38 |
+
/* Animated Background */
|
39 |
+
.gradio-container::before {
|
40 |
+
content: '';
|
41 |
+
position: fixed;
|
42 |
+
top: 0;
|
43 |
+
left: 0;
|
44 |
+
right: 0;
|
45 |
+
bottom: 0;
|
46 |
+
background:
|
47 |
+
linear-gradient(125deg,
|
48 |
+
#0a0a0f 0%,
|
49 |
+
rgba(99, 102, 241, 0.05) 30%,
|
50 |
+
rgba(99, 102, 241, 0.1) 50%,
|
51 |
+
rgba(99, 102, 241, 0.05) 70%,
|
52 |
+
#0a0a0f 100%);
|
53 |
+
animation: gradientMove 15s ease infinite;
|
54 |
+
background-size: 400% 400%;
|
55 |
+
z-index: 0;
|
56 |
+
}
|
57 |
+
|
58 |
+
/* Floating Particles */
|
59 |
+
.gradio-container::after {
|
60 |
+
content: '';
|
61 |
+
position: fixed;
|
62 |
+
top: 0;
|
63 |
+
left: 0;
|
64 |
+
width: 100%;
|
65 |
+
height: 100%;
|
66 |
+
background: radial-gradient(circle at center, transparent 0%, #0a0a0f 70%),
|
67 |
+
url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='1' fill='rgba(99, 102, 241, 0.15)'/%3E%3C/svg%3E");
|
68 |
+
opacity: 0.5;
|
69 |
+
animation: floatingParticles 20s linear infinite;
|
70 |
+
z-index: 1;
|
71 |
+
}
|
72 |
+
|
73 |
+
/* Futuristic Header */
|
74 |
.treat-title {
|
75 |
text-align: center;
|
76 |
+
padding: 3rem 1rem;
|
77 |
+
position: relative;
|
78 |
+
overflow: hidden;
|
79 |
+
z-index: 2;
|
80 |
+
background: linear-gradient(180deg,
|
81 |
+
rgba(99, 102, 241, 0.1),
|
82 |
+
transparent 70%);
|
83 |
+
}
|
84 |
+
|
85 |
+
.treat-title::before {
|
86 |
+
content: '';
|
87 |
+
position: absolute;
|
88 |
+
top: 0;
|
89 |
+
left: 50%;
|
90 |
+
width: 80%;
|
91 |
+
height: 1px;
|
92 |
+
background: linear-gradient(90deg,
|
93 |
+
transparent,
|
94 |
+
rgba(99, 102, 241, 0.5),
|
95 |
+
transparent);
|
96 |
+
transform: translateX(-50%);
|
97 |
+
animation: scanline 3s ease-in-out infinite;
|
98 |
}
|
99 |
+
|
100 |
.treat-title h1 {
|
101 |
+
font-size: 4.5rem;
|
102 |
+
font-weight: 800;
|
103 |
+
background: linear-gradient(135deg,
|
104 |
+
#2a2b55 0%,
|
105 |
+
#6366f1 50%,
|
106 |
+
#2a2b55 100%);
|
107 |
+
background-size: 200% auto;
|
108 |
+
-webkit-background-clip: text;
|
109 |
+
-webkit-text-fill-color: transparent;
|
110 |
+
margin-bottom: 0.5rem;
|
111 |
+
letter-spacing: -0.05em;
|
112 |
+
animation: gradientFlow 8s ease infinite;
|
113 |
+
position: relative;
|
114 |
}
|
115 |
+
|
116 |
+
.treat-title h1::after {
|
117 |
+
content: attr(data-text);
|
118 |
+
position: absolute;
|
119 |
+
left: 0;
|
120 |
+
top: 0;
|
121 |
+
width: 100%;
|
122 |
+
height: 100%;
|
123 |
+
background: linear-gradient(135deg,
|
124 |
+
transparent 0%,
|
125 |
+
rgba(99, 102, 241, 0.4) 50%,
|
126 |
+
transparent 100%);
|
127 |
+
background-size: 200% auto;
|
128 |
+
-webkit-background-clip: text;
|
129 |
+
-webkit-text-fill-color: transparent;
|
130 |
+
opacity: 0.5;
|
131 |
+
animation: textGlow 4s ease-in-out infinite;
|
132 |
}
|
133 |
+
|
134 |
.treat-title p {
|
135 |
+
font-size: 1.1rem;
|
136 |
+
color: rgba(255, 255, 255, 0.7);
|
137 |
+
max-width: 600px;
|
138 |
+
margin: 0 auto;
|
139 |
+
position: relative;
|
140 |
+
animation: fadeInUp 1s ease-out;
|
|
|
|
|
|
|
141 |
}
|
142 |
+
|
143 |
+
/* Tabs Styling */
|
144 |
+
.tabs {
|
145 |
+
background: rgba(17, 17, 27, 0.7);
|
146 |
+
border: 1px solid rgba(99, 102, 241, 0.2);
|
147 |
+
border-radius: 16px;
|
148 |
+
padding: 1rem;
|
149 |
+
margin: 0 1rem 2rem 1rem;
|
150 |
+
position: relative;
|
151 |
+
z-index: 2;
|
152 |
+
backdrop-filter: blur(10px);
|
153 |
+
box-shadow: 0 0 30px rgba(99, 102, 241, 0.1);
|
154 |
+
animation: floatIn 1s ease-out;
|
155 |
}
|
156 |
+
|
157 |
+
.tabs::before {
|
158 |
+
content: '';
|
159 |
+
position: absolute;
|
160 |
+
top: -1px;
|
161 |
+
left: -1px;
|
162 |
+
right: -1px;
|
163 |
+
bottom: -1px;
|
164 |
+
background: linear-gradient(45deg,
|
165 |
+
rgba(99, 102, 241, 0.1),
|
166 |
+
transparent,
|
167 |
+
rgba(99, 102, 241, 0.1));
|
168 |
+
border-radius: 16px;
|
169 |
+
z-index: -1;
|
170 |
+
animation: borderGlow 4s ease-in-out infinite;
|
171 |
}
|
172 |
+
|
173 |
+
/* Content Area */
|
174 |
+
.content-area {
|
175 |
+
background: rgba(17, 17, 27, 0.7) !important;
|
176 |
+
border: 1px solid rgba(99, 102, 241, 0.2) !important;
|
177 |
+
border-radius: 12px !important;
|
178 |
+
padding: 1.5rem !important;
|
179 |
+
backdrop-filter: blur(10px);
|
180 |
+
position: relative;
|
181 |
+
overflow: hidden;
|
182 |
+
animation: fadeScale 0.5s ease-out;
|
183 |
+
}
|
184 |
+
|
185 |
+
.content-area::before {
|
186 |
+
content: '';
|
187 |
+
position: absolute;
|
188 |
+
top: -50%;
|
189 |
+
left: -50%;
|
190 |
+
width: 200%;
|
191 |
+
height: 200%;
|
192 |
+
background: radial-gradient(circle at center,
|
193 |
+
rgba(99, 102, 241, 0.1) 0%,
|
194 |
+
transparent 70%);
|
195 |
+
animation: rotateGradient 10s linear infinite;
|
196 |
}
|
197 |
+
|
198 |
+
/* Input Fields */
|
199 |
.gradio-textbox textarea {
|
200 |
+
background: rgba(17, 17, 27, 0.6) !important;
|
201 |
+
border: 1px solid rgba(99, 102, 241, 0.3) !important;
|
|
|
202 |
border-radius: 8px !important;
|
203 |
+
color: rgba(255, 255, 255, 0.9) !important;
|
204 |
+
font-size: 0.95rem !important;
|
205 |
+
line-height: 1.6 !important;
|
206 |
+
padding: 1rem !important;
|
207 |
transition: all 0.3s ease;
|
208 |
+
position: relative;
|
209 |
+
z-index: 2;
|
210 |
}
|
211 |
+
|
|
|
|
|
|
|
212 |
.gradio-textbox textarea:focus {
|
213 |
+
border-color: #6366f1 !important;
|
214 |
+
box-shadow: 0 0 20px rgba(99, 102, 241, 0.2) !important;
|
215 |
+
background: rgba(17, 17, 27, 0.8) !important;
|
216 |
transform: translateY(-2px);
|
217 |
}
|
218 |
+
|
219 |
+
/* Buttons */
|
220 |
.gradio-button {
|
221 |
+
background: linear-gradient(45deg,
|
222 |
+
#6366f1,
|
223 |
+
#818cf8,
|
224 |
+
#6366f1) !important;
|
225 |
+
background-size: 200% auto !important;
|
226 |
border: none !important;
|
227 |
+
border-radius: 8px !important;
|
228 |
+
color: white !important;
|
229 |
+
font-weight: 600 !important;
|
230 |
+
font-size: 0.95rem !important;
|
231 |
+
padding: 0.75rem 1.5rem !important;
|
232 |
+
letter-spacing: 0.025em !important;
|
233 |
position: relative;
|
234 |
overflow: hidden;
|
235 |
+
transition: all 0.3s ease !important;
|
236 |
+
animation: gradientFlow 3s ease infinite;
|
237 |
}
|
238 |
+
|
239 |
.gradio-button::before {
|
240 |
content: '';
|
241 |
position: absolute;
|
242 |
+
top: -50%;
|
243 |
+
left: -50%;
|
244 |
+
width: 200%;
|
245 |
+
height: 200%;
|
246 |
+
background: radial-gradient(circle at center,
|
247 |
+
rgba(255, 255, 255, 0.2) 0%,
|
248 |
+
transparent 70%);
|
249 |
+
transform: scale(0);
|
250 |
+
transition: transform 0.5s ease;
|
251 |
}
|
252 |
+
|
253 |
.gradio-button:hover {
|
254 |
+
transform: translateY(-2px);
|
255 |
+
box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4) !important;
|
|
|
256 |
}
|
257 |
+
|
258 |
.gradio-button:hover::before {
|
259 |
+
transform: scale(1);
|
|
|
260 |
}
|
|
|
|
|
|
|
261 |
|
262 |
+
/* Results Area */
|
263 |
+
.results-area {
|
264 |
+
background: rgba(17, 17, 27, 0.7) !important;
|
265 |
+
border: 1px solid rgba(99, 102, 241, 0.2) !important;
|
266 |
+
border-radius: 12px !important;
|
267 |
+
margin-top: 2rem !important;
|
268 |
+
backdrop-filter: blur(10px);
|
269 |
+
animation: slideUp 0.5s ease-out;
|
270 |
+
position: relative;
|
271 |
+
overflow: hidden;
|
272 |
}
|
273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
.footer {
|
275 |
text-align: center;
|
276 |
+
padding: 2rem 0;
|
277 |
+
margin-top: 3rem;
|
278 |
+
font-size: 1.0rem;
|
279 |
+
position: relative;
|
280 |
+
z-index: 2;
|
|
|
|
|
|
|
|
|
281 |
}
|
282 |
+
|
283 |
.footer p {
|
284 |
+
color: rgba(255, 255, 255, 0.8);
|
285 |
+
display: flex;
|
286 |
+
align-items: center;
|
287 |
+
justify-content: center;
|
288 |
+
gap: 0.5rem;
|
289 |
}
|
290 |
+
|
291 |
.footer .heart {
|
292 |
+
color: #6366f1;
|
293 |
display: inline-block;
|
294 |
+
position: relative;
|
295 |
+
font-size: 1.0rem;
|
296 |
+
transform-origin: center;
|
297 |
+
animation: heartbeat 1.5s ease infinite;
|
298 |
+
}
|
299 |
+
|
300 |
+
.footer .heart::before,
|
301 |
+
.footer .heart::after {
|
302 |
+
content: '✦';
|
303 |
+
position: absolute;
|
304 |
+
opacity: 0;
|
305 |
+
font-size: 0.6rem;
|
306 |
+
animation: sparkle 1.5s ease infinite;
|
307 |
+
}
|
308 |
+
|
309 |
+
.footer .heart::before {
|
310 |
+
top: -8px;
|
311 |
+
left: -8px;
|
312 |
+
animation-delay: 0.2s;
|
313 |
}
|
314 |
+
|
315 |
+
.footer .heart::after {
|
316 |
+
top: -8px;
|
317 |
+
right: -8px;
|
318 |
+
animation-delay: 0.4s;
|
319 |
}
|
320 |
+
|
321 |
+
.footer .name {
|
322 |
+
color: #6366f1;
|
323 |
text-decoration: none;
|
324 |
position: relative;
|
325 |
transition: all 0.3s ease;
|
326 |
+
padding: 0 4px;
|
327 |
}
|
328 |
+
|
329 |
+
.footer .name:hover {
|
330 |
+
color: #818cf8;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
}
|
332 |
+
|
333 |
footer {
|
334 |
visibility: hidden;
|
335 |
+
}
|
336 |
|
337 |
+
/* Animations */
|
338 |
+
@keyframes gradientMove {
|
339 |
+
0% { background-position: 0% 50%; }
|
340 |
+
50% { background-position: 100% 50%; }
|
341 |
+
100% { background-position: 0% 50%; }
|
342 |
}
|
343 |
+
|
344 |
+
@keyframes floatingParticles {
|
345 |
+
0% { transform: translateY(0); }
|
346 |
+
100% { transform: translateY(-100%); }
|
347 |
+
}
|
348 |
+
|
349 |
+
@keyframes scanline {
|
350 |
+
0% { transform: translateX(-150%) scaleX(0.5); opacity: 0; }
|
351 |
+
50% { transform: translateX(-50%) scaleX(1); opacity: 1; }
|
352 |
+
100% { transform: translateX(50%) scaleX(0.5); opacity: 0; }
|
353 |
+
}
|
354 |
+
|
355 |
+
@keyframes gradientFlow {
|
356 |
+
0% { background-position: 0% 50%; }
|
357 |
+
50% { background-position: 100% 50%; }
|
358 |
+
100% { background-position: 0% 50%; }
|
359 |
+
}
|
360 |
+
|
361 |
+
@keyframes textGlow {
|
362 |
+
0% { opacity: 0.3; transform: scale(1); }
|
363 |
+
50% { opacity: 0.5; transform: scale(1.02); }
|
364 |
+
100% { opacity: 0.3; transform: scale(1); }
|
365 |
+
}
|
366 |
+
|
367 |
+
@keyframes borderGlow {
|
368 |
+
0% { opacity: 0.5; }
|
369 |
+
50% { opacity: 1; }
|
370 |
+
100% { opacity: 0.5; }
|
371 |
+
}
|
372 |
+
|
373 |
+
@keyframes rotateGradient {
|
374 |
+
0% { transform: rotate(0deg); }
|
375 |
+
100% { transform: rotate(360deg); }
|
376 |
+
}
|
377 |
+
|
378 |
+
@keyframes fadeScale {
|
379 |
+
0% { opacity: 0; transform: scale(0.95); }
|
380 |
+
100% { opacity: 1; transform: scale(1); }
|
381 |
+
}
|
382 |
+
|
383 |
+
@keyframes slideUp {
|
384 |
+
0% { opacity: 0; transform: translateY(20px); }
|
385 |
+
100% { opacity: 1; transform: translateY(0); }
|
386 |
+
}
|
387 |
+
|
388 |
+
@keyframes floatIn {
|
389 |
+
0% { opacity: 0; transform: translateY(20px); }
|
390 |
100% { opacity: 1; transform: translateY(0); }
|
391 |
}
|
392 |
+
|
393 |
@keyframes fadeInUp {
|
394 |
+
0% { opacity: 0; transform: translateY(10px); }
|
395 |
100% { opacity: 1; transform: translateY(0); }
|
396 |
}
|
397 |
+
|
398 |
+
@keyframes heartbeat {
|
399 |
0% { transform: scale(1); }
|
400 |
+
10% { transform: scale(1.2); }
|
401 |
+
20% { transform: scale(0.9); }
|
402 |
+
30% { transform: scale(1.1); }
|
403 |
+
40% { transform: scale(0.95); }
|
404 |
+
50% { transform: scale(1); }
|
405 |
100% { transform: scale(1); }
|
406 |
}
|
407 |
+
|
408 |
+
@keyframes sparkle {
|
409 |
+
0% { transform: scale(0); opacity: 0; }
|
410 |
+
50% { transform: scale(1.2); opacity: 1; }
|
411 |
+
100% { transform: scale(0); opacity: 0; }
|
412 |
+
}
|
413 |
"""
|
414 |
# Start the API server
|
415 |
def start_api_server():
|
|
|
498 |
trigger_list = "\n".join([f"• {trigger}" for trigger in triggers])
|
499 |
return f"⚠ Triggers Detected:\n{trigger_list}"
|
500 |
|
501 |
+
# Update the Gradio interface with new styling
|
502 |
+
import gradio as gr
|
503 |
+
from model.analyzer import analyze_content
|
504 |
+
import asyncio
|
505 |
+
import time
|
506 |
+
import httpx
|
507 |
+
import subprocess
|
508 |
+
import atexit
|
509 |
+
|
510 |
+
# Keep your existing CSS and server setup code...
|
511 |
+
# [Previous code until the interface definition remains the same]
|
512 |
+
|
513 |
+
# Update the Gradio interface with fixed button handling
|
514 |
with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as iface:
|
515 |
gr.HTML("""
|
516 |
<div class="treat-title">
|
517 |
+
<h1 data-text="TREAT">TREAT</h1>
|
518 |
+
<p>Trigger Recognition for Enjoyable and Appropriate Television</p>
|
|
|
|
|
|
|
|
|
519 |
</div>
|
520 |
""")
|
521 |
|
522 |
+
with gr.Tabs() as tabs:
|
523 |
+
with gr.Tab("Content Analysis"): # Changed from TabItem to Tab
|
524 |
+
with gr.Column():
|
525 |
+
input_text = gr.Textbox(
|
526 |
+
label="ANALYZE CONTENT",
|
527 |
+
placeholder="Enter the content you want to analyze...",
|
528 |
+
lines=8
|
529 |
+
)
|
530 |
+
analyze_btn = gr.Button("✨ Analyze")
|
531 |
+
|
532 |
+
with gr.Tab("Movie Search"): # Changed from TabItem to Tab
|
533 |
+
with gr.Column():
|
534 |
search_query = gr.Textbox(
|
535 |
+
label="SEARCH MOVIES",
|
536 |
+
placeholder="Type a movie title to search...",
|
537 |
+
lines=1
|
|
|
538 |
)
|
539 |
+
search_button = gr.Button("🔍 Search")
|
540 |
|
541 |
+
output_text = gr.Textbox(
|
542 |
+
label="ANALYSIS RESULTS",
|
543 |
+
lines=5,
|
544 |
+
interactive=False
|
545 |
+
)
|
|
|
546 |
|
547 |
+
status_text = gr.Markdown(
|
548 |
+
value=""
|
549 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
550 |
|
551 |
+
# Define click events
|
552 |
analyze_btn.click(
|
553 |
fn=analyze_with_loading,
|
554 |
+
inputs=input_text,
|
555 |
+
outputs=output_text
|
|
|
556 |
)
|
557 |
|
558 |
search_button.click(
|
559 |
fn=analyze_with_progress,
|
560 |
+
inputs=search_query,
|
561 |
+
outputs=output_text
|
|
|
562 |
)
|
563 |
|
564 |
gr.HTML("""
|
|
|
567 |
</div>
|
568 |
""")
|
569 |
|
|
|
|
|
570 |
if __name__ == "__main__":
|
571 |
iface.launch(
|
572 |
share=False,
|