Spaces:
Sleeping
Sleeping
Prarabdha pandey commited on
Commit ·
d8fd55e
1
Parent(s): 3150486
Remove background image and apply a new clean theme
Browse files- .streamlit/config.toml +10 -11
- app.py +0 -21
- background.png +0 -3
- style.css +13 -36
.streamlit/config.toml
CHANGED
|
@@ -1,18 +1,17 @@
|
|
| 1 |
# .streamlit/config.toml
|
| 2 |
|
| 3 |
[theme]
|
| 4 |
-
#
|
| 5 |
-
primaryColor
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
backgroundColor
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
secondaryBackgroundColor
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
textColor
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
font = "sans serif"
|
|
|
|
| 1 |
# .streamlit/config.toml
|
| 2 |
|
| 3 |
[theme]
|
| 4 |
+
# A professional blue for interactive elements
|
| 5 |
+
primaryColor="#0068C9"
|
| 6 |
|
| 7 |
+
# A very light grey for the main background
|
| 8 |
+
backgroundColor="#F0F2F6"
|
| 9 |
|
| 10 |
+
# A clean white for the sidebar and other elements
|
| 11 |
+
secondaryBackgroundColor="#FFFFFF"
|
| 12 |
|
| 13 |
+
# Dark text for high contrast and readability
|
| 14 |
+
textColor="#0D1117"
|
| 15 |
|
| 16 |
+
# Standard font
|
| 17 |
+
font="sans serif"
|
|
|
app.py
CHANGED
|
@@ -10,27 +10,6 @@ st.set_page_config(page_title="AI Constitution Bot", page_icon="🇮🇳", layou
|
|
| 10 |
# --- SETUP ---
|
| 11 |
load_dotenv()
|
| 12 |
|
| 13 |
-
# --- BACKGROUND IMAGE FUNCTION ---
|
| 14 |
-
def add_bg_from_local(image_file):
|
| 15 |
-
try:
|
| 16 |
-
with open(image_file, "rb") as image_file:
|
| 17 |
-
encoded_string = base64.b64encode(image_file.read()).decode()
|
| 18 |
-
st.markdown(
|
| 19 |
-
f"""
|
| 20 |
-
<style>
|
| 21 |
-
.stApp {{
|
| 22 |
-
background-image: url(data:image/{"png"};base64,{encoded_string});
|
| 23 |
-
background-size: cover;
|
| 24 |
-
}}
|
| 25 |
-
</style>
|
| 26 |
-
""",
|
| 27 |
-
unsafe_allow_html=True
|
| 28 |
-
)
|
| 29 |
-
except FileNotFoundError:
|
| 30 |
-
st.warning("Background image not found. Make sure 'background.png' is in the same folder as the app.")
|
| 31 |
-
|
| 32 |
-
add_bg_from_local('background.png')
|
| 33 |
-
|
| 34 |
# --- STYLING ---
|
| 35 |
def local_css(file_name):
|
| 36 |
try:
|
|
|
|
| 10 |
# --- SETUP ---
|
| 11 |
load_dotenv()
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# --- STYLING ---
|
| 14 |
def local_css(file_name):
|
| 15 |
try:
|
background.png
DELETED
Git LFS Details
|
style.css
CHANGED
|
@@ -5,51 +5,23 @@ body {
|
|
| 5 |
font-family: 'Poppins', sans-serif;
|
| 6 |
}
|
| 7 |
|
| 8 |
-
/* --- FROSTED GLASS EFFECT FOR MAIN CONTENT --- */
|
| 9 |
-
[data-testid="stAppViewBlockContainer"] {
|
| 10 |
-
/* The magic: blur the background behind this element */
|
| 11 |
-
backdrop-filter: blur(10px) !important;
|
| 12 |
-
|
| 13 |
-
/* A semi-transparent white background */
|
| 14 |
-
background-color: rgba(255, 255, 255, 0.85) !important;
|
| 15 |
-
|
| 16 |
-
/* Add a subtle border and shadow for depth */
|
| 17 |
-
border-radius: 20px;
|
| 18 |
-
border: 1px solid rgba(255, 255, 255, 0.18);
|
| 19 |
-
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
|
| 20 |
-
|
| 21 |
-
/* Add some padding */
|
| 22 |
-
padding: 2rem;
|
| 23 |
-
}
|
| 24 |
-
|
| 25 |
-
/* --- FROSTED GLASS EFFECT FOR SIDEBAR --- */
|
| 26 |
-
[data-testid="stSidebar"] {
|
| 27 |
-
backdrop-filter: blur(10px);
|
| 28 |
-
background-color: rgba(248, 249, 250, 0.9); /* Semi-transparent light grey */
|
| 29 |
-
border-right: 1px solid rgba(255, 255, 255, 0.18);
|
| 30 |
-
}
|
| 31 |
-
|
| 32 |
-
|
| 33 |
/* --- BUTTONS --- */
|
| 34 |
.stButton > button {
|
| 35 |
border-radius: 8px;
|
| 36 |
font-weight: 600;
|
| 37 |
color: white;
|
| 38 |
-
background-
|
| 39 |
border: none;
|
| 40 |
-
transition: all 0.
|
| 41 |
-
box-shadow: 0 4px
|
| 42 |
width: 100%;
|
| 43 |
padding: 0.6rem 1rem;
|
| 44 |
}
|
| 45 |
|
| 46 |
.stButton > button:hover {
|
| 47 |
transform: translateY(-2px);
|
| 48 |
-
box-shadow: 0
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
.stButton > button:active {
|
| 52 |
-
transform: translateY(1px);
|
| 53 |
}
|
| 54 |
|
| 55 |
|
|
@@ -58,13 +30,18 @@ body {
|
|
| 58 |
border-radius: 0.75rem;
|
| 59 |
padding: 1rem;
|
| 60 |
margin: 0.5rem 0;
|
| 61 |
-
|
| 62 |
}
|
| 63 |
|
| 64 |
[data-testid="chat-message-container"]:has(div[data-testid="stChatMessageContent-user"]) {
|
| 65 |
-
background-color: #
|
| 66 |
}
|
| 67 |
|
| 68 |
[data-testid="chat-message-container"]:has(div[data-testid="stChatMessageContent-assistant"]) {
|
| 69 |
-
background-color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
}
|
|
|
|
| 5 |
font-family: 'Poppins', sans-serif;
|
| 6 |
}
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
/* --- BUTTONS --- */
|
| 9 |
.stButton > button {
|
| 10 |
border-radius: 8px;
|
| 11 |
font-weight: 600;
|
| 12 |
color: white;
|
| 13 |
+
background-color: #0068C9; /* Using the primaryColor from the theme */
|
| 14 |
border: none;
|
| 15 |
+
transition: all 0.2s ease;
|
| 16 |
+
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
|
| 17 |
width: 100%;
|
| 18 |
padding: 0.6rem 1rem;
|
| 19 |
}
|
| 20 |
|
| 21 |
.stButton > button:hover {
|
| 22 |
transform: translateY(-2px);
|
| 23 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
|
| 24 |
+
background-color: #0055A4; /* A slightly darker blue on hover */
|
|
|
|
|
|
|
|
|
|
| 25 |
}
|
| 26 |
|
| 27 |
|
|
|
|
| 30 |
border-radius: 0.75rem;
|
| 31 |
padding: 1rem;
|
| 32 |
margin: 0.5rem 0;
|
| 33 |
+
border: 1px solid #e1e4e8; /* Add a subtle border */
|
| 34 |
}
|
| 35 |
|
| 36 |
[data-testid="chat-message-container"]:has(div[data-testid="stChatMessageContent-user"]) {
|
| 37 |
+
background-color: #FFFFFF; /* White */
|
| 38 |
}
|
| 39 |
|
| 40 |
[data-testid="chat-message-container"]:has(div[data-testid="stChatMessageContent-assistant"]) {
|
| 41 |
+
background-color: #F6F8FA; /* Off-white */
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
/* --- SIDEBAR --- */
|
| 45 |
+
[data-testid="stSidebar"] {
|
| 46 |
+
border-right: 1px solid #d1d5db;
|
| 47 |
}
|