saad-sust commited on
Commit
dc6cd80
Β·
verified Β·
1 Parent(s): 0be6505

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +128 -31
app.py CHANGED
@@ -2230,58 +2230,155 @@ with st.sidebar:
2230
  # MAIN AREA
2231
  # ════════════════════════════════════════════════════════════════════
2232
 
2233
- # Welcome message if no chat
2234
  if not st.session_state.messages:
2235
  st.markdown("""
2236
  <style>
2237
  @keyframes fadeInUp {
2238
- from { opacity: 0; transform: translateY(20px); }
2239
- to { opacity: 1; transform: translateY(0); }
2240
  }
2241
- @keyframes blink {
2242
- 0%, 100% { opacity: 1; }
2243
- 50% { opacity: 0; }
 
2244
  }
2245
- .saad-welcome {
 
 
 
 
 
 
 
 
 
 
2246
  display: flex;
2247
  flex-direction: column;
2248
  align-items: center;
2249
  justify-content: center;
2250
- padding: 6rem 1rem 4rem 1rem;
2251
  text-align: center;
2252
- animation: fadeInUp 0.6s ease both;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2253
  }
2254
- .saad-name {
2255
- font-size: 2.6rem;
2256
- font-weight: 700;
2257
- color: #ffffff;
 
 
 
 
 
 
 
 
 
 
2258
  font-family: 'Inter', sans-serif;
2259
- letter-spacing: 0.5px;
2260
- margin-bottom: 0.6rem;
2261
  }
2262
- .saad-sub {
2263
- font-size: 0.88rem;
2264
- color: #4b5563;
2265
- letter-spacing: 0.3px;
 
 
2266
  margin-bottom: 1.2rem;
 
 
 
 
 
 
 
 
 
2267
  }
2268
- .saad-cursor {
2269
- display: inline-block;
2270
- width: 2px;
2271
- height: 1.4rem;
2272
- background: #3b82f6;
2273
- margin-left: 4px;
2274
- vertical-align: middle;
2275
- animation: blink 1s step-start infinite;
2276
- border-radius: 1px;
 
 
 
 
 
 
2277
  }
2278
  </style>
2279
- <div class="saad-welcome">
2280
- <div class="saad-name">Saad.AI <span class="saad-cursor"></span></div>
2281
- <div class="saad-sub">BSc Mathematics Β· Step-by-Step Β· SymPy Verified Β· LaTeX Rendered</div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 "πŸ“"