File size: 4,683 Bytes
9ed22a3
1aa8799
3e8fb84
 
9ed22a3
3e8fb84
 
 
bc18442
1aa8799
bc18442
 
1aa8799
 
 
3e8fb84
 
ab3b5d9
 
 
 
 
 
1fdee8e
ab3b5d9
 
 
c4c21ca
1fdee8e
bc18442
ab3b5d9
 
1fdee8e
bc18442
ab3b5d9
 
c4c21ca
ab3b5d9
c4c21ca
ab3b5d9
 
bc18442
 
 
ab3b5d9
1fdee8e
 
ab3b5d9
 
62e7c5a
ab3b5d9
62e7c5a
bc18442
ab3b5d9
 
c4c21ca
1fdee8e
 
bc18442
ab3b5d9
1fdee8e
62e7c5a
9ed22a3
 
 
 
ab3b5d9
9ed22a3
 
 
 
 
c4c21ca
 
62e7c5a
9ed22a3
ab3b5d9
 
c4c21ca
ab3b5d9
bc18442
62e7c5a
ab3b5d9
1fdee8e
c4c21ca
1fdee8e
ab3b5d9
 
62e7c5a
bc18442
 
 
 
ab3b5d9
bc18442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3e8fb84
bc18442
 
 
 
 
 
 
 
 
 
 
 
3e8fb84
bc18442
 
 
1aa8799
bc18442
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3e8fb84
bc18442
3e8fb84
 
 
 
bc18442
 
 
 
3e8fb84
 
 
 
 
 
 
 
 
 
 
 
 
 
bc18442
3e8fb84
 
bc18442
3e8fb84
 
 
 
 
 
 
bc18442
 
3e8fb84
 
f57745e
bc18442
 
 
 
8a3d664
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
import gradio as gr
import logging
import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

# Configure logging
logging.basicConfig(
    level=logging.INFO,
    format='%(asctime)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)

# CSS Configuration
css = """
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
.header {
    background: #00000;
    border-bottom: 1px solid #e5e5e5;
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}
.logo {
    width: 100px;
    height: 45px;
    margin-right: 0px;
    transition: transform 0.3s ease;
}
.logo:hover {
    transform: scale(1.05);
}
.header-title {
    color: #000000;
    font-size: 24px;
    font-weight: 600;
}
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}
.main-content {
    background: #00000;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid #e5e5e5;
}
.iframe-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 65%;
}
.iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 1000px;
    height: 1000px;
    border: none;
}
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(1000px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}
.nav-card {
    background: #ffffff;
    border: 10px solid #e5e5e5;
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}
.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #000000;
}
.nav-card a {
    color: #000000;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.nav-card a::after {
    content: 'β†’';
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.nav-card:hover a::after {
    opacity: 1;
}
/* Hide Gradio elements */
footer {
    display: none !important;
}
.gradio-container {
    margin: 0 !important;
    padding: 0 !important;
}
@media (max-width: 768px) {
    .nav-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
}
"""

# Navigation cards configuration
NAVIGATION_CARDS = [
    {
        "icon": "πŸ”",
        "title": "DeepFake Detection",
        "url": "https://noumanjavaid-new-space.hf.space"
    },
    {
        "icon": "πŸ“„",
        "title": "Document Analysis",
        "url": "https://noumanjavaid-centurionv2.hf.space"
    },
    {
        "icon": "πŸŽ₯",
        "title": "Video Watermarking",
        "url": "https://noumanjavaid-watermark-demo-video.hf.space"
    },
    {
        "icon": "πŸ”",
        "title": "Image Authentication",
        "url": "https://noumanjavaid-centii.hf.space"
    }
]

def create_navigation_cards():
    return "".join([
        f'''
        <div class="nav-card">
            <a href="{card['url']}" target="_blank" rel="noopener noreferrer">
                {card['icon']} {card['title']}
            </a>
        </div>
        ''' for card in NAVIGATION_CARDS
    ])

def create_interface():
    with gr.Blocks(css=css, title="Centurion Analysis Platform") as demo:
        # Header
        with gr.Row(elem_classes=["header"]):
            gr.Image(
                "https://raw.githubusercontent.com/noumanjavaid96/ai-as-an-api/refs/heads/master/image%20(39).png",
                elem_classes=["logo"],
                show_label=False,
                container=False
            )
            gr.Markdown("Centurion Analysis", elem_classes=["header-title"])
        
        # Main content
        with gr.Row(elem_classes=["container"]):
            with gr.Column(elem_classes=["main-content"]):
                gr.HTML('''
                    <div class="iframe-container">
                        <iframe 
                            src="https://noumanjavaid-centii.hf.space"
                            title="Centurion Main Platform"
                        ></iframe>
                    </div>
                ''')
            
            # Navigation grid
            with gr.Row(elem_classes=["nav-grid"]):
                gr.HTML(create_navigation_cards())
    
    return demo

if __name__ == "__main__":
    demo = create_interface()
    demo.launch(
        show_error=False,
        show_api=False,
    )