Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -30,7 +30,6 @@ else:
|
|
| 30 |
st.warning("⚠️ GROQ_API_KEY not found. Please add it to Hugging Face secrets.")
|
| 31 |
|
| 32 |
# ---------------- STREAMLIT UI SETUP ----------------
|
| 33 |
-
# CHANGED: Added initial_sidebar_state="expanded" to ensure it starts open
|
| 34 |
st.set_page_config(
|
| 35 |
page_title="PDF Assistant",
|
| 36 |
page_icon="📘",
|
|
@@ -56,7 +55,6 @@ footer {
|
|
| 56 |
display: none;
|
| 57 |
}
|
| 58 |
|
| 59 |
-
/* --- NEW CODE START: HIDE SIDEBAR TOGGLE BUTTONS --- */
|
| 60 |
/* Hide the 'Close Sidebar' (<<) button inside the sidebar */
|
| 61 |
section[data-testid="stSidebar"] > div > div:first-child {
|
| 62 |
display: none;
|
|
@@ -65,7 +63,6 @@ section[data-testid="stSidebar"] > div > div:first-child {
|
|
| 65 |
[data-testid="collapsedControl"] {
|
| 66 |
display: none;
|
| 67 |
}
|
| 68 |
-
/* --- NEW CODE END --- */
|
| 69 |
|
| 70 |
/* 3. SIDEBAR STYLING (INDEPENDENT LEFT PANEL SCROLL) */
|
| 71 |
[data-testid="stSidebar"] {
|
|
@@ -92,7 +89,7 @@ section[data-testid="stSidebar"] > div > div:first-child {
|
|
| 92 |
left: 0;
|
| 93 |
width: 100%;
|
| 94 |
height: 6rem;
|
| 95 |
-
background-color: #0e1117;
|
| 96 |
z-index: 99998;
|
| 97 |
display: flex;
|
| 98 |
flex-direction: column;
|
|
@@ -160,11 +157,13 @@ section[data-testid="stFileUploader"] small {
|
|
| 160 |
}
|
| 161 |
|
| 162 |
/* 9. TITLE TEXT */
|
|
|
|
| 163 |
.title-text {
|
| 164 |
font-size: 2.5rem;
|
| 165 |
font-weight: 800;
|
| 166 |
margin: 0;
|
| 167 |
line-height: 1.2;
|
|
|
|
| 168 |
}
|
| 169 |
.creator-text {
|
| 170 |
font-size: 1rem;
|
|
@@ -181,6 +180,21 @@ section[data-testid="stFileUploader"] small {
|
|
| 181 |
border: none;
|
| 182 |
padding: 0;
|
| 183 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 184 |
</style>
|
| 185 |
""", unsafe_allow_html=True)
|
| 186 |
|
|
|
|
| 30 |
st.warning("⚠️ GROQ_API_KEY not found. Please add it to Hugging Face secrets.")
|
| 31 |
|
| 32 |
# ---------------- STREAMLIT UI SETUP ----------------
|
|
|
|
| 33 |
st.set_page_config(
|
| 34 |
page_title="PDF Assistant",
|
| 35 |
page_icon="📘",
|
|
|
|
| 55 |
display: none;
|
| 56 |
}
|
| 57 |
|
|
|
|
| 58 |
/* Hide the 'Close Sidebar' (<<) button inside the sidebar */
|
| 59 |
section[data-testid="stSidebar"] > div > div:first-child {
|
| 60 |
display: none;
|
|
|
|
| 63 |
[data-testid="collapsedControl"] {
|
| 64 |
display: none;
|
| 65 |
}
|
|
|
|
| 66 |
|
| 67 |
/* 3. SIDEBAR STYLING (INDEPENDENT LEFT PANEL SCROLL) */
|
| 68 |
[data-testid="stSidebar"] {
|
|
|
|
| 89 |
left: 0;
|
| 90 |
width: 100%;
|
| 91 |
height: 6rem;
|
| 92 |
+
background-color: #0e1117; /* Hardcoded Dark Background */
|
| 93 |
z-index: 99998;
|
| 94 |
display: flex;
|
| 95 |
flex-direction: column;
|
|
|
|
| 157 |
}
|
| 158 |
|
| 159 |
/* 9. TITLE TEXT */
|
| 160 |
+
/* UPDATED: Added color: #ffffff to ensure visibility on the dark header in Light Mode */
|
| 161 |
.title-text {
|
| 162 |
font-size: 2.5rem;
|
| 163 |
font-weight: 800;
|
| 164 |
margin: 0;
|
| 165 |
line-height: 1.2;
|
| 166 |
+
color: #ffffff !important;
|
| 167 |
}
|
| 168 |
.creator-text {
|
| 169 |
font-size: 1rem;
|
|
|
|
| 180 |
border: none;
|
| 181 |
padding: 0;
|
| 182 |
}
|
| 183 |
+
|
| 184 |
+
/* --- NEW: FIX FOR CHAT BUTTON IN LIGHT MODE --- */
|
| 185 |
+
/* If browser is in light mode, force the chat button to look clean (White bg, Dark text) */
|
| 186 |
+
@media (prefers-color-scheme: light) {
|
| 187 |
+
[data-testid="stFormSubmitButton"] > button {
|
| 188 |
+
background-color: #ffffff !important;
|
| 189 |
+
color: #000000 !important;
|
| 190 |
+
border: 1px solid #e2e8f0 !important;
|
| 191 |
+
}
|
| 192 |
+
[data-testid="stFormSubmitButton"] > button:hover {
|
| 193 |
+
background-color: #f7fafc !important;
|
| 194 |
+
border-color: #cbd5e0 !important;
|
| 195 |
+
color: #000000 !important;
|
| 196 |
+
}
|
| 197 |
+
}
|
| 198 |
</style>
|
| 199 |
""", unsafe_allow_html=True)
|
| 200 |
|