Nischal Subedi
commited on
Commit
·
791e26c
1
Parent(s):
ca9a9f1
UI update
Browse files
app.py
CHANGED
@@ -296,12 +296,12 @@ Answer:"""
|
|
296 |
/* Import legible fonts from Google Fonts */
|
297 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
|
298 |
|
299 |
-
/* Root variables for light theme */
|
300 |
:root {
|
301 |
--primary-color: #FF8C00;
|
302 |
--primary-hover: #E07B00;
|
303 |
--background-primary: hsl(30, 100%, 99.9%);
|
304 |
-
--background-secondary: #FFE8CC; /*
|
305 |
--text-primary: #4A3C32;
|
306 |
--text-secondary: #8C7B6F;
|
307 |
--border-color: hsl(30, 70%, 85%);
|
@@ -312,30 +312,9 @@ Answer:"""
|
|
312 |
--error-bg: #FFF0E0;
|
313 |
--error-border: #FFD2B2;
|
314 |
--error-text: #E05C00;
|
315 |
-
/*
|
316 |
-
--gradient-start: #
|
317 |
-
--gradient-end: #
|
318 |
-
}
|
319 |
-
|
320 |
-
/* Dark theme variables */
|
321 |
-
[data-theme="dark"] {
|
322 |
-
--primary-color: #FF8C00;
|
323 |
-
--primary-hover: #FFB366;
|
324 |
-
--background-primary: #1A1A1A;
|
325 |
-
--background-secondary: #FFCC99; /* Slightly darker light orange for dark theme */
|
326 |
-
--text-primary: #E0E0E0;
|
327 |
-
--text-secondary: #A0A0A0;
|
328 |
-
--border-color: #454545;
|
329 |
-
--border-focus: #FF8C00;
|
330 |
-
--shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
|
331 |
-
--shadow-md: 0 4px 10px rgba(0,0,0,0.4);
|
332 |
-
--shadow-lg: 0 10px 20px rgba(0,0,0,0.5);
|
333 |
-
--error-bg: #3A2A2A;
|
334 |
-
--error-border: #FF8C00;
|
335 |
-
--error-text: #FF8C00;
|
336 |
-
/* New variables for the orange gradient in dark theme */
|
337 |
-
--gradient-start: #D68A2E; /* Keep the same gradient for consistency */
|
338 |
-
--gradient-end: #F5B261; /* Keep the same gradient for consistency */
|
339 |
}
|
340 |
|
341 |
body, html {
|
@@ -868,26 +847,6 @@ Answer:"""
|
|
868 |
text-decoration: none !important;
|
869 |
}
|
870 |
|
871 |
-
/* Theme toggle button styles */
|
872 |
-
.theme-toggle {
|
873 |
-
position: fixed;
|
874 |
-
top: 1rem;
|
875 |
-
right: 1rem;
|
876 |
-
padding: 0.5rem 1rem;
|
877 |
-
background-color: var(--primary-color);
|
878 |
-
color: white;
|
879 |
-
border: none;
|
880 |
-
border-radius: 8px;
|
881 |
-
cursor: pointer;
|
882 |
-
font-size: 0.9rem;
|
883 |
-
font-weight: 600;
|
884 |
-
transition: background-color 0.2s ease;
|
885 |
-
}
|
886 |
-
|
887 |
-
.theme-toggle:hover {
|
888 |
-
background-color: var(--primary-hover);
|
889 |
-
}
|
890 |
-
|
891 |
@media (max-width: 768px) {
|
892 |
.gradio-container {
|
893 |
padding: 1rem !important;
|
@@ -933,47 +892,10 @@ Answer:"""
|
|
933 |
padding: 1.5rem 1rem !important;
|
934 |
font-size: 1rem !important;
|
935 |
}
|
936 |
-
|
937 |
-
.theme-toggle {
|
938 |
-
top: 0.5rem;
|
939 |
-
right: 0.5rem;
|
940 |
-
padding: 0.4rem 0.8rem;
|
941 |
-
font-size: 0.8rem;
|
942 |
-
}
|
943 |
}
|
944 |
"""
|
945 |
|
946 |
with gr.Blocks(css=custom_css, title="Landlord-Tenant Rights Assistant") as demo:
|
947 |
-
# Theme toggle button
|
948 |
-
gr.HTML(
|
949 |
-
"""
|
950 |
-
<button class="theme-toggle" onclick="toggleTheme()">Toggle Theme</button>
|
951 |
-
<script>
|
952 |
-
function setTheme(theme) {
|
953 |
-
document.documentElement.setAttribute('data-theme', theme);
|
954 |
-
localStorage.setItem('theme', theme);
|
955 |
-
}
|
956 |
-
|
957 |
-
function toggleTheme() {
|
958 |
-
const currentTheme = document.documentElement.getAttribute('data-theme') || 'light';
|
959 |
-
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
960 |
-
setTheme(newTheme);
|
961 |
-
}
|
962 |
-
|
963 |
-
// Check system preference or saved preference
|
964 |
-
const savedTheme = localStorage.getItem('theme');
|
965 |
-
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
|
966 |
-
const initialTheme = savedTheme || (prefersDark ? 'dark' : 'light');
|
967 |
-
setTheme(initialTheme);
|
968 |
-
|
969 |
-
// Listen for system theme changes
|
970 |
-
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => {
|
971 |
-
setTheme(e.matches ? 'dark' : 'light');
|
972 |
-
});
|
973 |
-
</script>
|
974 |
-
"""
|
975 |
-
)
|
976 |
-
|
977 |
with gr.Group(elem_classes="app-header-wrapper"):
|
978 |
gr.Markdown(
|
979 |
"""
|
@@ -1092,7 +1014,6 @@ Answer:"""
|
|
1092 |
|
1093 |
return demo
|
1094 |
|
1095 |
-
|
1096 |
# --- Main Execution Block (UNCHANGED from original logic) ---
|
1097 |
if __name__ == "__main__":
|
1098 |
logging.info("Starting Landlord-Tenant Rights Bot application...")
|
|
|
296 |
/* Import legible fonts from Google Fonts */
|
297 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@600;700;800&display=swap');
|
298 |
|
299 |
+
/* Root variables for the light theme (single theme now) */
|
300 |
:root {
|
301 |
--primary-color: #FF8C00;
|
302 |
--primary-hover: #E07B00;
|
303 |
--background-primary: hsl(30, 100%, 99.9%);
|
304 |
+
--background-secondary: #FFE8CC; /* Light orange background */
|
305 |
--text-primary: #4A3C32;
|
306 |
--text-secondary: #8C7B6F;
|
307 |
--border-color: hsl(30, 70%, 85%);
|
|
|
312 |
--error-bg: #FFF0E0;
|
313 |
--error-border: #FFD2B2;
|
314 |
--error-text: #E05C00;
|
315 |
+
/* Adjusted gradient variables to complement the light orange theme */
|
316 |
+
--gradient-start: #FFDAB3; /* Lighter orange to match the theme */
|
317 |
+
--gradient-end: #FFE8CC; /* Matches the background for a cohesive look */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
318 |
}
|
319 |
|
320 |
body, html {
|
|
|
847 |
text-decoration: none !important;
|
848 |
}
|
849 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
850 |
@media (max-width: 768px) {
|
851 |
.gradio-container {
|
852 |
padding: 1rem !important;
|
|
|
892 |
padding: 1.5rem 1rem !important;
|
893 |
font-size: 1rem !important;
|
894 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
895 |
}
|
896 |
"""
|
897 |
|
898 |
with gr.Blocks(css=custom_css, title="Landlord-Tenant Rights Assistant") as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
899 |
with gr.Group(elem_classes="app-header-wrapper"):
|
900 |
gr.Markdown(
|
901 |
"""
|
|
|
1014 |
|
1015 |
return demo
|
1016 |
|
|
|
1017 |
# --- Main Execution Block (UNCHANGED from original logic) ---
|
1018 |
if __name__ == "__main__":
|
1019 |
logging.info("Starting Landlord-Tenant Rights Bot application...")
|