Spaces:
Sleeping
Sleeping
Update pages/1_Profile.py
Browse files- pages/1_Profile.py +51 -355
pages/1_Profile.py
CHANGED
|
@@ -6,17 +6,17 @@ from auth_token import logout
|
|
| 6 |
st.set_page_config(page_title="FitPlan Pro β Profile", page_icon="β‘", layout="wide")
|
| 7 |
|
| 8 |
if not st.session_state.get("logged_in"):
|
| 9 |
-
|
| 10 |
|
| 11 |
uname = st.session_state.get("username", "Athlete")
|
| 12 |
|
| 13 |
# ββ Extract display name from email if needed ββ
|
| 14 |
def _display_name(raw: str) -> str:
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
|
| 21 |
display_name = _display_name(uname)
|
| 22 |
|
|
@@ -96,21 +96,13 @@ html,body,.stApp,[data-testid="stAppViewContainer"]{
|
|
| 96 |
text-shadow:0 0 36px rgba(229,9,20,0.65),0 0 72px rgba(229,9,20,0.25);
|
| 97 |
}
|
| 98 |
|
| 99 |
-
/* βββ HERO SECTION
|
| 100 |
.hero-section{
|
| 101 |
position:relative;
|
| 102 |
padding:20px 0 48px;
|
| 103 |
margin-bottom:10px;
|
| 104 |
overflow:hidden;
|
| 105 |
}
|
| 106 |
-
.hero-section::before{
|
| 107 |
-
content:'';
|
| 108 |
-
position:absolute;inset:0;z-index:0;
|
| 109 |
-
background:
|
| 110 |
-
radial-gradient(ellipse 60% 80% at 80% 50%, rgba(229,9,20,0.07) 0%, transparent 60%),
|
| 111 |
-
radial-gradient(ellipse 50% 60% at 20% 60%, rgba(255,255,255,0.02) 0%, transparent 50%);
|
| 112 |
-
pointer-events:none;
|
| 113 |
-
}
|
| 114 |
.hero-content{position:relative;z-index:1;}
|
| 115 |
|
| 116 |
.hero-title{
|
|
@@ -135,45 +127,6 @@ html,body,.stApp,[data-testid="stAppViewContainer"]{
|
|
| 135 |
line-height:1.7;
|
| 136 |
text-shadow:0 1px 12px rgba(0,0,0,0.5);
|
| 137 |
}
|
| 138 |
-
.hero-divider{
|
| 139 |
-
width:60px;height:3px;
|
| 140 |
-
background:linear-gradient(90deg,#E50914,rgba(229,9,20,0.15));
|
| 141 |
-
border-radius:3px;
|
| 142 |
-
margin-top:32px;
|
| 143 |
-
}
|
| 144 |
-
|
| 145 |
-
/* βββ GLASS DASHBOARD CARD βββ */
|
| 146 |
-
.glass-card{
|
| 147 |
-
background:rgba(10,7,22,0.52);
|
| 148 |
-
border:1px solid rgba(255,255,255,0.08);
|
| 149 |
-
border-radius:20px;
|
| 150 |
-
padding:36px 40px 32px;
|
| 151 |
-
margin-bottom:24px;
|
| 152 |
-
backdrop-filter:blur(32px) saturate(1.3);
|
| 153 |
-
-webkit-backdrop-filter:blur(32px) saturate(1.3);
|
| 154 |
-
box-shadow:
|
| 155 |
-
0 1px 0 rgba(255,255,255,0.06) inset,
|
| 156 |
-
0 -1px 0 rgba(255,255,255,0.02) inset,
|
| 157 |
-
0 20px 60px rgba(0,0,0,0.50),
|
| 158 |
-
0 4px 12px rgba(0,0,0,0.25);
|
| 159 |
-
transition:border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
|
| 160 |
-
position:relative;
|
| 161 |
-
overflow:hidden;
|
| 162 |
-
}
|
| 163 |
-
.glass-card::before{
|
| 164 |
-
content:'';
|
| 165 |
-
position:absolute;top:0;left:0;right:0;height:1px;
|
| 166 |
-
background:linear-gradient(90deg, transparent, rgba(255,255,255,0.10) 30%, rgba(255,255,255,0.10) 70%, transparent);
|
| 167 |
-
pointer-events:none;
|
| 168 |
-
}
|
| 169 |
-
.glass-card:hover{
|
| 170 |
-
border-color:rgba(255,255,255,0.13);
|
| 171 |
-
box-shadow:
|
| 172 |
-
0 1px 0 rgba(255,255,255,0.07) inset,
|
| 173 |
-
0 24px 72px rgba(0,0,0,0.55),
|
| 174 |
-
0 0 0 1px rgba(229,9,20,0.04);
|
| 175 |
-
transform:translateY(-1px);
|
| 176 |
-
}
|
| 177 |
|
| 178 |
/* βββ UPDATED SECTION HEADERS βββ */
|
| 179 |
.custom-section-hdr {
|
|
@@ -181,8 +134,8 @@ html,body,.stApp,[data-testid="stAppViewContainer"]{
|
|
| 181 |
font-size: 2.2rem;
|
| 182 |
color: #fff;
|
| 183 |
letter-spacing: 2px;
|
| 184 |
-
margin-bottom:
|
| 185 |
-
margin-top:
|
| 186 |
display: flex;
|
| 187 |
align-items: center;
|
| 188 |
gap: 15px;
|
|
@@ -203,190 +156,35 @@ div[data-baseweb="input"],div[data-baseweb="textarea"]{
|
|
| 203 |
border-radius:10px!important;
|
| 204 |
transition:all 0.25s cubic-bezier(0.4,0,0.2,1)!important;
|
| 205 |
}
|
| 206 |
-
div[data-baseweb="input"]:
|
| 207 |
-
background:rgba(255,255,255,0.08)!important;
|
| 208 |
-
border-color:rgba(255,255,255,0.22)!important;
|
| 209 |
-
}
|
| 210 |
-
div[data-baseweb="input"]:focus-within,div[data-baseweb="textarea"]:focus-within{
|
| 211 |
background:rgba(255,255,255,0.07)!important;
|
| 212 |
border-color:rgba(229,9,20,0.70)!important;
|
| 213 |
-
box-shadow:0 0 0 3px rgba(229,9,20,0.12)
|
| 214 |
}
|
| 215 |
-
div[data-baseweb="input"] input
|
| 216 |
background:transparent!important;
|
| 217 |
color:#fff!important;
|
| 218 |
font-family:'DM Sans',sans-serif!important;
|
| 219 |
font-size:0.95rem!important;
|
| 220 |
-
letter-spacing:0.3px!important;
|
| 221 |
-
padding:12px 14px!important;
|
| 222 |
-
}
|
| 223 |
-
div[data-baseweb="input"] input::placeholder{color:rgba(255,255,255,0.20)!important;}
|
| 224 |
-
|
| 225 |
-
/* Number input stepper buttons */
|
| 226 |
-
div[data-baseweb="input"] button{
|
| 227 |
-
color:rgba(255,255,255,0.30)!important;
|
| 228 |
-
transition:all 0.2s ease!important;
|
| 229 |
-
}
|
| 230 |
-
div[data-baseweb="input"] button:hover{
|
| 231 |
-
color:#fff!important;background:rgba(229,9,20,0.15)!important;
|
| 232 |
-
}
|
| 233 |
-
|
| 234 |
-
/* βββ SELECT / DROPDOWN β DARK THEMED βββ */
|
| 235 |
-
div[data-baseweb="select"]>div{
|
| 236 |
-
background:rgba(255,255,255,0.05)!important;
|
| 237 |
-
border:1.5px solid rgba(255,255,255,0.10)!important;
|
| 238 |
-
border-radius:10px!important;color:#fff!important;
|
| 239 |
-
transition:all 0.25s cubic-bezier(0.4,0,0.2,1)!important;
|
| 240 |
-
}
|
| 241 |
-
div[data-baseweb="select"]>div:hover{
|
| 242 |
-
background:rgba(255,255,255,0.08)!important;
|
| 243 |
-
border-color:rgba(255,255,255,0.22)!important;
|
| 244 |
-
}
|
| 245 |
-
div[data-baseweb="select"]>div:focus-within{
|
| 246 |
-
border-color:rgba(229,9,20,0.70)!important;
|
| 247 |
-
box-shadow:0 0 0 3px rgba(229,9,20,0.12), 0 0 24px rgba(229,9,20,0.08)!important;
|
| 248 |
-
}
|
| 249 |
-
div[data-baseweb="select"] span{color:#fff!important;}
|
| 250 |
-
div[data-baseweb="popover"]{
|
| 251 |
-
background:rgba(10,6,24,0.98)!important;
|
| 252 |
-
border:1px solid rgba(255,255,255,0.08)!important;
|
| 253 |
-
border-radius:12px!important;
|
| 254 |
-
box-shadow:0 24px 64px rgba(0,0,0,0.80)!important;
|
| 255 |
-
backdrop-filter:blur(24px) saturate(1.2)!important;
|
| 256 |
-
}
|
| 257 |
-
li[role="option"]{
|
| 258 |
-
color:rgba(255,255,255,0.72)!important;
|
| 259 |
-
font-family:'DM Sans',sans-serif!important;
|
| 260 |
-
border-radius:8px!important;
|
| 261 |
-
margin:3px 6px!important;
|
| 262 |
-
padding:10px 14px!important;
|
| 263 |
-
transition:all 0.18s ease!important;
|
| 264 |
-
}
|
| 265 |
-
li[role="option"]:hover{
|
| 266 |
-
background:rgba(255,255,255,0.07)!important;
|
| 267 |
-
color:#fff!important;
|
| 268 |
-
}
|
| 269 |
-
li[aria-selected="true"]{
|
| 270 |
-
background:rgba(229,9,20,0.18)!important;
|
| 271 |
-
color:#fff!important;
|
| 272 |
-
border-left:2px solid #E50914!important;
|
| 273 |
}
|
| 274 |
|
| 275 |
-
/* βββ
|
| 276 |
-
|
| 277 |
-
background:rgba(255,255,255,0.05)!important;
|
| 278 |
-
border:1.5px solid rgba(255,255,255,0.10)!important;
|
| 279 |
-
border-radius:10px!important;
|
| 280 |
-
min-height:54px!important;
|
| 281 |
-
transition:all 0.25s cubic-bezier(0.4,0,0.2,1)!important;
|
| 282 |
-
}
|
| 283 |
-
div[data-baseweb="multi-select"]>div:hover{
|
| 284 |
-
background:rgba(255,255,255,0.08)!important;
|
| 285 |
-
border-color:rgba(255,255,255,0.22)!important;
|
| 286 |
-
}
|
| 287 |
-
div[data-baseweb="multi-select"]>div:focus-within{
|
| 288 |
-
border-color:rgba(229,9,20,0.70)!important;
|
| 289 |
-
box-shadow:0 0 0 3px rgba(229,9,20,0.12), 0 0 24px rgba(229,9,20,0.08)!important;
|
| 290 |
-
}
|
| 291 |
-
span[data-baseweb="tag"]{
|
| 292 |
-
background:rgba(229,9,20,0.18)!important;
|
| 293 |
-
border:1px solid rgba(229,9,20,0.35)!important;
|
| 294 |
-
border-radius:8px!important;
|
| 295 |
-
padding:4px 10px!important;
|
| 296 |
-
transition:all 0.18s ease!important;
|
| 297 |
-
}
|
| 298 |
-
span[data-baseweb="tag"]:hover{
|
| 299 |
-
background:rgba(229,9,20,0.30)!important;
|
| 300 |
-
border-color:rgba(229,9,20,0.55)!important;
|
| 301 |
-
}
|
| 302 |
-
span[data-baseweb="tag"] span{color:#fff!important;font-size:0.82rem!important;font-weight:500!important;}
|
| 303 |
-
|
| 304 |
-
/* βββ FIELD LABELS β PREMIUM UPPERCASE βββ */
|
| 305 |
-
.stTextInput label,.stNumberInput label,.stSelectbox label,.stMultiSelect label,.stSlider label{
|
| 306 |
color:rgba(255,255,255,0.48)!important;
|
| 307 |
font-size:0.68rem!important;font-weight:700!important;
|
| 308 |
letter-spacing:2.5px!important;text-transform:uppercase!important;
|
| 309 |
margin-bottom:8px!important;
|
| 310 |
-
text-shadow:0 1px 6px rgba(0,0,0,0.4)!important;
|
| 311 |
-
transition:color 0.2s!important;
|
| 312 |
-
}
|
| 313 |
-
.stTextInput:hover label,.stNumberInput:hover label,.stSelectbox:hover label,.stMultiSelect:hover label{
|
| 314 |
-
color:rgba(255,255,255,0.62)!important;
|
| 315 |
}
|
| 316 |
|
| 317 |
-
/* βββ GENERATE BUTTON
|
| 318 |
.cta-wrapper .stButton>button{
|
| 319 |
-
background:linear-gradient(135deg,#E50914 0%,#
|
| 320 |
color:#fff!important;
|
| 321 |
-
border:none!important;
|
| 322 |
border-radius:14px!important;
|
| 323 |
font-family:'DM Sans',sans-serif!important;
|
| 324 |
font-size:1.1rem!important;font-weight:700!important;
|
| 325 |
padding:18px 48px!important;
|
| 326 |
-
letter-spacing:0.8px!important;
|
| 327 |
-
transition:all 0.3s cubic-bezier(0.34,1.56,0.64,1)!important;
|
| 328 |
-
box-shadow:
|
| 329 |
-
0 8px 32px rgba(229,9,20,0.45),
|
| 330 |
-
0 2px 8px rgba(229,9,20,0.25),
|
| 331 |
-
0 1px 0 rgba(255,255,255,0.12) inset!important;
|
| 332 |
width:100%!important;
|
| 333 |
-
position:relative!important;
|
| 334 |
-
overflow:hidden!important;
|
| 335 |
-
text-shadow:0 1px 3px rgba(0,0,0,0.3)!important;
|
| 336 |
-
}
|
| 337 |
-
.cta-wrapper .stButton>button::before{
|
| 338 |
-
content:'';
|
| 339 |
-
position:absolute;top:0;left:-100%;
|
| 340 |
-
width:100%;height:100%;
|
| 341 |
-
background:linear-gradient(90deg,transparent,rgba(255,255,255,0.08),transparent);
|
| 342 |
-
transform:skewX(-15deg);transition:left .5s ease;
|
| 343 |
-
}
|
| 344 |
-
.cta-wrapper .stButton>button:hover::before{
|
| 345 |
-
left:100%;
|
| 346 |
-
}
|
| 347 |
-
.cta-wrapper .stButton>button:hover{
|
| 348 |
-
transform:translateY(-4px) scale(1.01)!important;
|
| 349 |
-
box-shadow:
|
| 350 |
-
0 16px 52px rgba(229,9,20,0.55),
|
| 351 |
-
0 4px 16px rgba(229,9,20,0.35),
|
| 352 |
-
0 1px 0 rgba(255,255,255,0.15) inset!important;
|
| 353 |
-
filter:brightness(1.10)!important;
|
| 354 |
-
}
|
| 355 |
-
.cta-wrapper .stButton>button:active{
|
| 356 |
-
transform:translateY(-1px) scale(0.99)!important;
|
| 357 |
-
filter:brightness(0.93)!important;
|
| 358 |
-
box-shadow:
|
| 359 |
-
0 4px 20px rgba(229,9,20,0.40),
|
| 360 |
-
0 1px 0 rgba(255,255,255,0.10) inset!important;
|
| 361 |
-
}
|
| 362 |
-
|
| 363 |
-
/* Non-CTA buttons default (for sign out) */
|
| 364 |
-
.stButton>button{
|
| 365 |
-
background:linear-gradient(135deg,#E50914 0%,#b5000e 100%)!important;
|
| 366 |
-
color:#fff!important;
|
| 367 |
-
border:none!important;
|
| 368 |
-
border-radius:10px!important;
|
| 369 |
-
font-family:'DM Sans',sans-serif!important;
|
| 370 |
-
font-size:1.05rem!important;font-weight:700!important;
|
| 371 |
-
padding:16px 40px!important;
|
| 372 |
-
letter-spacing:0.6px!important;
|
| 373 |
-
transition:transform 0.2s cubic-bezier(0.34,1.56,0.64,1),
|
| 374 |
-
box-shadow 0.2s, filter 0.2s!important;
|
| 375 |
-
box-shadow:0 6px 28px rgba(229,9,20,0.45),
|
| 376 |
-
0 1px 0 rgba(255,255,255,0.14) inset!important;
|
| 377 |
-
width:100%!important;
|
| 378 |
-
position:relative!important;
|
| 379 |
-
overflow:hidden!important;
|
| 380 |
-
}
|
| 381 |
-
.stButton>button:hover{
|
| 382 |
-
transform:translateY(-3px) scale(1.01)!important;
|
| 383 |
-
box-shadow:0 14px 44px rgba(229,9,20,0.60),
|
| 384 |
-
0 1px 0 rgba(255,255,255,0.16) inset!important;
|
| 385 |
-
filter:brightness(1.08)!important;
|
| 386 |
-
}
|
| 387 |
-
.stButton>button:active{
|
| 388 |
-
transform:translateY(0) scale(0.99)!important;
|
| 389 |
-
filter:brightness(0.95)!important;
|
| 390 |
}
|
| 391 |
|
| 392 |
/* Logout button override */
|
|
@@ -396,112 +194,34 @@ span[data-baseweb="tag"] span{color:#fff!important;font-size:0.82rem!important;f
|
|
| 396 |
color:rgba(255,255,255,0.60)!important;
|
| 397 |
padding:9px 22px!important;
|
| 398 |
font-size:0.78rem!important;
|
| 399 |
-
font-weight:600!important;
|
| 400 |
width:auto!important;
|
| 401 |
box-shadow:none!important;
|
| 402 |
-
border-radius:8px!important;
|
| 403 |
-
letter-spacing:0.5px!important;
|
| 404 |
-
backdrop-filter:blur(12px)!important;
|
| 405 |
-
transition:all 0.25s ease!important;
|
| 406 |
-
}
|
| 407 |
-
.logout-btn .stButton>button:hover{
|
| 408 |
-
border-color:rgba(255,255,255,0.45)!important;
|
| 409 |
-
color:#fff!important;
|
| 410 |
-
background:rgba(255,255,255,0.08)!important;
|
| 411 |
-
transform:none!important;
|
| 412 |
-
box-shadow:none!important;
|
| 413 |
-
filter:none!important;
|
| 414 |
-
}
|
| 415 |
-
|
| 416 |
-
/* βββ FIELD HINTS βββ */
|
| 417 |
-
.field-hint{
|
| 418 |
-
font-size:0.70rem;color:rgba(255,255,255,0.24);
|
| 419 |
-
margin-top:6px;letter-spacing:0.3px;line-height:1.6;
|
| 420 |
-
padding-left:2px;
|
| 421 |
-
font-weight:400;
|
| 422 |
-
}
|
| 423 |
-
|
| 424 |
-
/* βββ EQUIPMENT HELPER βββ */
|
| 425 |
-
.equip-note{
|
| 426 |
-
display:inline-flex;align-items:center;gap:8px;
|
| 427 |
-
font-size:0.74rem;color:rgba(255,255,255,0.30);
|
| 428 |
-
margin-top:8px;
|
| 429 |
-
padding:10px 16px;
|
| 430 |
-
background:rgba(229,9,20,0.06);
|
| 431 |
-
border:1px solid rgba(229,9,20,0.12);
|
| 432 |
-
border-radius:10px;
|
| 433 |
-
transition:all 0.25s ease;
|
| 434 |
-
}
|
| 435 |
-
.equip-note:hover{
|
| 436 |
-
background:rgba(229,9,20,0.10);
|
| 437 |
-
border-color:rgba(229,9,20,0.22);
|
| 438 |
}
|
| 439 |
-
.equip-note span{color:rgba(229,9,20,0.75);}
|
| 440 |
|
| 441 |
-
|
| 442 |
-
.card-spacer{height:20px;}
|
| 443 |
|
| 444 |
-
/* βββ DIVIDER βββ */
|
| 445 |
-
hr{border:none!important;border-top:1px solid rgba(255,255,255,0.06)!important;margin:32px 0!important;}
|
| 446 |
-
|
| 447 |
-
/* βββ ALERTS βββ */
|
| 448 |
-
.stAlert{border-radius:10px!important;}
|
| 449 |
-
[data-testid="stNotification"]{
|
| 450 |
-
background:rgba(232,124,3,0.12)!important;
|
| 451 |
-
border:1px solid rgba(232,124,3,0.25)!important;
|
| 452 |
-
border-radius:10px!important;
|
| 453 |
-
backdrop-filter:blur(12px)!important;
|
| 454 |
-
}
|
| 455 |
-
|
| 456 |
-
/* βββ COLUMN GAP βββ */
|
| 457 |
-
[data-testid="stHorizontalBlock"]{gap:16px!important;}
|
| 458 |
-
|
| 459 |
-
/* βββ PAGE FADE IN βββ */
|
| 460 |
-
[data-testid="stAppViewContainer"]>section>div.block-container{
|
| 461 |
-
animation:prof-fade-in 0.65s cubic-bezier(0.22,1,0.36,1) both;
|
| 462 |
-
}
|
| 463 |
-
@keyframes prof-fade-in{
|
| 464 |
-
from{opacity:0;transform:translateY(18px);}
|
| 465 |
-
to{opacity:1;transform:none;}
|
| 466 |
-
}
|
| 467 |
-
|
| 468 |
-
/* βββ CARD INNER SECTIONS FADE βββ */
|
| 469 |
-
.glass-card{
|
| 470 |
-
animation:card-rise 0.7s cubic-bezier(0.22,1,0.36,1) 0.15s both;
|
| 471 |
-
}
|
| 472 |
-
@keyframes card-rise{
|
| 473 |
-
from{opacity:0;transform:translateY(12px);}
|
| 474 |
-
to{opacity:1;transform:none;}
|
| 475 |
-
}
|
| 476 |
-
|
| 477 |
-
/* βββ RESPONSIVE TWEAKS βββ */
|
| 478 |
-
@media (max-width:768px){
|
| 479 |
-
.glass-card{padding:24px 20px 20px!important;border-radius:16px!important;}
|
| 480 |
-
.hero-title{font-size:clamp(2.4rem,8vw,3.6rem)!important;}
|
| 481 |
-
[data-testid="stAppViewContainer"]>section>div.block-container{padding:0 16px 60px!important;}
|
| 482 |
-
}
|
| 483 |
</style>""", unsafe_allow_html=True)
|
| 484 |
|
| 485 |
# ββ TOPNAV ββ
|
| 486 |
col_logo, col_user, col_logout = st.columns([3, 4, 2])
|
| 487 |
with col_logo:
|
| 488 |
-
|
| 489 |
-
with col_user:
|
| 490 |
-
|
| 491 |
-
with col_logout:
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
|
| 500 |
# ββ HERO SECTION ββ
|
| 501 |
hero_html = f"""
|
| 502 |
<div class='hero-section'>
|
| 503 |
<div class='hero-content'>
|
| 504 |
-
<div style='font-family:"Inter", sans-serif; font-size:1.8rem; font-weight:700; color:white; margin-bottom:30px;
|
| 505 |
Welcome, {display_name.title()}!!
|
| 506 |
</div>
|
| 507 |
<div class='hero-title' style='margin-bottom:30px;'>
|
|
@@ -511,7 +231,6 @@ hero_html = f"""
|
|
| 511 |
<div class='hero-subtitle' style='margin-bottom:20px;'>
|
| 512 |
Fill in your profile and we'll generate a personalised AI workout plan β tailored to your body, goals and equipment.
|
| 513 |
</div>
|
| 514 |
-
<div class='hero-divider'></div>
|
| 515 |
</div>
|
| 516 |
</div>"""
|
| 517 |
st.markdown(hero_html, unsafe_allow_html=True)
|
|
@@ -519,66 +238,43 @@ st.markdown(hero_html, unsafe_allow_html=True)
|
|
| 519 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 520 |
# SECTION 1 β PERSONAL INFORMATION
|
| 521 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 522 |
-
|
| 523 |
-
|
|
|
|
|
|
|
|
|
|
| 524 |
st.markdown("<div class='field-hint'>Your first name, used to personalise your plan</div>", unsafe_allow_html=True)
|
| 525 |
|
| 526 |
c1, c2, c3, c4 = st.columns(4)
|
| 527 |
-
with c1:
|
| 528 |
-
|
| 529 |
-
with
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
with c4:
|
| 534 |
-
weight_kg = st.number_input("Weight (kg)", min_value=30, max_value=300, step=1, value=70)
|
| 535 |
-
|
| 536 |
-
st.markdown("<div class='field-hint' style='margin-top:-6px'>Height and weight are used to calculate your BMI and tailor exercise intensity</div>", unsafe_allow_html=True)
|
| 537 |
-
st.markdown("</div>", unsafe_allow_html=True)
|
| 538 |
|
| 539 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 540 |
# SECTION 2 β GOALS & EQUIPMENT
|
| 541 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 542 |
-
|
| 543 |
-
st.markdown("<
|
| 544 |
-
c5, c6 = st.columns(2)
|
| 545 |
-
with c5:
|
| 546 |
-
goal = st.selectbox("Fitness Goal", [
|
| 547 |
-
"Build Muscle","Weight Loss","Strength Gain",
|
| 548 |
-
"Abs Building","Flexibility and Mobility"
|
| 549 |
-
])
|
| 550 |
-
with c6:
|
| 551 |
-
level = st.selectbox("Fitness Level", ["Beginner","Intermediate","Advanced"])
|
| 552 |
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
st.
|
| 556 |
|
| 557 |
equipment = st.multiselect(
|
| 558 |
"Available Equipment",
|
| 559 |
-
["No Equipment
|
| 560 |
-
"Dumbbells","Resistance Band","Yoga Mat","Bench",
|
| 561 |
-
"Pullup Bar","Barbell","Kettlebell","Treadmill"],
|
| 562 |
default=[])
|
| 563 |
|
| 564 |
-
st.markdown("""<div class='equip-note'> <span>π‘</span> Select everything available β or choose <em>No Equipment</em> for a bodyweight-only plan</div>""", unsafe_allow_html=True)
|
| 565 |
-
st.markdown("</div>", unsafe_allow_html=True)
|
| 566 |
-
|
| 567 |
# ββ GENERATE BUTTON ββ
|
| 568 |
-
st.markdown("<div
|
| 569 |
st.markdown("<div class='cta-wrapper'>", unsafe_allow_html=True)
|
| 570 |
-
|
| 571 |
if st.button("β‘ Generate My Workout Plan"):
|
| 572 |
-
if not name.strip():
|
| 573 |
-
st.error("Please enter your full name.")
|
| 574 |
-
st.stop()
|
| 575 |
-
st.session_state.user_data = {
|
| 576 |
-
"name": name.strip(), "age": age, "gender": gender,
|
| 577 |
-
"height": height_cm, "weight": weight_kg,
|
| 578 |
-
"goal": goal, "level": level, "equipment": equipment
|
| 579 |
-
}
|
| 580 |
-
st.session_state.pop("workout_plan", None)
|
| 581 |
-
st.session_state.pop("plan_for", None)
|
| 582 |
st.switch_page("pages/2_Workout_Plan.py")
|
| 583 |
-
|
| 584 |
st.markdown("</div>", unsafe_allow_html=True)
|
|
|
|
| 6 |
st.set_page_config(page_title="FitPlan Pro β Profile", page_icon="β‘", layout="wide")
|
| 7 |
|
| 8 |
if not st.session_state.get("logged_in"):
|
| 9 |
+
st.switch_page("app.py")
|
| 10 |
|
| 11 |
uname = st.session_state.get("username", "Athlete")
|
| 12 |
|
| 13 |
# ββ Extract display name from email if needed ββ
|
| 14 |
def _display_name(raw: str) -> str:
|
| 15 |
+
if "@" in raw:
|
| 16 |
+
local = raw.split("@")[0]
|
| 17 |
+
# Turn "john.doe" or "john_doe" into "John Doe"
|
| 18 |
+
return " ".join(w.capitalize() for w in local.replace(".", " ").replace("_", " ").split())
|
| 19 |
+
return raw
|
| 20 |
|
| 21 |
display_name = _display_name(uname)
|
| 22 |
|
|
|
|
| 96 |
text-shadow:0 0 36px rgba(229,9,20,0.65),0 0 72px rgba(229,9,20,0.25);
|
| 97 |
}
|
| 98 |
|
| 99 |
+
/* βββ HERO SECTION βββ */
|
| 100 |
.hero-section{
|
| 101 |
position:relative;
|
| 102 |
padding:20px 0 48px;
|
| 103 |
margin-bottom:10px;
|
| 104 |
overflow:hidden;
|
| 105 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
.hero-content{position:relative;z-index:1;}
|
| 107 |
|
| 108 |
.hero-title{
|
|
|
|
| 127 |
line-height:1.7;
|
| 128 |
text-shadow:0 1px 12px rgba(0,0,0,0.5);
|
| 129 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 130 |
|
| 131 |
/* βββ UPDATED SECTION HEADERS βββ */
|
| 132 |
.custom-section-hdr {
|
|
|
|
| 134 |
font-size: 2.2rem;
|
| 135 |
color: #fff;
|
| 136 |
letter-spacing: 2px;
|
| 137 |
+
margin-bottom: 25px;
|
| 138 |
+
margin-top: 30px;
|
| 139 |
display: flex;
|
| 140 |
align-items: center;
|
| 141 |
gap: 15px;
|
|
|
|
| 156 |
border-radius:10px!important;
|
| 157 |
transition:all 0.25s cubic-bezier(0.4,0,0.2,1)!important;
|
| 158 |
}
|
| 159 |
+
div[data-baseweb="input"]:focus-within{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 160 |
background:rgba(255,255,255,0.07)!important;
|
| 161 |
border-color:rgba(229,9,20,0.70)!important;
|
| 162 |
+
box-shadow:0 0 0 3px rgba(229,9,20,0.12)!important;
|
| 163 |
}
|
| 164 |
+
div[data-baseweb="input"] input{
|
| 165 |
background:transparent!important;
|
| 166 |
color:#fff!important;
|
| 167 |
font-family:'DM Sans',sans-serif!important;
|
| 168 |
font-size:0.95rem!important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
}
|
| 170 |
|
| 171 |
+
/* βββ FIELD LABELS βββ */
|
| 172 |
+
.stTextInput label, .stNumberInput label, .stSelectbox label, .stMultiSelect label {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 173 |
color:rgba(255,255,255,0.48)!important;
|
| 174 |
font-size:0.68rem!important;font-weight:700!important;
|
| 175 |
letter-spacing:2.5px!important;text-transform:uppercase!important;
|
| 176 |
margin-bottom:8px!important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 177 |
}
|
| 178 |
|
| 179 |
+
/* βββ GENERATE BUTTON βββ */
|
| 180 |
.cta-wrapper .stButton>button{
|
| 181 |
+
background:linear-gradient(135deg,#E50914 0%,#a00008 100%)!important;
|
| 182 |
color:#fff!important;
|
|
|
|
| 183 |
border-radius:14px!important;
|
| 184 |
font-family:'DM Sans',sans-serif!important;
|
| 185 |
font-size:1.1rem!important;font-weight:700!important;
|
| 186 |
padding:18px 48px!important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
width:100%!important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
}
|
| 189 |
|
| 190 |
/* Logout button override */
|
|
|
|
| 194 |
color:rgba(255,255,255,0.60)!important;
|
| 195 |
padding:9px 22px!important;
|
| 196 |
font-size:0.78rem!important;
|
|
|
|
| 197 |
width:auto!important;
|
| 198 |
box-shadow:none!important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
}
|
|
|
|
| 200 |
|
| 201 |
+
.field-hint{ font-size:0.70rem; color:rgba(255,255,255,0.24); margin-top:6px; }
|
|
|
|
| 202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
</style>""", unsafe_allow_html=True)
|
| 204 |
|
| 205 |
# ββ TOPNAV ββ
|
| 206 |
col_logo, col_user, col_logout = st.columns([3, 4, 2])
|
| 207 |
with col_logo:
|
| 208 |
+
st.markdown("<div class='nav-logo'>β‘ FITPLAN PRO</div>", unsafe_allow_html=True)
|
| 209 |
+
with col_user:
|
| 210 |
+
st.write("")
|
| 211 |
+
with col_logout:
|
| 212 |
+
st.markdown("<div class='logout-btn'>", unsafe_allow_html=True)
|
| 213 |
+
if st.button("Sign Out"):
|
| 214 |
+
logout(st.session_state.get("username",""))
|
| 215 |
+
for k in ["logged_in","username","auth_token","user_data","workout_plan","plan_for"]:
|
| 216 |
+
st.session_state.pop(k, None)
|
| 217 |
+
st.switch_page("app.py")
|
| 218 |
+
st.markdown("</div>", unsafe_allow_html=True)
|
| 219 |
|
| 220 |
# ββ HERO SECTION ββ
|
| 221 |
hero_html = f"""
|
| 222 |
<div class='hero-section'>
|
| 223 |
<div class='hero-content'>
|
| 224 |
+
<div style='font-family:"Inter", sans-serif; font-size:1.8rem; font-weight:700; color:white; margin-bottom:30px;'>
|
| 225 |
Welcome, {display_name.title()}!!
|
| 226 |
</div>
|
| 227 |
<div class='hero-title' style='margin-bottom:30px;'>
|
|
|
|
| 231 |
<div class='hero-subtitle' style='margin-bottom:20px;'>
|
| 232 |
Fill in your profile and we'll generate a personalised AI workout plan β tailored to your body, goals and equipment.
|
| 233 |
</div>
|
|
|
|
| 234 |
</div>
|
| 235 |
</div>"""
|
| 236 |
st.markdown(hero_html, unsafe_allow_html=True)
|
|
|
|
| 238 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 239 |
# SECTION 1 β PERSONAL INFORMATION
|
| 240 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 241 |
+
# HEADING ONLY - NO OPENING GLASS DIV
|
| 242 |
+
st.markdown("<h2 style='color:white; font-family:\"Bebas Neue\", sans-serif; font-size:2.5rem; margin-top:40px; margin-bottom:10px;'>π€ PERSONAL INFORMATION</h2>", unsafe_allow_html=True)
|
| 243 |
+
|
| 244 |
+
# Actual inputs sitting directly on the background
|
| 245 |
+
name = st.text_input("Full Name", placeholder="e.g. Karthik", label_visibility="visible")
|
| 246 |
st.markdown("<div class='field-hint'>Your first name, used to personalise your plan</div>", unsafe_allow_html=True)
|
| 247 |
|
| 248 |
c1, c2, c3, c4 = st.columns(4)
|
| 249 |
+
with c1: age = st.number_input("Age", min_value=15, max_value=80, step=1, value=25)
|
| 250 |
+
with c2: gender = st.selectbox("Gender", ["Male", "Female", "Other"])
|
| 251 |
+
with c3: height_cm = st.number_input("Height (cm)", min_value=100, max_value=250, step=1, value=170)
|
| 252 |
+
with c4: weight_kg = st.number_input("Weight (kg)", min_value=30, max_value=300, step=1, value=70)
|
| 253 |
+
|
| 254 |
+
# NO CLOSING DIV HERE BECAUSE WE DIDNT OPEN ONE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 255 |
|
| 256 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 257 |
# SECTION 2 β GOALS & EQUIPMENT
|
| 258 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 259 |
+
# HEADING ONLY - NO OPENING GLASS DIV
|
| 260 |
+
st.markdown("<h2 style='color:white; font-family:\"Bebas Neue\", sans-serif; font-size:2.5rem; margin-top:40px; margin-bottom:10px;'>π― GOALS & EQUIPMENT</h2>", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 261 |
|
| 262 |
+
c5, c6 = st.columns(2)
|
| 263 |
+
with c5: goal = st.selectbox("Fitness Goal", ["Build Muscle","Weight Loss","Strength Gain","Abs Building","Flexibility"])
|
| 264 |
+
with c6: level = st.selectbox("Fitness Level", ["Beginner","Intermediate","Advanced"])
|
| 265 |
|
| 266 |
equipment = st.multiselect(
|
| 267 |
"Available Equipment",
|
| 268 |
+
["No Equipment","Dumbbells","Resistance Band","Yoga Mat","Bench","Pullup Bar","Barbell","Kettlebell","Treadmill"],
|
|
|
|
|
|
|
| 269 |
default=[])
|
| 270 |
|
|
|
|
|
|
|
|
|
|
| 271 |
# ββ GENERATE BUTTON ββ
|
| 272 |
+
st.markdown("<div style='margin-top:50px;'></div>", unsafe_allow_html=True)
|
| 273 |
st.markdown("<div class='cta-wrapper'>", unsafe_allow_html=True)
|
|
|
|
| 274 |
if st.button("β‘ Generate My Workout Plan"):
|
| 275 |
+
if not name.strip():
|
| 276 |
+
st.error("Please enter your full name.")
|
| 277 |
+
st.stop()
|
| 278 |
+
st.session_state.user_data = {"name": name.strip(), "age": age, "gender": gender, "height": height_cm, "weight": weight_kg, "goal": goal, "level": level, "equipment": equipment}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
st.switch_page("pages/2_Workout_Plan.py")
|
|
|
|
| 280 |
st.markdown("</div>", unsafe_allow_html=True)
|