from llm import chat_ari from assets import emotion_assets import gradio as gr CSS = """ body { background: #ffffff; overflow-x: hidden; font-family: "Comic Sans MS", "Chalkboard SE", "Trebuchet MS", sans-serif; } .gradio-container { background: #ffffff !important; } #app { max-width: 1400px; margin: auto; } #ari-layout { display: flex; flex-direction: row; align-items: flex-start; gap: 20px; padding: 24px; min-height: 520px; } /* remove gradio image frame */ #ari-character > .wrap, #ari-character img, #ari-character [data-testid="image"] { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; } #ari-character * { background: transparent !important; border: none !important; box-shadow: none !important; } #ari-character img { width: 280px; height: auto; border-radius: 0; filter: drop-shadow(0px 8px 18px rgba(0,0,0,0.12)); } /* bubble wrapper */ #ari-bubble-wrapper { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; } /* ari label */ #ari-name { font-size: 14px; color: #7b61c9; font-weight: 800; letter-spacing: 0.5px; padding-left: 8px; text-shadow: 1px 1px 0px white; } /* cartoon bubble */ #ari-bubble { position: relative; background: #f7f3ff; color: #2d2440; padding: 22px 26px; border-radius: 30px; font-size: 17px; line-height: 1.8; max-width: 650px; min-height: 110px; display: flex; align-items: center; border: 3px solid #2d2440; box-shadow: 6px 6px 0px #d8ccff, 12px 12px 0px rgba(0,0,0,0.07); transform: rotate(-0.4deg); transition: transform 0.18s ease, box-shadow 0.18s ease; } /* bubble hover animation */ #ari-bubble:hover { transform: rotate(0deg) translateY(-2px); box-shadow: 8px 8px 0px #d8ccff, 14px 14px 0px rgba(0,0,0,0.07); } /* speech bubble tail */ #ari-bubble::before { content: ""; position: absolute; left: -16px; top: 36px; width: 28px; height: 28px; background: #f7f3ff; border-left: 3px solid #2d2440; border-bottom: 3px solid #2d2440; transform: rotate(45deg); z-index: 1; } /* keep text above tail */ #ari-bubble > * { position: relative; z-index: 2; } /* text input */ #message-box textarea { background: #ffffff !important; color: #2d2440 !important; border: 3px solid #2d2440 !important; border-radius: 18px !important; font-size: 16px !important; box-shadow: 4px 4px 0px #d8ccff !important; padding: 14px !important; } /* remove textarea glow */ #message-box textarea:focus { box-shadow: 6px 6px 0px #cabaff !important; border-color: #7b61c9 !important; } /* send button */ #send-btn { border-radius: 16px !important; height: 52px !important; font-size: 16px !important; font-weight: 700 !important; border: 3px solid #2d2440 !important; background: #8b6dff !important; color: white !important; box-shadow: 4px 4px 0px #2d2440 !important; transition: transform 0.15s ease, box-shadow 0.15s ease !important; } /* button press effect */ #send-btn:hover { transform: translateY(-2px); box-shadow: 6px 6px 0px #2d2440 !important; } #send-btn:active { transform: translateY(2px); box-shadow: 2px 2px 0px #2d2440 !important; } /* code block */ #code-block { margin-top: 12px; border-radius: 18px; overflow: hidden; border: 3px solid #2d2440; box-shadow: 6px 6px 0px #d8ccff; } """ def build_bubble(message: str) -> str: return f"""