Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,6 +62,11 @@ st.markdown("""
|
|
62 |
border-radius: 15px;
|
63 |
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
64 |
}
|
|
|
|
|
|
|
|
|
|
|
65 |
</style>
|
66 |
""", unsafe_allow_html=True)
|
67 |
|
@@ -162,13 +167,26 @@ else:
|
|
162 |
# Sidebar navigation
|
163 |
with st.sidebar:
|
164 |
st.title("π§ Navigation")
|
165 |
-
st.
|
166 |
-
|
167 |
-
|
168 |
-
"
|
169 |
-
|
170 |
-
|
171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
# Question flow
|
174 |
if st.session_state.current_q < 5:
|
@@ -209,16 +227,21 @@ else:
|
|
209 |
|
210 |
elif st.session_state.page == "π Visual Analysis":
|
211 |
st.header("π Personality Visualization")
|
|
|
212 |
radar_data = pd.DataFrame({
|
213 |
-
"Trait": list(traits.keys())
|
214 |
-
"Score": list(traits.values())
|
215 |
-
"
|
216 |
})
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
|
|
|
|
|
|
|
|
222 |
|
223 |
elif st.session_state.page == "π± Social Media Post":
|
224 |
st.header("π± Create Social Post")
|
|
|
62 |
border-radius: 15px;
|
63 |
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
64 |
}
|
65 |
+
|
66 |
+
.nav-btn {
|
67 |
+
margin: 8px 0;
|
68 |
+
width: 100%;
|
69 |
+
}
|
70 |
</style>
|
71 |
""", unsafe_allow_html=True)
|
72 |
|
|
|
167 |
# Sidebar navigation
|
168 |
with st.sidebar:
|
169 |
st.title("π§ Navigation")
|
170 |
+
st.markdown("---")
|
171 |
+
if st.button("π Personality Report", key="btn1", use_container_width=True,
|
172 |
+
help="View your detailed personality analysis"):
|
173 |
+
st.session_state.page = "π Personality Report"
|
174 |
+
|
175 |
+
if st.button("π Visual Analysis", key="btn2", use_container_width=True,
|
176 |
+
help="Explore visual representations of your personality"):
|
177 |
+
st.session_state.page = "π Visual Analysis"
|
178 |
+
|
179 |
+
if st.button("π± Social Media Post", key="btn3", use_container_width=True,
|
180 |
+
help="Generate personalized social media posts"):
|
181 |
+
st.session_state.page = "π± Social Media Post"
|
182 |
+
|
183 |
+
if st.button("π‘ Success Tips", key="btn4", use_container_width=True,
|
184 |
+
help="Discover personalized improvement tips"):
|
185 |
+
st.session_state.page = "π‘ Success Tips"
|
186 |
+
|
187 |
+
if st.button("π₯ Download Report", key="btn5", use_container_width=True,
|
188 |
+
help="Download your complete personality report"):
|
189 |
+
st.session_state.page = "π₯ Download Report"
|
190 |
|
191 |
# Question flow
|
192 |
if st.session_state.current_q < 5:
|
|
|
227 |
|
228 |
elif st.session_state.page == "π Visual Analysis":
|
229 |
st.header("π Personality Visualization")
|
230 |
+
# Fix radar chart encoding
|
231 |
radar_data = pd.DataFrame({
|
232 |
+
"Trait": list(traits.keys()),
|
233 |
+
"Score": list(traits.values()),
|
234 |
+
"Angle": [i*(360/5) for i in range(5)]
|
235 |
})
|
236 |
+
|
237 |
+
chart = alt.Chart(radar_data).mark_line(point=True).encode(
|
238 |
+
theta=alt.Theta("Angle:Q", stack=True),
|
239 |
+
radius=alt.Radius("Score:Q", scale=alt.Scale(type='linear', zero=True)),
|
240 |
+
color=alt.value("#4CAF50"),
|
241 |
+
tooltip=["Trait", "Score"]
|
242 |
+
).project(type='radial')
|
243 |
+
|
244 |
+
st.altair_chart(chart, use_container_width=True)
|
245 |
|
246 |
elif st.session_state.page == "π± Social Media Post":
|
247 |
st.header("π± Create Social Post")
|