Skip to content

Commit 7e7f2ee

Browse files
Merge pull request #56 from ShrishtiSingh26/scrollupbt
scroll up to top button added
2 parents 31249cf + df70d14 commit 7e7f2ee

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

app.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,34 @@
99
from dotenv import load_dotenv
1010
#AI Integration
1111
import anthropic
12+
import datetime
13+
import datetime
14+
# CSS for Scroll to Top Button
15+
scroll_to_top = """
16+
<style>
17+
#scrollButton {
18+
position: fixed;
19+
bottom: 20px;
20+
right: 20px;
21+
z-index: 99;
22+
font-size: 18px;
23+
border: none;
24+
outline: none;
25+
background-color: rgb(4, 170, 109);
26+
color: white;
27+
cursor: pointer;
28+
padding: 10px;
29+
border-radius: 10px;
30+
opacity: 0.7;
31+
}
32+
33+
#scrollButton:hover {
34+
background-color: rgb(4, 170, 109);
35+
opacity: 1;
36+
}
37+
</style>
38+
"""
39+
1240

1341
#Changes made by --Charvi Arora
1442
#Added security
@@ -39,8 +67,15 @@ def anxiety_management_guide(mood, feeling_description, current_stress_level, re
3967
]
4068
)
4169

70+
4271
# Set page config (must be the first Streamlit command)
4372
st.set_page_config(page_title="Anxiety Relief App", page_icon=":relieved:", layout="centered")
73+
st.markdown(scroll_to_top, unsafe_allow_html=True)
74+
def scroll_to_top_button():
75+
st.markdown('<a id="scrollButton" title="Go to top" href="#top">↑ Top</a>', unsafe_allow_html=True)
76+
st.markdown('<div id="top"></div>', unsafe_allow_html=True)
77+
78+
scroll_to_top_button()
4479

4580
# Data for mental health (sampled)
4681
data = {

0 commit comments

Comments
 (0)