lanna_lalala;- commited on
Commit
78f9beb
·
1 Parent(s): b2239bd

welcome css try

Browse files
Files changed (1) hide show
  1. phase/welcome.py +10 -0
phase/welcome.py CHANGED
@@ -3,6 +3,14 @@ from PIL import Image
3
  import base64
4
  import os
5
 
 
 
 
 
 
 
 
 
6
  @st.cache_data
7
  def get_base64_img(image_path):
8
  if not os.path.exists(image_path):
@@ -150,6 +158,8 @@ def welcomeui():
150
  st.rerun()
151
 
152
  def show_page():
 
 
153
  st.title("💹 Welcome to $mart Kids App")
154
 
155
  # ✅ Only show this when user is logged in
 
3
  import base64
4
  import os
5
 
6
+ # --- Load external CSS (optional) ---
7
+ def load_css(file_name: str):
8
+ try:
9
+ with open(file_name, "r", encoding="utf-8") as f:
10
+ st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
11
+ except FileNotFoundError:
12
+ st.warning("⚠️ Stylesheet not found. Please ensure 'assets/styles.css' exists.")
13
+
14
  @st.cache_data
15
  def get_base64_img(image_path):
16
  if not os.path.exists(image_path):
 
158
  st.rerun()
159
 
160
  def show_page():
161
+ load_css(os.path.join("assets", "styles.css"))
162
+
163
  st.title("💹 Welcome to $mart Kids App")
164
 
165
  # ✅ Only show this when user is logged in