lanna_lalala;- commited on
Commit
6971068
ยท
1 Parent(s): 14f0eb2

welcome css try

Browse files
Files changed (2) hide show
  1. assets/logo.png +3 -0
  2. phase/welcome.py +144 -1
assets/logo.png ADDED

Git LFS Details

  • SHA256: de4e1d2823ef2c4567a0c5d2907e598155ea81660f10f60ceaa111d58ada3b94
  • Pointer size: 130 Bytes
  • Size of remote file: 80 kB
phase/welcome.py CHANGED
@@ -1,11 +1,154 @@
1
  # phase/Welcome.py
2
  import streamlit as st
 
3
 
4
  def show_page():
5
- st.title("๐Ÿ’น Welcome to FinEdu App")
6
  if st.session_state.user:
7
  st.success(f"Welcome back, {st.session_state.user['name']}! โœ…")
8
  st.write(
9
  "This app helps you improve your **financial education and numeracy skills**. \n"
10
  "๐Ÿ‘‰ Use the sidebar to **Signup** or **Login** to get started."
11
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # phase/Welcome.py
2
  import streamlit as st
3
+ from PIL import Image
4
 
5
  def show_page():
6
+ st.title("๐Ÿ’น Welcome to $mart Kids App")
7
  if st.session_state.user:
8
  st.success(f"Welcome back, {st.session_state.user['name']}! โœ…")
9
  st.write(
10
  "This app helps you improve your **financial education and numeracy skills**. \n"
11
  "๐Ÿ‘‰ Use the sidebar to **Signup** or **Login** to get started."
12
  )
13
+
14
+ # Load images
15
+ logo = Image.open("assets/logo.png")
16
+ banner = "assets/welcome-banner.png" # used as CSS background
17
+
18
+ # Dummy role for now (could be replaced with session state or login)
19
+ role = st.success(f"Welcome back, {st.session_state.user['name']}! โœ…")
20
+
21
+ # ---------- CSS Styling ----------
22
+ st.markdown("""
23
+ <style>
24
+ body {
25
+ font-family: 'Segoe UI', sans-serif;
26
+ background: #f9f9fb;
27
+ }
28
+
29
+ .hero {
30
+ position: relative;
31
+ padding: 4rem 2rem;
32
+ text-align: center;
33
+ background: linear-gradient(to right, #8EC5FC, #E0C3FC);
34
+ color: white;
35
+ }
36
+
37
+ .hero::before {
38
+ content: "";
39
+ background-image: url("data:image/png;base64, """ + banner + """");
40
+ position: absolute;
41
+ opacity: 0.1;
42
+ inset: 0;
43
+ background-size: cover;
44
+ background-position: center;
45
+ }
46
+
47
+ .badge {
48
+ display: inline-block;
49
+ padding: 0.5rem 1rem;
50
+ background: white;
51
+ color: #333;
52
+ margin: 0.25rem;
53
+ border-radius: 10px;
54
+ font-weight: 600;
55
+ box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
56
+ }
57
+
58
+ .card {
59
+ background: white;
60
+ border-radius: 12px;
61
+ padding: 2rem;
62
+ margin-bottom: 2rem;
63
+ box-shadow: 0 5px 15px rgba(0,0,0,0.1);
64
+ text-align: center;
65
+ }
66
+
67
+ .card-icon {
68
+ font-size: 2rem;
69
+ margin-bottom: 1rem;
70
+ }
71
+ </style>
72
+ """, unsafe_allow_html=True)
73
+
74
+ # ---------- Hero Section ----------
75
+ st.markdown(f"""
76
+ <div class="hero">
77
+ <img src="data:image/png;base64,{logo}" width="120" style="margin-bottom:1rem;" />
78
+ <h1>Welcome to FinanceLearn! ๐Ÿ’–</h1>
79
+ <p style="font-size: 1.2rem; max-width: 700px; margin: auto;">
80
+ The fun and engaging platform that makes financial literacy accessible for students and easy to teach! โœจ๐ŸŒŸ
81
+ </p>
82
+ <div style="margin-top:2rem;">
83
+ <div class="badge">โค๏ธ Made with love for young learners</div>
84
+ <div class="badge">๐Ÿ‘จโ€๐Ÿซ Perfect for classrooms and individuals</div>
85
+ <div class="badge">๐Ÿ“š Curriculum-aligned content</div>
86
+ </div>
87
+ </div>
88
+ """, unsafe_allow_html=True)
89
+
90
+ # ---------- What is FinanceLearn ----------
91
+ st.header("โœจ What is FinanceLearn? ๐ŸŽˆ")
92
+ st.write("FinanceLearn is an interactive educational platform designed to teach financial literacy through fun, engaging activities. Perfect for both classroom learning and individual exploration! โœจ")
93
+
94
+ # ---------- Demo Video Placeholder ----------
95
+ st.markdown("""
96
+ <div class="card">
97
+ <div class="card-icon">๐ŸŽฌ</div>
98
+ <h3>See How It Works! ๐ŸŒˆ</h3>
99
+ <div style="padding: 2rem; background: #f1f1f1; border-radius: 10px;">
100
+ <div class="card-icon">โ–ถ๏ธ</div>
101
+ <p><strong>Demo Video Coming Soon! ๐ŸŽฅโœจ</strong></p>
102
+ <p>Watch students learn and teachers teach with FinanceLearn</p>
103
+ </div>
104
+ </div>
105
+ """, unsafe_allow_html=True)
106
+
107
+ # ---------- Platform Features ----------
108
+ st.subheader("๐Ÿš€ Features")
109
+ col1, col2, col3, col4 = st.columns(4)
110
+
111
+ features = [
112
+ ("๐Ÿ“–", "Interactive Lessons", "Engaging content that makes financial literacy fun and accessible for all ages!"),
113
+ ("๐ŸŽฎ", "Educational Games", "Learn through play with our collection of money management games and challenges!"),
114
+ ("๐Ÿ†", "Progress Tracking", "Monitor learning progress with quizzes, achievements, and detailed analytics!"),
115
+ ("๐Ÿค–", "AI Assistant", "Get instant help and personalized guidance from our friendly chatbot!")
116
+ ]
117
+
118
+ for col, (icon, title, desc) in zip([col1, col2, col3, col4], features):
119
+ with col:
120
+ st.markdown(f"""
121
+ <div class="card">
122
+ <div class="card-icon">{icon}</div>
123
+ <h4>{title}</h4>
124
+ <p style="font-size:0.9rem;">{desc}</p>
125
+ </div>
126
+ """, unsafe_allow_html=True)
127
+
128
+ # ---------- Get Started Section ----------
129
+ st.subheader("๐ŸŽ“ Get Started")
130
+
131
+ left, right = st.columns(2)
132
+
133
+ with left:
134
+ st.markdown("""
135
+ <div class="card" style="background: linear-gradient(to right, #D3CCE3, #E9E4F0); color: #333;">
136
+ <div class="card-icon">๐Ÿ‘ฆ๐Ÿ‘ง</div>
137
+ <h3>For Students</h3>
138
+ <p>Start your financial learning journey with games, lessons, and fun challenges!</p>
139
+ </div>
140
+ """, unsafe_allow_html=True)
141
+ if st.button("๐Ÿš€ Start Learning!"):
142
+ st.success("Redirecting to Student Dashboard...")
143
+
144
+ with right:
145
+ st.markdown("""
146
+ <div class="card" style="background: linear-gradient(to right, #30E8BF, #FF8235); color: #fff;">
147
+ <div class="card-icon">๐Ÿ‘ฉโ€๐Ÿซ</div>
148
+ <h3>For Teachers</h3>
149
+ <p>Manage your classroom, track progress, and engage your students with financial education!</p>
150
+ </div>
151
+ """, unsafe_allow_html=True)
152
+ if st.button("๐Ÿ“Š Teacher Dashboard"):
153
+ st.success("Redirecting to Teacher Dashboard...")
154
+