Update app.py
Browse files
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 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
]
|
| 142 |
-
|
| 143 |
-
|
|
|
|
| 144 |
col1, col2 = st.columns([0.8, 0.2])
|
| 145 |
with col1:
|
| 146 |
-
st.
|
| 147 |
with col2:
|
| 148 |
-
if st.button("Delete", key=f"
|
| 149 |
-
del saved_data["
|
| 150 |
with open("data.txt", "w") as f:
|
| 151 |
f.write(str(saved_data))
|
| 152 |
st.rerun()
|
| 153 |
|
| 154 |
-
if st.button("Generate
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 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 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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}"):
|