File size: 2,743 Bytes
df3e474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 30 11:25:05 2022

@author: Usuario
"""

import imagen_subida as ims
import streamlit as st
from keras.models import load_model
from tensorflow.keras.utils import load_img
import sys
import os
import about_pj as pj
import about_us as us
import main_page as mp
#Fondo de streamlit
ims.add_bg_from_url() 

if 'param' not in st.session_state:
    st.session_state.param = 1

def about_project():
    pj.textito(language_button)
    
def ab_us():
    us.unodinoi(language_button)

def language():
    language_button = ims.idioma()
    return language_button

def main_page(param):
    
    if param == 1:
        mp.main_page(language_button, label_names)  
    
    elif param == 2:
        pj.textito(language_button)
    
    elif param == 3:
        us.unodinoi(language_button)
    

#SIDEBAR OPTIONS ======================================
with st.sidebar:

    #cambiar color de los botones
    m = st.markdown("""
                           <style>
                           div.stButton > button:first-child {
                               background-color: #18202b;
                               color:#ffffff;
                               }
                           div.stButton > button:hover {
                               background-color: #522100;
                               color:#ffffff;
                               }
                           </style>""", unsafe_allow_html=True)

    param = 1
        
    col1, col2, col3, col4, col5 = st.columns([20,60,40,60,20])

    with col2:
        st.image('./images/spain_flag.png', width = 60)
    with col3:
        language_button = language()
    with col4:
        st.image('./images/united_kingdom_flag.png', width = 60)
        
    st.markdown("***")
    
    _, colb, _ = st.columns([10,60,20])#([50,80,50])
    with colb:
        botones = ims.botoncitos(language_button)
        home = st.button('  Home  🏠  ')
        project_button = st.button(label = botones[0])#(label = 'About the project 📕')
        us_button = st.button(label = botones[1])#'  About us  🧝‍♂️  ')
        
    st.markdown('---')

#=======================================================



if language_button == 1:
    label_names = ['Basophil', 'Eosinophil', 'Erythroblast', 'Immature gralulocyte', 'Lymphocyte', 'Monocyte', 'Neutrophil', 'Platelet']
else:
    label_names = ['Basófilo', 'Eosinófilo', 'Eritoblasto', 'Granulocitos inmaduros', 'Linfocito', 'Monocito', 'Neutróofilo', 'Plaqueta']
    


if home:
    st.session_state.param = 1
    st.experimental_rerun()
elif project_button:
    st.session_state.param = 2
elif us_button:
    st.session_state.param = 3
    
main_page(st.session_state.param)