Upload app.py
Browse files
app.py
CHANGED
|
@@ -2230,58 +2230,155 @@ with st.sidebar:
|
|
| 2230 |
# MAIN AREA
|
| 2231 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 2232 |
|
| 2233 |
-
# Welcome
|
| 2234 |
if not st.session_state.messages:
|
| 2235 |
st.markdown("""
|
| 2236 |
<style>
|
| 2237 |
@keyframes fadeInUp {
|
| 2238 |
-
from { opacity:
|
| 2239 |
-
to { opacity:
|
| 2240 |
}
|
| 2241 |
-
@keyframes
|
| 2242 |
-
0%
|
| 2243 |
-
50%
|
|
|
|
| 2244 |
}
|
| 2245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2246 |
display: flex;
|
| 2247 |
flex-direction: column;
|
| 2248 |
align-items: center;
|
| 2249 |
justify-content: center;
|
| 2250 |
-
padding:
|
| 2251 |
text-align: center;
|
| 2252 |
-
animation: fadeInUp 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2253 |
}
|
| 2254 |
-
|
| 2255 |
-
|
| 2256 |
-
|
| 2257 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2258 |
font-family: 'Inter', sans-serif;
|
| 2259 |
-
letter-spacing: 0.5px;
|
| 2260 |
-
margin-bottom: 0.6rem;
|
| 2261 |
}
|
| 2262 |
-
|
| 2263 |
-
|
| 2264 |
-
|
| 2265 |
-
|
|
|
|
|
|
|
| 2266 |
margin-bottom: 1.2rem;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2267 |
}
|
| 2268 |
-
.
|
| 2269 |
-
|
| 2270 |
-
|
| 2271 |
-
|
| 2272 |
-
|
| 2273 |
-
|
| 2274 |
-
|
| 2275 |
-
|
| 2276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2277 |
}
|
| 2278 |
</style>
|
| 2279 |
-
|
| 2280 |
-
|
| 2281 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2282 |
</div>
|
| 2283 |
""", unsafe_allow_html=True)
|
| 2284 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2285 |
# Render chat history
|
| 2286 |
for i, msg in enumerate(st.session_state.messages):
|
| 2287 |
avatar = "π§βπ" if msg["role"] == "user" else "π"
|
|
|
|
| 2230 |
# MAIN AREA
|
| 2231 |
# ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 2232 |
|
| 2233 |
+
# Welcome screen β only when no messages
|
| 2234 |
if not st.session_state.messages:
|
| 2235 |
st.markdown("""
|
| 2236 |
<style>
|
| 2237 |
@keyframes fadeInUp {
|
| 2238 |
+
from { opacity:0; transform:translateY(24px); }
|
| 2239 |
+
to { opacity:1; transform:translateY(0); }
|
| 2240 |
}
|
| 2241 |
+
@keyframes gradientShift {
|
| 2242 |
+
0% { background-position: 0% 50%; }
|
| 2243 |
+
50% { background-position: 100% 50%; }
|
| 2244 |
+
100% { background-position: 0% 50%; }
|
| 2245 |
}
|
| 2246 |
+
@keyframes floatSymbol {
|
| 2247 |
+
0%,100% { transform: translateY(0px) rotate(0deg); opacity:0.18; }
|
| 2248 |
+
33% { transform: translateY(-8px) rotate(5deg); opacity:0.32; }
|
| 2249 |
+
66% { transform: translateY(4px) rotate(-3deg); opacity:0.22; }
|
| 2250 |
+
}
|
| 2251 |
+
@keyframes spin {
|
| 2252 |
+
from { transform: rotate(0deg); }
|
| 2253 |
+
to { transform: rotate(360deg); }
|
| 2254 |
+
}
|
| 2255 |
+
.saad-welcome-wrap {
|
| 2256 |
+
position: relative;
|
| 2257 |
display: flex;
|
| 2258 |
flex-direction: column;
|
| 2259 |
align-items: center;
|
| 2260 |
justify-content: center;
|
| 2261 |
+
padding: 5rem 1rem 4rem 1rem;
|
| 2262 |
text-align: center;
|
| 2263 |
+
animation: fadeInUp 0.7s cubic-bezier(.22,1,.36,1) both;
|
| 2264 |
+
overflow: hidden;
|
| 2265 |
+
}
|
| 2266 |
+
/* Floating math symbols background */
|
| 2267 |
+
.math-bg {
|
| 2268 |
+
position: absolute;
|
| 2269 |
+
top: 0; left: 0; right: 0; bottom: 0;
|
| 2270 |
+
pointer-events: none;
|
| 2271 |
+
z-index: 0;
|
| 2272 |
+
}
|
| 2273 |
+
.math-sym {
|
| 2274 |
+
position: absolute;
|
| 2275 |
+
font-size: 1.4rem;
|
| 2276 |
+
color: #3b82f6;
|
| 2277 |
+
animation: floatSymbol 6s ease-in-out infinite;
|
| 2278 |
+
font-family: 'JetBrains Mono', monospace;
|
| 2279 |
+
user-select: none;
|
| 2280 |
}
|
| 2281 |
+
/* Main name with gradient */
|
| 2282 |
+
.saad-main-name {
|
| 2283 |
+
position: relative;
|
| 2284 |
+
z-index: 1;
|
| 2285 |
+
font-size: 3rem;
|
| 2286 |
+
font-weight: 800;
|
| 2287 |
+
background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 40%, #f472b6 70%, #60a5fa 100%);
|
| 2288 |
+
background-size: 300% 300%;
|
| 2289 |
+
-webkit-background-clip: text;
|
| 2290 |
+
-webkit-text-fill-color: transparent;
|
| 2291 |
+
background-clip: text;
|
| 2292 |
+
animation: gradientShift 4s ease infinite;
|
| 2293 |
+
letter-spacing: 1px;
|
| 2294 |
+
margin-bottom: 0.5rem;
|
| 2295 |
font-family: 'Inter', sans-serif;
|
|
|
|
|
|
|
| 2296 |
}
|
| 2297 |
+
/* Spinning math ring */
|
| 2298 |
+
.math-ring {
|
| 2299 |
+
position: relative;
|
| 2300 |
+
z-index: 1;
|
| 2301 |
+
width: 56px;
|
| 2302 |
+
height: 56px;
|
| 2303 |
margin-bottom: 1.2rem;
|
| 2304 |
+
border-radius: 50%;
|
| 2305 |
+
border: 2px solid transparent;
|
| 2306 |
+
background: linear-gradient(#0f0f0f, #0f0f0f) padding-box,
|
| 2307 |
+
linear-gradient(135deg, #3b82f6, #a78bfa, #f472b6) border-box;
|
| 2308 |
+
animation: spin 3s linear infinite;
|
| 2309 |
+
display: flex;
|
| 2310 |
+
align-items: center;
|
| 2311 |
+
justify-content: center;
|
| 2312 |
+
font-size: 1.5rem;
|
| 2313 |
}
|
| 2314 |
+
.math-ring-inner {
|
| 2315 |
+
animation: spin 3s linear infinite reverse;
|
| 2316 |
+
font-size: 1.4rem;
|
| 2317 |
+
}
|
| 2318 |
+
.saad-tagline {
|
| 2319 |
+
position: relative;
|
| 2320 |
+
z-index: 1;
|
| 2321 |
+
font-size: 0.82rem;
|
| 2322 |
+
color: #4b5563;
|
| 2323 |
+
letter-spacing: 0.4px;
|
| 2324 |
+
margin-top: 0.3rem;
|
| 2325 |
+
}
|
| 2326 |
+
.saad-tagline span {
|
| 2327 |
+
color: #374151;
|
| 2328 |
+
margin: 0 0.4rem;
|
| 2329 |
}
|
| 2330 |
</style>
|
| 2331 |
+
|
| 2332 |
+
<div class="saad-welcome-wrap">
|
| 2333 |
+
<!-- Floating math symbols -->
|
| 2334 |
+
<div class="math-bg">
|
| 2335 |
+
<span class="math-sym" style="top:10%; left:8%; animation-delay:0s;">β«</span>
|
| 2336 |
+
<span class="math-sym" style="top:20%; right:10%; animation-delay:1s;">β</span>
|
| 2337 |
+
<span class="math-sym" style="top:60%; left:5%; animation-delay:2s;">β</span>
|
| 2338 |
+
<span class="math-sym" style="top:70%; right:8%; animation-delay:0.5s;">β</span>
|
| 2339 |
+
<span class="math-sym" style="top:40%; left:15%; animation-delay:1.5s; font-size:1rem;">Ο</span>
|
| 2340 |
+
<span class="math-sym" style="top:35%; right:15%; animation-delay:2.5s; font-size:1rem;">β</span>
|
| 2341 |
+
<span class="math-sym" style="top:80%; left:20%; animation-delay:3s; font-size:0.9rem;">Ξ</span>
|
| 2342 |
+
<span class="math-sym" style="top:15%; left:40%; animation-delay:3.5s; font-size:0.85rem;">Ξ»</span>
|
| 2343 |
+
</div>
|
| 2344 |
+
<!-- Spinning ring -->
|
| 2345 |
+
<div class="math-ring">
|
| 2346 |
+
<span class="math-ring-inner">β</span>
|
| 2347 |
+
</div>
|
| 2348 |
+
<!-- Name with gradient -->
|
| 2349 |
+
<div class="saad-main-name">Saad.AI</div>
|
| 2350 |
+
<!-- Tagline -->
|
| 2351 |
+
<div class="saad-tagline">
|
| 2352 |
+
BSc Mathematics
|
| 2353 |
+
<span>Β·</span> Step-by-Step Solutions
|
| 2354 |
+
<span>Β·</span> SymPy Verified
|
| 2355 |
+
<span>Β·</span> LaTeX Rendered
|
| 2356 |
+
</div>
|
| 2357 |
</div>
|
| 2358 |
""", unsafe_allow_html=True)
|
| 2359 |
|
| 2360 |
+
# Small corner header β only when chat has started
|
| 2361 |
+
else:
|
| 2362 |
+
st.markdown("""
|
| 2363 |
+
<style>
|
| 2364 |
+
@keyframes fadeIn { from { opacity:0; } to { opacity:1; } }
|
| 2365 |
+
.saad-corner {
|
| 2366 |
+
font-size: 0.88rem;
|
| 2367 |
+
font-weight: 600;
|
| 2368 |
+
background: linear-gradient(135deg, #60a5fa, #a78bfa);
|
| 2369 |
+
-webkit-background-clip: text;
|
| 2370 |
+
-webkit-text-fill-color: transparent;
|
| 2371 |
+
background-clip: text;
|
| 2372 |
+
letter-spacing: 0.3px;
|
| 2373 |
+
margin-bottom: 0.6rem;
|
| 2374 |
+
padding: 0.1rem 0;
|
| 2375 |
+
animation: fadeIn 0.4s ease both;
|
| 2376 |
+
font-family: 'Inter', sans-serif;
|
| 2377 |
+
}
|
| 2378 |
+
</style>
|
| 2379 |
+
<div class="saad-corner">β Saad.AI</div>
|
| 2380 |
+
""", unsafe_allow_html=True)
|
| 2381 |
+
|
| 2382 |
# Render chat history
|
| 2383 |
for i, msg in enumerate(st.session_state.messages):
|
| 2384 |
avatar = "π§βπ" if msg["role"] == "user" else "π"
|