client / utils.py
Ashhar
improved font
b59ec81
raw
history blame
1.76 kB
import streamlit as st
import datetime as DT
import pytz
def applyCommonStyles():
st.markdown(
"""
<head>
<link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&family=Raleway:ital,wght@0,100..900;1,100..900&Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet">
</head>
<style>
h1 {
font-family: 'Raleway';
}
.stChatMessage div[data-testid="stMarkdownContainer"], .stChatInput textarea {
font-family: 'Roboto', sans-serif;
}
.stButton p {
font-size: 0.9rem;
}
@keyframes blinker {
0% {
opacity: 1;
}
50% {
opacity: 0.2;
}
100% {
opacity: 1;
}
}
.blinking {
animation: blinker 3s ease-out infinite;
}
.code {
color: green;
border-radius: 3px;
padding: 2px 4px; /* Padding around the text */
font-family: 'Courier New', Courier, monospace; /* Monospace font */
}
.large {
font-size: 15px;
}
.bold {
font-weight: bold;
}
div[aria-label="dialog"] {
width: 80vw;
height: 620px;
}
</style>
""",
unsafe_allow_html=True
)
def __nowInIST() -> DT.datetime:
return DT.datetime.now(pytz.timezone("Asia/Kolkata"))
def pprint(log: str):
now = __nowInIST()
now = now.strftime("%Y-%m-%d %H:%M:%S")
print(f"[{now}] [{st.session_state.ipAddress}] {log}")