Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,9 +2,27 @@ import streamlit as st
|
|
2 |
import pandas as pd
|
3 |
import plotly.express as px
|
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
# Set page configuration
|
6 |
st.set_page_config(page_title="GreenLens AI", layout="wide")
|
7 |
|
|
|
|
|
|
|
8 |
# Title and subtitle
|
9 |
st.markdown("<h1 style='text-align: center; color: #4CAF50;'>GreenLens AI</h1>", unsafe_allow_html=True)
|
10 |
st.markdown(
|
@@ -107,10 +125,8 @@ if fiber_impact_data and transport_impact_data and washing_impact_data:
|
|
107 |
# Input for two assessments
|
108 |
col1, col2 = st.columns(2)
|
109 |
with col1:
|
110 |
-
|
111 |
weight1, composition1, lifecycle1 = get_inputs("Assessment 1")
|
112 |
with col2:
|
113 |
-
|
114 |
weight2, composition2, lifecycle2 = get_inputs("Assessment 2")
|
115 |
|
116 |
# Calculate footprints for both assessments
|
|
|
2 |
import pandas as pd
|
3 |
import plotly.express as px
|
4 |
|
5 |
+
# Add custom CSS for the background
|
6 |
+
def add_background():
|
7 |
+
background_url = "https://huggingface.co/spaces/ZainMalik0925/GreenLensAI_LCA/resolve/main/BCK1.jpg"
|
8 |
+
css = f"""
|
9 |
+
<style>
|
10 |
+
.stApp {{
|
11 |
+
background-image: url("{background_url}");
|
12 |
+
background-size: cover;
|
13 |
+
background-position: center;
|
14 |
+
background-attachment: fixed;
|
15 |
+
}}
|
16 |
+
</style>
|
17 |
+
"""
|
18 |
+
st.markdown(css, unsafe_allow_html=True)
|
19 |
+
|
20 |
# Set page configuration
|
21 |
st.set_page_config(page_title="GreenLens AI", layout="wide")
|
22 |
|
23 |
+
# Call the background function to load the background silently
|
24 |
+
add_background()
|
25 |
+
|
26 |
# Title and subtitle
|
27 |
st.markdown("<h1 style='text-align: center; color: #4CAF50;'>GreenLens AI</h1>", unsafe_allow_html=True)
|
28 |
st.markdown(
|
|
|
125 |
# Input for two assessments
|
126 |
col1, col2 = st.columns(2)
|
127 |
with col1:
|
|
|
128 |
weight1, composition1, lifecycle1 = get_inputs("Assessment 1")
|
129 |
with col2:
|
|
|
130 |
weight2, composition2, lifecycle2 = get_inputs("Assessment 2")
|
131 |
|
132 |
# Calculate footprints for both assessments
|