Pointf5ive commited on
Commit
5fef618
Β·
1 Parent(s): c6376b5

Embed supplied banner art as text data URI and refine hero

Browse files
assets/smoke_signal_banner_data_uri.txt ADDED
The diff for this file is too large to render. See raw diff
 
smoke_signal_tab.py CHANGED
@@ -57,6 +57,26 @@ for d in [SOURCE_DIR, MANIFEST_CSV.parent, PROFILES_DIR, OCR_RAW_DIR,
57
  GOLD_FILE = GOLD_DIR / "gold_corrections.jsonl"
58
  DECISIONS_CSV = REVIEW_DIR / "review_decisions.csv"
59
  QUEUE_CSV = REVIEW_DIR / "review_queue.csv"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  # ── Confidence calibration state (in-memory, persisted to disk) ────────────────
62
  CALIBRATION_FILE = SS_ROOT / "manifest" / "confidence_calibration.json"
@@ -124,78 +144,39 @@ SS_CSS = """
124
  border-radius: 16px;
125
  border: 1px solid #2a3240;
126
  margin: 12px 0 16px;
127
- background:
128
- radial-gradient(1000px 420px at 8% 10%, rgba(86, 151, 255, 0.22), transparent 55%),
129
- radial-gradient(820px 380px at 88% 0%, rgba(240, 136, 62, 0.18), transparent 60%),
130
- linear-gradient(132deg, #040816 0%, #0a1329 45%, #030916 100%);
131
- box-shadow: 0 24px 70px rgba(3, 9, 25, 0.42);
132
  }
133
 
134
  .ss-hero::before {
135
  content: "";
136
  position: absolute;
137
  inset: 0;
138
- background-image:
139
- radial-gradient(circle at 14% 26%, rgba(255, 255, 255, 0.28) 0 1px, transparent 2px),
140
- radial-gradient(circle at 58% 16%, rgba(255, 185, 120, 0.20) 0 1px, transparent 2px),
141
- radial-gradient(circle at 84% 30%, rgba(110, 193, 255, 0.24) 0 1px, transparent 2px),
142
- radial-gradient(circle at 75% 72%, rgba(255, 255, 255, 0.12) 0 1px, transparent 2px);
143
- background-size: 220px 220px, 280px 280px, 300px 300px, 260px 260px;
144
- opacity: 0.8;
145
  pointer-events: none;
146
  }
147
 
148
- .ss-hero-top {
149
- position: relative;
150
- display: flex;
151
- align-items: center;
152
- gap: 16px;
153
- padding: 24px 28px 8px;
 
 
 
 
 
 
154
  z-index: 1;
155
  }
156
 
157
- .ss-hero-emblem {
158
- width: 54px;
159
- height: 54px;
160
- border-radius: 12px;
161
- border: 1px solid rgba(125, 133, 144, 0.35);
162
- background: linear-gradient(140deg, rgba(94, 160, 255, 0.25), rgba(240, 136, 62, 0.22));
163
- display: flex;
164
- align-items: center;
165
- justify-content: center;
166
- font-size: 28px;
167
- box-shadow: 0 8px 28px rgba(88, 166, 255, 0.25);
168
- }
169
-
170
- .ss-hero-title {
171
- margin: 0;
172
- line-height: 1;
173
- font-family: 'Playfair Display', Georgia, serif;
174
- font-size: 48px;
175
- font-weight: 900;
176
- letter-spacing: 0.4px;
177
- background: linear-gradient(90deg, #c892ff 0%, #f39d53 45%, #58a6ff 95%);
178
- -webkit-background-clip: text;
179
- background-clip: text;
180
- color: transparent;
181
- text-shadow:
182
- 0 0 16px rgba(195, 146, 255, 0.30),
183
- 0 0 24px rgba(88, 166, 255, 0.16);
184
- }
185
-
186
- .ss-hero-sub {
187
- margin: 8px 0 0;
188
- font-family: 'Source Code Pro', monospace;
189
- font-size: 11px;
190
- color: #ffb46f;
191
- letter-spacing: 3px;
192
- text-transform: uppercase;
193
- }
194
-
195
  .ss-hero-step-wrap {
196
  position: relative;
197
- z-index: 1;
198
- margin: 12px 20px 20px;
199
  border-radius: 14px;
200
  border: 1px solid rgba(125, 133, 144, 0.26);
201
  background: linear-gradient(180deg, rgba(11, 18, 35, 0.88), rgba(8, 14, 30, 0.88));
@@ -266,8 +247,12 @@ SS_CSS = """
266
  }
267
 
268
  @media (max-width: 900px) {
269
- .ss-hero-title { font-size: 34px; }
270
- .ss-hero-sub { letter-spacing: 2px; }
 
 
 
 
271
  }
272
 
273
  /* Main panel */
@@ -519,6 +504,8 @@ SS_CSS = """
519
  #ss-tab .label-wrap span { color: var(--ss-smoke) !important; font-size: 11px !important; text-transform: uppercase !important; letter-spacing: 1px !important; }
520
  """
521
 
 
 
522
 
523
  # ── Utility functions ──────────────────────────────────────────────────────────
524
  def sha256_file(path: Path) -> str:
@@ -1719,13 +1706,7 @@ def _wizard_header_html(active_step: int = 1) -> str:
1719
 
1720
  return """
1721
  <div class="ss-hero">
1722
- <div class="ss-hero-top">
1723
- <div class="ss-hero-emblem">✦</div>
1724
- <div>
1725
- <p class="ss-hero-title">Smoke Signal</p>
1726
- <p class="ss-hero-sub">Picture-Book OCR Β· Extraction Pipeline Β· v1</p>
1727
- </div>
1728
- </div>
1729
  <div class="ss-hero-step-wrap">
1730
  <div class="ss-wizard">
1731
  """ + "".join(step_html) + """
 
57
  GOLD_FILE = GOLD_DIR / "gold_corrections.jsonl"
58
  DECISIONS_CSV = REVIEW_DIR / "review_decisions.csv"
59
  QUEUE_CSV = REVIEW_DIR / "review_queue.csv"
60
+ BANNER_DATA_URI_FILE = Path(__file__).resolve().parent / "assets" / "smoke_signal_banner_data_uri.txt"
61
+
62
+
63
+ def _load_banner_image_css() -> str:
64
+ """
65
+ Return a CSS-ready background-image value.
66
+ Uses a text data-URI file so HF push is text-only (no binary file tracking needed).
67
+ """
68
+ try:
69
+ uri = BANNER_DATA_URI_FILE.read_text(encoding="utf-8").strip()
70
+ if not uri:
71
+ return "none"
72
+ if not uri.startswith("data:image/"):
73
+ return "none"
74
+ return f"url('{uri}')"
75
+ except Exception:
76
+ return "none"
77
+
78
+
79
+ SS_BANNER_IMAGE_CSS = _load_banner_image_css()
80
 
81
  # ── Confidence calibration state (in-memory, persisted to disk) ────────────────
82
  CALIBRATION_FILE = SS_ROOT / "manifest" / "confidence_calibration.json"
 
144
  border-radius: 16px;
145
  border: 1px solid #2a3240;
146
  margin: 12px 0 16px;
147
+ padding-top: 230px;
148
+ background: linear-gradient(132deg, #040816 0%, #0a1329 45%, #030916 100%);
149
+ box-shadow: 0 24px 70px rgba(3, 9, 25, 0.38);
 
 
150
  }
151
 
152
  .ss-hero::before {
153
  content: "";
154
  position: absolute;
155
  inset: 0;
156
+ background-image: radial-gradient(circle at 12% 18%, rgba(90, 164, 255, 0.35), transparent 25%);
157
+ opacity: 0.7;
 
 
 
 
 
158
  pointer-events: none;
159
  }
160
 
161
+ .ss-hero-art {
162
+ position: absolute;
163
+ top: 10px;
164
+ left: 10px;
165
+ right: 10px;
166
+ height: 205px;
167
+ border-radius: 14px;
168
+ border: 1px solid rgba(125, 133, 144, 0.24);
169
+ background-image: __SS_BANNER_IMAGE_CSS__;
170
+ background-size: cover;
171
+ background-position: center top;
172
+ box-shadow: inset 0 -26px 40px rgba(3, 9, 22, 0.65);
173
  z-index: 1;
174
  }
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  .ss-hero-step-wrap {
177
  position: relative;
178
+ z-index: 2;
179
+ margin: 0 20px 20px;
180
  border-radius: 14px;
181
  border: 1px solid rgba(125, 133, 144, 0.26);
182
  background: linear-gradient(180deg, rgba(11, 18, 35, 0.88), rgba(8, 14, 30, 0.88));
 
247
  }
248
 
249
  @media (max-width: 900px) {
250
+ .ss-hero {
251
+ padding-top: 156px;
252
+ }
253
+ .ss-hero-art {
254
+ height: 134px;
255
+ }
256
  }
257
 
258
  /* Main panel */
 
504
  #ss-tab .label-wrap span { color: var(--ss-smoke) !important; font-size: 11px !important; text-transform: uppercase !important; letter-spacing: 1px !important; }
505
  """
506
 
507
+ SS_CSS = SS_CSS.replace("__SS_BANNER_IMAGE_CSS__", SS_BANNER_IMAGE_CSS)
508
+
509
 
510
  # ── Utility functions ──────────────────────────────────────────────────────────
511
  def sha256_file(path: Path) -> str:
 
1706
 
1707
  return """
1708
  <div class="ss-hero">
1709
+ <div class="ss-hero-art" aria-hidden="true"></div>
 
 
 
 
 
 
1710
  <div class="ss-hero-step-wrap">
1711
  <div class="ss-wizard">
1712
  """ + "".join(step_html) + """