Carbon Footprint Streamlit Interface
Browse files- .gitattributes +3 -0
- app.py +171 -0
- functions.py +164 -0
- media/ayak.png +3 -0
- media/background_min.jpg +3 -0
- media/default.png +3 -0
- media/favicon.ico +0 -0
- media/icon2.png +3 -0
- media/icon3.png +3 -0
- models/model.sav +0 -0
- models/scale.sav +0 -0
- requirements.txt +6 -0
- style/ArchivoBlack-Regular.ttf +3 -0
- style/arialuni.ttf +3 -0
- style/footer.html +38 -0
- style/main.md +20 -0
- style/scripts.js +82 -0
- style/style.css +159 -0
.gitattributes
CHANGED
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
media/*.jpg filter=lfs diff=lfs merge=lfs -text
|
37 |
+
media/*.png filter=lfs diff=lfs merge=lfs -text
|
38 |
+
style/*.ttf filter=lfs diff=lfs merge=lfs -text
|
app.py
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import numpy as np
|
4 |
+
from streamlit.components.v1 import html
|
5 |
+
from sklearn.neural_network import MLPRegressor
|
6 |
+
from sklearn.preprocessing import StandardScaler
|
7 |
+
import pickle
|
8 |
+
import io
|
9 |
+
import matplotlib.pyplot as plt
|
10 |
+
from PIL import Image, ImageDraw, ImageFont
|
11 |
+
import base64
|
12 |
+
from functions import *
|
13 |
+
|
14 |
+
st.set_page_config(layout="wide",page_title="Carbon Footprint Calculator", page_icon="./media/favicon.ico")
|
15 |
+
|
16 |
+
def get_base64(bin_file):
|
17 |
+
with open(bin_file, 'rb') as f:
|
18 |
+
data = f.read()
|
19 |
+
return base64.b64encode(data).decode()
|
20 |
+
|
21 |
+
background = get_base64("./media/background_min.jpg")
|
22 |
+
icon2 = get_base64("./media/icon2.png")
|
23 |
+
icon3 = get_base64("./media/icon3.png")
|
24 |
+
|
25 |
+
with open("./style/style.css", "r") as style:
|
26 |
+
css=f"""<style>{style.read().format(background=background, icon2=icon2, icon3=icon3)}</style>"""
|
27 |
+
st.markdown(css, unsafe_allow_html=True)
|
28 |
+
|
29 |
+
def script():
|
30 |
+
with open("./style/scripts.js", "r", encoding="utf-8") as scripts:
|
31 |
+
open_script = f"""<script>{scripts.read()}</script> """
|
32 |
+
html(open_script, width=0, height=0)
|
33 |
+
|
34 |
+
|
35 |
+
left, middle, right = st.columns([2,3.5,2])
|
36 |
+
main, comps , result = middle.tabs([" ", " ", " "])
|
37 |
+
|
38 |
+
with open("./style/main.md", "r", encoding="utf-8") as main_page:
|
39 |
+
main.markdown(f"""{main_page.read()}""")
|
40 |
+
|
41 |
+
_,but,_ = main.columns([1,2,1])
|
42 |
+
if but.button("Calculate Your Carbon Footprint!", type="primary"):
|
43 |
+
click_element('tab-1')
|
44 |
+
|
45 |
+
tab1, tab2, tab3, tab4, tab5 = comps.tabs(["👴 Personal","🚗 Travel","🗑️ Waste","⚡ Energy","💸 Consumption"])
|
46 |
+
tab_result,_ = result.tabs([" "," "])
|
47 |
+
|
48 |
+
def component():
|
49 |
+
tab1col1, tab1col2 = tab1.columns(2)
|
50 |
+
height = tab1col1.number_input("Height",0,251, value=None, placeholder="160", help="in cm")
|
51 |
+
weight = tab1col2.number_input("Weight", 0, 250, value=None, placeholder="75", help="in kg")
|
52 |
+
if (weight is None) or (weight == 0) : weight = 1
|
53 |
+
if (height is None) or (height == 0) : height = 1
|
54 |
+
calculation = weight / (height/100)**2
|
55 |
+
body_type = "underweight" if (calculation < 18.5) else \
|
56 |
+
"normal" if ((calculation >=18.5) and (calculation < 25 )) else \
|
57 |
+
"overweight" if ((calculation >= 25) and (calculation < 30)) else "obese"
|
58 |
+
sex = tab1.selectbox('Gender', ["female", "male"])
|
59 |
+
diet = tab1.selectbox('Diet', ['omnivore', 'pescatarian', 'vegetarian', 'vegan'], help="""
|
60 |
+
Omnivore: Eats both plants and animals.\n
|
61 |
+
Pescatarian: Consumes plants and seafood, but no other meat\n
|
62 |
+
Vegetarian: Diet excludes meat but includes plant-based foods.\n
|
63 |
+
Vegan: Avoids all animal products, including meat, dairy, and eggs.""")
|
64 |
+
social = tab1.selectbox('Social Activity', ['never', 'often', 'sometimes'], help="How often do you go out?")
|
65 |
+
|
66 |
+
transport = tab2.selectbox('Transportation', ['public', 'private', 'walk/bicycle'],
|
67 |
+
help="Which transportation method do you prefer the most?")
|
68 |
+
if transport == "private":
|
69 |
+
vehicle_type = tab2.selectbox('Vehicle Type', ['petrol', 'diesel', 'hybrid', 'lpg', 'electric'],
|
70 |
+
help="What type of fuel do you use in your car?")
|
71 |
+
else:
|
72 |
+
vehicle_type = "None"
|
73 |
+
|
74 |
+
if transport == "walk/bicycle":
|
75 |
+
vehicle_km = 0
|
76 |
+
else:
|
77 |
+
vehicle_km = tab2.slider('What is the monthly distance traveled by the vehicle in kilometers?', 0, 5000, 0, disabled=False)
|
78 |
+
|
79 |
+
air_travel = tab2.selectbox('How often did you fly last month?', ['never', 'rarely', 'frequently', 'very frequently'], help= """
|
80 |
+
Never: I didn't travel by plane.\n
|
81 |
+
Rarely: Around 1-4 Hours.\n
|
82 |
+
Frequently: Around 5 - 10 Hours.\n
|
83 |
+
Very Frequently: Around 10+ Hours. """)
|
84 |
+
|
85 |
+
waste_bag = tab3.selectbox('What is the size of your waste bag?', ['small', 'medium', 'large', 'extra large'])
|
86 |
+
waste_count = tab3.slider('How many waste bags do you trash out in a week?', 0, 10, 0)
|
87 |
+
recycle = tab3.multiselect('Do you recycle any materials below?', ['Plastic', 'Paper', 'Metal', 'Glass'])
|
88 |
+
|
89 |
+
heating_energy = tab4.selectbox('What power source do you use for heating?', ['natural gas', 'electricity', 'wood', 'coal'])
|
90 |
+
|
91 |
+
for_cooking = tab4.multiselect('What cooking systems do you use?', ['microwave', 'oven', 'grill', 'airfryer', 'stove'])
|
92 |
+
energy_efficiency = tab4.selectbox('Do you consider the energy efficiency of electronic devices?', ['No', 'Yes', 'Sometimes' ])
|
93 |
+
daily_tv_pc = tab4.slider('How many hours a day do you spend in front of your PC/TV?', 0, 24, 0)
|
94 |
+
internet_daily = tab4.slider('What is your daily internet usage in hours?', 0, 24, 0)
|
95 |
+
|
96 |
+
shower = tab5.selectbox('How often do you take a shower?', ['daily', 'twice a day', 'more frequently', 'less frequently'])
|
97 |
+
grocery_bill = tab5.slider('Monthly grocery spending in $', 0, 500, 0)
|
98 |
+
clothes_monthly = tab5.slider('How many clothes do you buy monthly?', 0, 30, 0)
|
99 |
+
|
100 |
+
data = {'Body Type': body_type,
|
101 |
+
"Sex": sex,
|
102 |
+
'Diet': diet,
|
103 |
+
"How Often Shower": shower,
|
104 |
+
"Heating Energy Source": heating_energy,
|
105 |
+
"Transport": transport,
|
106 |
+
"Social Activity": social,
|
107 |
+
'Monthly Grocery Bill': grocery_bill,
|
108 |
+
"Frequency of Traveling by Air": air_travel,
|
109 |
+
"Vehicle Monthly Distance Km": vehicle_km,
|
110 |
+
"Waste Bag Size": waste_bag,
|
111 |
+
"Waste Bag Weekly Count": waste_count,
|
112 |
+
"How Long TV PC Daily Hour": daily_tv_pc,
|
113 |
+
"Vehicle Type": vehicle_type,
|
114 |
+
"How Many New Clothes Monthly": clothes_monthly,
|
115 |
+
"How Long Internet Daily Hour": internet_daily,
|
116 |
+
"Energy efficiency": energy_efficiency
|
117 |
+
}
|
118 |
+
data.update({f"Cooking_with_{x}": y for x, y in
|
119 |
+
dict(zip(for_cooking, np.ones(len(for_cooking)))).items()})
|
120 |
+
data.update({f"Do You Recyle_{x}": y for x, y in
|
121 |
+
dict(zip(recycle, np.ones(len(recycle)))).items()})
|
122 |
+
|
123 |
+
|
124 |
+
return pd.DataFrame(data, index=[0])
|
125 |
+
|
126 |
+
df = component()
|
127 |
+
data = input_preprocessing(df)
|
128 |
+
|
129 |
+
sample_df = pd.DataFrame(data=sample,index=[0])
|
130 |
+
sample_df[sample_df.columns] = 0
|
131 |
+
sample_df[data.columns] = data
|
132 |
+
|
133 |
+
ss = pickle.load(open("./models/scale.sav","rb"))
|
134 |
+
model = pickle.load(open("./models/model.sav","rb"))
|
135 |
+
prediction = round(np.exp(model.predict(ss.transform(sample_df))[0]))
|
136 |
+
|
137 |
+
column1,column2 = tab1.columns(2)
|
138 |
+
_,resultbutton,_ = tab5.columns([1,1,1])
|
139 |
+
if resultbutton.button(" ", type = "secondary"):
|
140 |
+
tab_result.image(chart(model,ss, sample_df,prediction), use_column_width="auto")
|
141 |
+
click_element('tab-2')
|
142 |
+
|
143 |
+
pop_button = """<button id = "button-17" class="button-17" role="button"> ❔ Did You Know</button>"""
|
144 |
+
_,home,_ = comps.columns([1,2,1])
|
145 |
+
_,col2,_ = comps.columns([1,10,1])
|
146 |
+
col2.markdown(pop_button, unsafe_allow_html=True)
|
147 |
+
pop = """
|
148 |
+
<div id="popup" class="DidYouKnow_root">
|
149 |
+
<p class="DidYouKnow_title TextNew" style="font-size: 20px;"> ❔ Did you know</p>
|
150 |
+
<p id="popupText" class="DidYouKnow_content TextNew"><span>
|
151 |
+
Each year, human activities release over 40 billion metric tons of carbon dioxide into the atmosphere, contributing to climate change.
|
152 |
+
</span></p>
|
153 |
+
</div>
|
154 |
+
"""
|
155 |
+
col2.markdown(pop, unsafe_allow_html=True)
|
156 |
+
|
157 |
+
if home.button("🏡"):
|
158 |
+
click_element('tab-0')
|
159 |
+
_,resultmid,_ = result.columns([1,2,1])
|
160 |
+
|
161 |
+
tree_count = round(prediction / 411.4)
|
162 |
+
tab_result.markdown(f"""You owe nature <b>{tree_count}</b> tree{'s' if tree_count > 1 else ''} monthly. <br> {f"<a href='https://www.tema.org.tr/en/homepage' id = 'button-17' class='button-17' role='button'> 🌳 Proceed to offset 🌳</a>" if tree_count > 0 else ""}""", unsafe_allow_html=True)
|
163 |
+
|
164 |
+
if resultmid.button(" ", type="secondary"):
|
165 |
+
click_element('tab-1')
|
166 |
+
|
167 |
+
with open("./style/footer.html", "r", encoding="utf-8") as footer:
|
168 |
+
footer_html = f"""{footer.read()}"""
|
169 |
+
st.markdown(footer_html, unsafe_allow_html=True)
|
170 |
+
|
171 |
+
script()
|
functions.py
ADDED
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from streamlit.components.v1 import html
|
2 |
+
import numpy as np
|
3 |
+
from PIL import Image, ImageDraw, ImageFont
|
4 |
+
import matplotlib.pyplot as plt
|
5 |
+
import io
|
6 |
+
import pandas as pd
|
7 |
+
def click_element(element):
|
8 |
+
open_script = f"<script type = 'text/javascript'>window.parent.document.querySelector('[id^=tabs-bui][id$=-{element}]').click();</script>"
|
9 |
+
html(open_script, width=0, height=0)
|
10 |
+
|
11 |
+
|
12 |
+
sample = {'Body Type': 2,
|
13 |
+
'Sex': 0,
|
14 |
+
'How Often Shower': 1,
|
15 |
+
'Social Activity': 2,
|
16 |
+
'Monthly Grocery Bill': 230,
|
17 |
+
'Frequency of Traveling by Air': 2,
|
18 |
+
'Vehicle Monthly Distance Km': 210,
|
19 |
+
'Waste Bag Size': 2,
|
20 |
+
'Waste Bag Weekly Count': 4,
|
21 |
+
'How Long TV PC Daily Hour': 7,
|
22 |
+
'How Many New Clothes Monthly': 26,
|
23 |
+
'How Long Internet Daily Hour': 1,
|
24 |
+
'Energy efficiency': 0,
|
25 |
+
'Do You Recyle_Paper': 0,
|
26 |
+
'Do You Recyle_Plastic': 0,
|
27 |
+
'Do You Recyle_Glass': 0,
|
28 |
+
'Do You Recyle_Metal': 1,
|
29 |
+
'Cooking_with_stove': 1,
|
30 |
+
'Cooking_with_oven': 1,
|
31 |
+
'Cooking_with_microwave': 0,
|
32 |
+
'Cooking_with_grill': 0,
|
33 |
+
'Cooking_with_airfryer': 1,
|
34 |
+
'Diet_omnivore': 0,
|
35 |
+
'Diet_pescatarian': 1,
|
36 |
+
'Diet_vegan': 0,
|
37 |
+
'Diet_vegetarian': 0,
|
38 |
+
'Heating Energy Source_coal': 1,
|
39 |
+
'Heating Energy Source_electricity': 0,
|
40 |
+
'Heating Energy Source_natural gas': 0,
|
41 |
+
'Heating Energy Source_wood': 0,
|
42 |
+
'Transport_private': 0,
|
43 |
+
'Transport_public': 1,
|
44 |
+
'Transport_walk/bicycle': 0,
|
45 |
+
'Vehicle Type_None': 1,
|
46 |
+
'Vehicle Type_diesel': 0,
|
47 |
+
'Vehicle Type_electric': 0,
|
48 |
+
'Vehicle Type_hybrid': 0,
|
49 |
+
'Vehicle Type_lpg': 0,
|
50 |
+
'Vehicle Type_petrol': 0}
|
51 |
+
|
52 |
+
def input_preprocessing(data):
|
53 |
+
data["Body Type"] = data["Body Type"].map({'underweight':0, 'normal':1, 'overweight':2, 'obese':3})
|
54 |
+
data["Sex"] = data["Sex"].map({'female':0, 'male':1})
|
55 |
+
data = pd.get_dummies(data, columns=["Diet","Heating Energy Source","Transport","Vehicle Type"], dtype=int)
|
56 |
+
data["How Often Shower"] = data["How Often Shower"].map({'less frequently':0, 'daily':1, "twice a day":2, "more frequently":3})
|
57 |
+
data["Social Activity"] = data["Social Activity"].map({'never':0, 'sometimes':1, "often":2})
|
58 |
+
data["Frequency of Traveling by Air"] = data["Frequency of Traveling by Air"].map({'never':0, 'rarely':1, "frequently":2, "very frequently":3})
|
59 |
+
data["Waste Bag Size"] = data["Waste Bag Size"].map({'small':0, 'medium':1, "large":2, "extra large":3})
|
60 |
+
data["Energy efficiency"] = data["Energy efficiency"].map({'No':0, 'Sometimes':1, "Yes":2})
|
61 |
+
return data
|
62 |
+
def hesapla(model,ss, sample_df):
|
63 |
+
copy_df = sample_df.copy()
|
64 |
+
travels = copy_df[["Frequency of Traveling by Air",
|
65 |
+
"Vehicle Monthly Distance Km",
|
66 |
+
'Transport_private',
|
67 |
+
'Transport_public',
|
68 |
+
'Transport_walk/bicycle',
|
69 |
+
'Vehicle Type_None',
|
70 |
+
'Vehicle Type_diesel',
|
71 |
+
'Vehicle Type_electric',
|
72 |
+
'Vehicle Type_hybrid',
|
73 |
+
'Vehicle Type_lpg',
|
74 |
+
'Vehicle Type_petrol']]
|
75 |
+
copy_df[list(set(copy_df.columns) - set(travels.columns))] = 0
|
76 |
+
travel = np.exp(model.predict(ss.transform(copy_df)))
|
77 |
+
|
78 |
+
copy_df = sample_df.copy()
|
79 |
+
energys = copy_df[[ 'Heating Energy Source_coal','How Often Shower', 'How Long TV PC Daily Hour',
|
80 |
+
'Heating Energy Source_electricity','How Long Internet Daily Hour',
|
81 |
+
'Heating Energy Source_natural gas',
|
82 |
+
'Cooking_with_stove',
|
83 |
+
'Cooking_with_oven',
|
84 |
+
'Cooking_with_microwave',
|
85 |
+
'Cooking_with_grill',
|
86 |
+
'Cooking_with_airfryer',
|
87 |
+
'Heating Energy Source_wood','Energy efficiency']]
|
88 |
+
copy_df[list(set(copy_df.columns) - set(energys.columns))] = 0
|
89 |
+
energy = np.exp(model.predict(ss.transform(copy_df)))
|
90 |
+
|
91 |
+
copy_df = sample_df.copy()
|
92 |
+
wastes = copy_df[[ 'Do You Recyle_Paper','How Many New Clothes Monthly',
|
93 |
+
'Waste Bag Size',
|
94 |
+
'Waste Bag Weekly Count',
|
95 |
+
'Do You Recyle_Plastic',
|
96 |
+
'Do You Recyle_Glass',
|
97 |
+
'Do You Recyle_Metal',
|
98 |
+
'Social Activity',]]
|
99 |
+
copy_df[list(set(copy_df.columns) - set(wastes.columns))] = 0
|
100 |
+
waste = np.exp(model.predict(ss.transform(copy_df)))
|
101 |
+
|
102 |
+
copy_df = sample_df.copy()
|
103 |
+
diets = copy_df[[ 'Diet_omnivore',
|
104 |
+
'Diet_pescatarian',
|
105 |
+
'Diet_vegan',
|
106 |
+
'Diet_vegetarian', 'Monthly Grocery Bill','Transport_private',
|
107 |
+
'Transport_public',
|
108 |
+
'Transport_walk/bicycle',
|
109 |
+
'Heating Energy Source_coal',
|
110 |
+
'Heating Energy Source_electricity',
|
111 |
+
'Heating Energy Source_natural gas',
|
112 |
+
'Heating Energy Source_wood',
|
113 |
+
]]
|
114 |
+
copy_df[list(set(copy_df.columns) - set(diets.columns))] = 0
|
115 |
+
diet = np.exp(model.predict(ss.transform(copy_df)))
|
116 |
+
hesap = {"Travel": travel[0], "Energy": energy[0], "Waste": waste[0], "Diet": diet[0]}
|
117 |
+
|
118 |
+
return hesap
|
119 |
+
|
120 |
+
|
121 |
+
def chart(model, scaler,sample_df, prediction):
|
122 |
+
p = hesapla(model, scaler,sample_df)
|
123 |
+
bbox_props = dict(boxstyle="round", facecolor="white", edgecolor="white", alpha=0.7)
|
124 |
+
|
125 |
+
plt.figure(figsize=(10, 10))
|
126 |
+
patches, texts = plt.pie(x=p.values(),
|
127 |
+
labels=p.keys(),
|
128 |
+
explode=[0.03] * 4,
|
129 |
+
labeldistance=0.75,
|
130 |
+
colors=["#29ad9f", "#1dc8b8", "#99d9d9", "#b4e3dd" ], shadow=True,
|
131 |
+
textprops={'fontsize': 20, 'weight': 'bold', "color": "#000000ad"})
|
132 |
+
for text in texts:
|
133 |
+
text.set_horizontalalignment('center')
|
134 |
+
|
135 |
+
data = io.BytesIO()
|
136 |
+
plt.savefig(data, transparent=True)
|
137 |
+
|
138 |
+
background = Image.open("./media/default.png")
|
139 |
+
draw = ImageDraw.Draw(background)
|
140 |
+
font1 = ImageFont.truetype(font="./style/ArchivoBlack-Regular.ttf", size=50)
|
141 |
+
font = ImageFont.truetype(font="./style/arialuni.ttf", size=50)
|
142 |
+
draw.text(xy=(320, 50), text=f" How big is your\nCarbon Footprint?", font=font1, fill="#039e8e", stroke_width=1, stroke_fill="#039e8e")
|
143 |
+
draw.text(xy=(370, 250), text=f"Monthly Emission \n\n {prediction:.0f} kgCO₂e", font=font, fill="#039e8e", stroke_width=1, stroke_fill="#039e8e")
|
144 |
+
data_back = io.BytesIO()
|
145 |
+
background.save(data_back, "PNG")
|
146 |
+
background = Image.open(data_back).convert('RGBA')
|
147 |
+
piechart = Image.open(data)
|
148 |
+
ayak = Image.open("./media/ayak.png").resize((370, 370))
|
149 |
+
bg_width, bg_height = piechart.size
|
150 |
+
ov_width, ov_height = ayak.size
|
151 |
+
x = (bg_width - ov_width) // 2
|
152 |
+
y = (bg_height - ov_height) // 2
|
153 |
+
piechart.paste(ayak, (x, y), ayak.convert('RGBA'))
|
154 |
+
background.paste(piechart, (40, 200), piechart.convert('RGBA'))
|
155 |
+
data2 = io.BytesIO()
|
156 |
+
background.save(data2, "PNG")
|
157 |
+
background = Image.open(data2).resize((700, 700))
|
158 |
+
data3 = io.BytesIO()
|
159 |
+
background.save(data3, "PNG")
|
160 |
+
return data3
|
161 |
+
|
162 |
+
|
163 |
+
|
164 |
+
|
media/ayak.png
ADDED
Git LFS Details
|
media/background_min.jpg
ADDED
Git LFS Details
|
media/default.png
ADDED
Git LFS Details
|
media/favicon.ico
ADDED
media/icon2.png
ADDED
Git LFS Details
|
media/icon3.png
ADDED
Git LFS Details
|
models/model.sav
ADDED
Binary file (474 kB). View file
|
|
models/scale.sav
ADDED
Binary file (2.36 kB). View file
|
|
requirements.txt
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit==1.29.0
|
2 |
+
pandas==1.4.2
|
3 |
+
numpy==1.22.3
|
4 |
+
matplotlib==3.8.0
|
5 |
+
scikit-learn==1.3.2
|
6 |
+
Pillow==10.2.0
|
style/ArchivoBlack-Regular.ttf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dd9a89a019b4849f66ab75455fe7bdf931311042cbb0f0f97acc061539703180
|
3 |
+
size 90988
|
style/arialuni.ttf
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:699b818bddd1d7f47b3ccdbf089140303198aebe297fd2e73f7d0fde604553e5
|
3 |
+
size 1588364
|
style/footer.html
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<div style="position: fixed; bottom: 0; left: 0; width: 100%; background-color: rgba(112,170,96,0.7); padding: 10px; display: flex; justify-content: space-between; align-items: center;">
|
2 |
+
<div id="project-copyright" style="display: flex; align-items: center;">
|
3 |
+
<p style="margin: 0; color: rgba(255,255,255,0.6); font-size: 10px;">© 2023 Miuul Carbon Footprint Project.</p>
|
4 |
+
</div>
|
5 |
+
<div style="display: flex; align-items: center; margin-right: 135px;">
|
6 |
+
<p style="margin: 0; color: rgba(255,255,255,0.9); font-size: 9px; height:16px;">Contributors: </p>
|
7 |
+
<a href="https://www.linkedin.com/in/burhanyildiz" target="_blank" rel="noopener noreferrer" style="width:32px; height:32px;">
|
8 |
+
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="32" height="32" viewBox="0 0 64 64">
|
9 |
+
<circle cx="32" cy="32" r="31" fill="#007fb1"></circle>
|
10 |
+
<path d="M20.4,44h5.4V26.6h-5.4V44z M23.1,18c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1 c1.7,0,3.1-1.4,3.1-3.1C26.2,19.4,24.8,18,23.1,18z M39.5,26.2c-2.6,0-4.4,1.4-5.1,2.8h-0.1v-2.4h-5.2V44h5.4v-8.6 c0-2.3,0.4-4.5,3.2-4.5c2.8,0,2.8,2.6,2.8,4.6V44H46v-9.5C46,29.8,45,26.2,39.5,26.2z" fill="white"></path>
|
11 |
+
</svg>
|
12 |
+
</a>
|
13 |
+
<a href="https://www.linkedin.com/in/ecembayindir" target="_blank" rel="noopener noreferrer" style="width:32px; height:32px;">
|
14 |
+
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="32" height="32" viewBox="0 0 64 64">
|
15 |
+
<circle cx="32" cy="32" r="31" fill="#007fb1"></circle>
|
16 |
+
<path d="M20.4,44h5.4V26.6h-5.4V44z M23.1,18c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1 c1.7,0,3.1-1.4,3.1-3.1C26.2,19.4,24.8,18,23.1,18z M39.5,26.2c-2.6,0-4.4,1.4-5.1,2.8h-0.1v-2.4h-5.2V44h5.4v-8.6 c0-2.3,0.4-4.5,3.2-4.5c2.8,0,2.8,2.6,2.8,4.6V44H46v-9.5C46,29.8,45,26.2,39.5,26.2z" fill="white"></path>
|
17 |
+
</svg>
|
18 |
+
</a>
|
19 |
+
<a href="https://www.linkedin.com/in/huseyinbaytar" target="_blank" rel="noopener noreferrer" style="width:32px; height:32px;">
|
20 |
+
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="32" height="32" viewBox="0 0 64 64">
|
21 |
+
<circle cx="32" cy="32" r="31" fill="#007fb1"></circle>
|
22 |
+
<path d="M20.4,44h5.4V26.6h-5.4V44z M23.1,18c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1 c1.7,0,3.1-1.4,3.1-3.1C26.2,19.4,24.8,18,23.1,18z M39.5,26.2c-2.6,0-4.4,1.4-5.1,2.8h-0.1v-2.4h-5.2V44h5.4v-8.6 c0-2.3,0.4-4.5,3.2-4.5c2.8,0,2.8,2.6,2.8,4.6V44H46v-9.5C46,29.8,45,26.2,39.5,26.2z" fill="white"></path>
|
23 |
+
</svg>
|
24 |
+
</a>
|
25 |
+
<a href="https://www.linkedin.com/in/serap-gülasar" target="_blank" rel="noopener noreferrer" style="width:32px; height:32px;">
|
26 |
+
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="32" height="32" viewBox="0 0 64 64">
|
27 |
+
<circle cx="32" cy="32" r="31" fill="#007fb1"></circle>
|
28 |
+
<path d="M20.4,44h5.4V26.6h-5.4V44z M23.1,18c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1 c1.7,0,3.1-1.4,3.1-3.1C26.2,19.4,24.8,18,23.1,18z M39.5,26.2c-2.6,0-4.4,1.4-5.1,2.8h-0.1v-2.4h-5.2V44h5.4v-8.6 c0-2.3,0.4-4.5,3.2-4.5c2.8,0,2.8,2.6,2.8,4.6V44H46v-9.5C46,29.8,45,26.2,39.5,26.2z" fill="white"></path>
|
29 |
+
</svg>
|
30 |
+
</a>
|
31 |
+
<a href="https://www.linkedin.com/in/mesut-duman" target="_blank" rel="noopener noreferrer" style="width:32px; height:32px;">
|
32 |
+
<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="32" height="32" viewBox="0 0 64 64">
|
33 |
+
<circle cx="32" cy="32" r="31" fill="#007fb1"></circle>
|
34 |
+
<path d="M20.4,44h5.4V26.6h-5.4V44z M23.1,18c-1.7,0-3.1,1.4-3.1,3.1c0,1.7,1.4,3.1,3.1,3.1 c1.7,0,3.1-1.4,3.1-3.1C26.2,19.4,24.8,18,23.1,18z M39.5,26.2c-2.6,0-4.4,1.4-5.1,2.8h-0.1v-2.4h-5.2V44h5.4v-8.6 c0-2.3,0.4-4.5,3.2-4.5c2.8,0,2.8,2.6,2.8,4.6V44H46v-9.5C46,29.8,45,26.2,39.5,26.2z" fill="white"></path>
|
35 |
+
</svg>
|
36 |
+
</a>
|
37 |
+
</div>
|
38 |
+
</div>
|
style/main.md
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 🌳About Carbon Footprint
|
2 |
+
|
3 |
+
A carbon footprint measures the total greenhouse gas emissions linked to an individual, organization, event, or product. It's a crucial metric for gauging our impact on the environment and climate change.
|
4 |
+
|
5 |
+
# 🌳Why It Matters
|
6 |
+
|
7 |
+
#### 🍃Climate Impact
|
8 |
+
Reducing your carbon footprint directly contributes to global efforts against climate change, mitigating extreme weather and rising temperatures.
|
9 |
+
|
10 |
+
#### 🍃Resource Conservation
|
11 |
+
Cutting carbon often means using fewer natural resources, and promoting sustainability in water, energy, and raw materials.
|
12 |
+
|
13 |
+
#### 🍃Health and Well-being
|
14 |
+
Lowering emissions supports healthier lifestyle choices, improving air quality and physical well-being.
|
15 |
+
|
16 |
+
#### 🍃Sustainable Practices
|
17 |
+
Measuring and managing your carbon footprint encourages eco-friendly choices, fostering a more sustainable society.
|
18 |
+
|
19 |
+
#### 🍃Responsibility
|
20 |
+
Acknowledging and addressing your carbon impact demonstrates social and environmental responsibility.
|
style/scripts.js
ADDED
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
window.parent.document.getElementById('button-17').addEventListener('click', showPopup);
|
2 |
+
window.parent.document.getElementById('button-17').addEventListener('click', changeText);
|
3 |
+
window.parent.document.getElementById('popup').addEventListener('click', hidePopup);
|
4 |
+
|
5 |
+
function showPopup() {
|
6 |
+
window.parent.document.getElementById('popup').style.display = 'block';
|
7 |
+
window.parent.document.getElementById('button-17').style.display = 'none';
|
8 |
+
};
|
9 |
+
function hidePopup() {
|
10 |
+
window.parent.document.getElementById('popup').style.display = 'none';
|
11 |
+
window.parent.document.getElementById('button-17').style.display = 'block';
|
12 |
+
};
|
13 |
+
var texts = [
|
14 |
+
"Each year, human activities release over 40 billion tCO₂ into the atmosphere.",
|
15 |
+
"The production of one kilogram of beef is associated with approximately 26 kgCO₂ emissions.",
|
16 |
+
"The transportation sector accounts for nearly 25% of global CO₂ emissions, with the aviation industry being a major contributor.",
|
17 |
+
"Deforestation contributes to about 10% of global carbon emissions, releasing stored carbon in trees into the atmosphere",
|
18 |
+
"Some carbon offset projects, like reforestation initiatives, can sequester up to 20 tCO₂ per acre over several decades.",
|
19 |
+
"Driving an electric vehicle can reduce an individual's carbon footprint by around 50% compared to a conventional gasoline-powered car.",
|
20 |
+
"Approximately 3 kgCO₂ is produced when using 1GB of data, and watching an HD-quality movie on Netflix causes approximately 4.5 kgCO₂ emissions.",
|
21 |
+
"Globally, buildings are responsible for approximately 36% of total energy use and 39% of CO₂ emissions.",
|
22 |
+
"The annual global carbon footprint from the fashion industry is estimated to be around 3.3 billion tons of CO₂.",
|
23 |
+
"As of 2021, the average global temperature has increased by approximately 1.2 degrees Celsius compared to pre-industrial levels.",
|
24 |
+
"The Amazon rainforest, often referred to as the 'lungs of the Earth,' produces around 20% of the world's oxygen.",
|
25 |
+
"In 2019, renewable energy accounted for about 26.2% of global electricity production.",
|
26 |
+
"Worldwide, over 90 million barrels of crude oil are consumed each day, contributing to CO₂ emissions.",
|
27 |
+
"The global use of coal for electricity generation surpasses 9,000 million metric tons annually.",
|
28 |
+
"Approximately 1.3 billion tons of food are wasted globally each year, leading to significant carbon emissions.",
|
29 |
+
"The aviation industry is responsible for more than 2% of global CO₂ emissions.",
|
30 |
+
"In 2020, global carbon dioxide emissions decreased by around 5.8% due to the COVID-19 pandemic.",
|
31 |
+
"The production of one ton of cement releases about 1 ton of CO₂ into the atmosphere.",
|
32 |
+
"Over 1.5 billion new smartphones are manufactured each year, contributing to electronic waste and carbon emissions.",
|
33 |
+
"The burning of fossil fuels for energy production accounts for over 70% of global greenhouse gas emissions.",
|
34 |
+
"Annually, deforestation results in the loss of around 7 million hectares of forest, releasing stored carbon.",
|
35 |
+
"The Paris Agreement aims to limit global warming to well below 2 degrees Celsius above pre-industrial levels.",
|
36 |
+
"Roughly 25% of the world's population relies on biomass (wood, charcoal) for cooking, contributing to indoor air pollution and carbon emissions.",
|
37 |
+
"The ocean absorbs about 30% of the CO₂ released into the atmosphere, leading to ocean acidification.",
|
38 |
+
"Every year, over 8 million metric tons of plastic enter the oceans, contributing to marine pollution and environmental harm.",
|
39 |
+
"The construction industry is responsible for nearly 40% of global energy-related CO₂ emissions.",
|
40 |
+
"The average American generates over 16 metric tons of carbon dioxide emissions annually."
|
41 |
+
];
|
42 |
+
|
43 |
+
function changeText() {
|
44 |
+
var randomIndex = Math.floor(Math.random() * texts.length);
|
45 |
+
var newText = texts[randomIndex];
|
46 |
+
|
47 |
+
window.parent.document.getElementById('popupText').innerHTML = newText;
|
48 |
+
};
|
49 |
+
|
50 |
+
if (!window.parent.document.querySelector('[class^=icon2]')) {
|
51 |
+
var newDiv = document.createElement('span');
|
52 |
+
|
53 |
+
newDiv.className = 'icon2';
|
54 |
+
|
55 |
+
var button = window.parent.document.querySelector('div[id^=tabs-bui][id$=-tabpanel-4] > div > div > div > div > div > div > div> div > div > div > button[kind = "secondary"] > div');
|
56 |
+
|
57 |
+
button.appendChild(newDiv);
|
58 |
+
};
|
59 |
+
|
60 |
+
if (!window.parent.document.querySelector('[class^=icon3]')) {
|
61 |
+
var newDiv2 = document.createElement('span');
|
62 |
+
|
63 |
+
newDiv2.className = 'icon3';
|
64 |
+
|
65 |
+
var button2 = window.parent.document.querySelector('div[id^=tabs-bui][id$=-tabpanel-2] > div > div > div > div > div > div > div> div > div > div > button[kind = "secondary"] > div');
|
66 |
+
|
67 |
+
button2.appendChild(newDiv2);
|
68 |
+
};
|
69 |
+
|
70 |
+
function checkScreenWidth() {
|
71 |
+
var screenWidth = window.innerWidth || window.parent.document.documentElement.clientWidth || window.parent.document.body.clientWidth;
|
72 |
+
|
73 |
+
if (screenWidth <= 600) {
|
74 |
+
window.parent.document.getElementById('project-copyright').style.display = 'none';
|
75 |
+
Array.from(window.parent.document.querySelectorAll('button[data-baseweb="tab"] > div > p')).forEach(button => button.style.fontSize = '10px');
|
76 |
+
} else {
|
77 |
+
window.parent.document.getElementById('project-copyright').style.display = 'block';
|
78 |
+
}
|
79 |
+
}
|
80 |
+
|
81 |
+
window.onload = checkScreenWidth;
|
82 |
+
window.onresize = checkScreenWidth;
|
style/style.css
ADDED
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body {{
|
2 |
+
background-image: url("data:image/png;base64,{background}");
|
3 |
+
background-size: cover;
|
4 |
+
background-repeat: no-repeat;
|
5 |
+
background-attachment: fixed;
|
6 |
+
margin: 0;
|
7 |
+
padding: 0;
|
8 |
+
height: 100vh;
|
9 |
+
}}
|
10 |
+
p {{
|
11 |
+
color: black;
|
12 |
+
font-family: "Google Sans",Roboto,Arial,sans-serif;
|
13 |
+
font-size: 20px;
|
14 |
+
|
15 |
+
}}
|
16 |
+
div[data-testid="StyledLinkIconContainer"]> a, div[data-testid="StyledLinkIconContainer"]> a > svg {{background-color: rgba(255, 255, 255,0); stroke: rgba(0, 0, 0, 0);}}
|
17 |
+
#popup {{
|
18 |
+
display: none;
|
19 |
+
background-color: #fff;
|
20 |
+
border: 1px solid #ccc;
|
21 |
+
overflow: hidden;
|
22 |
+
}}
|
23 |
+
.button-17, div[data-testid = "column"] > div > div> div > div > div > button{{
|
24 |
+
align-items: center;
|
25 |
+
appearance: none;
|
26 |
+
background-color: #fff;
|
27 |
+
border-radius: 24px;
|
28 |
+
border-style: none;
|
29 |
+
box-shadow: rgba(0, 0, 0, .2) 0 3px 5px -1px,rgba(0, 0, 0, .14) 0 6px 10px 0,rgba(0, 0, 0, .12) 0 1px 18px 0;
|
30 |
+
box-sizing: border-box;
|
31 |
+
color: #3c4043;
|
32 |
+
cursor: pointer;
|
33 |
+
display: inline-flex;
|
34 |
+
fill: currentcolor;
|
35 |
+
font-family: "Google Sans",Roboto,Arial,sans-serif;
|
36 |
+
font-size: 14px;
|
37 |
+
font-weight: 500;
|
38 |
+
height: 48px;
|
39 |
+
justify-content: center;
|
40 |
+
letter-spacing: .25px;
|
41 |
+
line-height: normal;
|
42 |
+
max-width: 100%;
|
43 |
+
overflow: visible;
|
44 |
+
padding: 2px 24px;
|
45 |
+
position: relative;
|
46 |
+
text-align: center;
|
47 |
+
text-transform: none;
|
48 |
+
transition: box-shadow 280ms cubic-bezier(.4, 0, .2, 1),opacity 15ms linear 30ms,transform 270ms cubic-bezier(0, 0, .2, 1) 0ms;
|
49 |
+
user-select: none;
|
50 |
+
-webkit-user-select: none;
|
51 |
+
touch-action: manipulation;
|
52 |
+
width: auto;
|
53 |
+
will-change: transform,opacity;
|
54 |
+
z-index: 0;
|
55 |
+
margin: 0 auto;
|
56 |
+
|
57 |
+
}}
|
58 |
+
.button-17, div[data-testid = "column"] > div > div> div > div > div > button:hover {{
|
59 |
+
background: #F6F9FE;
|
60 |
+
color: #174ea6;
|
61 |
+
}}
|
62 |
+
|
63 |
+
.button-17, div[data-testid = "column"] > div > div> div > div > div > button:active {{
|
64 |
+
box-shadow: 0 4px 4px 0 rgb(60 64 67 / 30%), 0 8px 12px 6px rgb(60 64 67 / 15%);
|
65 |
+
outline: none;
|
66 |
+
}}
|
67 |
+
|
68 |
+
.button-17, div[data-testid = "column"] > div > div> div > div > div > button:focus {{
|
69 |
+
outline: none;
|
70 |
+
border: 2px solid #4285f4;
|
71 |
+
}}
|
72 |
+
.DidYouKnow_root {{
|
73 |
+
box-shadow: rgba(77, 131, 132, 0.1) 0px 0px 0.5px 1px, rgba(0, 0, 0, 0.024) 0px 0.5px 0.9px, rgba(0, 0, 0, 0.035) 0px 1.4px 2.5px, rgba(0, 0, 0, 0.04) 0px 3.3px 6px, rgba(0, 0, 0, 0.06) 0px 11px 20px;
|
74 |
+
cursor: pointer;
|
75 |
+
padding: 0.5rem 20px;
|
76 |
+
background: rgb(255, 255, 255);
|
77 |
+
border-radius: 2rem;
|
78 |
+
margin: 1.75em 0px;
|
79 |
+
max-width: 1000px;
|
80 |
+
overflow: hidden;
|
81 |
+
}}
|
82 |
+
|
83 |
+
|
84 |
+
.TextNew {{
|
85 |
+
font-size: 20px;
|
86 |
+
line-height: 1.5;
|
87 |
+
}}
|
88 |
+
|
89 |
+
.DidYouKnow_title {{
|
90 |
+
color: rgb(49, 91, 85);
|
91 |
+
margin: 0px;
|
92 |
+
user-select: none;
|
93 |
+
}}
|
94 |
+
|
95 |
+
.DidYouKnow_content {{
|
96 |
+
color: rgb(14, 17, 23);
|
97 |
+
margin-top: 0.5rem;
|
98 |
+
padding: 0px 1rem;
|
99 |
+
}}
|
100 |
+
h1,h2,h3,h4 {{
|
101 |
+
color:rgb(14, 17, 23);
|
102 |
+
color: inherit;
|
103 |
+
text-decoration: none;
|
104 |
+
cursor: default;
|
105 |
+
}}
|
106 |
+
|
107 |
+
button[data-testid = "baseButton-primary"]{{width: 100%;}}
|
108 |
+
button[data-testid = "baseButton-secondary"]{{width: 100%;}}
|
109 |
+
div[data-testid = "stApp"]{{background: None; color: black;}}
|
110 |
+
div[id^=tabs-bui][id$=-tabpanel-0] > div> div > div > div > div[class = "stMarkdown"] {{padding: 20px; border-radius: 2rem; background: rgba(255,255,255,0.7);}}
|
111 |
+
div[id^=tabs-bui][id$=-tabpanel-1] > div > div > div > div > div[class = "st-ae"] {{padding: 20px; border-radius: 2rem; background: rgba(255,255,255,0.7);}}
|
112 |
+
div[id^=tabs-bui][id$=-tabpanel-2] > div > div > div > div > div[class = "st-ae"] {{padding: 20px; border-radius: 2rem; background: rgba(255,255,255,0.7);}}
|
113 |
+
div[id^=tabs-bui][id$=-tabpanel-2] > div > div > div > div > div > div[id^=tabs-bui][id$=-tabpanel-0] > div> div > div > div > div[class = "stMarkdown"]{{background: rgba(255,255,255,0);}}
|
114 |
+
div[data-testid = "column"] > div > div> div > div > div > div >p {{text-align: center;}}
|
115 |
+
div[data-testid = "stButton"] {{text-align: center;}}
|
116 |
+
div[data-testid = "column"] > div > div> div > div > div > button > div > p {{color: black;}}
|
117 |
+
div[data-testid = "column"] > div > div> div > div > div > button[kind = "secondary"] > div > p {{font-size: 25px; margin-bottom: 5px}}
|
118 |
+
svg[xmlns = "http://www.w3.org/2000/svg"]{{stroke: rgba(0, 0, 0, 0.6);}}
|
119 |
+
div[data-testid = "stButton"] > button > div > p {{color: white; font-size: 15px;}}
|
120 |
+
header[data-testid = "stHeader"]{{background: rgba(255,255,255,0);}}
|
121 |
+
div[data-testid = "stDecoration"]{{background: rgba(255,255,255,0);}}
|
122 |
+
div[data-baseweb = "tab-border"] {{display: none;}}
|
123 |
+
|
124 |
+
div[id^=tabs-bui][id$=-tabpanel-0] > div > div > div > div > div[data-testid = "column"] > div > div> div > div > div > button[kind = "primary"] > div > p
|
125 |
+
{{
|
126 |
+
font-size: 20px;
|
127 |
+
font-weight: bold;
|
128 |
+
}}
|
129 |
+
div[data-baseweb="tooltip"] > div {{background-color: rgb(255, 255, 255); border-radius: 2rem; padding: 10px;}}
|
130 |
+
|
131 |
+
div[id^=tabs-bui][id$=-tabpanel-4] > div > div > div > div > div > div > div> div > div > div > button[kind = "secondary"]
|
132 |
+
{{
|
133 |
+
background: #6fa861;
|
134 |
+
}}
|
135 |
+
div[id^=tabs-bui][id$=-tabpanel-4] > div > div > div > div > div > div > div> div > div > div > button[kind = "secondary"] > div > p
|
136 |
+
{{
|
137 |
+
color: rgb(255, 255, 255);
|
138 |
+
}}
|
139 |
+
|
140 |
+
div[data-testid = "stMarkdownContainer"] > p > a {{color: rgb(0, 0, 0); text-decoration: none; border: 0px; font-size: 18px; }}
|
141 |
+
div[data-testid = "stMarkdownContainer"] > p > a:hover:active {{border: 1px solid; border-color: rgb(0, 255, 0);}}
|
142 |
+
div[id^=tabs-bui][id$=-tabpanel-2] > div > div > div > div > div > div > div > div > div > div[data-testid = "stMarkdownContainer"] > p {{text-align: center;}}
|
143 |
+
div[data-testid="stStyledFullScreenFrame"] > div,div[id^=tabs-bui][id$=-tabpanel-2] > div > div > div > div > div > div[id^=tabs-bui][id$=-tabpanel-0] > div > div > div > div > div > div {{display: grid; place-items: center; text-align: center;}}
|
144 |
+
div[data-testid="stImage"] {{max-width: 700px; display: grid;}}
|
145 |
+
.icon2 {{
|
146 |
+
background: url("data:image/png;base64,{icon2}");
|
147 |
+
height: 40px;
|
148 |
+
width: 40px;
|
149 |
+
background-repeat: no-repeat;
|
150 |
+
display: block;
|
151 |
+
}}
|
152 |
+
.icon3 {{
|
153 |
+
background: url("data:image/png;base64,{icon3}");
|
154 |
+
height: 40px;
|
155 |
+
width: 40px;
|
156 |
+
background-repeat: no-repeat;
|
157 |
+
display: block;
|
158 |
+
}}
|
159 |
+
|