File size: 2,897 Bytes
f536df9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fe34dce
 
9d32ef7
fe34dce
 
f536df9
 
 
 
 
 
 
 
 
 
 
 
 
9d32ef7
fe34dce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f536df9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42583c9
f536df9
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import streamlit as st
from PIL import Image
import base64
from io import BytesIO

def image_to_base64(img):
    buffered = BytesIO()
    img.save(buffered, format="PNG")
    return base64.b64encode(buffered.getvalue()).decode()

def display_homepage():
    image = Image.open('image.jpg')
    img_base64 = image_to_base64(image)

    st.markdown(
        f"""
        <style>
            /* Set background color to white for both light and dark mode */
            body {{
                background-color: #ffffff ;
            }}

            .image-container {{
                position: relative;
                margin-top: -70px;
                margin-left: auto;
                margin-right: auto;
                width: 300px; /* Increase width for larger image */
                display: flex;
                justify-content: center;
            }}
            .content-container {{
                margin-top: 50px; /* Adjust margin-top to make space for the image */
            }}
            .main {{
                background-color: #ffffff ;
            }}

            /* Text and button styling */
            .stButton>button {{
                background-color: #2980b9;
                color: white;
                font-size: 18px;
                font-weight: bold;
                padding: 15px 30px;
                border-radius: 8px;
                border: none;
                box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
                cursor: pointer;
                transition: background-color 0.3s ease;
            }}
            .stButton>button:hover {{
                background-color: #3498db;
            }}
        </style>
        <div class="image-container">
            <img src="data:image/png;base64,{img_base64}" alt="image"/>
        </div>
        """,
        unsafe_allow_html=True
    )

    st.markdown(
        """
        <div class="content-container">
            <div style="text-align: center; font-size: 60px; font-weight: bold; color: #2c3e50;">
                AI Support for Your Mental Well-Being
            </div>
            <div style="text-align: center; font-size: 20px; margin-top: 20px; max-width: 700px; margin-left: auto; margin-right: auto;">
                Designed to streamline your mental health journey, our AI therapist is here to offer round-the-clock support, addressing mental health-related queries, providing personalized reports, and helping you understand your stress level to ensure a smoother journey toward mental and emotional health.
            </div>
        </div>
        """, unsafe_allow_html=True
    )

    col1, col2 = st.columns([1, 1])
    with col1:
        if st.button("Start Chat", key="start_chat_button"):
            st.session_state.page = "chat"

    with col2:
        if st.button("Stress Test", key="predict_stress_button"):
            st.session_state.page = "stress"