srbhavya01 commited on
Commit
8d7f9a0
ยท
verified ยท
1 Parent(s): aac3a41

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +39 -25
app.py CHANGED
@@ -4,51 +4,66 @@ from emails_utils import send_otp_email
4
 
5
  st.set_page_config(page_title="FitPlan AI", layout="centered")
6
 
7
- # ------------------ CUSTOM CSS ------------------
8
 
9
  st.markdown("""
10
  <style>
11
 
12
  .stApp{
13
- background: linear-gradient(135deg,#0f172a,#020617);
14
- color:white;
 
 
 
15
  }
16
 
17
  .login-card{
18
- background: rgba(0,0,0,0.65);
 
19
  padding:40px;
20
  border-radius:20px;
21
- width:400px;
22
  margin:auto;
23
- box-shadow:0 10px 30px rgba(0,0,0,0.6);
 
24
  }
25
 
26
  .title{
27
  text-align:center;
28
  font-size:34px;
29
  font-weight:700;
 
 
 
 
 
 
 
30
  margin-bottom:25px;
31
  }
32
 
 
 
 
 
 
33
  .stTextInput input{
34
- background:#111827;
35
  color:white;
36
- border-radius:10px;
37
  }
38
 
39
  .stButton>button{
40
  width:100%;
41
- background:linear-gradient(90deg,#2563eb,#6366f1);
42
- color:white;
43
  border-radius:12px;
44
- font-weight:bold;
45
- height:45px;
 
 
 
46
  }
47
 
48
- .otp-box{
49
- text-align:center;
50
- letter-spacing:10px;
51
- font-size:20px;
52
  }
53
 
54
  </style>
@@ -62,20 +77,20 @@ if "logged_in" not in st.session_state:
62
  if "otp" not in st.session_state:
63
  st.session_state.otp = None
64
 
65
- # ------------------ LOGIN SCREEN ------------------
66
 
67
  if not st.session_state.logged_in:
68
 
69
  st.markdown('<div class="login-card">', unsafe_allow_html=True)
70
 
71
- st.markdown('<div class="title">๐Ÿ” Login To Your Account</div>', unsafe_allow_html=True)
 
72
 
73
- email = st.text_input("Email")
74
 
75
  if st.button("Send OTP"):
76
 
77
  if email:
78
-
79
  otp = generate_otp()
80
  st.session_state.otp = otp
81
 
@@ -84,9 +99,9 @@ if not st.session_state.logged_in:
84
  st.success("OTP sent to your email")
85
 
86
  else:
87
- st.warning("Enter email first")
88
 
89
- user_otp = st.text_input("Enter OTP", max_chars=6)
90
 
91
  if st.button("Verify OTP"):
92
 
@@ -97,7 +112,7 @@ if not st.session_state.logged_in:
97
  st.session_state.logged_in = True
98
  st.session_state.token = token
99
 
100
- st.success("Login Successful")
101
  st.rerun()
102
 
103
  else:
@@ -110,5 +125,4 @@ if not st.session_state.logged_in:
110
  # ------------------ AFTER LOGIN ------------------
111
 
112
  st.title("๐Ÿ‹๏ธ AI Personalized 5-Day Workout Planner")
113
-
114
- st.success("Login successful! Now generate your workout plan.")
 
4
 
5
  st.set_page_config(page_title="FitPlan AI", layout="centered")
6
 
7
+ # ------------------ CSS DESIGN ------------------
8
 
9
  st.markdown("""
10
  <style>
11
 
12
  .stApp{
13
+ background: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.85)),
14
+ url("https://images.unsplash.com/photo-1534438327276-14e5300c3a48");
15
+ background-size: cover;
16
+ background-position: center;
17
+ background-attachment: fixed;
18
  }
19
 
20
  .login-card{
21
+ background: rgba(255,255,255,0.08);
22
+ backdrop-filter: blur(10px);
23
  padding:40px;
24
  border-radius:20px;
25
+ width:420px;
26
  margin:auto;
27
+ margin-top:120px;
28
+ box-shadow:0 10px 35px rgba(0,0,0,0.6);
29
  }
30
 
31
  .title{
32
  text-align:center;
33
  font-size:34px;
34
  font-weight:700;
35
+ color:white;
36
+ margin-bottom:25px;
37
+ }
38
+
39
+ .subtitle{
40
+ text-align:center;
41
+ color:#cbd5f5;
42
  margin-bottom:25px;
43
  }
44
 
45
+ div[data-baseweb="input"]{
46
+ background:#0f172a;
47
+ border-radius:10px;
48
+ }
49
+
50
  .stTextInput input{
 
51
  color:white;
 
52
  }
53
 
54
  .stButton>button{
55
  width:100%;
56
+ height:48px;
 
57
  border-radius:12px;
58
+ border:none;
59
+ font-size:16px;
60
+ font-weight:600;
61
+ color:white;
62
+ background:linear-gradient(90deg,#3b82f6,#6366f1);
63
  }
64
 
65
+ .stButton>button:hover{
66
+ background:linear-gradient(90deg,#2563eb,#4f46e5);
 
 
67
  }
68
 
69
  </style>
 
77
  if "otp" not in st.session_state:
78
  st.session_state.otp = None
79
 
80
+ # ------------------ LOGIN PAGE ------------------
81
 
82
  if not st.session_state.logged_in:
83
 
84
  st.markdown('<div class="login-card">', unsafe_allow_html=True)
85
 
86
+ st.markdown('<div class="title">๐Ÿ’ช FitPlan AI</div>', unsafe_allow_html=True)
87
+ st.markdown('<div class="subtitle">Login to your account</div>', unsafe_allow_html=True)
88
 
89
+ email = st.text_input("๐Ÿ“ง Enter Email")
90
 
91
  if st.button("Send OTP"):
92
 
93
  if email:
 
94
  otp = generate_otp()
95
  st.session_state.otp = otp
96
 
 
99
  st.success("OTP sent to your email")
100
 
101
  else:
102
+ st.warning("Please enter email")
103
 
104
+ user_otp = st.text_input("๐Ÿ” Enter OTP")
105
 
106
  if st.button("Verify OTP"):
107
 
 
112
  st.session_state.logged_in = True
113
  st.session_state.token = token
114
 
115
+ st.success("Login Successful ๐ŸŽ‰")
116
  st.rerun()
117
 
118
  else:
 
125
  # ------------------ AFTER LOGIN ------------------
126
 
127
  st.title("๐Ÿ‹๏ธ AI Personalized 5-Day Workout Planner")
128
+ st.success("You are logged in successfully! Now generate your workout plan.")