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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -27
app.py CHANGED
@@ -181,28 +181,21 @@ def main():
181
 
182
  # Define custom CSS to style the logo across the entire header
183
  custom_css = """
184
- {
185
  width: 100%;
186
  background-color: #fff;
187
- padding: 10px 0;
188
  margin-bottom: 20px;
189
- box-shadow: 0 2px 5px rgba(0,0,0,0.1);
190
- }
191
-
192
- #logo-image {
193
- width: 100%;
194
- height: auto;
195
- max-height: 80px;
196
- object-fit: contain;
197
- display: block;
198
- margin: 0 auto;
199
- }
200
 
201
  .logo-image {
202
- max-height: 80px;
203
- width: auto;
204
- display: inline-block;
205
- }
 
 
206
 
207
  """
208
 
@@ -211,16 +204,13 @@ def main():
211
  # Create Gradio UI
212
  with gr.Blocks(css=custom_css) as ui:
213
  with gr.Row(elem_id="header-container"):
214
- with gr.Column(elem_id="logo-wrapper"):
215
- if os.path.exists(logo_path):
216
- # Using HTML component for more control over image rendering
217
- gr.HTML(f'<img src="file/{logo_path}" class="logo-image" alt="Equinix Logo">')
218
- # Debug message to console
219
- print(f"Logo file found at {os.path.abspath(logo_path)}")
220
- else:
221
- gr.Markdown("<h2>Equinix</h2>")
222
- print(f"Warning: Logo file {logo_path} not found at {os.path.abspath(logo_path)}")
223
-
224
 
225
 
226
  # 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: #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
 
 
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