File size: 1,340 Bytes
f798c9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import base64
import streamlit as st
from pathlib import Path

def get_base64_of_bin_file(bin_file_path: str) -> str:
    file_bytes = Path(bin_file_path).read_bytes()
    return base64.b64encode(file_bytes).decode()

def main():
    st.set_page_config(page_title="INWI Chatbot - Accueil", layout="wide")

    # Read local image and convert to Base64
    img_base64 = get_base64_of_bin_file("./img/logo inwi celeverlytics.png")
    css_logo = f"""

    <style>

    [data-testid="stSidebarNav"]::before {{

        content: "";

        display: block;

        margin: 0 auto 20px auto;

        width: 80%;

        height: 100px;

        background-image: url("data:image/png;base64,{img_base64}");

        background-size: contain;

        background-repeat: no-repeat;

        background-position: center;

    }}

    </style>

    """

    st.markdown(css_logo, unsafe_allow_html=True)

    st.title("👋 Bienvenue sur le Chatbot INWI")
    st.markdown(
        """

        Ceci est la page principale.  

        Vous pouvez choisir le **Chatbot en Français** ou le **Chatbot en Arabe** en naviguant dans le menu de gauche (sous "Pages" ou "Select a page").

        """
    )
    st.write("Veuillez sélectionner la langue désirée dans la barre latérale.")

if __name__ == "__main__":
    main()