Mavhas commited on
Commit
5352193
·
verified ·
1 Parent(s): 06e636c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +49 -25
app.py CHANGED
@@ -131,41 +131,65 @@ if st.session_state.get('password_entered', False):
131
  """,
132
  unsafe_allow_html=True,
133
  )
134
- elif selected_tab == "Messages":
135
- st.write("## Sweet Messages")
136
 
137
- messages = [
138
- "I love you more than words can say.",
139
- "You're my everything.",
140
- # ... (rest of your messages)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  ]
142
- if saved_data["messages"]:
143
- for i, message in enumerate(saved_data["messages"]):
 
144
  col1, col2 = st.columns([0.8, 0.2])
145
  with col1:
146
- st.markdown(f"<div style='background-color: #ffe6f2; padding: 10px; border-radius: 5px; margin-bottom: 10px;'>{message}</div>", unsafe_allow_html=True)
147
  with col2:
148
- if st.button("Delete", key=f"delete_message_{i}"):
149
- del saved_data["messages"][i]
150
  with open("data.txt", "w") as f:
151
  f.write(str(saved_data))
152
  st.rerun()
153
 
154
- if st.button("Generate Message"):
155
- random_message = random.choice(messages)
156
- html_string = f"""<div style='background-color: #ffe6f2; padding: 10px; border-radius: 5px; margin-bottom: 10px;'>{random_message}</div>""" # Corrected line
157
- st.markdown(html_string, unsafe_allow_html=True)
158
- saved_data["messages"].append(random_message)
159
  with open("data.txt", "w") as f:
160
  f.write(str(saved_data))
161
  st.rerun()
 
 
162
 
163
- # Custom message area
164
- custom_message = st.text_area("Write a personal message for her:", height=100)
165
- if st.button("Save Custom Message"):
166
- if custom_message:
167
- saved_data["messages"].append(custom_message)
168
- with open("data.txt", "w") as f:
169
- f.write(str(saved_data))
170
- st.success("Custom message saved!")
171
- st.rerun()
 
 
 
 
 
 
 
 
 
 
 
131
  """,
132
  unsafe_allow_html=True,
133
  )
 
 
134
 
135
+ # Tabs
136
+ tabs = ["Compliments", "Messages", "Reasons"]
137
+ selected_tab = st.sidebar.radio("Select a tab:", tabs)
138
+
139
+ if selected_tab == "Compliments":
140
+ st.write("## Sweet Compliments")
141
+
142
+ compliments = [
143
+ "You have the most beautiful smile.",
144
+ "Your kindness is inspiring.",
145
+ "You’re incredibly intelligent and witty.",
146
+ "You make every day an adventure.",
147
+ "Your laugh is contagious and makes me so happy.",
148
+ "You have a heart of gold.",
149
+ "You’re the most supportive person I know.",
150
+ "You have amazing taste in everything.",
151
+ "You’re my best friend and my soulmate.",
152
+ "You’re simply amazing!"
153
  ]
154
+
155
+ if saved_data["compliments"]:
156
+ for i, compliment in enumerate(saved_data["compliments"]):
157
  col1, col2 = st.columns([0.8, 0.2])
158
  with col1:
159
+ st.write(f"{i+1}. {compliment}")
160
  with col2:
161
+ if st.button("Delete", key=f"delete_compliment_{i}"):
162
+ del saved_data["compliments"][i]
163
  with open("data.txt", "w") as f:
164
  f.write(str(saved_data))
165
  st.rerun()
166
 
167
+ if st.button("Generate Compliment"):
168
+ random_compliment = random.choice(compliments)
169
+ st.write(f"💖 {random_compliment}")
170
+ saved_data["compliments"].append(random_compliment)
 
171
  with open("data.txt", "w") as f:
172
  f.write(str(saved_data))
173
  st.rerun()
174
+ elif selected_tab == "Messages":
175
+ st.write("## Sweet Messages")
176
 
177
+ messages = [
178
+ "I love you more than words can say.",
179
+ "You're my everything.",
180
+ "You make me happier than I ever thought I could be.",
181
+ "I'm so lucky to have you in my life.",
182
+ "You're the most amazing woman I know.",
183
+ "I can't imagine my life without you.",
184
+ "You're my best friend, my lover, and my soulmate.",
185
+ "I cherish every moment I spend with you.",
186
+ "You're the most beautiful woman in the world.",
187
+ "I'm so grateful for your love and support."
188
+ ]
189
+ if saved_data["messages"]:
190
+ for i, message in enumerate(saved_data["messages"]):
191
+ col1, col2 = st.columns([0.8, 0.2])
192
+ with col1:
193
+ st.markdown(f"<div style='background-color: #ffe6f2; padding: 10px; border-radius: 5px; margin-bottom: 10px;'>{message}</div>", unsafe_allow_html=True)
194
+ with col2:
195
+ if st.button("Delete", key=f"delete_message_{i}"):