Update app.py
Browse files
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:
|
188 |
margin-bottom: 20px;
|
189 |
-
|
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 |
-
|
203 |
-
|
204 |
-
|
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 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
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
|