Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +241 -34
src/streamlit_app.py
CHANGED
|
@@ -1,40 +1,247 @@
|
|
| 1 |
-
import altair as alt
|
| 2 |
-
import numpy as np
|
| 3 |
-
import pandas as pd
|
| 4 |
import streamlit as st
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
"""
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import base64
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
+
st.set_page_config(
|
| 6 |
+
page_title="InsightLoop",
|
| 7 |
+
page_icon="🔁",
|
| 8 |
+
layout="wide",
|
| 9 |
+
initial_sidebar_state="collapsed"
|
| 10 |
+
)
|
| 11 |
+
|
| 12 |
+
# --- LOGO ---
|
| 13 |
+
def get_logo_base64(logo_path):
|
| 14 |
+
if not os.path.exists(logo_path):
|
| 15 |
+
return None
|
| 16 |
+
with open(logo_path, "rb") as img_file:
|
| 17 |
+
b64 = base64.b64encode(img_file.read()).decode("utf-8")
|
| 18 |
+
return b64
|
| 19 |
+
|
| 20 |
+
logo_path = "logo.png"
|
| 21 |
+
logo_b64 = get_logo_base64(logo_path)
|
| 22 |
+
|
| 23 |
+
if logo_b64:
|
| 24 |
+
st.markdown(
|
| 25 |
+
f"""
|
| 26 |
+
<div style='display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:0.2em;'>
|
| 27 |
+
<img src="data:image/png;base64,{logo_b64}" alt="Logo" style="width:260px;height:260px;object-fit:contain;filter:drop-shadow(0 0 26px #00fff7cc);"/>
|
| 28 |
+
</div>
|
| 29 |
+
""",
|
| 30 |
+
unsafe_allow_html=True
|
| 31 |
+
)
|
| 32 |
+
else:
|
| 33 |
+
st.markdown(
|
| 34 |
+
"""
|
| 35 |
+
<div style='display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:0.2em;'>
|
| 36 |
+
<span style='font-size:2.9rem;font-weight:900;color:#00fff7;letter-spacing:-2px;margin-top:0;'>InsightLoop</span>
|
| 37 |
+
</div>
|
| 38 |
+
""", unsafe_allow_html=True
|
| 39 |
+
)
|
| 40 |
|
| 41 |
+
# --- GLASSY INTRO BOX ---
|
| 42 |
+
st.markdown("""
|
| 43 |
+
<div style="
|
| 44 |
+
background: rgba(32,40,52,0.96);
|
| 45 |
+
border: 2.3px solid #00fff7cc;
|
| 46 |
+
border-radius: 24px;
|
| 47 |
+
margin: 1.3em auto 2.1em auto;
|
| 48 |
+
max-width: 1060px;
|
| 49 |
+
min-width: 420px;
|
| 50 |
+
padding: 38px 36px 20px 36px;
|
| 51 |
+
box-shadow:0 14px 68px #00fff799;
|
| 52 |
+
color: #fff;
|
| 53 |
+
font-size: 1.03rem;
|
| 54 |
+
line-height:1.63;
|
| 55 |
+
font-family: 'Montserrat', sans-serif;">
|
| 56 |
+
<span style="font-size:1.38rem;font-weight:900;background:linear-gradient(90deg,#00fff7,#F72585 92%);-webkit-background-clip:text;-webkit-text-fill-color:transparent;">
|
| 57 |
+
Stop guessing. Start knowing—every persona, every opinion, every launch.
|
| 58 |
+
</span>
|
| 59 |
+
<br><br>
|
| 60 |
+
<b>InsightLoop</b> isn’t just another dashboard. It’s your on-demand product research team—powered by AI, fueled by every kind of customer feedback.
|
| 61 |
+
<br><br>
|
| 62 |
+
<div style="display:grid;grid-template-columns:38px 1fr;gap:10px 13px;align-items:start;">
|
| 63 |
+
<div style="font-size:1.6rem;">🔀</div>
|
| 64 |
+
<div>
|
| 65 |
+
<b style="color:#00fff7;">Multimodal Magic</b><br>
|
| 66 |
+
Bring your reviews, screenshots, or even audio rants—InsightLoop reads, listens, and <i>sees</i> to give you the whole customer picture.
|
| 67 |
+
No more missing context, no more “one channel” blind spots.
|
| 68 |
+
</div>
|
| 69 |
+
<div style="font-size:1.6rem;">🧬</div>
|
| 70 |
+
<div>
|
| 71 |
+
<b style="color:#7CFC00;">Persona Discovery</b><br>
|
| 72 |
+
Our AI auto-sorts your users into real-world groups—think loyalists, price hawks, fitness geeks, skeptics, and more.
|
| 73 |
+
It finds them by their words, their tone, their buying patterns—even if you’ve never tagged or labeled a thing.
|
| 74 |
+
</div>
|
| 75 |
+
<div style="font-size:1.6rem;">⚡</div>
|
| 76 |
+
<div>
|
| 77 |
+
<b style="color:#F72585;">Instant, Actionable Insights</b><br>
|
| 78 |
+
Get beautiful, interactive dashboards for <i>every</i> persona: see what excites them, what drives them nuts, and what’ll keep them coming back (or send them running). All charted, all explained—no stats degree needed.
|
| 79 |
+
</div>
|
| 80 |
+
<div style="font-size:1.6rem;">🚀</div>
|
| 81 |
+
<div>
|
| 82 |
+
<b style="color:#FFB347;">Launch Simulation Superpower</b><br>
|
| 83 |
+
Curious about a new product or feature? Instantly predict how each persona will react—with auto-generated marketing hooks and push notifications written <i>for them</i>, by AI.
|
| 84 |
+
Turn “blind launch” into “bullseye launch.”
|
| 85 |
+
</div>
|
| 86 |
+
</div>
|
| 87 |
+
<br>
|
| 88 |
+
<span style="color:#AC7CFF;font-weight:700;">
|
| 89 |
+
Fully automated. Zero spreadsheets.<br>
|
| 90 |
+
Just drop your data, and let InsightLoop surface the real market signals you’ve been missing.
|
| 91 |
+
</span>
|
| 92 |
+
<br><br>
|
| 93 |
+
<span style="color:#fff;font-weight:500;font-size:1.01em;">
|
| 94 |
+
<b>Why does this matter?</b> Most brands guess. The best brands <i>know</i>. InsightLoop makes it effortless to know.
|
| 95 |
+
</span>
|
| 96 |
+
</div>
|
| 97 |
+
""", unsafe_allow_html=True)
|
| 98 |
|
| 99 |
+
# --- GLOW BUTTON (Streamlit native for navigation) ---
|
| 100 |
+
st.markdown("""
|
| 101 |
+
<style>
|
| 102 |
+
div.stButton > button.insight-glow-btn {
|
| 103 |
+
font-family: 'Montserrat',sans-serif;
|
| 104 |
+
font-size: 1.19em;
|
| 105 |
+
font-weight: 900;
|
| 106 |
+
color: #181830;
|
| 107 |
+
background: linear-gradient(90deg,#00fff7 10%,#7CFC00 90%);
|
| 108 |
+
padding: 15px 46px 13px 46px;
|
| 109 |
+
border: 2px solid #00fff7;
|
| 110 |
+
border-radius: 16px;
|
| 111 |
+
box-shadow: 0 0 18px #00fff799, 0 0 36px #7CFC0055;
|
| 112 |
+
cursor: pointer;
|
| 113 |
+
transition: all 0.11s cubic-bezier(.31,1.3,.7,1);
|
| 114 |
+
letter-spacing: 0.01em;
|
| 115 |
+
margin: 0 auto;
|
| 116 |
+
outline: none;
|
| 117 |
+
display: block;
|
| 118 |
+
}
|
| 119 |
+
div.stButton > button.insight-glow-btn:hover,
|
| 120 |
+
div.stButton > button.insight-glow-btn:focus {
|
| 121 |
+
transform: scale(1.045);
|
| 122 |
+
background: linear-gradient(90deg,#7CFC00 10%,#00fff7 90%);
|
| 123 |
+
color: #222;
|
| 124 |
+
box-shadow: 0 0 32px #00fff7cc, 0 0 36px #7CFC00cc;
|
| 125 |
+
}
|
| 126 |
+
</style>
|
| 127 |
+
""", unsafe_allow_html=True)
|
| 128 |
+
|
| 129 |
+
center = """
|
| 130 |
+
<div style='display: flex; justify-content: center; align-items: center; margin: 1.7em auto 0.7em auto;'>
|
| 131 |
+
{content}
|
| 132 |
+
</div>
|
| 133 |
"""
|
| 134 |
|
| 135 |
+
# Place this where you want your big button (centered and as wide as your boxes):
|
| 136 |
+
|
| 137 |
+
st.markdown("""
|
| 138 |
+
<style>
|
| 139 |
+
.custom-glow-btn-main {
|
| 140 |
+
display: block;
|
| 141 |
+
width: 100%;
|
| 142 |
+
max-width: 1060px;
|
| 143 |
+
min-width: 420px;
|
| 144 |
+
margin: 2em auto 1.1em auto;
|
| 145 |
+
font-family: 'Montserrat',sans-serif;
|
| 146 |
+
font-size: 1.26em;
|
| 147 |
+
font-weight: 900;
|
| 148 |
+
color: #181830 !important;
|
| 149 |
+
background: linear-gradient(90deg,#00fff7 12%,#7CFC00 88%);
|
| 150 |
+
padding: 21px 0 18px 0;
|
| 151 |
+
border: 2.5px solid #00fff7cc;
|
| 152 |
+
border-radius: 17px;
|
| 153 |
+
box-shadow: 0 0 24px #00fff7b8, 0 0 46px #7CFC0090;
|
| 154 |
+
text-align: center;
|
| 155 |
+
text-decoration: none !important;
|
| 156 |
+
transition: all 0.13s cubic-bezier(.31,1.3,.7,1);
|
| 157 |
+
cursor: pointer;
|
| 158 |
+
outline: none;
|
| 159 |
+
}
|
| 160 |
+
.custom-glow-btn-main:hover, .custom-glow-btn-main:focus {
|
| 161 |
+
background: linear-gradient(90deg,#7CFC00 14%,#00fff7 86%);
|
| 162 |
+
color: #19191f !important;
|
| 163 |
+
box-shadow: 0 0 38px #00fff7cc, 0 0 56px #7CFC00cc;
|
| 164 |
+
transform: scale(1.018);
|
| 165 |
+
}
|
| 166 |
+
</style>
|
| 167 |
+
<div style="display:flex;justify-content:center;">
|
| 168 |
+
<a href="/prt111" class="custom-glow-btn-main" target="_self">💡 Let’s Start</a>
|
| 169 |
+
</div>
|
| 170 |
+
""", unsafe_allow_html=True)
|
| 171 |
+
|
| 172 |
+
# --- HEADS UP & DEMO BOXES (smaller) ---
|
| 173 |
+
st.markdown("""
|
| 174 |
+
<style>
|
| 175 |
+
.insight-centerbox, .insight-demo {
|
| 176 |
+
margin: 1.5em auto 0.3em auto;
|
| 177 |
+
background: rgba(22,26,38,0.97);
|
| 178 |
+
border-radius: 19px;
|
| 179 |
+
box-shadow: 0 5px 30px #00fff73c;
|
| 180 |
+
font-family: 'Montserrat', sans-serif;
|
| 181 |
+
text-align: center;
|
| 182 |
+
max-width: 1060px;
|
| 183 |
+
min-width: 420px;
|
| 184 |
+
padding: 20px 30px 17px 30px;
|
| 185 |
+
border: none;
|
| 186 |
+
}
|
| 187 |
+
.insight-centerbox h4 {
|
| 188 |
+
color: #7CFC00;
|
| 189 |
+
font-size: 1.06em;
|
| 190 |
+
margin-bottom: 0.45em;
|
| 191 |
+
font-weight: 900;
|
| 192 |
+
letter-spacing: 0.02em;
|
| 193 |
+
}
|
| 194 |
+
.insight-centerbox p {
|
| 195 |
+
color: #7CFC00;
|
| 196 |
+
font-size: 0.99em;
|
| 197 |
+
font-weight: 600;
|
| 198 |
+
margin-bottom: 0;
|
| 199 |
+
}
|
| 200 |
+
.insight-centerbox i {
|
| 201 |
+
color: #A0FFB2;
|
| 202 |
+
font-size: 0.97em;
|
| 203 |
+
}
|
| 204 |
+
.insight-demo {
|
| 205 |
+
background: rgba(0,30,40,0.94);
|
| 206 |
+
color: #00fff7;
|
| 207 |
+
box-shadow: 0 4px 18px #00fff75c;
|
| 208 |
+
border-radius: 19px;
|
| 209 |
+
margin-top: 1.2em;
|
| 210 |
+
max-width: 1060px;
|
| 211 |
+
min-width: 420px;
|
| 212 |
+
padding: 18px 32px 13px 32px;
|
| 213 |
+
text-align: center;
|
| 214 |
+
font-size: 0.97em;
|
| 215 |
+
}
|
| 216 |
+
.insight-demo b {
|
| 217 |
+
color: #7CFC00;
|
| 218 |
+
font-weight: 900;
|
| 219 |
+
font-size: 1.06em;
|
| 220 |
+
}
|
| 221 |
+
.insight-demo .demo-product {
|
| 222 |
+
color: #FFB347;
|
| 223 |
+
font-weight: 700;
|
| 224 |
+
}
|
| 225 |
+
</style>
|
| 226 |
+
<div class="insight-centerbox">
|
| 227 |
+
<h4>🤖 Heads up: InsightLoop is working hard behind the scenes!</h4>
|
| 228 |
+
<p>
|
| 229 |
+
Analyzing images and audio takes a few seconds—so just sit back, relax, and let the AI do the heavy lifting.<br>
|
| 230 |
+
<i>You’ll have deeper insights in less time than it takes to reheat your coffee. ☕🦾</i>
|
| 231 |
+
</p>
|
| 232 |
+
</div>
|
| 233 |
+
<div class="insight-demo">
|
| 234 |
+
<b>🚀 Demo mode:</b> <span class="demo-product">This dashboard is running on real chocolate protein powder reviews—just to show what’s possible.</span><br>
|
| 235 |
+
InsightLoop adapts to <b>any</b> product or dataset. When you’re ready, upload your own and watch the magic happen.
|
| 236 |
+
</div>
|
| 237 |
+
""", unsafe_allow_html=True)
|
| 238 |
+
|
| 239 |
+
# --- POWERED BY SIGN-OFF ---
|
| 240 |
+
st.markdown(
|
| 241 |
+
"""
|
| 242 |
+
<div style="margin-top:1.7em;margin-bottom:0.5em;text-align:center;">
|
| 243 |
+
<span style="font-size:1.09em;color:#F72585;font-weight:700;">Powered by Bugs Fring</span>
|
| 244 |
+
</div>
|
| 245 |
+
""",
|
| 246 |
+
unsafe_allow_html=True
|
| 247 |
+
)
|