Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,16 +64,45 @@ def process_query(message, history):
|
|
| 64 |
return f"[{t}] {reply}"
|
| 65 |
|
| 66 |
# ============================================================
|
| 67 |
-
#
|
| 68 |
# ============================================================
|
| 69 |
custom_css = """
|
| 70 |
-
body {
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
"""
|
| 75 |
|
| 76 |
-
|
|
|
|
|
|
|
|
|
|
| 77 |
gr.Markdown(
|
| 78 |
f"""
|
| 79 |
<div style='text-align:center;'>
|
|
@@ -133,7 +162,7 @@ with gr.Blocks(css=custom_css, title=APP_TITLE, theme=gr.themes.Soft(primary_hue
|
|
| 133 |
try:
|
| 134 |
safe_env = {k:getattr(math,k) for k in dir(math)}
|
| 135 |
result = eval(expr, {"__builtins__":None}, safe_env)
|
| 136 |
-
return f"<div style='color:#
|
| 137 |
except Exception as e:
|
| 138 |
return f"<div style='color:#ffaa00;'>⚠️ Expression error: {e}</div>"
|
| 139 |
|
|
|
|
| 64 |
return f"[{t}] {reply}"
|
| 65 |
|
| 66 |
# ============================================================
|
| 67 |
+
# QUANTUM-STYLE THEME (light + animated grid)
|
| 68 |
# ============================================================
|
| 69 |
custom_css = """
|
| 70 |
+
body {
|
| 71 |
+
background: radial-gradient(circle at 30% 20%, #d0e7ff 0%, #a7d4ff 30%, #7fb8ff 60%, #4a90e2 100%);
|
| 72 |
+
font-family: 'IBM Plex Sans', sans-serif;
|
| 73 |
+
color: #001133 !important;
|
| 74 |
+
}
|
| 75 |
+
.gradio-container {
|
| 76 |
+
background: rgba(255,255,255,0.85) !important;
|
| 77 |
+
backdrop-filter: blur(6px);
|
| 78 |
+
border-radius: 12px;
|
| 79 |
+
box-shadow: 0 0 25px rgba(0,140,255,0.3);
|
| 80 |
+
}
|
| 81 |
+
#component-0, #component-1, #component-2 {
|
| 82 |
+
color: #001133 !important;
|
| 83 |
+
}
|
| 84 |
+
/* Subtle animated quantum grid */
|
| 85 |
+
body::before {
|
| 86 |
+
content: "";
|
| 87 |
+
position: fixed;
|
| 88 |
+
top: 0; left: 0; right: 0; bottom: 0;
|
| 89 |
+
background-image:
|
| 90 |
+
linear-gradient(90deg, rgba(0,180,255,0.08) 1px, transparent 1px),
|
| 91 |
+
linear-gradient(0deg, rgba(0,180,255,0.08) 1px, transparent 1px);
|
| 92 |
+
background-size: 40px 40px;
|
| 93 |
+
animation: drift 20s linear infinite;
|
| 94 |
+
z-index: -1;
|
| 95 |
+
}
|
| 96 |
+
@keyframes drift {
|
| 97 |
+
from {background-position: 0 0, 0 0;}
|
| 98 |
+
to {background-position: 40px 40px, 40px 40px;}
|
| 99 |
+
}
|
| 100 |
"""
|
| 101 |
|
| 102 |
+
# ============================================================
|
| 103 |
+
# BUILD INTERFACE
|
| 104 |
+
# ============================================================
|
| 105 |
+
with gr.Blocks(css=custom_css, title=APP_TITLE, theme=gr.themes.Soft(primary_hue="cyan")) as demo:
|
| 106 |
gr.Markdown(
|
| 107 |
f"""
|
| 108 |
<div style='text-align:center;'>
|
|
|
|
| 162 |
try:
|
| 163 |
safe_env = {k:getattr(math,k) for k in dir(math)}
|
| 164 |
result = eval(expr, {"__builtins__":None}, safe_env)
|
| 165 |
+
return f"<div style='color:#00a37a;font-weight:bold;'>🧠 Rendered Result: {result}</div>"
|
| 166 |
except Exception as e:
|
| 167 |
return f"<div style='color:#ffaa00;'>⚠️ Expression error: {e}</div>"
|
| 168 |
|