Mavhas commited on
Commit
4b65f05
·
verified ·
1 Parent(s): a534dba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -3
app.py CHANGED
@@ -8,10 +8,20 @@ st.set_page_config(page_title="Valentine's Day Surprise", page_icon="❤️", la
8
 
9
  # --- Startup Page ---
10
  if not st.session_state.get('password_entered', False):
 
 
 
 
 
 
 
 
 
 
 
11
  st.markdown(
12
  """
13
  <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh;">
14
- <img src="YOUR_GIF_URL_HERE" width="200" style="margin-bottom: 20px;">
15
  <h1 style="color: #f08080; font-family: 'Arial', sans-serif;">Happy Valentine's Day!</h1>
16
  <p style="font-size: 1.2em; margin-bottom: 30px;">Enter the secret word to unlock the surprise:</p>
17
  </div>
@@ -20,7 +30,7 @@ if not st.session_state.get('password_entered', False):
20
  )
21
 
22
  password_entered = st.text_input("", type="password", placeholder="Enter the secret word")
23
- correct_password = "yoursecretword" # Replace with your secret word
24
 
25
  if password_entered == correct_password:
26
  st.session_state.password_entered = True
@@ -29,7 +39,6 @@ if not st.session_state.get('password_entered', False):
29
  elif password_entered:
30
  st.error("Incorrect secret word. Try again.")
31
 
32
-
33
  # --- Main Content (after password entered) ---
34
  if st.session_state.get('password_entered', False):
35
  # Load previous data (if it exists)
 
8
 
9
  # --- Startup Page ---
10
  if not st.session_state.get('password_entered', False):
11
+ # Option 1: Using a local image file (recommended for privacy)
12
+ try:
13
+ image = Image.open("hvd.jpeg") # Replace "your_image.jpg" with your image file
14
+ st.image(image, width=200) # Adjust width as needed
15
+ except FileNotFoundError:
16
+ st.error("Image file not found. Please place 'your_image.jpg' in the same directory as your script.")
17
+ # Provide a default image or message here if needed.
18
+
19
+ # Option 2: Using an image URL (if you don't mind the image being publicly accessible)
20
+ # st.image("YOUR_IMAGE_URL_HERE", width=200) # Replace with your image URL
21
+
22
  st.markdown(
23
  """
24
  <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100vh;">
 
25
  <h1 style="color: #f08080; font-family: 'Arial', sans-serif;">Happy Valentine's Day!</h1>
26
  <p style="font-size: 1.2em; margin-bottom: 30px;">Enter the secret word to unlock the surprise:</p>
27
  </div>
 
30
  )
31
 
32
  password_entered = st.text_input("", type="password", placeholder="Enter the secret word")
33
+ correct_password = "anna" # Replace with your secret word
34
 
35
  if password_entered == correct_password:
36
  st.session_state.password_entered = True
 
39
  elif password_entered:
40
  st.error("Incorrect secret word. Try again.")
41
 
 
42
  # --- Main Content (after password entered) ---
43
  if st.session_state.get('password_entered', False):
44
  # Load previous data (if it exists)