File size: 2,727 Bytes
8f9b130
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import gradio as gr
from PIL import Image
import os

CUSTOM_CSS = """
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&display=swap');

.gradio-container{
  background: white !important;
  font-family: 'IBM Plex Mono', monospace !important;
}

/* Headings */
h1{
  font-size:52px !important;
  font-weight:800 !important;
  line-height:1.05 !important;
  letter-spacing:-1px;
}

h3{
  color:#6b7280 !important;
  font-weight:400 !important;
}

/* Buttons */
button{
  border-radius: 12px !important;
  padding: 12px 24px !important;
  font-weight: 600 !important;
}

/* Navbar bottom border */
.gradio-container > div:first-child {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 20px;
  margin-bottom: 26px;
}
"""

IMG_PATH = "assets/file cabinet.png"   # hero image
LOGO_PATH = "assets/archive logo.png"  # logo image

def load_image(path: str):
    if os.path.exists(path):
        return Image.open(path)
    return None

with gr.Blocks(css=CUSTOM_CSS, title="Election Memory Engine") as demo:

    # ---------- NAVBAR ----------
    with gr.Row():
        with gr.Column(scale=1, min_width=70):
            logo = load_image(LOGO_PATH)
            if logo is not None:
                gr.Image(value=logo, show_label=False, container=False, height=44)
            else:
                gr.Markdown(f"<span style='color:#6b7280;font-size:12px;'>Missing: {LOGO_PATH}</span>")

        with gr.Column(scale=5):
            gr.Markdown(
                "<div style='font-weight:700; font-size:18px; padding-top:6px;'>Election Archive</div>"
            )

        with gr.Column(scale=6):
            gr.HTML(
                """
                <div style="display:flex; justify-content:flex-end; gap:28px; font-weight:500; padding-top:10px;">
                  <span style="cursor:pointer;">Home</span>
                  <span style="cursor:pointer;">Archive</span>
                  <span style="cursor:pointer;">Upload</span>
                </div>
                """
            )

    # ---------- HERO ----------
    with gr.Row():
        with gr.Column(scale=6):
            gr.Markdown("""
# What Happened  
# Last  
# Election?

### Turn your newsroom archive into a searchable memory engine.
### Upload documents. Ask questions. Get answers with sources.
""")
            with gr.Row():
                gr.Button("Get Started", variant="primary")
                gr.Button("Upload Archive")

        with gr.Column(scale=6):
            hero = load_image(IMG_PATH)
            if hero is not None:
                gr.Image(value=hero, show_label=False, container=False)
            else:
                gr.Markdown(f"**Missing hero image:** `{IMG_PATH}`")

demo.launch()