JeCabrera commited on
Commit
e490fb8
·
verified ·
1 Parent(s): 97e5674

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -4
app.py CHANGED
@@ -68,13 +68,28 @@ with col1:
68
  type=['txt', 'pdf', 'docx', 'jpg', 'jpeg', 'png'])
69
 
70
  # Display success message if it exists and hasn't timed out
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  if st.session_state.success_message:
72
  current_time = time.time()
73
- # Show message for 3 seconds
74
- if current_time - st.session_state.success_time < 3:
75
- st.success(st.session_state.success_message)
76
  else:
77
- # Clear the message after timeout
78
  st.session_state.success_message = None
79
  st.session_state.success_time = None
80
  st.rerun()
 
68
  type=['txt', 'pdf', 'docx', 'jpg', 'jpeg', 'png'])
69
 
70
  # Display success message if it exists and hasn't timed out
71
+ st.markdown("""
72
+ <style>
73
+ .success {
74
+ font-weight: bold;
75
+ background-color: rgba(40, 167, 69, 0.2);
76
+ border-radius: 5px;
77
+ padding: 10px;
78
+ animation: fadeIn 0.3s ease-in;
79
+ }
80
+ @keyframes fadeIn {
81
+ from { opacity: 0; }
82
+ to { opacity: 1; }
83
+ }
84
+ </style>
85
+ """, unsafe_allow_html=True)
86
+
87
+ # Then in your success message display
88
  if st.session_state.success_message:
89
  current_time = time.time()
90
+ if current_time - st.session_state.success_time < 2:
91
+ st.markdown(f'<div class="success">{st.session_state.success_message}</div>', unsafe_allow_html=True)
 
92
  else:
 
93
  st.session_state.success_message = None
94
  st.session_state.success_time = None
95
  st.rerun()