-
Notifications
You must be signed in to change notification settings - Fork 0
/
Home.py
57 lines (43 loc) · 2.06 KB
/
Home.py
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
from functions.weather import get_temperature, get_temperature_delta_from_Milan
from functions.age import calculate_age, calculate_age_in_nanoseconds
import streamlit as st
#def show_Home():
st.set_page_config(layout="wide", page_title="Home Page", page_icon="🏠")
# Title of the app
# Custom CSS for the title
st.markdown("""
<style>
.title {
font-family: 'Open Sans', sans-serif;
font-size: 70px;
font-weight: bold;
color: #2D3E50;
text-align: center;
margin-top: 210px;
}
.for_sofia {
font-family: 'Open Sans', sans-serif;
font-size: 30x;
color: #7D8A96;
padding-bottom: 40px;
text-align: center;
}
.logo_home {
font-family: 'Open Sans', sans-serif;
font-size: 70px;
color: #2D3E50;
text-align: center;
padding-bottom: 40px;
</style>
""", unsafe_allow_html=True)
# Title with the custom CSS class
st.markdown('<div class="title">Welcome to IsoSpectra</div>', unsafe_allow_html=True)
st.markdown('<div class="logo_home">⚛</div>', unsafe_allow_html=True)
st.markdown('<div class="for_sofia">For my lovely Sofia ❤️. This is the homepage of IsoSpectra, a specialised app where you can visualise and analyse NMR spectra in an intuitive and beatiful way. Choose between a variety of options. </div>', unsafe_allow_html=True)
col1, col2, col3 = st.columns([1.45, 1, 1])
col2.page_link("pages/Spectrum Plotter.py", label="Plot basic 1D NMR spectra here", icon="🔬", use_container_width=True)
st.markdown("<br>" * 10, unsafe_allow_html=True) # Adds 5 line breaks
col1, col2, col3 = st.columns([1, 1.5, 1])
col1.metric(label="Temperature in Sofia's city", value=f"{get_temperature("London")} K", delta=f"{get_temperature_delta_from_Milan("London")} K")
col2.metric(label="Sofia's age", value=f"{calculate_age("2004-08-30")}")
col3.metric(label="...in nanoseconds", value=f"{calculate_age_in_nanoseconds("2004-08-30")}")