Spaces:
Sleeping
Sleeping
UI/UX Redesign: Clean Chat-Style Interface - User Friendly
Browse files
app.py
CHANGED
|
@@ -2200,31 +2200,24 @@ def _format_final(steps_done, crew_member, final_text):
|
|
| 2200 |
# ============================================================
|
| 2201 |
|
| 2202 |
GEMINI_CSS = """
|
| 2203 |
-
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700
|
| 2204 |
|
| 2205 |
:root {
|
| 2206 |
-
--
|
| 2207 |
-
--
|
| 2208 |
-
--
|
| 2209 |
-
--
|
| 2210 |
-
--
|
| 2211 |
-
--
|
| 2212 |
-
--
|
| 2213 |
-
--
|
| 2214 |
-
--
|
| 2215 |
-
--
|
| 2216 |
-
--
|
| 2217 |
-
--
|
| 2218 |
-
--
|
| 2219 |
-
--
|
| 2220 |
-
--
|
| 2221 |
-
--ai-text: #e8eaed;
|
| 2222 |
-
--ai-text2: #9aa0a6;
|
| 2223 |
-
--ai-text3: #5f6368;
|
| 2224 |
-
--ai-accent: #8ab4f8;
|
| 2225 |
-
--ai-user-bg: rgba(138,180,248,0.12);
|
| 2226 |
-
--ai-bot-bg: rgba(255,255,255,0.03);
|
| 2227 |
-
--ai-glow: rgba(138,180,248,0.15);
|
| 2228 |
--font-main: 'Inter', 'Noto Sans Myanmar', system-ui, -apple-system, sans-serif;
|
| 2229 |
--font-mono: 'JetBrains Mono', 'Courier New', monospace;
|
| 2230 |
}
|
|
@@ -2232,237 +2225,115 @@ GEMINI_CSS = """
|
|
| 2232 |
* { box-sizing: border-box; margin: 0; padding: 0; }
|
| 2233 |
|
| 2234 |
body {
|
| 2235 |
-
background: var(--
|
| 2236 |
font-family: var(--font-main) !important;
|
| 2237 |
-webkit-font-smoothing: antialiased;
|
| 2238 |
-moz-osx-font-smoothing: grayscale;
|
| 2239 |
overflow-x: hidden;
|
|
|
|
| 2240 |
}
|
| 2241 |
|
| 2242 |
-
/* =====
|
| 2243 |
-
.ambient-bg {
|
| 2244 |
-
position: fixed;
|
| 2245 |
-
top: 0; left: 0; width: 100%; height: 100%;
|
| 2246 |
-
pointer-events: none;
|
| 2247 |
-
z-index: 0;
|
| 2248 |
-
overflow: hidden;
|
| 2249 |
-
}
|
| 2250 |
-
.ambient-orb {
|
| 2251 |
-
position: absolute;
|
| 2252 |
-
border-radius: 50%;
|
| 2253 |
-
filter: blur(120px);
|
| 2254 |
-
opacity: 0.15;
|
| 2255 |
-
animation: orb-float 20s ease-in-out infinite;
|
| 2256 |
-
}
|
| 2257 |
-
.ambient-orb:nth-child(1) {
|
| 2258 |
-
width: 600px; height: 600px;
|
| 2259 |
-
background: radial-gradient(circle, #8ab4f8, transparent 70%);
|
| 2260 |
-
top: -200px; left: -100px;
|
| 2261 |
-
animation-delay: 0s;
|
| 2262 |
-
}
|
| 2263 |
-
.ambient-orb:nth-child(2) {
|
| 2264 |
-
width: 500px; height: 500px;
|
| 2265 |
-
background: radial-gradient(circle, #c58af9, transparent 70%);
|
| 2266 |
-
top: 50%; right: -150px;
|
| 2267 |
-
animation-delay: -7s;
|
| 2268 |
-
}
|
| 2269 |
-
.ambient-orb:nth-child(3) {
|
| 2270 |
-
width: 400px; height: 400px;
|
| 2271 |
-
background: radial-gradient(circle, #f28b82, transparent 70%);
|
| 2272 |
-
bottom: -100px; left: 30%;
|
| 2273 |
-
animation-delay: -14s;
|
| 2274 |
-
}
|
| 2275 |
-
@keyframes orb-float {
|
| 2276 |
-
0%, 100% { transform: translate(0, 0) scale(1); }
|
| 2277 |
-
33% { transform: translate(30px, -40px) scale(1.1); }
|
| 2278 |
-
66% { transform: translate(-20px, 20px) scale(0.95); }
|
| 2279 |
-
}
|
| 2280 |
-
|
| 2281 |
.gradio-container {
|
| 2282 |
-
max-width:
|
| 2283 |
margin: 0 auto !important;
|
| 2284 |
font-family: var(--font-main) !important;
|
| 2285 |
background: transparent !important;
|
| 2286 |
-
padding: 0
|
| 2287 |
-
position: relative;
|
| 2288 |
-
z-index: 1;
|
| 2289 |
}
|
| 2290 |
|
| 2291 |
/* ===== HEADER ===== */
|
| 2292 |
-
.
|
| 2293 |
text-align: center;
|
| 2294 |
-
padding:
|
| 2295 |
-
position: relative;
|
| 2296 |
}
|
| 2297 |
-
.
|
| 2298 |
display: inline-flex;
|
| 2299 |
align-items: center;
|
| 2300 |
justify-content: center;
|
| 2301 |
-
gap:
|
| 2302 |
-
margin-bottom:
|
| 2303 |
}
|
| 2304 |
-
.
|
| 2305 |
-
width:
|
| 2306 |
-
background: linear-gradient(135deg,
|
| 2307 |
-
border-radius:
|
| 2308 |
display: flex; align-items: center; justify-content: center;
|
| 2309 |
-
font-size:
|
| 2310 |
-
box-shadow: 0
|
| 2311 |
-
|
| 2312 |
-
position: relative;
|
| 2313 |
-
overflow: hidden;
|
| 2314 |
}
|
| 2315 |
-
.
|
| 2316 |
-
|
| 2317 |
-
|
| 2318 |
-
|
| 2319 |
-
|
| 2320 |
-
|
| 2321 |
-
|
| 2322 |
-
|
| 2323 |
-
|
| 2324 |
-
|
| 2325 |
-
50% { box-shadow: 0 12px 44px rgba(197,138,249,0.4), 0 0 0 1px rgba(255,255,255,0.15) inset; transform: scale(1.03); }
|
| 2326 |
-
}
|
| 2327 |
-
@keyframes shimmer {
|
| 2328 |
-
0% { transform: translateX(-100%) rotate(25deg); }
|
| 2329 |
-
100% { transform: translateX(100%) rotate(25deg); }
|
| 2330 |
-
}
|
| 2331 |
-
.ai-title {
|
| 2332 |
-
font-size: 36px;
|
| 2333 |
-
font-weight: 800;
|
| 2334 |
-
background: linear-gradient(135deg, #8ab4f8 0%, #c58af9 30%, #f28b82 60%, #fdd663 100%);
|
| 2335 |
-
-webkit-background-clip: text;
|
| 2336 |
-
-webkit-text-fill-color: transparent;
|
| 2337 |
-
background-clip: text;
|
| 2338 |
-
letter-spacing: -1px;
|
| 2339 |
-
background-size: 200% auto;
|
| 2340 |
-
animation: gradient-shift 6s ease infinite;
|
| 2341 |
-
}
|
| 2342 |
-
@keyframes gradient-shift {
|
| 2343 |
-
0%, 100% { background-position: 0% center; }
|
| 2344 |
-
50% { background-position: 100% center; }
|
| 2345 |
-
}
|
| 2346 |
-
.ai-subtitle {
|
| 2347 |
-
color: var(--ai-text2);
|
| 2348 |
-
font-size: 14px;
|
| 2349 |
-
margin-top: 6px;
|
| 2350 |
-
letter-spacing: 0.5px;
|
| 2351 |
font-weight: 400;
|
| 2352 |
}
|
| 2353 |
|
| 2354 |
/* ===== STATS BAR ===== */
|
| 2355 |
-
.
|
| 2356 |
display: flex;
|
| 2357 |
justify-content: center;
|
| 2358 |
-
gap: 8px;
|
| 2359 |
-
padding: 12px 0 4px;
|
| 2360 |
-
flex-wrap: wrap;
|
| 2361 |
-
}
|
| 2362 |
-
.ai-stat-chip {
|
| 2363 |
-
display: inline-flex;
|
| 2364 |
align-items: center;
|
| 2365 |
gap: 6px;
|
| 2366 |
-
padding:
|
| 2367 |
-
|
| 2368 |
-
background: var(--ai-glass);
|
| 2369 |
-
border: 1px solid var(--ai-border);
|
| 2370 |
font-size: 13px;
|
| 2371 |
-
color: var(--
|
| 2372 |
-
backdrop-filter: blur(12px);
|
| 2373 |
-
-webkit-backdrop-filter: blur(12px);
|
| 2374 |
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 2375 |
-
}
|
| 2376 |
-
.ai-stat-chip:hover {
|
| 2377 |
-
background: var(--ai-glass2);
|
| 2378 |
-
border-color: var(--ai-border2);
|
| 2379 |
-
transform: translateY(-2px);
|
| 2380 |
-
box-shadow: 0 8px 24px rgba(0,0,0,0.3);
|
| 2381 |
-
}
|
| 2382 |
-
.ai-stat-chip .stat-val {
|
| 2383 |
-
font-weight: 700;
|
| 2384 |
-
font-size: 14px;
|
| 2385 |
}
|
| 2386 |
-
.
|
| 2387 |
-
|
| 2388 |
-
|
| 2389 |
-
.stat-green .stat-val { color: #81c995; }
|
| 2390 |
-
|
| 2391 |
-
/* ===== CREW PILLS - GLASS ===== */
|
| 2392 |
-
.crew-pills {
|
| 2393 |
-
display: flex;
|
| 2394 |
-
flex-wrap: wrap;
|
| 2395 |
-
justify-content: center;
|
| 2396 |
-
gap: 5px;
|
| 2397 |
-
padding: 10px 4px 6px;
|
| 2398 |
-
max-width: 800px;
|
| 2399 |
-
margin: 0 auto;
|
| 2400 |
}
|
| 2401 |
-
.crew-
|
| 2402 |
-
|
| 2403 |
-
|
| 2404 |
-
gap: 4px;
|
| 2405 |
-
padding: 4px 10px;
|
| 2406 |
-
border-radius: 20px;
|
| 2407 |
-
background: var(--ai-glass);
|
| 2408 |
-
border: 1px solid var(--ai-border);
|
| 2409 |
-
font-size: 12px;
|
| 2410 |
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 2411 |
-
cursor: default;
|
| 2412 |
-
white-space: nowrap;
|
| 2413 |
-
backdrop-filter: blur(8px);
|
| 2414 |
-
-webkit-backdrop-filter: blur(8px);
|
| 2415 |
}
|
| 2416 |
-
.crew-
|
| 2417 |
-
|
| 2418 |
-
|
| 2419 |
-
transform: translateY(-2px) scale(1.04);
|
| 2420 |
-
box-shadow: 0 6px 20px rgba(0,0,0,0.3);
|
| 2421 |
}
|
| 2422 |
-
.pill-emoji { font-size: 13px; }
|
| 2423 |
-
.pill-name { color: var(--ai-text2); font-weight: 500; font-size: 11.5px; }
|
| 2424 |
|
| 2425 |
-
/* ===== CHATBOT
|
| 2426 |
.chatbot {
|
| 2427 |
-
background: var(--
|
| 2428 |
-
border: 1px solid var(--
|
| 2429 |
-
border-radius:
|
| 2430 |
-
min-height:
|
| 2431 |
-
backdrop-filter: blur(20px) !important;
|
| 2432 |
-
-webkit-backdrop-filter: blur(20px) !important;
|
| 2433 |
-
box-shadow: 0 4px 24px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(255,255,255,0.05) !important;
|
| 2434 |
}
|
| 2435 |
|
| 2436 |
/* User message bubble */
|
| 2437 |
.chatbot .message.user {
|
| 2438 |
-
background: var(--
|
| 2439 |
-
border-radius:
|
| 2440 |
-
padding:
|
| 2441 |
-
margin-left:
|
| 2442 |
-
border: 1px solid
|
| 2443 |
-
backdrop-filter: blur(8px) !important;
|
| 2444 |
-
box-shadow: 0 2px 12px rgba(138,180,248,0.08) !important;
|
| 2445 |
}
|
| 2446 |
|
| 2447 |
/* Assistant message bubble */
|
| 2448 |
.chatbot .message.assistant,
|
| 2449 |
.chatbot .message.bot {
|
| 2450 |
-
background: var(--
|
| 2451 |
-
border-radius:
|
| 2452 |
-
padding:
|
| 2453 |
-
margin-right:
|
| 2454 |
-
border: 1px solid var(--
|
| 2455 |
-
backdrop-filter: blur(8px) !important;
|
| 2456 |
-
box-shadow: 0 2px 12px rgba(0,0,0,0.15) !important;
|
| 2457 |
}
|
| 2458 |
|
| 2459 |
/* Message text */
|
| 2460 |
.chatbot .message p,
|
| 2461 |
.chatbot .message span,
|
| 2462 |
.chatbot .message div {
|
| 2463 |
-
font-size:
|
| 2464 |
-
line-height: 1.
|
| 2465 |
-
color: var(--
|
| 2466 |
font-family: var(--font-main) !important;
|
| 2467 |
word-wrap: break-word;
|
| 2468 |
overflow-wrap: break-word;
|
|
@@ -2471,40 +2342,38 @@ body {
|
|
| 2471 |
/* Myanmar text readability */
|
| 2472 |
.chatbot .message {
|
| 2473 |
font-family: var(--font-main) !important;
|
| 2474 |
-
font-size:
|
| 2475 |
line-height: 1.85 !important;
|
| 2476 |
-
letter-spacing: 0.
|
| 2477 |
}
|
| 2478 |
|
| 2479 |
/* Code blocks inside messages */
|
| 2480 |
.chatbot .message pre {
|
| 2481 |
-
background:
|
| 2482 |
-
border: 1px solid var(--
|
| 2483 |
-
border-radius:
|
| 2484 |
-
padding: 14px
|
| 2485 |
font-size: 13px !important;
|
| 2486 |
line-height: 1.6 !important;
|
| 2487 |
font-family: var(--font-mono) !important;
|
| 2488 |
overflow-x: auto;
|
| 2489 |
white-space: pre-wrap;
|
| 2490 |
word-wrap: break-word;
|
| 2491 |
-
backdrop-filter: blur(8px) !important;
|
| 2492 |
}
|
| 2493 |
|
| 2494 |
/* Inline code */
|
| 2495 |
.chatbot .message code {
|
| 2496 |
font-family: var(--font-mono) !important;
|
| 2497 |
font-size: 13px !important;
|
| 2498 |
-
background: rgba(
|
| 2499 |
-
padding: 2px
|
| 2500 |
-
border-radius:
|
| 2501 |
-
|
| 2502 |
-
color: #8ab4f8 !important;
|
| 2503 |
}
|
| 2504 |
|
| 2505 |
-
/* Bold text
|
| 2506 |
.chatbot .message strong {
|
| 2507 |
-
color:
|
| 2508 |
font-weight: 600 !important;
|
| 2509 |
}
|
| 2510 |
|
|
@@ -2514,37 +2383,59 @@ body {
|
|
| 2514 |
padding-left: 4px !important;
|
| 2515 |
}
|
| 2516 |
|
| 2517 |
-
/* =====
|
| 2518 |
-
.
|
| 2519 |
-
|
| 2520 |
-
|
| 2521 |
-
|
| 2522 |
-
|
| 2523 |
-
-
|
| 2524 |
-
|
| 2525 |
-
|
| 2526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2527 |
}
|
| 2528 |
-
.
|
| 2529 |
-
|
| 2530 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2531 |
}
|
| 2532 |
|
|
|
|
| 2533 |
.input-container,
|
| 2534 |
.gr-input-container {
|
| 2535 |
background: transparent !important;
|
| 2536 |
border: none !important;
|
| 2537 |
-
border-radius: 0 !important;
|
| 2538 |
-
box-shadow: none !important;
|
| 2539 |
}
|
| 2540 |
|
| 2541 |
textarea {
|
| 2542 |
-
font-size:
|
| 2543 |
font-family: var(--font-main) !important;
|
| 2544 |
-
color: var(--
|
| 2545 |
background: transparent !important;
|
| 2546 |
line-height: 1.5 !important;
|
| 2547 |
-
padding:
|
| 2548 |
border: none !important;
|
| 2549 |
resize: none !important;
|
| 2550 |
}
|
|
@@ -2553,227 +2444,188 @@ textarea:focus {
|
|
| 2553 |
box-shadow: none !important;
|
| 2554 |
}
|
| 2555 |
textarea::placeholder {
|
| 2556 |
-
color: var(--
|
| 2557 |
-
font-size:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2558 |
}
|
| 2559 |
|
| 2560 |
/* ===== BUTTONS ===== */
|
| 2561 |
-
.primary-btn,
|
| 2562 |
-
button.
|
| 2563 |
-
|
|
|
|
|
|
|
| 2564 |
border: none !important;
|
| 2565 |
-
border-radius:
|
| 2566 |
-
font-weight:
|
| 2567 |
font-size: 14px !important;
|
| 2568 |
-
padding: 10px
|
| 2569 |
-
min-height:
|
| 2570 |
-
transition: all 0.
|
| 2571 |
-
color: #
|
| 2572 |
-
|
| 2573 |
-
|
| 2574 |
-
|
| 2575 |
-
.
|
| 2576 |
-
|
| 2577 |
-
|
| 2578 |
-
|
|
|
|
| 2579 |
}
|
| 2580 |
-
.primary-btn:active,
|
| 2581 |
-
|
| 2582 |
-
|
|
|
|
| 2583 |
}
|
| 2584 |
|
| 2585 |
/* Secondary/clear button */
|
| 2586 |
-
|
| 2587 |
-
background: var(--
|
| 2588 |
-
border: 1px solid var(--
|
| 2589 |
-
border-radius:
|
| 2590 |
-
color: var(--
|
| 2591 |
font-weight: 500 !important;
|
| 2592 |
-
|
| 2593 |
-
|
|
|
|
|
|
|
| 2594 |
}
|
| 2595 |
-
|
| 2596 |
-
background: var(--
|
| 2597 |
-
border-color: var(--
|
| 2598 |
-
color: var(--
|
| 2599 |
-
transform: translateY(-1px) !important;
|
| 2600 |
}
|
| 2601 |
|
| 2602 |
-
/* ===== EXAMPLES
|
| 2603 |
.examples {
|
| 2604 |
background: transparent !important;
|
| 2605 |
border: none !important;
|
| 2606 |
border-radius: 0 !important;
|
| 2607 |
padding: 0 !important;
|
| 2608 |
-
margin-top:
|
| 2609 |
}
|
| 2610 |
.examples .example {
|
| 2611 |
-
background: var(--
|
| 2612 |
-
border: 1px solid var(--
|
| 2613 |
-
border-radius:
|
| 2614 |
-
color: var(--
|
| 2615 |
-
font-size:
|
| 2616 |
-
padding:
|
| 2617 |
-
transition: all 0.
|
| 2618 |
cursor: pointer;
|
| 2619 |
-
backdrop-filter: blur(8px) !important;
|
| 2620 |
}
|
| 2621 |
.examples .example:hover {
|
| 2622 |
-
border-color:
|
| 2623 |
-
background: rgba(
|
| 2624 |
-
color: var(--
|
| 2625 |
-
transform: translateY(-2px);
|
| 2626 |
-
box-shadow: 0 6px 20px rgba(0,0,0,0.25);
|
| 2627 |
}
|
| 2628 |
|
| 2629 |
-
/* ===== ACCORDION
|
| 2630 |
.gr-accordion {
|
| 2631 |
-
background: var(--
|
| 2632 |
-
border: 1px solid var(--
|
| 2633 |
-
border-radius:
|
| 2634 |
-
backdrop-filter: blur(12px) !important;
|
| 2635 |
-
-webkit-backdrop-filter: blur(12px) !important;
|
| 2636 |
overflow: hidden;
|
| 2637 |
-
transition: all 0.3s ease;
|
| 2638 |
}
|
| 2639 |
.gr-accordion:hover {
|
| 2640 |
-
border-color: var(--
|
| 2641 |
}
|
| 2642 |
|
| 2643 |
/* ===== DROPDOWN ===== */
|
| 2644 |
.gr-dropdown {
|
| 2645 |
-
background: var(--
|
| 2646 |
-
border: 1px solid var(--
|
| 2647 |
-
border-radius:
|
| 2648 |
-
color: var(--
|
| 2649 |
-
backdrop-filter: blur(8px) !important;
|
| 2650 |
}
|
| 2651 |
-
.gr-dropdown:hover,
|
| 2652 |
-
|
|
|
|
| 2653 |
}
|
| 2654 |
|
| 2655 |
/* ===== SCROLLBAR ===== */
|
| 2656 |
::-webkit-scrollbar {
|
| 2657 |
-
width:
|
| 2658 |
}
|
| 2659 |
::-webkit-scrollbar-track {
|
| 2660 |
background: transparent;
|
| 2661 |
}
|
| 2662 |
::-webkit-scrollbar-thumb {
|
| 2663 |
-
background: rgba(255,255,255,0.
|
| 2664 |
border-radius: 10px;
|
| 2665 |
}
|
| 2666 |
::-webkit-scrollbar-thumb:hover {
|
| 2667 |
-
background: rgba(255,255,255,0.
|
| 2668 |
}
|
| 2669 |
|
| 2670 |
/* ===== GLOBAL TEXT ===== */
|
| 2671 |
.gradio-container p, .gradio-container li {
|
| 2672 |
-
color: var(--
|
| 2673 |
-
font-size:
|
| 2674 |
-
line-height: 1.
|
| 2675 |
}
|
| 2676 |
.gradio-container h1, .gradio-container h2, .gradio-container h3 {
|
| 2677 |
-
color: var(--
|
| 2678 |
}
|
| 2679 |
|
| 2680 |
-
/* ===== FOOTER ===== */
|
| 2681 |
footer { display: none !important; }
|
| 2682 |
|
| 2683 |
-
/* ===== WELCOME FEATURE CARDS ===== */
|
| 2684 |
-
.welcome-grid {
|
| 2685 |
-
display: grid;
|
| 2686 |
-
grid-template-columns: repeat(3, 1fr);
|
| 2687 |
-
gap: 10px;
|
| 2688 |
-
padding: 8px 0;
|
| 2689 |
-
max-width: 680px;
|
| 2690 |
-
margin: 0 auto;
|
| 2691 |
-
}
|
| 2692 |
-
.welcome-card {
|
| 2693 |
-
background: var(--ai-glass);
|
| 2694 |
-
border: 1px solid var(--ai-border);
|
| 2695 |
-
border-radius: 16px;
|
| 2696 |
-
padding: 14px 12px;
|
| 2697 |
-
text-align: center;
|
| 2698 |
-
backdrop-filter: blur(8px);
|
| 2699 |
-
-webkit-backdrop-filter: blur(8px);
|
| 2700 |
-
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
| 2701 |
-
cursor: default;
|
| 2702 |
-
}
|
| 2703 |
-
.welcome-card:hover {
|
| 2704 |
-
background: var(--ai-glass2);
|
| 2705 |
-
border-color: rgba(138,180,248,0.25);
|
| 2706 |
-
transform: translateY(-3px);
|
| 2707 |
-
box-shadow: 0 8px 28px rgba(0,0,0,0.3);
|
| 2708 |
-
}
|
| 2709 |
-
.welcome-card .wc-icon {
|
| 2710 |
-
font-size: 24px;
|
| 2711 |
-
margin-bottom: 6px;
|
| 2712 |
-
display: block;
|
| 2713 |
-
}
|
| 2714 |
-
.welcome-card .wc-title {
|
| 2715 |
-
color: var(--ai-text);
|
| 2716 |
-
font-size: 12.5px;
|
| 2717 |
-
font-weight: 600;
|
| 2718 |
-
display: block;
|
| 2719 |
-
}
|
| 2720 |
-
.welcome-card .wc-desc {
|
| 2721 |
-
color: var(--ai-text3);
|
| 2722 |
-
font-size: 11px;
|
| 2723 |
-
margin-top: 3px;
|
| 2724 |
-
display: block;
|
| 2725 |
-
}
|
| 2726 |
-
|
| 2727 |
/* ===== TEMPLATE GALLERY GRID ===== */
|
| 2728 |
.tmpl-grid {
|
| 2729 |
display: grid;
|
| 2730 |
-
grid-template-columns: repeat(auto-fill, minmax(
|
| 2731 |
gap: 8px;
|
| 2732 |
padding: 4px 0;
|
| 2733 |
}
|
| 2734 |
.tmpl-card {
|
| 2735 |
-
background: var(--
|
| 2736 |
-
border: 1px solid var(--
|
| 2737 |
-
border-radius:
|
| 2738 |
-
padding: 10px
|
| 2739 |
-
|
| 2740 |
-
-webkit-backdrop-filter: blur(8px);
|
| 2741 |
-
transition: all 0.25s ease;
|
| 2742 |
cursor: default;
|
| 2743 |
}
|
| 2744 |
.tmpl-card:hover {
|
| 2745 |
-
background: var(--
|
| 2746 |
-
border-color:
|
| 2747 |
-
transform: translateY(-
|
| 2748 |
-
box-shadow: 0 4px 16px rgba(0,0,0,0.2);
|
| 2749 |
-
}
|
| 2750 |
-
.tmpl-card b { color: #8ab4f8; font-size: 13px; }
|
| 2751 |
-
.tmpl-card span { color: var(--ai-text3); font-size: 11px; }
|
| 2752 |
-
|
| 2753 |
-
/* ===== LOADING DOTS ===== */
|
| 2754 |
-
@keyframes dot-bounce {
|
| 2755 |
-
0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
|
| 2756 |
-
40% { transform: scale(1); opacity: 1; }
|
| 2757 |
}
|
|
|
|
|
|
|
| 2758 |
|
| 2759 |
/* ===== RESPONSIVE ===== */
|
| 2760 |
@media (max-width: 768px) {
|
| 2761 |
-
.
|
| 2762 |
-
.
|
| 2763 |
-
.
|
| 2764 |
-
.ai-stat-chip { padding: 5px 10px; font-size: 12px; }
|
| 2765 |
-
.crew-pills { gap: 4px; }
|
| 2766 |
-
.crew-pill { padding: 3px 8px; font-size: 11px; }
|
| 2767 |
-
.chatbot .message.user { margin-left: 16px !important; }
|
| 2768 |
.chatbot .message.assistant,
|
| 2769 |
-
.chatbot .message.bot { margin-right:
|
| 2770 |
-
.
|
| 2771 |
.tmpl-grid { grid-template-columns: repeat(2, 1fr); }
|
|
|
|
| 2772 |
}
|
| 2773 |
@media (max-width: 480px) {
|
| 2774 |
-
.
|
| 2775 |
-
.
|
| 2776 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2777 |
}
|
| 2778 |
|
| 2779 |
/* ===== TEXT INPUT / DROPDOWN CONTAINERS ===== */
|
|
@@ -2782,155 +2634,137 @@ footer { display: none !important; }
|
|
| 2782 |
border: none !important;
|
| 2783 |
}
|
| 2784 |
.gr-box {
|
| 2785 |
-
border-radius:
|
| 2786 |
}
|
| 2787 |
label {
|
| 2788 |
-
color: var(--
|
| 2789 |
-
font-size:
|
| 2790 |
}
|
| 2791 |
"""
|
| 2792 |
|
| 2793 |
# ============================================================
|
| 2794 |
-
# GRADIO UI -
|
| 2795 |
# ============================================================
|
| 2796 |
|
| 2797 |
with gr.Blocks(title="AI Coding Agent Crew") as demo:
|
| 2798 |
-
# Ambient background orbs
|
| 2799 |
-
gr.HTML("""
|
| 2800 |
-
<div class="ambient-bg">
|
| 2801 |
-
<div class="ambient-orb"></div>
|
| 2802 |
-
<div class="ambient-orb"></div>
|
| 2803 |
-
<div class="ambient-orb"></div>
|
| 2804 |
-
</div>
|
| 2805 |
-
""")
|
| 2806 |
|
| 2807 |
-
#
|
| 2808 |
-
gr.HTML("""
|
| 2809 |
-
<div class="ai-header">
|
| 2810 |
-
<div class="ai-logo-row">
|
| 2811 |
-
<div class="ai-logo-icon">β¦</div>
|
| 2812 |
-
<span class="ai-title">AI Coding Crew</span>
|
| 2813 |
-
</div>
|
| 2814 |
-
<div class="ai-subtitle">Autonomous AI Agent Crew for Hugging Face Spaces</div>
|
| 2815 |
-
</div>
|
| 2816 |
-
""")
|
| 2817 |
-
|
| 2818 |
-
# Stats chips
|
| 2819 |
gr.HTML(f"""
|
| 2820 |
-
<div class="
|
| 2821 |
-
<
|
| 2822 |
-
|
| 2823 |
-
|
| 2824 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2825 |
</div>
|
| 2826 |
""")
|
| 2827 |
|
| 2828 |
-
#
|
| 2829 |
-
crew_row1 = '<div class="crew-pills">'
|
| 2830 |
-
for key in ["planner","architect","coder","designer","reviewer","tester","optimizer","security","deployer","debugger"]:
|
| 2831 |
-
c = CREW[key]
|
| 2832 |
-
crew_row1 += f'<span class="crew-pill"><span class="pill-emoji">{c["emoji"]}</span><span class="pill-name">{c["name"]}</span></span>'
|
| 2833 |
-
crew_row1 += '</div>'
|
| 2834 |
-
gr.HTML(crew_row1)
|
| 2835 |
-
|
| 2836 |
-
crew_row2 = '<div class="crew-pills">'
|
| 2837 |
-
for key in ["documenter","manager","devops","analyst","qa","integrator","refactorer","monitor","scraper","api_builder"]:
|
| 2838 |
-
c = CREW[key]
|
| 2839 |
-
crew_row2 += f'<span class="crew-pill"><span class="pill-emoji">{c["emoji"]}</span><span class="pill-name">{c["name"]}</span></span>'
|
| 2840 |
-
crew_row2 += '</div>'
|
| 2841 |
-
gr.HTML(crew_row2)
|
| 2842 |
-
|
| 2843 |
-
# Welcome feature cards
|
| 2844 |
gr.HTML("""
|
| 2845 |
-
<div class="
|
| 2846 |
-
<div class="
|
| 2847 |
-
<span class="
|
| 2848 |
-
<span class="
|
| 2849 |
-
<span class="wc-desc">One-click template deploy</span>
|
| 2850 |
</div>
|
| 2851 |
-
<div class="
|
| 2852 |
-
<span class="
|
| 2853 |
-
<span class="
|
| 2854 |
-
<span class="wc-desc">Autonomous crew system</span>
|
| 2855 |
</div>
|
| 2856 |
-
<div class="
|
| 2857 |
-
<span class="
|
| 2858 |
-
<span class="
|
| 2859 |
-
<span class="wc-desc">Smart error repair</span>
|
| 2860 |
</div>
|
| 2861 |
-
<div class="
|
| 2862 |
-
<span class="
|
| 2863 |
-
<span class="
|
| 2864 |
-
<span class="wc-desc">Ready-made projects</span>
|
| 2865 |
</div>
|
| 2866 |
-
<div class="
|
| 2867 |
-
<span class="
|
| 2868 |
-
<span class="
|
| 2869 |
-
<span class="wc-desc">Code validation</span>
|
| 2870 |
</div>
|
| 2871 |
-
<div class="
|
| 2872 |
-
<span class="
|
| 2873 |
-
<span class="
|
| 2874 |
-
<span class="wc-desc">Pollinations AI</span>
|
| 2875 |
</div>
|
| 2876 |
</div>
|
| 2877 |
""")
|
| 2878 |
|
| 2879 |
-
#
|
| 2880 |
-
chatbot = gr.Chatbot(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2881 |
|
| 2882 |
-
#
|
| 2883 |
with gr.Row(equal_height=True):
|
| 2884 |
-
with gr.Column(scale=
|
| 2885 |
msg_input = gr.Textbox(
|
| 2886 |
-
placeholder="
|
| 2887 |
show_label=False,
|
| 2888 |
container=False,
|
| 2889 |
lines=1,
|
| 2890 |
max_lines=4,
|
| 2891 |
)
|
| 2892 |
-
with gr.Column(scale=
|
| 2893 |
with gr.Row(equal_height=True):
|
| 2894 |
model_dropdown = gr.Dropdown(
|
| 2895 |
choices=["openai", "mistral", "deepseek", "llama", "qwen"],
|
| 2896 |
value="openai",
|
| 2897 |
label="Model",
|
| 2898 |
-
min_width=
|
| 2899 |
scale=2,
|
| 2900 |
)
|
| 2901 |
-
send_btn = gr.Button("
|
| 2902 |
-
clear_btn = gr.Button("
|
| 2903 |
|
| 2904 |
-
|
| 2905 |
-
|
| 2906 |
-
|
| 2907 |
-
|
| 2908 |
-
|
| 2909 |
-
|
| 2910 |
-
|
| 2911 |
-
|
| 2912 |
-
|
| 2913 |
-
|
| 2914 |
-
|
| 2915 |
-
|
|
|
|
| 2916 |
|
| 2917 |
-
#
|
| 2918 |
-
with gr.Accordion("
|
| 2919 |
with gr.Row():
|
| 2920 |
-
refresh_btn = gr.Button("
|
| 2921 |
-
export_btn = gr.Button("
|
| 2922 |
spaces_output = gr.Textbox(label="Your Spaces", lines=8, interactive=False)
|
| 2923 |
stats_output = gr.Textbox(label="Session Stats", interactive=False)
|
| 2924 |
export_file = gr.File(label="Download")
|
| 2925 |
|
| 2926 |
-
# Templates gallery
|
| 2927 |
-
with gr.Accordion("
|
| 2928 |
template_html = '<div class="tmpl-grid">'
|
| 2929 |
for tkey, tmpl in PROJECT_TEMPLATES.items():
|
| 2930 |
template_html += f'<div class="tmpl-card"><b>{tmpl["name"]}</b><br><span>{tkey}</span></div>'
|
| 2931 |
template_html += '</div>'
|
| 2932 |
gr.HTML(template_html)
|
| 2933 |
|
|
|
|
| 2934 |
msg_input.submit(run_agent, [msg_input, chatbot, model_dropdown], [chatbot]).then(fn=lambda: "", outputs=msg_input)
|
| 2935 |
send_btn.click(run_agent, [msg_input, chatbot, model_dropdown], [chatbot], api_name="send").then(fn=lambda: "", outputs=msg_input)
|
| 2936 |
clear_btn.click(fn=lambda: ([], ""), inputs=None, outputs=[chatbot, msg_input])
|
|
|
|
| 2200 |
# ============================================================
|
| 2201 |
|
| 2202 |
GEMINI_CSS = """
|
| 2203 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Myanmar:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');
|
| 2204 |
|
| 2205 |
:root {
|
| 2206 |
+
--bg-primary: #0f0f11;
|
| 2207 |
+
--bg-surface: #1a1a2e;
|
| 2208 |
+
--bg-glass: rgba(255,255,255,0.04);
|
| 2209 |
+
--bg-glass-hover: rgba(255,255,255,0.07);
|
| 2210 |
+
--border-subtle: rgba(255,255,255,0.08);
|
| 2211 |
+
--border-hover: rgba(255,255,255,0.14);
|
| 2212 |
+
--accent-primary: #6c63ff;
|
| 2213 |
+
--accent-secondary: #00d4aa;
|
| 2214 |
+
--user-bubble-bg: rgba(108,99,255,0.15);
|
| 2215 |
+
--user-bubble-border: rgba(108,99,255,0.25);
|
| 2216 |
+
--bot-bubble-bg: rgba(255,255,255,0.03);
|
| 2217 |
+
--bot-bubble-border: rgba(255,255,255,0.06);
|
| 2218 |
+
--text-primary: #e8eaed;
|
| 2219 |
+
--text-secondary: #9aa0a6;
|
| 2220 |
+
--text-muted: #5f6368;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2221 |
--font-main: 'Inter', 'Noto Sans Myanmar', system-ui, -apple-system, sans-serif;
|
| 2222 |
--font-mono: 'JetBrains Mono', 'Courier New', monospace;
|
| 2223 |
}
|
|
|
|
| 2225 |
* { box-sizing: border-box; margin: 0; padding: 0; }
|
| 2226 |
|
| 2227 |
body {
|
| 2228 |
+
background: var(--bg-primary) !important;
|
| 2229 |
font-family: var(--font-main) !important;
|
| 2230 |
-webkit-font-smoothing: antialiased;
|
| 2231 |
-moz-osx-font-smoothing: grayscale;
|
| 2232 |
overflow-x: hidden;
|
| 2233 |
+
color: var(--text-primary);
|
| 2234 |
}
|
| 2235 |
|
| 2236 |
+
/* ===== GRADIO CONTAINER ===== */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2237 |
.gradio-container {
|
| 2238 |
+
max-width: 860px !important;
|
| 2239 |
margin: 0 auto !important;
|
| 2240 |
font-family: var(--font-main) !important;
|
| 2241 |
background: transparent !important;
|
| 2242 |
+
padding: 0 16px !important;
|
|
|
|
|
|
|
| 2243 |
}
|
| 2244 |
|
| 2245 |
/* ===== HEADER ===== */
|
| 2246 |
+
.crew-header {
|
| 2247 |
text-align: center;
|
| 2248 |
+
padding: 28px 16px 8px;
|
|
|
|
| 2249 |
}
|
| 2250 |
+
.crew-header-row {
|
| 2251 |
display: inline-flex;
|
| 2252 |
align-items: center;
|
| 2253 |
justify-content: center;
|
| 2254 |
+
gap: 14px;
|
| 2255 |
+
margin-bottom: 6px;
|
| 2256 |
}
|
| 2257 |
+
.crew-logo {
|
| 2258 |
+
width: 44px; height: 44px;
|
| 2259 |
+
background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
|
| 2260 |
+
border-radius: 14px;
|
| 2261 |
display: flex; align-items: center; justify-content: center;
|
| 2262 |
+
font-size: 22px; color: #fff;
|
| 2263 |
+
box-shadow: 0 4px 20px rgba(108,99,255,0.3);
|
| 2264 |
+
flex-shrink: 0;
|
|
|
|
|
|
|
| 2265 |
}
|
| 2266 |
+
.crew-title {
|
| 2267 |
+
font-size: 28px;
|
| 2268 |
+
font-weight: 700;
|
| 2269 |
+
color: var(--text-primary);
|
| 2270 |
+
letter-spacing: -0.5px;
|
| 2271 |
+
}
|
| 2272 |
+
.crew-subtitle {
|
| 2273 |
+
color: var(--text-secondary);
|
| 2274 |
+
font-size: 13px;
|
| 2275 |
+
margin-top: 4px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2276 |
font-weight: 400;
|
| 2277 |
}
|
| 2278 |
|
| 2279 |
/* ===== STATS BAR ===== */
|
| 2280 |
+
.crew-stats {
|
| 2281 |
display: flex;
|
| 2282 |
justify-content: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2283 |
align-items: center;
|
| 2284 |
gap: 6px;
|
| 2285 |
+
padding: 10px 0 4px;
|
| 2286 |
+
flex-wrap: wrap;
|
|
|
|
|
|
|
| 2287 |
font-size: 13px;
|
| 2288 |
+
color: var(--text-muted);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2289 |
}
|
| 2290 |
+
.crew-stats .stat-sep {
|
| 2291 |
+
color: var(--border-subtle);
|
| 2292 |
+
margin: 0 2px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2293 |
}
|
| 2294 |
+
.crew-stats .stat-val {
|
| 2295 |
+
font-weight: 600;
|
| 2296 |
+
color: var(--accent-primary);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2297 |
}
|
| 2298 |
+
.crew-stats .stat-free {
|
| 2299 |
+
font-weight: 600;
|
| 2300 |
+
color: var(--accent-secondary);
|
|
|
|
|
|
|
| 2301 |
}
|
|
|
|
|
|
|
| 2302 |
|
| 2303 |
+
/* ===== CHATBOT ===== */
|
| 2304 |
.chatbot {
|
| 2305 |
+
background: var(--bg-glass) !important;
|
| 2306 |
+
border: 1px solid var(--border-subtle) !important;
|
| 2307 |
+
border-radius: 16px !important;
|
| 2308 |
+
min-height: 500px !important;
|
|
|
|
|
|
|
|
|
|
| 2309 |
}
|
| 2310 |
|
| 2311 |
/* User message bubble */
|
| 2312 |
.chatbot .message.user {
|
| 2313 |
+
background: var(--user-bubble-bg) !important;
|
| 2314 |
+
border-radius: 18px 18px 4px 18px !important;
|
| 2315 |
+
padding: 12px 18px !important;
|
| 2316 |
+
margin-left: 40px !important;
|
| 2317 |
+
border: 1px solid var(--user-bubble-border) !important;
|
|
|
|
|
|
|
| 2318 |
}
|
| 2319 |
|
| 2320 |
/* Assistant message bubble */
|
| 2321 |
.chatbot .message.assistant,
|
| 2322 |
.chatbot .message.bot {
|
| 2323 |
+
background: var(--bot-bubble-bg) !important;
|
| 2324 |
+
border-radius: 18px 18px 18px 4px !important;
|
| 2325 |
+
padding: 14px 18px !important;
|
| 2326 |
+
margin-right: 40px !important;
|
| 2327 |
+
border: 1px solid var(--bot-bubble-border) !important;
|
|
|
|
|
|
|
| 2328 |
}
|
| 2329 |
|
| 2330 |
/* Message text */
|
| 2331 |
.chatbot .message p,
|
| 2332 |
.chatbot .message span,
|
| 2333 |
.chatbot .message div {
|
| 2334 |
+
font-size: 14.5px !important;
|
| 2335 |
+
line-height: 1.7 !important;
|
| 2336 |
+
color: var(--text-primary) !important;
|
| 2337 |
font-family: var(--font-main) !important;
|
| 2338 |
word-wrap: break-word;
|
| 2339 |
overflow-wrap: break-word;
|
|
|
|
| 2342 |
/* Myanmar text readability */
|
| 2343 |
.chatbot .message {
|
| 2344 |
font-family: var(--font-main) !important;
|
| 2345 |
+
font-size: 14.5px !important;
|
| 2346 |
line-height: 1.85 !important;
|
| 2347 |
+
letter-spacing: 0.1px;
|
| 2348 |
}
|
| 2349 |
|
| 2350 |
/* Code blocks inside messages */
|
| 2351 |
.chatbot .message pre {
|
| 2352 |
+
background: #0d0d12 !important;
|
| 2353 |
+
border: 1px solid var(--border-subtle) !important;
|
| 2354 |
+
border-radius: 10px !important;
|
| 2355 |
+
padding: 14px 16px !important;
|
| 2356 |
font-size: 13px !important;
|
| 2357 |
line-height: 1.6 !important;
|
| 2358 |
font-family: var(--font-mono) !important;
|
| 2359 |
overflow-x: auto;
|
| 2360 |
white-space: pre-wrap;
|
| 2361 |
word-wrap: break-word;
|
|
|
|
| 2362 |
}
|
| 2363 |
|
| 2364 |
/* Inline code */
|
| 2365 |
.chatbot .message code {
|
| 2366 |
font-family: var(--font-mono) !important;
|
| 2367 |
font-size: 13px !important;
|
| 2368 |
+
background: rgba(108,99,255,0.12) !important;
|
| 2369 |
+
padding: 2px 6px !important;
|
| 2370 |
+
border-radius: 5px !important;
|
| 2371 |
+
color: var(--accent-primary) !important;
|
|
|
|
| 2372 |
}
|
| 2373 |
|
| 2374 |
+
/* Bold text */
|
| 2375 |
.chatbot .message strong {
|
| 2376 |
+
color: var(--text-primary) !important;
|
| 2377 |
font-weight: 600 !important;
|
| 2378 |
}
|
| 2379 |
|
|
|
|
| 2383 |
padding-left: 4px !important;
|
| 2384 |
}
|
| 2385 |
|
| 2386 |
+
/* ===== QUICK START TEMPLATE CARDS ===== */
|
| 2387 |
+
.quick-grid {
|
| 2388 |
+
display: grid;
|
| 2389 |
+
grid-template-columns: repeat(3, 1fr);
|
| 2390 |
+
gap: 8px;
|
| 2391 |
+
padding: 6px 0;
|
| 2392 |
+
max-width: 100%;
|
| 2393 |
+
}
|
| 2394 |
+
.quick-card {
|
| 2395 |
+
background: var(--bg-glass);
|
| 2396 |
+
border: 1px solid var(--border-subtle);
|
| 2397 |
+
border-radius: 12px;
|
| 2398 |
+
padding: 12px 10px;
|
| 2399 |
+
text-align: center;
|
| 2400 |
+
transition: all 0.2s ease;
|
| 2401 |
+
cursor: pointer;
|
| 2402 |
+
user-select: none;
|
| 2403 |
+
}
|
| 2404 |
+
.quick-card:hover {
|
| 2405 |
+
background: var(--bg-glass-hover);
|
| 2406 |
+
border-color: var(--accent-primary);
|
| 2407 |
+
transform: translateY(-1px);
|
| 2408 |
}
|
| 2409 |
+
.quick-card:active {
|
| 2410 |
+
transform: translateY(0);
|
| 2411 |
+
}
|
| 2412 |
+
.quick-card .qc-icon {
|
| 2413 |
+
font-size: 20px;
|
| 2414 |
+
display: block;
|
| 2415 |
+
margin-bottom: 4px;
|
| 2416 |
+
}
|
| 2417 |
+
.quick-card .qc-label {
|
| 2418 |
+
color: var(--text-secondary);
|
| 2419 |
+
font-size: 12px;
|
| 2420 |
+
font-weight: 500;
|
| 2421 |
+
line-height: 1.35;
|
| 2422 |
+
display: block;
|
| 2423 |
}
|
| 2424 |
|
| 2425 |
+
/* ===== INPUT AREA ===== */
|
| 2426 |
.input-container,
|
| 2427 |
.gr-input-container {
|
| 2428 |
background: transparent !important;
|
| 2429 |
border: none !important;
|
|
|
|
|
|
|
| 2430 |
}
|
| 2431 |
|
| 2432 |
textarea {
|
| 2433 |
+
font-size: 15px !important;
|
| 2434 |
font-family: var(--font-main) !important;
|
| 2435 |
+
color: var(--text-primary) !important;
|
| 2436 |
background: transparent !important;
|
| 2437 |
line-height: 1.5 !important;
|
| 2438 |
+
padding: 12px 16px !important;
|
| 2439 |
border: none !important;
|
| 2440 |
resize: none !important;
|
| 2441 |
}
|
|
|
|
| 2444 |
box-shadow: none !important;
|
| 2445 |
}
|
| 2446 |
textarea::placeholder {
|
| 2447 |
+
color: var(--text-muted) !important;
|
| 2448 |
+
font-size: 15px !important;
|
| 2449 |
+
}
|
| 2450 |
+
|
| 2451 |
+
.crew-input-row {
|
| 2452 |
+
display: flex;
|
| 2453 |
+
align-items: center;
|
| 2454 |
+
gap: 8px;
|
| 2455 |
+
background: var(--bg-surface);
|
| 2456 |
+
border: 1px solid var(--border-subtle);
|
| 2457 |
+
border-radius: 24px;
|
| 2458 |
+
padding: 6px 8px 6px 16px;
|
| 2459 |
+
transition: border-color 0.2s ease;
|
| 2460 |
+
}
|
| 2461 |
+
.crew-input-row:focus-within {
|
| 2462 |
+
border-color: var(--accent-primary);
|
| 2463 |
}
|
| 2464 |
|
| 2465 |
/* ===== BUTTONS ===== */
|
| 2466 |
+
button.primary-btn,
|
| 2467 |
+
button.btn-primary,
|
| 2468 |
+
.gr-button-primary,
|
| 2469 |
+
button[variant="primary"] {
|
| 2470 |
+
background: var(--accent-primary) !important;
|
| 2471 |
border: none !important;
|
| 2472 |
+
border-radius: 20px !important;
|
| 2473 |
+
font-weight: 600 !important;
|
| 2474 |
font-size: 14px !important;
|
| 2475 |
+
padding: 10px 20px !important;
|
| 2476 |
+
min-height: 42px !important;
|
| 2477 |
+
transition: all 0.2s ease !important;
|
| 2478 |
+
color: #fff !important;
|
| 2479 |
+
box-shadow: 0 2px 12px rgba(108,99,255,0.25) !important;
|
| 2480 |
+
}
|
| 2481 |
+
button.primary-btn:hover,
|
| 2482 |
+
button.btn-primary:hover,
|
| 2483 |
+
.gr-button-primary:hover {
|
| 2484 |
+
background: #7b73ff !important;
|
| 2485 |
+
box-shadow: 0 4px 20px rgba(108,99,255,0.35) !important;
|
| 2486 |
+
transform: translateY(-1px) !important;
|
| 2487 |
}
|
| 2488 |
+
button.primary-btn:active,
|
| 2489 |
+
button.btn-primary:active {
|
| 2490 |
+
transform: translateY(0) !important;
|
| 2491 |
+
box-shadow: 0 2px 8px rgba(108,99,255,0.2) !important;
|
| 2492 |
}
|
| 2493 |
|
| 2494 |
/* Secondary/clear button */
|
| 2495 |
+
.crew-clear-btn {
|
| 2496 |
+
background: var(--bg-glass) !important;
|
| 2497 |
+
border: 1px solid var(--border-subtle) !important;
|
| 2498 |
+
border-radius: 20px !important;
|
| 2499 |
+
color: var(--text-secondary) !important;
|
| 2500 |
font-weight: 500 !important;
|
| 2501 |
+
font-size: 13px !important;
|
| 2502 |
+
padding: 8px 14px !important;
|
| 2503 |
+
min-height: 42px !important;
|
| 2504 |
+
transition: all 0.2s ease !important;
|
| 2505 |
}
|
| 2506 |
+
.crew-clear-btn:hover {
|
| 2507 |
+
background: var(--bg-glass-hover) !important;
|
| 2508 |
+
border-color: var(--border-hover) !important;
|
| 2509 |
+
color: var(--text-primary) !important;
|
|
|
|
| 2510 |
}
|
| 2511 |
|
| 2512 |
+
/* ===== EXAMPLES ROW ===== */
|
| 2513 |
.examples {
|
| 2514 |
background: transparent !important;
|
| 2515 |
border: none !important;
|
| 2516 |
border-radius: 0 !important;
|
| 2517 |
padding: 0 !important;
|
| 2518 |
+
margin-top: 8px !important;
|
| 2519 |
}
|
| 2520 |
.examples .example {
|
| 2521 |
+
background: var(--bg-glass) !important;
|
| 2522 |
+
border: 1px solid var(--border-subtle) !important;
|
| 2523 |
+
border-radius: 12px !important;
|
| 2524 |
+
color: var(--text-secondary) !important;
|
| 2525 |
+
font-size: 13px !important;
|
| 2526 |
+
padding: 8px 14px !important;
|
| 2527 |
+
transition: all 0.2s ease !important;
|
| 2528 |
cursor: pointer;
|
|
|
|
| 2529 |
}
|
| 2530 |
.examples .example:hover {
|
| 2531 |
+
border-color: var(--accent-primary) !important;
|
| 2532 |
+
background: rgba(108,99,255,0.08) !important;
|
| 2533 |
+
color: var(--text-primary) !important;
|
|
|
|
|
|
|
| 2534 |
}
|
| 2535 |
|
| 2536 |
+
/* ===== ACCORDION ===== */
|
| 2537 |
.gr-accordion {
|
| 2538 |
+
background: var(--bg-glass) !important;
|
| 2539 |
+
border: 1px solid var(--border-subtle) !important;
|
| 2540 |
+
border-radius: 14px !important;
|
|
|
|
|
|
|
| 2541 |
overflow: hidden;
|
|
|
|
| 2542 |
}
|
| 2543 |
.gr-accordion:hover {
|
| 2544 |
+
border-color: var(--border-hover) !important;
|
| 2545 |
}
|
| 2546 |
|
| 2547 |
/* ===== DROPDOWN ===== */
|
| 2548 |
.gr-dropdown {
|
| 2549 |
+
background: var(--bg-surface) !important;
|
| 2550 |
+
border: 1px solid var(--border-subtle) !important;
|
| 2551 |
+
border-radius: 12px !important;
|
| 2552 |
+
color: var(--text-primary) !important;
|
|
|
|
| 2553 |
}
|
| 2554 |
+
.gr-dropdown:hover,
|
| 2555 |
+
.gr-dropdown:focus {
|
| 2556 |
+
border-color: var(--accent-primary) !important;
|
| 2557 |
}
|
| 2558 |
|
| 2559 |
/* ===== SCROLLBAR ===== */
|
| 2560 |
::-webkit-scrollbar {
|
| 2561 |
+
width: 4px;
|
| 2562 |
}
|
| 2563 |
::-webkit-scrollbar-track {
|
| 2564 |
background: transparent;
|
| 2565 |
}
|
| 2566 |
::-webkit-scrollbar-thumb {
|
| 2567 |
+
background: rgba(255,255,255,0.10);
|
| 2568 |
border-radius: 10px;
|
| 2569 |
}
|
| 2570 |
::-webkit-scrollbar-thumb:hover {
|
| 2571 |
+
background: rgba(255,255,255,0.18);
|
| 2572 |
}
|
| 2573 |
|
| 2574 |
/* ===== GLOBAL TEXT ===== */
|
| 2575 |
.gradio-container p, .gradio-container li {
|
| 2576 |
+
color: var(--text-primary);
|
| 2577 |
+
font-size: 14px;
|
| 2578 |
+
line-height: 1.6;
|
| 2579 |
}
|
| 2580 |
.gradio-container h1, .gradio-container h2, .gradio-container h3 {
|
| 2581 |
+
color: var(--text-primary);
|
| 2582 |
}
|
| 2583 |
|
| 2584 |
+
/* ===== FOOTER - ALWAYS HIDDEN ===== */
|
| 2585 |
footer { display: none !important; }
|
| 2586 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2587 |
/* ===== TEMPLATE GALLERY GRID ===== */
|
| 2588 |
.tmpl-grid {
|
| 2589 |
display: grid;
|
| 2590 |
+
grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
|
| 2591 |
gap: 8px;
|
| 2592 |
padding: 4px 0;
|
| 2593 |
}
|
| 2594 |
.tmpl-card {
|
| 2595 |
+
background: var(--bg-glass);
|
| 2596 |
+
border: 1px solid var(--border-subtle);
|
| 2597 |
+
border-radius: 12px;
|
| 2598 |
+
padding: 10px 12px;
|
| 2599 |
+
transition: all 0.2s ease;
|
|
|
|
|
|
|
| 2600 |
cursor: default;
|
| 2601 |
}
|
| 2602 |
.tmpl-card:hover {
|
| 2603 |
+
background: var(--bg-glass-hover);
|
| 2604 |
+
border-color: var(--border-hover);
|
| 2605 |
+
transform: translateY(-1px);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2606 |
}
|
| 2607 |
+
.tmpl-card b { color: var(--accent-primary); font-size: 13px; }
|
| 2608 |
+
.tmpl-card span { color: var(--text-muted); font-size: 11px; }
|
| 2609 |
|
| 2610 |
/* ===== RESPONSIVE ===== */
|
| 2611 |
@media (max-width: 768px) {
|
| 2612 |
+
.crew-title { font-size: 22px; }
|
| 2613 |
+
.crew-logo { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
|
| 2614 |
+
.chatbot .message.user { margin-left: 12px !important; }
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2615 |
.chatbot .message.assistant,
|
| 2616 |
+
.chatbot .message.bot { margin-right: 12px !important; }
|
| 2617 |
+
.quick-grid { grid-template-columns: repeat(2, 1fr); }
|
| 2618 |
.tmpl-grid { grid-template-columns: repeat(2, 1fr); }
|
| 2619 |
+
.crew-stats { font-size: 12px; }
|
| 2620 |
}
|
| 2621 |
@media (max-width: 480px) {
|
| 2622 |
+
.crew-title { font-size: 20px; }
|
| 2623 |
+
.quick-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
|
| 2624 |
+
.quick-card { padding: 10px 8px; }
|
| 2625 |
+
.quick-card .qc-icon { font-size: 18px; }
|
| 2626 |
+
.quick-card .qc-label { font-size: 11px; }
|
| 2627 |
+
.crew-header { padding: 20px 12px 6px; }
|
| 2628 |
+
.crew-stats { gap: 4px; font-size: 11px; }
|
| 2629 |
}
|
| 2630 |
|
| 2631 |
/* ===== TEXT INPUT / DROPDOWN CONTAINERS ===== */
|
|
|
|
| 2634 |
border: none !important;
|
| 2635 |
}
|
| 2636 |
.gr-box {
|
| 2637 |
+
border-radius: 12px !important;
|
| 2638 |
}
|
| 2639 |
label {
|
| 2640 |
+
color: var(--text-secondary) !important;
|
| 2641 |
+
font-size: 12px !important;
|
| 2642 |
}
|
| 2643 |
"""
|
| 2644 |
|
| 2645 |
# ============================================================
|
| 2646 |
+
# GRADIO UI - CLEAN CHAT-STYLE LAYOUT
|
| 2647 |
# ============================================================
|
| 2648 |
|
| 2649 |
with gr.Blocks(title="AI Coding Agent Crew") as demo:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2650 |
|
| 2651 |
+
# ---- Simple header ----
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2652 |
gr.HTML(f"""
|
| 2653 |
+
<div class="crew-header">
|
| 2654 |
+
<div class="crew-header-row">
|
| 2655 |
+
<div class="crew-logo">✦</div>
|
| 2656 |
+
<span class="crew-title">AI Coding Crew</span>
|
| 2657 |
+
</div>
|
| 2658 |
+
<div class="crew-subtitle">Autonomous AI Agent Crew for Hugging Face Spaces</div>
|
| 2659 |
+
<div class="crew-stats">
|
| 2660 |
+
<span class="stat-val">{len(CREW)}</span> Agents
|
| 2661 |
+
<span class="stat-sep">|</span>
|
| 2662 |
+
<span class="stat-val">{len(TOOLS)}</span> Tools
|
| 2663 |
+
<span class="stat-sep">|</span>
|
| 2664 |
+
<span class="stat-val">{len(PROJECT_TEMPLATES)}</span> Templates
|
| 2665 |
+
<span class="stat-sep">|</span>
|
| 2666 |
+
<span class="stat-free">Free</span>
|
| 2667 |
+
</div>
|
| 2668 |
</div>
|
| 2669 |
""")
|
| 2670 |
|
| 2671 |
+
# ---- Quick-start template cards ----
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2672 |
gr.HTML("""
|
| 2673 |
+
<div class="quick-grid">
|
| 2674 |
+
<div class="quick-card" onclick="document.querySelector('textarea').value='chatbot αα±α¬ααΊαα±αΈ'; document.querySelector('textarea').dispatchEvent(new Event('input',{bubbles:true}))">
|
| 2675 |
+
<span class="qc-icon">🚀</span>
|
| 2676 |
+
<span class="qc-label">chatbot αα±α¬ααΊαα±αΈ</span>
|
|
|
|
| 2677 |
</div>
|
| 2678 |
+
<div class="quick-card" onclick="document.querySelector('textarea').value='image generator αα―ααΊαα±αΈ'; document.querySelector('textarea').dispatchEvent(new Event('input',{bubbles:true}))">
|
| 2679 |
+
<span class="qc-icon">🎨</span>
|
| 2680 |
+
<span class="qc-label">image generator αα―ααΊαα±αΈ</span>
|
|
|
|
| 2681 |
</div>
|
| 2682 |
+
<div class="quick-card" onclick="document.querySelector('textarea').value='text to speech app αα±α¬ααΊαα±αΈ'; document.querySelector('textarea').dispatchEvent(new Event('input',{bubbles:true}))">
|
| 2683 |
+
<span class="qc-icon">🎵</span>
|
| 2684 |
+
<span class="qc-label">TTS app αα±α¬ααΊαα±αΈ</span>
|
|
|
|
| 2685 |
</div>
|
| 2686 |
+
<div class="quick-card" onclick="document.querySelector('textarea').value='password generator αα―ααΊαα±αΈ'; document.querySelector('textarea').dispatchEvent(new Event('input',{bubbles:true}))">
|
| 2687 |
+
<span class="qc-icon">🔒</span>
|
| 2688 |
+
<span class="qc-label">password gen αα―ααΊαα±αΈ</span>
|
|
|
|
| 2689 |
</div>
|
| 2690 |
+
<div class="quick-card" onclick="document.querySelector('textarea').value='translator app αα±α¬ααΊαα±αΈ'; document.querySelector('textarea').dispatchEvent(new Event('input',{bubbles:true}))">
|
| 2691 |
+
<span class="qc-icon">🌍</span>
|
| 2692 |
+
<span class="qc-label">translator αα±α¬ααΊαα±αΈ</span>
|
|
|
|
| 2693 |
</div>
|
| 2694 |
+
<div class="quick-card" onclick="document.querySelector('textarea').value='my spaces αα½α±ααΌαα±αΈ'; document.querySelector('textarea').dispatchEvent(new Event('input',{bubbles:true}))">
|
| 2695 |
+
<span class="qc-icon">📊</span>
|
| 2696 |
+
<span class="qc-label">my spaces ααΌαα±αΈ</span>
|
|
|
|
| 2697 |
</div>
|
| 2698 |
</div>
|
| 2699 |
""")
|
| 2700 |
|
| 2701 |
+
# ---- Chatbot (main area) ----
|
| 2702 |
+
chatbot = gr.Chatbot(
|
| 2703 |
+
height=550,
|
| 2704 |
+
placeholder="""
|
| 2705 |
+
<div style='text-align:center;padding:60px 20px;color:#9aa0a6;font-family:Inter,Noto Sans Myanmar,sans-serif'>
|
| 2706 |
+
<div style='font-size:40px;margin-bottom:12px'>✦</div>
|
| 2707 |
+
<div style='font-size:20px;font-weight:600;color:#e8eaed;margin-bottom:6px'>αα¬αα±α¬ααΊαα»ααΊαα«ααα²?</div>
|
| 2708 |
+
<div style='font-size:14px;color:#5f6368'>What would you like to build today?</div>
|
| 2709 |
+
<div style='font-size:13px;color:#5f6368;margin-top:10px'>App αα
αΊαα―αα±α¬ααΊαα»ααΊαααΊ ααΌα±α¬αα« / Just describe what you want</div>
|
| 2710 |
+
</div>
|
| 2711 |
+
""",
|
| 2712 |
+
)
|
| 2713 |
|
| 2714 |
+
# ---- Input row ----
|
| 2715 |
with gr.Row(equal_height=True):
|
| 2716 |
+
with gr.Column(scale=8, min_width=300):
|
| 2717 |
msg_input = gr.Textbox(
|
| 2718 |
+
placeholder="αα¬αα±α¬ααΊαα»ααΊαα²? / What would you like to build?...",
|
| 2719 |
show_label=False,
|
| 2720 |
container=False,
|
| 2721 |
lines=1,
|
| 2722 |
max_lines=4,
|
| 2723 |
)
|
| 2724 |
+
with gr.Column(scale=4, min_width=180):
|
| 2725 |
with gr.Row(equal_height=True):
|
| 2726 |
model_dropdown = gr.Dropdown(
|
| 2727 |
choices=["openai", "mistral", "deepseek", "llama", "qwen"],
|
| 2728 |
value="openai",
|
| 2729 |
label="Model",
|
| 2730 |
+
min_width=90,
|
| 2731 |
scale=2,
|
| 2732 |
)
|
| 2733 |
+
send_btn = gr.Button("Send", variant="primary", min_width=70, scale=1)
|
| 2734 |
+
clear_btn = gr.Button("Clear", elem_classes=["crew-clear-btn"], min_width=60, scale=1)
|
| 2735 |
|
| 2736 |
+
# ---- Quick examples row ----
|
| 2737 |
+
gr.Examples(
|
| 2738 |
+
examples=[
|
| 2739 |
+
"chatbot αα±α¬ααΊαα±αΈ",
|
| 2740 |
+
"image generator αα―ααΊαα±αΈ",
|
| 2741 |
+
"text to speech app αα±α¬ααΊαα±αΈ",
|
| 2742 |
+
"password generator αα―ααΊαα±αΈ",
|
| 2743 |
+
"translator app αα±α¬ααΊαα±αΈ",
|
| 2744 |
+
"my spaces αα½α±ααΌαα±αΈ",
|
| 2745 |
+
],
|
| 2746 |
+
inputs=msg_input,
|
| 2747 |
+
label="Quick Start",
|
| 2748 |
+
)
|
| 2749 |
|
| 2750 |
+
# ---- Dashboard accordion ----
|
| 2751 |
+
with gr.Accordion("Dashboard & Tools", open=False):
|
| 2752 |
with gr.Row():
|
| 2753 |
+
refresh_btn = gr.Button("Refresh Spaces", variant="primary")
|
| 2754 |
+
export_btn = gr.Button("Export Chat")
|
| 2755 |
spaces_output = gr.Textbox(label="Your Spaces", lines=8, interactive=False)
|
| 2756 |
stats_output = gr.Textbox(label="Session Stats", interactive=False)
|
| 2757 |
export_file = gr.File(label="Download")
|
| 2758 |
|
| 2759 |
+
# ---- Templates gallery accordion ----
|
| 2760 |
+
with gr.Accordion("Template Gallery", open=False):
|
| 2761 |
template_html = '<div class="tmpl-grid">'
|
| 2762 |
for tkey, tmpl in PROJECT_TEMPLATES.items():
|
| 2763 |
template_html += f'<div class="tmpl-card"><b>{tmpl["name"]}</b><br><span>{tkey}</span></div>'
|
| 2764 |
template_html += '</div>'
|
| 2765 |
gr.HTML(template_html)
|
| 2766 |
|
| 2767 |
+
# ---- Event handlers ----
|
| 2768 |
msg_input.submit(run_agent, [msg_input, chatbot, model_dropdown], [chatbot]).then(fn=lambda: "", outputs=msg_input)
|
| 2769 |
send_btn.click(run_agent, [msg_input, chatbot, model_dropdown], [chatbot], api_name="send").then(fn=lambda: "", outputs=msg_input)
|
| 2770 |
clear_btn.click(fn=lambda: ([], ""), inputs=None, outputs=[chatbot, msg_input])
|