Menixis Claude Opus 4.7 (1M context) commited on
Commit
0b04419
·
1 Parent(s): ab7e3be

Add step-number UI: corner badges, Step 3 marker, pill stepper

Browse files

- Popup step badges (1/2) protruding from card corners, unified purple->pink gradient
- Step 3 'Download' marker rendered in front of the download button
- Top step indicator: round circles -> 'Step 1/2/3' pills (check prefix when done)
- Larger, higher-contrast hero title + subtitle

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Files changed (1) hide show
  1. streamlit_app.py +62 -13
streamlit_app.py CHANGED
@@ -325,21 +325,23 @@ st.markdown("""
325
  .hero .hero-title {
326
  color: #FFFFFF !important;
327
  text-align: left !important;
328
- font-size: 2.2rem !important;
329
- font-weight: 800 !important;
330
- margin: 0 0 0.75rem 0 !important;
331
  letter-spacing: -0.02em !important;
332
- line-height: 1.1 !important;
333
  text-transform: uppercase !important;
 
334
  }
335
  .hero .hero-subtitle {
336
- color: rgba(255, 255, 255, 0.9) !important;
337
  text-align: left !important;
338
- font-size: 0.92rem !important;
339
- font-weight: 400 !important;
340
  max-width: 600px;
341
  margin: 0 !important;
342
- line-height: 1.5;
 
343
  }
344
  /* ─── STEPS ──────────────────────────────────────────────────── */
345
  .steps-wrapper {
@@ -354,9 +356,11 @@ st.markdown("""
354
  .steps-row { display: flex; align-items: center; gap: 0; }
355
  .step { display: flex; align-items: center; gap: 0.7rem; flex: 0 0 auto; }
356
  .step-circle {
357
- width: 40px; height: 40px; border-radius: 50%;
 
358
  display: flex; align-items: center; justify-content: center;
359
- font-weight: 700; font-size: 1rem;
 
360
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
361
  }
362
  .step-default .step-circle {
@@ -419,9 +423,42 @@ st.markdown("""
419
  font-size: 0.8rem; color: #8E86AC; margin: 0.15rem 0 0 0; font-weight: 500;
420
  }
421
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
  /* ─── STEP CARDS (top-level columns become distinct panels) ──── */
423
  /* :not(...) excludes nested column rows (e.g. the PO input + button row) */
424
  [data-testid="stColumn"]:not([data-testid="stColumn"] [data-testid="stColumn"]) {
 
425
  background: #352C54;
426
  border: 1px solid rgba(255, 255, 255, 0.08);
427
  border-radius: 18px;
@@ -998,17 +1035,17 @@ st.markdown(f"""
998
  <div class="steps-wrapper">
999
  <div class="steps-row">
1000
  <div class="step {s1}">
1001
- <div class="step-circle">{('✓' if 'done' in s1 else '1')}</div>
1002
  <span class="step-label">เลือกแบบฟอร์ม + ใส่เลข PO</span>
1003
  </div>
1004
  <div class="step-bar"><div class="step-bar-fill {bar1}"></div></div>
1005
  <div class="step {s2}">
1006
- <div class="step-circle">{('✓' if 'done' in s2 else '2')}</div>
1007
  <span class="step-label">กรอกรายละเอียด เพิ่มเติม</span>
1008
  </div>
1009
  <div class="step-bar"><div class="step-bar-fill {bar2}"></div></div>
1010
  <div class="step {s3}">
1011
- <div class="step-circle">{('✓' if 'done' in s3 else '3')}</div>
1012
  <span class="step-label">ดาวน์โหลด</span>
1013
  </div>
1014
  </div>
@@ -1025,6 +1062,7 @@ left_col, right_col = st.columns([1.05, 1], gap="large")
1025
  # === LEFT: Form selection + PO lookup ===
1026
  with left_col:
1027
  st.markdown("""
 
1028
  <div class="card-header">
1029
  <div class="card-icon card-icon-1">📋</div>
1030
  <div>
@@ -1143,6 +1181,7 @@ with right_col:
1143
  step1_done = has_lookup or not selected_form["uses_po"]
1144
 
1145
  st.markdown("""
 
1146
  <div class="card-header">
1147
  <div class="card-icon card-icon-2">✏️</div>
1148
  <div>
@@ -1252,6 +1291,16 @@ with right_col:
1252
  </div>
1253
  """, unsafe_allow_html=True)
1254
 
 
 
 
 
 
 
 
 
 
 
1255
  st.download_button(
1256
  label="⬇ ดาวน์โหลดเอกสาร",
1257
  data=st.session_state.generated_file,
 
325
  .hero .hero-title {
326
  color: #FFFFFF !important;
327
  text-align: left !important;
328
+ font-size: 2.7rem !important;
329
+ font-weight: 900 !important;
330
+ margin: 0 0 0.85rem 0 !important;
331
  letter-spacing: -0.02em !important;
332
+ line-height: 1.05 !important;
333
  text-transform: uppercase !important;
334
+ text-shadow: 0 2px 10px rgba(0, 0, 0, 0.30) !important;
335
  }
336
  .hero .hero-subtitle {
337
+ color: #FFFFFF !important;
338
  text-align: left !important;
339
+ font-size: 1.05rem !important;
340
+ font-weight: 600 !important;
341
  max-width: 600px;
342
  margin: 0 !important;
343
+ line-height: 1.55;
344
+ text-shadow: 0 1px 6px rgba(0, 0, 0, 0.28) !important;
345
  }
346
  /* ─── STEPS ──────────────────────────────────────────────────── */
347
  .steps-wrapper {
 
356
  .steps-row { display: flex; align-items: center; gap: 0; }
357
  .step { display: flex; align-items: center; gap: 0.7rem; flex: 0 0 auto; }
358
  .step-circle {
359
+ height: 40px; border-radius: 999px;
360
+ padding: 0 1rem;
361
  display: flex; align-items: center; justify-content: center;
362
+ gap: 0.3rem;
363
+ font-weight: 700; font-size: 0.95rem; white-space: nowrap;
364
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
365
  }
366
  .step-default .step-circle {
 
423
  font-size: 0.8rem; color: #8E86AC; margin: 0.15rem 0 0 0; font-weight: 500;
424
  }
425
 
426
+ /* ─── STEP NUMBER BADGES (popup, straddling the card's top-left corner) ── */
427
+ .step-badge {
428
+ position: absolute;
429
+ top: -24px; left: -52px;
430
+ width: 54px; height: 54px;
431
+ border-radius: 50%;
432
+ display: flex; align-items: center; justify-content: center;
433
+ font-size: 1.6rem; font-weight: 800; color: #FFFFFF;
434
+ border: 3px solid #211B3D; /* deep-indigo ring → makes it pop off the card */
435
+ box-shadow: 0 6px 18px rgba(0, 0, 0, 0.40);
436
+ z-index: 5;
437
+ background: linear-gradient(135deg, #7C5CFF 0%, #FF4D8D 100%);
438
+ animation: stepPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
439
+ }
440
+
441
+ /* ─── STEP 3 header (inline marker placed in front of the download button) ── */
442
+ .dl-step-header {
443
+ display: flex; align-items: center; gap: 0.7rem;
444
+ margin: 0 0 0.85rem 0;
445
+ }
446
+ .step-badge-inline {
447
+ flex: 0 0 auto;
448
+ width: 36px; height: 36px;
449
+ border-radius: 50%;
450
+ display: flex; align-items: center; justify-content: center;
451
+ font-size: 1.1rem; font-weight: 800; color: #FFFFFF;
452
+ background: linear-gradient(135deg, #22D3EE 0%, #0EA5C0 100%);
453
+ box-shadow: 0 4px 12px rgba(34, 211, 238, 0.35);
454
+ }
455
+ .dl-step-title { font-size: 1.05rem; font-weight: 700; color: #F4F1FA; line-height: 1.2; }
456
+ .dl-step-sub { font-size: 0.8rem; color: #8E86AC; font-weight: 500; margin-top: 0.1rem; }
457
+
458
  /* ─── STEP CARDS (top-level columns become distinct panels) ──── */
459
  /* :not(...) excludes nested column rows (e.g. the PO input + button row) */
460
  [data-testid="stColumn"]:not([data-testid="stColumn"] [data-testid="stColumn"]) {
461
+ position: relative; /* anchor for the popup step badges */
462
  background: #352C54;
463
  border: 1px solid rgba(255, 255, 255, 0.08);
464
  border-radius: 18px;
 
1035
  <div class="steps-wrapper">
1036
  <div class="steps-row">
1037
  <div class="step {s1}">
1038
+ <div class="step-circle">{('✓ Step 1' if 'done' in s1 else 'Step 1')}</div>
1039
  <span class="step-label">เลือกแบบฟอร์ม + ใส่เลข PO</span>
1040
  </div>
1041
  <div class="step-bar"><div class="step-bar-fill {bar1}"></div></div>
1042
  <div class="step {s2}">
1043
+ <div class="step-circle">{('✓ Step 2' if 'done' in s2 else 'Step 2')}</div>
1044
  <span class="step-label">กรอกรายละเอียด เพิ่มเติม</span>
1045
  </div>
1046
  <div class="step-bar"><div class="step-bar-fill {bar2}"></div></div>
1047
  <div class="step {s3}">
1048
+ <div class="step-circle">{('✓ Step 3' if 'done' in s3 else 'Step 3')}</div>
1049
  <span class="step-label">ดาวน์โหลด</span>
1050
  </div>
1051
  </div>
 
1062
  # === LEFT: Form selection + PO lookup ===
1063
  with left_col:
1064
  st.markdown("""
1065
+ <div class="step-badge step-badge-1">1</div>
1066
  <div class="card-header">
1067
  <div class="card-icon card-icon-1">📋</div>
1068
  <div>
 
1181
  step1_done = has_lookup or not selected_form["uses_po"]
1182
 
1183
  st.markdown("""
1184
+ <div class="step-badge step-badge-2">2</div>
1185
  <div class="card-header">
1186
  <div class="card-icon card-icon-2">✏️</div>
1187
  <div>
 
1291
  </div>
1292
  """, unsafe_allow_html=True)
1293
 
1294
+ st.markdown("""
1295
+ <div class="dl-step-header">
1296
+ <div class="step-badge-inline">3</div>
1297
+ <div>
1298
+ <div class="dl-step-title">ดาวน์โหลดเอกสาร</div>
1299
+ <div class="dl-step-sub">Step 3 — Download</div>
1300
+ </div>
1301
+ </div>
1302
+ """, unsafe_allow_html=True)
1303
+
1304
  st.download_button(
1305
  label="⬇ ดาวน์โหลดเอกสาร",
1306
  data=st.session_state.generated_file,