UCS2014 commited on
Commit
95adf40
·
verified ·
1 Parent(s): 891b30e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -10
app.py CHANGED
@@ -9,10 +9,10 @@ ASSETS = BASE_DIR / "assets" # -> Landing_Page/assets/
9
 
10
  # ========= CONTROLS (tweak these) =========
11
  HERO_LOGO_SIZE = 160 # px (top company logo size)
12
- TOP_SPACER = 100 # px (breathing room above hero; raise if the logo looks "trimmed")
13
  CARD_WIDTH = 300 # px (fixed width per card on desktop)
14
  CARD_THUMB_HEIGHT = 120 # px (image area inside each card)
15
- GRID_GAP = 80 # px (space between the two cards)
16
  BUTTON_TEXT = "Click to Run APP"
17
  OPEN_IN_NEW_TAB = False # True = open links in a new tab
18
 
@@ -36,6 +36,16 @@ APP2 = {
36
  "bg": "#F6FFF7", # very light green
37
  "border":"#E4F9E6", # light green border
38
  }
 
 
 
 
 
 
 
 
 
 
39
  LOGO_PATH = ASSETS / "logo.png"
40
 
41
  # ========= PAGE META =========
@@ -76,9 +86,9 @@ st.markdown(
76
  .hero h1 {{ font-size: 2.3rem; margin: .2rem 0 0; }}
77
  .hero p {{
78
  color: #5a5f6a;
79
- margin: var(--tagline-gap) auto 0; /* top margin = small gap to H1 */
80
  max-width: 720px;
81
- font-style: italic; /* ← italic tagline */
82
  }}
83
 
84
  /* GRID: precise card width + extra space above cards */
@@ -87,10 +97,11 @@ st.markdown(
87
  gap: var(--grid-gap);
88
  justify-content: center;
89
  align-items: stretch;
90
- flex-wrap: nowrap;
91
- margin-top: var(--grid-top-space); /* ← space above cards */
92
  }}
93
- @media (max-width: calc(2 * var(--card-width) + var(--grid-gap) + 64px)) {{
 
94
  .grid {{ flex-wrap: wrap; }}
95
  }}
96
 
@@ -110,13 +121,14 @@ st.markdown(
110
  height: {CARD_THUMB_HEIGHT}px;
111
  border-radius:14px;
112
  border:1px solid rgba(0,0,0,.06);
113
- object-fit: contain;
114
  background:#fff;
115
  }}
116
 
117
  .card h3 {{ margin:6px 0 2px; }}
118
  .card p {{ color:#5a5f6a; min-height:30px; margin:0 8px 2px; }}
119
 
 
120
  .btn {{
121
  display:inline-block; padding:10px 14px; border-radius:12px;
122
  border:1px solid #e5e7eb; text-decoration:none;
@@ -168,7 +180,8 @@ def app_card(app: dict) -> str:
168
  + "</div>"
169
  )
170
 
171
- st.markdown("<div class='grid'>" + app_card(APP1) + app_card(APP2) + "</div>", unsafe_allow_html=True)
 
172
 
173
  # ========= FOOTER (compact; no extra spacing) =========
174
  st.markdown(
@@ -180,4 +193,4 @@ st.markdown(
180
  </div>
181
  """,
182
  unsafe_allow_html=True,
183
- )
 
9
 
10
  # ========= CONTROLS (tweak these) =========
11
  HERO_LOGO_SIZE = 160 # px (top company logo size)
12
+ TOP_SPACER = 100 # px (breathing room above hero; raise if the logo looks "trimmed")
13
  CARD_WIDTH = 300 # px (fixed width per card on desktop)
14
  CARD_THUMB_HEIGHT = 120 # px (image area inside each card)
15
+ GRID_GAP = 80 # px (space between the cards)
16
  BUTTON_TEXT = "Click to Run APP"
17
  OPEN_IN_NEW_TAB = False # True = open links in a new tab
18
 
 
36
  "bg": "#F6FFF7", # very light green
37
  "border":"#E4F9E6", # light green border
38
  }
39
+ # NEW third card (edit title/url/blurb/thumb/colors as needed)
40
+ APP3 = {
41
+ "title": "ST_GeoMech_Ym",
42
+ "url": "https://smart-thinking-ym.hf.space/", # <-- replace with your Space URL
43
+ "thumb": ASSETS / "app3.png", # <-- upload this image
44
+ "blurb": "Real-Time Static Young's Modulus Prediction",
45
+ "bg": "#F9F6FF", # very light purple
46
+ "border":"#EDE6FF", # light purple border
47
+ }
48
+
49
  LOGO_PATH = ASSETS / "logo.png"
50
 
51
  # ========= PAGE META =========
 
86
  .hero h1 {{ font-size: 2.3rem; margin: .2rem 0 0; }}
87
  .hero p {{
88
  color: #5a5f6a;
89
+ margin: var(--tagline-gap) auto 0;
90
  max-width: 720px;
91
+ font-style: italic;
92
  }}
93
 
94
  /* GRID: precise card width + extra space above cards */
 
97
  gap: var(--grid-gap);
98
  justify-content: center;
99
  align-items: stretch;
100
+ flex-wrap: nowrap; /* keep three across on desktop */
101
+ margin-top: var(--grid-top-space);
102
  }}
103
+ /* When viewport too narrow for 3-up, allow wrapping */
104
+ @media (max-width: calc(3 * var(--card-width) + 2 * var(--grid-gap) + 64px)) {{
105
  .grid {{ flex-wrap: wrap; }}
106
  }}
107
 
 
121
  height: {CARD_THUMB_HEIGHT}px;
122
  border-radius:14px;
123
  border:1px solid rgba(0,0,0,.06);
124
+ object-fit: contain; /* show full image */
125
  background:#fff;
126
  }}
127
 
128
  .card h3 {{ margin:6px 0 2px; }}
129
  .card p {{ color:#5a5f6a; min-height:30px; margin:0 8px 2px; }}
130
 
131
+ /* Light button with dark text */
132
  .btn {{
133
  display:inline-block; padding:10px 14px; border-radius:12px;
134
  border:1px solid #e5e7eb; text-decoration:none;
 
180
  + "</div>"
181
  )
182
 
183
+ # Render 3 cards side-by-side
184
+ st.markdown("<div class='grid'>" + app_card(APP1) + app_card(APP2) + app_card(APP3) + "</div>", unsafe_allow_html=True)
185
 
186
  # ========= FOOTER (compact; no extra spacing) =========
187
  st.markdown(
 
193
  </div>
194
  """,
195
  unsafe_allow_html=True,
196
+ )