SAVAI123 commited on
Commit
750a010
·
verified ·
1 Parent(s): 8f8c433

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -17
app.py CHANGED
@@ -181,21 +181,24 @@ def main():
181
 
182
  # Define custom CSS to style the logo across the entire header
183
  custom_css = """
184
- #header-container {
185
  width: 100%;
186
- background-color: #fff;
187
  padding: 15px 0;
188
- margin-bottom: 20px;
189
  text-align: center;
190
- }
 
191
 
192
- .logo-image {
193
- max-width: 100%;
194
- height: auto; /* This ensures the aspect ratio is maintained */
195
- max-height: none; /* Remove the height restriction */
196
- display: block;
197
  margin: 0 auto;
198
- }
 
 
 
 
 
 
199
 
200
  """
201
 
@@ -203,14 +206,27 @@ def main():
203
 
204
  # Create Gradio UI
205
  with gr.Blocks(css=custom_css) as ui:
 
206
  with gr.Row(elem_id="header-container"):
207
- if os.path.exists(logo_path):
208
- # Using HTML for direct control over the image
209
- gr.HTML(f'<img src="file/{logo_path}" class="logo-image" alt="Equinix Logo">')
210
- print(f"Logo file found at {os.path.abspath(logo_path)}")
211
- else:
212
- gr.Markdown("<h2>Equinix</h2>")
213
- print(f"Warning: Logo file {logo_path} not found")
 
 
 
 
 
 
 
 
 
 
 
 
214
 
215
 
216
  # Title & Description
 
181
 
182
  # Define custom CSS to style the logo across the entire header
183
  custom_css = """
184
+ #header-container {
185
  width: 100%;
186
+ background-color: black;
187
  padding: 15px 0;
 
188
  text-align: center;
189
+ margin-bottom: 20px;
190
+ }
191
 
192
+ .logo-container {
193
+ max-width: 300px;
 
 
 
194
  margin: 0 auto;
195
+ padding: 10px;
196
+ }
197
+
198
+ .logo-image {
199
+ width: 100%;
200
+ height: auto;
201
+ }
202
 
203
  """
204
 
 
206
 
207
  # Create Gradio UI
208
  with gr.Blocks(css=custom_css) as ui:
209
+ # Header with logo
210
  with gr.Row(elem_id="header-container"):
211
+ with gr.Column(scale=1):
212
+ pass # Spacer
213
+
214
+ with gr.Column(scale=2, elem_classes="logo-container"):
215
+ # Check if the file exists before trying to display it
216
+ if os.path.exists(logo_path):
217
+ gr.Image(value=logo_path, show_label=False, elem_classes="logo-image")
218
+ else:
219
+ # Fallback to text + styling that mimics the logo
220
+ gr.HTML("""
221
+ <div style="text-align:center; color:white; background-color:black; padding:20px;">
222
+ <div style="color:#FF0000; font-size:24px;">■■■■</div>
223
+ <div style="font-size:28px; letter-spacing:5px; margin-top:10px;">EQUINIX</div>
224
+ </div>
225
+ """)
226
+ print(f"Warning: Logo file {logo_path} not found")
227
+
228
+ with gr.Column(scale=1):
229
+ pass # Spacer
230
 
231
 
232
  # Title & Description