Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,36 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import influencer_ui
|
| 3 |
import influencer_onboarding
|
|
|
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# Page Configuration
|
| 6 |
st.set_page_config(page_title="InstaImpact", layout="wide")
|
| 7 |
|
|
@@ -15,20 +44,28 @@ selection = st.sidebar.radio("Go to", nav_options)
|
|
| 15 |
|
| 16 |
# Homepage
|
| 17 |
if selection == "Homepage":
|
| 18 |
-
st.
|
| 19 |
st.markdown("""
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
-
st.markdown("
|
| 27 |
st.markdown("""
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
# Influencer Search
|
| 33 |
elif selection == "Influencer Search":
|
| 34 |
influencer_ui.show_influencer_search_page()
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import influencer_ui
|
| 3 |
import influencer_onboarding
|
| 4 |
+
import base64
|
| 5 |
|
| 6 |
+
def get_base64_of_bin_file(bin_file):
|
| 7 |
+
"""
|
| 8 |
+
Converts a binary file to base64 encoding.
|
| 9 |
+
"""
|
| 10 |
+
with open(bin_file, 'rb') as file:
|
| 11 |
+
data = file.read()
|
| 12 |
+
return base64.b64encode(data).decode()
|
| 13 |
+
|
| 14 |
+
def set_bg_from_local_image(local_img_path):
|
| 15 |
+
"""
|
| 16 |
+
Sets a local image as the background of the Streamlit app.
|
| 17 |
+
"""
|
| 18 |
+
bin_str = get_base64_of_bin_file(local_img_path)
|
| 19 |
+
page_bg_img = f"""
|
| 20 |
+
<style>
|
| 21 |
+
.stApp {{
|
| 22 |
+
background-image: url("data:image/jpg;base64,{bin_str}");
|
| 23 |
+
background-size: cover;
|
| 24 |
+
background-attachment: fixed;
|
| 25 |
+
background-repeat: no-repeat;
|
| 26 |
+
background-position: center center;
|
| 27 |
+
opacity: 0.8;
|
| 28 |
+
}}
|
| 29 |
+
</style>
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
set_bg_from_local_image('images/Influencers.png')
|
| 33 |
+
|
| 34 |
# Page Configuration
|
| 35 |
st.set_page_config(page_title="InstaImpact", layout="wide")
|
| 36 |
|
|
|
|
| 44 |
|
| 45 |
# Homepage
|
| 46 |
if selection == "Homepage":
|
| 47 |
+
st.markdown("<h1 style='text-align: center; color: white;'>Welcome to InstaImpact</h1>", unsafe_allow_html=True)
|
| 48 |
st.markdown("""
|
| 49 |
+
<div style="font-size: 20px; color: white;">
|
| 50 |
+
<p><strong>InstaImpact is your comprehensive tool for influencer marketing.</strong></p>
|
| 51 |
+
<ul>
|
| 52 |
+
<li>Discover and analyze influencers</li>
|
| 53 |
+
<li>Plan and manage your campaigns</li>
|
| 54 |
+
<li>Get insights on the latest market trends</li>
|
| 55 |
+
</ul>
|
| 56 |
+
</div>
|
| 57 |
+
""", unsafe_allow_html=True)
|
| 58 |
|
| 59 |
+
st.markdown("<h2 style='color: white;'>Platform Capabilities</h2>", unsafe_allow_html=True)
|
| 60 |
st.markdown("""
|
| 61 |
+
<div style="font-size: 18px; color: white;">
|
| 62 |
+
<ul>
|
| 63 |
+
<li><strong>Influencer Search</strong>: Find the perfect influencer match for your brand.</li>
|
| 64 |
+
<li><strong>Campaign Analytics</strong>: Measure the success of your campaigns.</li>
|
| 65 |
+
<li><strong>Market Trends</strong>: Stay ahead with the latest in influencer marketing.</li>
|
| 66 |
+
</ul>
|
| 67 |
+
</div>
|
| 68 |
+
""", unsafe_allow_html=True)
|
| 69 |
# Influencer Search
|
| 70 |
elif selection == "Influencer Search":
|
| 71 |
influencer_ui.show_influencer_search_page()
|