noumanjavaid commited on
Commit
ab3b5d9
Β·
verified Β·
1 Parent(s): 62e7c5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +211 -104
app.py CHANGED
@@ -1,29 +1,102 @@
1
  import gradio as gr
2
 
3
  css = """
4
- /* Container styles */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  .container {
6
- max-width: 1200px;
7
  margin: 0 auto;
8
- padding: 20px;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  }
10
 
11
- /* Header styles */
12
- h1, h2, h3 {
13
- font-family: 'Arial', sans-serif;
14
- color: #2d3748;
15
  }
16
 
17
- /* Iframe container styles */
18
  .iframe-container {
19
  position: relative;
20
  width: 100%;
21
  height: 0;
22
- padding-bottom: 75%;
23
- background: #f7fafc;
24
- border-radius: 12px;
25
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
26
- overflow: hidden;
27
  }
28
 
29
  .iframe-container iframe {
@@ -33,139 +106,173 @@ h1, h2, h3 {
33
  width: 100%;
34
  height: 100%;
35
  border: none;
36
- border-radius: 12px;
37
  }
38
 
39
- /* Card styles */
40
- .card {
41
- background: linear-gradient(145deg, #1a365d, #2d4a8c);
42
- color: white;
43
- padding: 20px;
44
- margin: 10px 0;
45
- border-radius: 12px;
46
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
47
- transition: transform 0.2s ease, box-shadow 0.2s ease;
48
  }
49
 
50
- .card:hover {
51
- transform: translateY(-5px);
52
- box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
 
 
 
 
 
 
 
 
53
  }
54
 
55
- .card a {
56
- color: white;
57
- text-decoration: none;
58
- font-weight: bold;
59
- font-size: 1.1em;
60
- display: block;
61
- padding: 10px;
 
 
 
 
 
 
 
 
62
  }
63
 
64
- .card a:hover {
65
- text-decoration: underline;
 
 
66
  }
67
 
68
- /* Fallback link styles */
69
- .fallback-link {
70
- margin-top: 20px;
71
- padding: 15px;
72
- background-color: #f8f9fa;
73
- border-radius: 8px;
74
- border: 1px solid #e2e8f0;
75
  }
76
 
77
- .fallback-link a {
78
- color: #4a5568;
79
  text-decoration: none;
80
  font-weight: 500;
 
 
 
 
 
81
  }
82
 
83
- .fallback-link a:hover {
84
- color: #2b6cb0;
 
 
 
 
 
85
  }
86
 
87
- /* Icon styles */
88
- .icon {
89
- width: 50px;
90
- height: 50px;
91
- margin-bottom: 20px;
92
  }
93
 
94
- /* Layout styles */
95
- .column {
96
- padding: 10px;
97
  }
98
 
99
- .row {
100
- display: flex;
101
- align-items: stretch;
102
- margin: -10px;
 
103
  }
104
 
105
- /* Responsive design */
106
- @media (max-width: 768px) {
107
- .row {
108
- flex-direction: column;
109
- }
110
-
111
- .column {
112
- width: 100%;
113
- }
114
-
115
- .iframe-container {
116
- padding-bottom: 100%;
117
- }
 
 
 
 
 
 
 
 
118
  }
119
  """
120
 
121
- with gr.Blocks(css=css) as demo:
122
- with gr.Row(elem_classes=["container"]):
123
- gr.Image("https://raw.githubusercontent.com/noumanjavaid96/ai-as-an-api/refs/heads/master/image%20(39).png",
124
- elem_classes=["icon"])
125
- gr.Markdown("# Centurion Complete Demo", elem_classes=["header"])
 
 
 
 
 
 
126
 
127
- with gr.Row(elem_classes=["row"]):
128
- with gr.Column(elem_classes=["column"]):
129
- gr.Markdown("### Featured Tools", elem_classes=["section-title"])
130
  gr.HTML('''
131
- <div class="card">
 
 
 
 
 
 
 
 
132
  <a href="https://noumanjavaid-new-space.hf.space" target="_blank">
133
  πŸ” DeepFake Detection
134
  </a>
135
  </div>
136
- <div class="card">
 
137
  <a href="https://noumanjavaid-centurionv2.hf.space" target="_blank">
138
- πŸ“„ Image and Document Diff Checker
139
  </a>
140
  </div>
141
- ''')
142
-
143
- with gr.Column(scale=2, elem_classes=["column"]):
144
- gr.HTML('''
145
- <div class="iframe-container">
146
- <iframe src="https://noumanjavaid-centii.hf.space"></iframe>
147
- </div>
148
- ''')
149
-
150
- with gr.Column(elem_classes=["column"]):
151
- gr.Markdown("### Additional Tools", elem_classes=["section-title"])
152
- gr.HTML('''
153
- <div class="card">
154
  <a href="https://noumanjavaid-watermark-demo-video.hf.space" target="_blank">
155
  πŸŽ₯ Video Watermarking
156
  </a>
157
  </div>
158
- <div class="card">
159
- <a href="https://space4.hf.space" target="_blank">
160
- 🚧 UNDER CONSTRUCTION
 
161
  </a>
162
  </div>
163
  ''')
164
-
165
- with gr.Row(elem_classes=["fallback-link"]):
166
- gr.Markdown("""
167
- ℹ️ If the Deepfake Detector is not loading, please [click here](https://noumanjavaid-new-space.hf.space) to access it directly.
168
- """)
169
 
170
  if __name__ == "__main__":
171
- demo.launch(show_error=True)
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
  css = """
4
+ /* Modern theme with cool effects */
5
+ :root {
6
+ --primary-black: #000000;
7
+ --primary-white: #ffffff;
8
+ --gray-100: #f7f7f7;
9
+ --gray-200: #e5e5e5;
10
+ --gray-300: #d4d4d4;
11
+ --gray-400: #a3a3a3;
12
+ --gray-800: #262626;
13
+ --gray-900: #171717;
14
+ }
15
+
16
+ * {
17
+ margin: 0;
18
+ padding: 0;
19
+ box-sizing: border-box;
20
+ }
21
+
22
+ body {
23
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
24
+ background-color: var(--primary-black);
25
+ color: var(--primary-white);
26
+ }
27
+
28
+ /* Glassmorphism Header */
29
+ .header {
30
+ background: rgba(23, 23, 23, 0.8);
31
+ backdrop-filter: blur(10px);
32
+ -webkit-backdrop-filter: blur(10px);
33
+ border-bottom: 1px solid rgba(255, 255, 255, 0.1);
34
+ padding: 1.5rem 2rem;
35
+ position: sticky;
36
+ top: 0;
37
+ z-index: 1000;
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: space-between;
41
+ }
42
+
43
+ .logo-container {
44
+ display: flex;
45
+ align-items: center;
46
+ gap: 1rem;
47
+ }
48
+
49
+ .logo {
50
+ width: 45px;
51
+ height: 45px;
52
+ filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
53
+ transition: transform 0.3s ease;
54
+ }
55
+
56
+ .logo:hover {
57
+ transform: scale(1.1);
58
+ }
59
+
60
+ .header-title {
61
+ color: var(--primary-white);
62
+ font-size: 28px;
63
+ font-weight: 600;
64
+ text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
65
+ }
66
+
67
+ /* Main container with cool gradient */
68
  .container {
69
+ max-width: 1400px;
70
  margin: 0 auto;
71
+ padding: 2rem;
72
+ background: linear-gradient(
73
+ 135deg,
74
+ rgba(38, 38, 38, 0.9) 0%,
75
+ rgba(23, 23, 23, 0.9) 100%
76
+ );
77
+ }
78
+
79
+ /* Modern Iframe container */
80
+ .main-content {
81
+ background: var(--gray-900);
82
+ border-radius: 20px;
83
+ box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
84
+ margin: 2rem 0;
85
+ overflow: hidden;
86
+ border: 1px solid rgba(255, 255, 255, 0.1);
87
+ transition: transform 0.3s ease;
88
  }
89
 
90
+ .main-content:hover {
91
+ transform: translateY(-5px);
 
 
92
  }
93
 
 
94
  .iframe-container {
95
  position: relative;
96
  width: 100%;
97
  height: 0;
98
+ padding-bottom: 65%;
99
+ background: var(--gray-900);
 
 
 
100
  }
101
 
102
  .iframe-container iframe {
 
106
  width: 100%;
107
  height: 100%;
108
  border: none;
109
+ border-radius: 20px;
110
  }
111
 
112
+ /* Modern Navigation Grid */
113
+ .nav-grid {
114
+ display: grid;
115
+ grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
116
+ gap: 1.5rem;
117
+ margin-top: 2rem;
 
 
 
118
  }
119
 
120
+ /* Sleek Navigation Cards */
121
+ .nav-card {
122
+ background: rgba(38, 38, 38, 0.5);
123
+ backdrop-filter: blur(10px);
124
+ -webkit-backdrop-filter: blur(10px);
125
+ border-radius: 15px;
126
+ padding: 1.5rem;
127
+ border: 1px solid rgba(255, 255, 255, 0.1);
128
+ transition: all 0.3s ease;
129
+ position: relative;
130
+ overflow: hidden;
131
  }
132
 
133
+ .nav-card::before {
134
+ content: '';
135
+ position: absolute;
136
+ top: 0;
137
+ left: 0;
138
+ width: 100%;
139
+ height: 100%;
140
+ background: linear-gradient(
141
+ 45deg,
142
+ transparent 0%,
143
+ rgba(255, 255, 255, 0.05) 50%,
144
+ transparent 100%
145
+ );
146
+ transform: translateX(-100%);
147
+ transition: transform 0.6s ease;
148
  }
149
 
150
+ .nav-card:hover {
151
+ transform: translateY(-5px) scale(1.02);
152
+ box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
153
+ background: rgba(38, 38, 38, 0.8);
154
  }
155
 
156
+ .nav-card:hover::before {
157
+ transform: translateX(100%);
 
 
 
 
 
158
  }
159
 
160
+ .nav-card a {
161
+ color: var(--primary-white);
162
  text-decoration: none;
163
  font-weight: 500;
164
+ font-size: 1.1rem;
165
+ display: flex;
166
+ align-items: center;
167
+ gap: 0.8rem;
168
+ position: relative;
169
  }
170
 
171
+ .nav-card a::after {
172
+ content: 'β†’';
173
+ position: absolute;
174
+ right: 0;
175
+ opacity: 0;
176
+ transform: translateX(-10px);
177
+ transition: all 0.3s ease;
178
  }
179
 
180
+ .nav-card:hover a::after {
181
+ opacity: 1;
182
+ transform: translateX(0);
 
 
183
  }
184
 
185
+ /* Hide Gradio elements */
186
+ footer, .gradio-container {
187
+ display: none !important;
188
  }
189
 
190
+ /* Cool loading animation */
191
+ @keyframes pulse {
192
+ 0% { opacity: 0.5; }
193
+ 50% { opacity: 1; }
194
+ 100% { opacity: 0.5; }
195
  }
196
 
197
+ .loading {
198
+ animation: pulse 1.5s infinite;
199
+ }
200
+
201
+ /* Modern scrollbar */
202
+ ::-webkit-scrollbar {
203
+ width: 8px;
204
+ height: 8px;
205
+ }
206
+
207
+ ::-webkit-scrollbar-track {
208
+ background: var(--gray-900);
209
+ }
210
+
211
+ ::-webkit-scrollbar-thumb {
212
+ background: var(--gray-400);
213
+ border-radius: 4px;
214
+ }
215
+
216
+ ::-webkit-scrollbar-thumb:hover {
217
+ background: var(--gray-300);
218
  }
219
  """
220
 
221
+ with gr.Blocks(css=css, title="Centurion Analysis Platform") as demo:
222
+ # Modern Header
223
+ with gr.Row(elem_classes=["header"]):
224
+ with gr.Column(elem_classes=["logo-container"]):
225
+ gr.Image(
226
+ "https://raw.githubusercontent.com/noumanjavaid96/ai-as-an-api/refs/heads/master/image%20(39).png",
227
+ elem_classes=["logo"],
228
+ show_label=False,
229
+ container=False
230
+ )
231
+ gr.Markdown("Centurion Analysis", elem_classes=["header-title"])
232
 
233
+ # Main Content
234
+ with gr.Row(elem_classes=["container"]):
235
+ with gr.Column(elem_classes=["main-content"]):
236
  gr.HTML('''
237
+ <div class="iframe-container">
238
+ <iframe src="https://noumanjavaid-centii.hf.space"></iframe>
239
+ </div>
240
+ ''')
241
+
242
+ # Navigation Cards
243
+ with gr.Row(elem_classes=["nav-grid"]):
244
+ gr.HTML('''
245
+ <div class="nav-card">
246
  <a href="https://noumanjavaid-new-space.hf.space" target="_blank">
247
  πŸ” DeepFake Detection
248
  </a>
249
  </div>
250
+
251
+ <div class="nav-card">
252
  <a href="https://noumanjavaid-centurionv2.hf.space" target="_blank">
253
+ πŸ“„ Document Analysis
254
  </a>
255
  </div>
256
+
257
+ <div class="nav-card">
 
 
 
 
 
 
 
 
 
 
 
258
  <a href="https://noumanjavaid-watermark-demo-video.hf.space" target="_blank">
259
  πŸŽ₯ Video Watermarking
260
  </a>
261
  </div>
262
+
263
+ <div class="nav-card">
264
+ <a href="https://noumanjavaid-centii.hf.space" target="_blank">
265
+ πŸ” Image Authentication
266
  </a>
267
  </div>
268
  ''')
 
 
 
 
 
269
 
270
  if __name__ == "__main__":
271
+ demo.launch(
272
+ show_error=True,
273
+ show_api=False,
274
+ show_tips=False,
275
+ height=800,
276
+ analytics_enabled=False,
277
+ enable_queue=False
278
+ )