Kuberwastaken commited on
Commit
9ae2d27
·
1 Parent(s): 4ba9361

Enhanced UI

Browse files
Files changed (1) hide show
  1. 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: 'Roboto', sans-serif;
27
- transition: all 0.3s ease;
28
  }
 
29
  .gradio-container {
30
- background: #121212 !important;
31
  color: #fff !important;
 
 
32
  overflow: hidden;
33
- transition: all 0.5s ease;
34
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  .treat-title {
36
  text-align: center;
37
- padding: 40px;
38
- margin-bottom: 30px;
39
- background: rgba(18, 18, 18, 0.85);
40
- border-radius: 15px;
41
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
42
- animation: slideInFromTop 1s ease-out;
43
- transition: transform 0.3s ease, box-shadow 0.3s ease;
44
- }
45
- .treat-title:hover {
46
- transform: translateY(-5px);
47
- box-shadow: 0 8px 16px rgba(106, 13, 173);
 
 
 
 
 
 
 
 
 
 
 
48
  }
 
49
  .treat-title h1 {
50
- font-size: 5em;
51
- color: rgb(106, 13, 173);
52
- margin-bottom: 10px;
53
- font-weight: bold;
54
- animation: fadeInText 1.5s ease-out;
55
- transition: color 0.3s ease;
 
 
 
 
 
 
 
56
  }
57
- .treat-title:hover h1 {
58
- color: rgb(106, 13, 173);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  }
 
60
  .treat-title p {
61
- font-size: 1.3em;
62
- color: rgb(106, 13, 173);
63
- animation: fadeInText 1.5s ease-out 0.5s;
64
- }
65
- .highlight {
66
- color: rgb(106, 13, 173);
67
- font-weight: bold;
68
- transition: color 0.3s ease, transform 0.3s ease;
69
- display: inline-block;
70
  }
71
- .highlight:hover {
72
- color: rgb(106, 13, 173);
73
- transform: scale(1.1);
 
 
 
 
 
 
 
 
 
 
74
  }
75
- .content-area, .results-area {
76
- background: rgba(33, 33, 33, 0.9) !important;
77
- border-radius: 15px !important;
78
- padding: 30px !important;
79
- margin: 20px 0 !important;
80
- box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5) !important;
81
- opacity: 0;
82
- animation: fadeInUp 1s forwards;
83
- transition: transform 0.3s ease, box-shadow 0.3s ease;
 
 
 
 
 
 
84
  }
85
- .content-area:hover, .results-area:hover {
86
- transform: translateY(-3px);
87
- box-shadow: 0 8px 16px rgb(106, 13, 173) !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  }
 
 
89
  .gradio-textbox textarea {
90
- background-color: #333 !important;
91
- color: #fff !important;
92
- border: 1px solid rgb(106, 13, 173) !important;
93
  border-radius: 8px !important;
94
- padding: 12px !important;
95
- font-size: 1.1em !important;
 
 
96
  transition: all 0.3s ease;
 
 
97
  }
98
- .gradio-textbox textarea:hover {
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: rgb(106, 13, 173) !important;
104
- box-shadow: 0 0 15px rgb(106, 13, 173) !important;
 
105
  transform: translateY(-2px);
106
  }
 
 
107
  .gradio-button {
108
- background-color: rgb(106, 13, 173) !important;
109
- color: white !important;
 
 
 
110
  border: none !important;
111
- border-radius: 25px !important;
112
- padding: 12px 24px !important;
113
- font-size: 1.2em !important;
114
- transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
115
- margin: 20px 0 !important;
 
116
  position: relative;
117
  overflow: hidden;
 
 
118
  }
 
119
  .gradio-button::before {
120
  content: '';
121
  position: absolute;
122
- top: 50%;
123
- left: 50%;
124
- width: 0;
125
- height: 0;
126
- background: rgba(255, 255, 255, 0.2);
127
- border-radius: 50%;
128
- transform: translate(-50%, -50%);
129
- transition: width 0.6s ease, height 0.6s ease;
 
130
  }
 
131
  .gradio-button:hover {
132
- transform: scale(1.05) translateY(-2px);
133
- background-color: rgb(106, 13, 173) !important;
134
- box-shadow: 0 6px 15px rgb(106, 13, 173);
135
  }
 
136
  .gradio-button:hover::before {
137
- width: 300px;
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
- /* Custom style for the Analyze Content button */
145
- .gradio-button.primary {
146
- background-color: rgb(106, 13, 173) !important;
147
- border-color: rgb(106, 13, 173) !important;
 
 
 
 
 
 
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
- margin-top: 40px;
168
- font-size: 1.2em;
169
- color: #bdbdbd;
170
- opacity: 0;
171
- animation: fadeInUp 1s forwards 1.5s;
172
- transition: all 0.3s ease;
173
- }
174
- .footer:hover {
175
- transform: translateY(-3px);
176
  }
 
177
  .footer p {
178
- color: rgb(106, 13, 173);
179
- transition: all 0.3s ease;
 
 
 
180
  }
 
181
  .footer .heart {
 
182
  display: inline-block;
183
- transition: transform 0.3s ease;
184
- animation: pulse 1.5s infinite;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
185
  }
186
- .footer:hover .heart {
187
- transform: scale(1.3);
 
 
 
188
  }
189
- .footer a {
190
- color: rgb(106, 13, 173);
 
191
  text-decoration: none;
192
  position: relative;
193
  transition: all 0.3s ease;
 
194
  }
195
- .footer a:hover {
196
- color: rgb(106, 13, 173);
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
- @keyframes slideInFromTop {
216
- 0% { transform: translateY(-50px); opacity: 0; }
217
- 100% { transform: translateY(0); opacity: 1; }
 
 
218
  }
219
- @keyframes fadeInText {
220
- 0% { opacity: 0; transform: translateY(10px); }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  100% { opacity: 1; transform: translateY(0); }
222
  }
 
223
  @keyframes fadeInUp {
224
- 0% { opacity: 0; transform: translateY(30px); }
225
  100% { opacity: 1; transform: translateY(0); }
226
  }
227
- @keyframes pulse {
 
228
  0% { transform: scale(1); }
229
- 50% { transform: scale(1.2); }
 
 
 
 
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><span class="highlight">T</span>rigger
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.Row():
334
- with gr.Column(elem_classes="content-area"):
335
- input_text = gr.Textbox(
336
- label="Content to Analyze",
337
- placeholder="Paste your content here...",
338
- lines=8,
339
- interactive=True
340
- )
341
- with gr.Row():
 
 
 
342
  search_query = gr.Textbox(
343
- label="Search Movie Scripts",
344
- placeholder="Enter movie title...",
345
- lines=1,
346
- interactive=True
347
  )
 
348
 
349
- with gr.Row(elem_classes="center-row"):
350
- analyze_btn = gr.Button(
351
- "✨ Analyze Content",
352
- variant="primary"
353
- )
354
- search_button = gr.Button("🔍 Search and Analyze Script")
355
 
356
- with gr.Row():
357
- with gr.Column(elem_classes="results-area"):
358
- output_text = gr.Textbox(
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=[input_text],
371
- outputs=[output_text],
372
- api_name="analyze"
373
  )
374
 
375
  search_button.click(
376
  fn=analyze_with_progress,
377
- inputs=[search_query],
378
- outputs=[output_text],
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,