Gen. Overseer Lupo commited on
Commit
a307b42
Β·
1 Parent(s): 5b38a89

Restore original dark theme, shrink hero, white text

Browse files
Files changed (1) hide show
  1. app/ui_streamlit.py +52 -20
app/ui_streamlit.py CHANGED
@@ -8,41 +8,73 @@ from app.main import get_env, ensure_index_exists
8
  from app.search import search
9
 
10
  # ── Streamlit config MUST be the first Streamlit call ──────────────────────────
11
- st.set_page_config(page_title="Grants Discovery RAG", page_icon="🧭", layout="wide")
12
 
13
  # ── Hero image (URL-based; no binaries in repo). Swap URL if you prefer. ──────
14
- HERO_URL = "https://images.unsplash.com/photo-1469474968028-56623f02e42e?auto=format&fit=crop&w=1600&q=80"
15
  st.image(HERO_URL, use_column_width=True)
16
 
17
- # ── Dark background styling ───────────────────────────
18
  st.markdown("""
19
  <style>
20
- /* Force app background dark */
21
- .stApp {
22
- background-color: #0f172a;
23
- color: #f8fafc; /* light text */
24
- }
25
 
26
- /* Make all text elements white */
27
- html, body, [class*="css"] {
28
- color: #f8fafc !important;
29
  }
30
 
31
- /* Headings also white */
32
- h1, h2, h3, h4, h5, h6, p, span, div {
33
- color: #f8fafc !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
 
 
 
 
 
 
 
35
 
36
- /* Buttons: white text on blue */
37
- .stButton>button {
38
- color: #ffffff !important;
39
- background-color: #1d4ed8 !important;
40
- border-radius: 8px;
41
- border: none;
 
 
 
42
  }
43
  </style>
44
  """, unsafe_allow_html=True)
45
 
 
 
 
 
 
 
 
 
 
 
 
 
46
 
47
 
48
  # ── Environment + index ───────────────────────────────────────────────────────
 
8
  from app.search import search
9
 
10
  # ── Streamlit config MUST be the first Streamlit call ──────────────────────────
11
+ st.set_page_config(page_title="Grants Discovery App By Lupo", page_icon="🧭", layout="wide")
12
 
13
  # ── Hero image (URL-based; no binaries in repo). Swap URL if you prefer. ──────
14
+ HERO_URL = "https://images.unsplash.com/photo-1469474968028-56623f02e42e?auto=format&fit=crop&w=240&q=80"
15
  st.image(HERO_URL, use_column_width=True)
16
 
17
+ # ── Dark theme stylesheet ─────────────────────────────────────────────────────
18
  st.markdown("""
19
  <style>
20
+ /* Dark background */
21
+ .stApp { background-color: #0f172a; color: #f8fafc; }
 
 
 
22
 
23
+ /* Make all text white */
24
+ html, body, [class*="css"], h1, h2, h3, h4, h5, h6, p, span, div {
25
+ color: #f8fafc !important;
26
  }
27
 
28
+ /* Buttons */
29
+ .stButton>button {
30
+ background:#1e88e5; color:#fff; border:none; border-radius:8px;
31
+ padding:0.5rem 0.9rem; font-weight:600;
32
+ }
33
+ .stButton>button:hover { filter:brightness(1.1); }
34
+
35
+ /* Compact hero with dark overlay */
36
+ .hero {
37
+ height: 220px; /* smaller than before */
38
+ border-radius: 16px;
39
+ margin: 6px 0 16px;
40
+ background:
41
+ linear-gradient(rgba(0,0,0,.35), rgba(0,0,0,.35)),
42
+ url('https://images.unsplash.com/photo-1469474968028-56623f02e42e?auto=format&fit=crop&w=1600&q=80')
43
+ center/cover no-repeat;
44
  }
45
+ .hero-text {
46
+ height:100%; display:flex; flex-direction:column;
47
+ align-items:center; justify-content:center;
48
+ text-align:center; color:#fff;
49
+ }
50
+ .hero-text h1 { margin:0; font-size:28px; font-weight:700; }
51
+ .hero-text p { margin:6px 0 0; font-size:15px; color:#e5e7eb; }
52
 
53
+ /* Card styling */
54
+ .result-card {
55
+ border:1px solid #1e293b; background:#1e293b; border-radius:14px;
56
+ padding:16px; margin:10px 0; box-shadow:0 1px 2px rgba(0,0,0,0.2);
57
+ }
58
+ .result-meta { font-size:13px; color:#94a3b8; margin-top:6px; }
59
+ span.chip {
60
+ display:inline-block; padding:3px 8px; border-radius:999px;
61
+ background:#334155; margin-right:6px; font-size:12px; color:#e2e8f0;
62
  }
63
  </style>
64
  """, unsafe_allow_html=True)
65
 
66
+ # ── Hero block ────────────────────────────────────────────────────────────────
67
+ st.markdown("""
68
+ <div class="hero">
69
+ <div class="hero-text">
70
+ <h1>Grants Discovery Live RAG by Lupo</h1>
71
+ <p>Find capacity-building grants fast.</p>
72
+ </div>
73
+ </div>
74
+ """, unsafe_allow_html=True)
75
+
76
+ # ── Hide developer diagnostics by default ─────────────────────────────────────
77
+ SHOW_DEV = os.environ.get("SHOW_DEV") == "1"
78
 
79
 
80
  # ── Environment + index ───────────────────────────────────────────────────────