Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,49 +102,59 @@ def chat_logic(message, history, system_prompt, context, max_tokens, temperature
|
|
| 102 |
CSS = """
|
| 103 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
body {
|
| 106 |
font-family: 'Inter', sans-serif !important;
|
|
|
|
| 107 |
background: radial-gradient(circle at 10% 10%, #ffeef8 0%, #edf6ff 50%, #f7f0ff 90%) !important;
|
| 108 |
-
color: #1f2937;
|
| 109 |
margin: 0; padding: 0;
|
| 110 |
}
|
| 111 |
|
| 112 |
-
/* Contenedor principal transparente */
|
| 113 |
-
.gradio-container {
|
| 114 |
-
background: transparent !important;
|
| 115 |
-
}
|
| 116 |
-
|
| 117 |
/* Títulos */
|
| 118 |
-
h1 { font-weight: 700 !important; color: #111827
|
| 119 |
-
p { color: #4b5563; }
|
| 120 |
|
| 121 |
-
/* ---
|
| 122 |
.config-card {
|
| 123 |
-
background: rgba(255, 255, 255, 0.
|
| 124 |
-
border: 1px solid rgba(255, 255, 255, 0.
|
| 125 |
backdrop-filter: blur(12px);
|
| 126 |
border-radius: 24px;
|
| 127 |
padding: 24px;
|
| 128 |
-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01);
|
| 129 |
}
|
| 130 |
|
| 131 |
-
/*
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
}
|
| 138 |
|
| 139 |
-
/* Sliders */
|
| 140 |
-
input[type=
|
| 141 |
-
|
|
|
|
|
|
|
|
|
|
| 142 |
}
|
|
|
|
| 143 |
|
| 144 |
-
/* ---
|
| 145 |
.chat-window {
|
| 146 |
-
background: rgba(255, 255, 255, 0.
|
| 147 |
-
border: 1px solid rgba(255, 255, 255, 0.
|
| 148 |
backdrop-filter: blur(20px);
|
| 149 |
border-radius: 24px;
|
| 150 |
box-shadow: 0 20px 50px rgba(0,0,0,0.05);
|
|
@@ -152,97 +162,51 @@ input[type=range] {
|
|
| 152 |
padding: 0 !important;
|
| 153 |
}
|
| 154 |
|
| 155 |
-
/*
|
| 156 |
.window-header {
|
| 157 |
-
display: flex;
|
| 158 |
-
gap: 8px;
|
| 159 |
padding: 20px 24px 10px 24px;
|
|
|
|
| 160 |
}
|
| 161 |
.dot { width: 12px; height: 12px; border-radius: 50%; }
|
| 162 |
.red { background-color: #ff5f56; }
|
| 163 |
.yellow { background-color: #ffbd2e; }
|
| 164 |
.green { background-color: #27c93f; }
|
| 165 |
|
| 166 |
-
/* El Chatbot
|
| 167 |
#chatbot {
|
| 168 |
background: transparent !important;
|
| 169 |
-
border: none !important;
|
| 170 |
height: 500px !important;
|
| 171 |
}
|
| 172 |
-
|
|
|
|
| 173 |
.message.user {
|
| 174 |
-
background-color: #111827 !important;
|
| 175 |
color: white !important;
|
| 176 |
border-radius: 18px 18px 4px 18px !important;
|
| 177 |
}
|
| 178 |
.message.bot {
|
| 179 |
background-color: #ffffff !important;
|
| 180 |
color: #111827 !important;
|
| 181 |
-
border: 1px solid #e5e7eb;
|
| 182 |
border-radius: 18px 18px 18px 4px !important;
|
| 183 |
-
box-shadow: 0 2px 5px rgba(0,0,0,0.02);
|
| 184 |
}
|
| 185 |
|
| 186 |
-
/*
|
| 187 |
.chat-input-area {
|
| 188 |
padding: 16px 24px 24px 24px;
|
| 189 |
-
display: flex;
|
| 190 |
-
gap: 10px;
|
| 191 |
-
align-items: center;
|
| 192 |
}
|
| 193 |
#msg-box textarea {
|
| 194 |
border-radius: 99px !important;
|
| 195 |
background: #ffffff !important;
|
| 196 |
-
|
| 197 |
-
border: 1px solid #e5e7eb !important;
|
| 198 |
}
|
| 199 |
#send-btn {
|
| 200 |
background: #111827 !important;
|
| 201 |
color: white !important;
|
| 202 |
border-radius: 50% !important;
|
| 203 |
-
width: 50px;
|
| 204 |
-
height: 50px;
|
| 205 |
-
min-width: 50px !important;
|
| 206 |
-
display: flex;
|
| 207 |
-
align-items: center;
|
| 208 |
-
justify-content: center;
|
| 209 |
-
font-size: 1.2em;
|
| 210 |
-
padding: 0 !important;
|
| 211 |
}
|
| 212 |
-
|
| 213 |
-
/* Logos de trusted by */
|
| 214 |
-
.trusted-logos {
|
| 215 |
-
opacity: 0.5;
|
| 216 |
-
filter: grayscale(100%);
|
| 217 |
-
margin-top: 40px;
|
| 218 |
-
display: flex;
|
| 219 |
-
gap: 20px;
|
| 220 |
-
font-weight: 600;
|
| 221 |
-
font-size: 1.2rem;
|
| 222 |
-
}
|
| 223 |
-
"""
|
| 224 |
-
|
| 225 |
-
# HTML para la cabecera de la ventana de chat
|
| 226 |
-
WINDOW_HEADER_HTML = """
|
| 227 |
-
<div class="window-header">
|
| 228 |
-
<div class="dot red"></div>
|
| 229 |
-
<div class="dot yellow"></div>
|
| 230 |
-
<div class="dot green"></div>
|
| 231 |
-
<span style="margin-left: 10px; font-size: 0.85rem; color: #6b7280; font-weight: 500;">Iris AI Assistant</span>
|
| 232 |
-
</div>
|
| 233 |
-
"""
|
| 234 |
-
|
| 235 |
-
# HTML para la sección "Trusted by" simulada
|
| 236 |
-
TRUSTED_HTML = """
|
| 237 |
-
<div style="margin-top: 40px;">
|
| 238 |
-
<p style="font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: #9ca3af;">Trusted by</p>
|
| 239 |
-
<div class="trusted-logos">
|
| 240 |
-
<span>Pingdom</span>
|
| 241 |
-
<span>prismic</span>
|
| 242 |
-
<span>Unsplash</span>
|
| 243 |
-
<span>krisp</span>
|
| 244 |
-
</div>
|
| 245 |
-
</div>
|
| 246 |
"""
|
| 247 |
|
| 248 |
with gr.Blocks(css=CSS, title="Custom AI Layout") as demo:
|
|
|
|
| 102 |
CSS = """
|
| 103 |
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');
|
| 104 |
|
| 105 |
+
/* --- FORZAR MODO CLARO Y VARIABLES --- */
|
| 106 |
+
:root, .dark, body, .gradio-container {
|
| 107 |
+
--body-text-color: #1f2937 !important;
|
| 108 |
+
--body-background-fill: transparent !important;
|
| 109 |
+
--background-fill-primary: transparent !important;
|
| 110 |
+
--background-fill-secondary: transparent !important;
|
| 111 |
+
--block-background-fill: transparent !important;
|
| 112 |
+
--block-border-color: rgba(255,255,255, 0.4) !important;
|
| 113 |
+
--input-background-fill: rgba(255, 255, 255, 0.9) !important;
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
body {
|
| 117 |
font-family: 'Inter', sans-serif !important;
|
| 118 |
+
/* Tu gradiente original */
|
| 119 |
background: radial-gradient(circle at 10% 10%, #ffeef8 0%, #edf6ff 50%, #f7f0ff 90%) !important;
|
| 120 |
+
color: #1f2937 !important;
|
| 121 |
margin: 0; padding: 0;
|
| 122 |
}
|
| 123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
/* Títulos */
|
| 125 |
+
h1 { font-weight: 700 !important; color: #111827 !important; }
|
| 126 |
+
p, span, label { color: #4b5563 !important; }
|
| 127 |
|
| 128 |
+
/* --- TARJETAS DE CRISTAL (Panel Izquierdo) --- */
|
| 129 |
.config-card {
|
| 130 |
+
background: rgba(255, 255, 255, 0.6) !important;
|
| 131 |
+
border: 1px solid rgba(255, 255, 255, 0.8) !important;
|
| 132 |
backdrop-filter: blur(12px);
|
| 133 |
border-radius: 24px;
|
| 134 |
padding: 24px;
|
|
|
|
| 135 |
}
|
| 136 |
|
| 137 |
+
/* Evitar que los grupos internos se pongan negros */
|
| 138 |
+
.config-card .gr-form,
|
| 139 |
+
.config-card .gr-box,
|
| 140 |
+
.config-card .gr-block {
|
| 141 |
+
background: transparent !important;
|
| 142 |
+
border: none !important;
|
| 143 |
}
|
| 144 |
|
| 145 |
+
/* Inputs y Sliders */
|
| 146 |
+
textarea, input[type="text"] {
|
| 147 |
+
background-color: rgba(255, 255, 255, 0.95) !important;
|
| 148 |
+
color: #111827 !important;
|
| 149 |
+
border: 1px solid #e5e7eb !important;
|
| 150 |
+
border-radius: 12px !important;
|
| 151 |
}
|
| 152 |
+
input[type=range] { accent-color: #111827; }
|
| 153 |
|
| 154 |
+
/* --- VENTANA DE CHAT (Panel Derecho) --- */
|
| 155 |
.chat-window {
|
| 156 |
+
background: rgba(255, 255, 255, 0.85) !important;
|
| 157 |
+
border: 1px solid rgba(255, 255, 255, 0.9);
|
| 158 |
backdrop-filter: blur(20px);
|
| 159 |
border-radius: 24px;
|
| 160 |
box-shadow: 0 20px 50px rgba(0,0,0,0.05);
|
|
|
|
| 162 |
padding: 0 !important;
|
| 163 |
}
|
| 164 |
|
| 165 |
+
/* Header tipo Mac */
|
| 166 |
.window-header {
|
|
|
|
|
|
|
| 167 |
padding: 20px 24px 10px 24px;
|
| 168 |
+
display: flex; gap: 8px; align-items: center;
|
| 169 |
}
|
| 170 |
.dot { width: 12px; height: 12px; border-radius: 50%; }
|
| 171 |
.red { background-color: #ff5f56; }
|
| 172 |
.yellow { background-color: #ffbd2e; }
|
| 173 |
.green { background-color: #27c93f; }
|
| 174 |
|
| 175 |
+
/* El Chatbot Area Negra - FIX */
|
| 176 |
#chatbot {
|
| 177 |
background: transparent !important;
|
|
|
|
| 178 |
height: 500px !important;
|
| 179 |
}
|
| 180 |
+
|
| 181 |
+
/* Mensajes del chat */
|
| 182 |
.message.user {
|
| 183 |
+
background-color: #111827 !important;
|
| 184 |
color: white !important;
|
| 185 |
border-radius: 18px 18px 4px 18px !important;
|
| 186 |
}
|
| 187 |
.message.bot {
|
| 188 |
background-color: #ffffff !important;
|
| 189 |
color: #111827 !important;
|
| 190 |
+
border: 1px solid #e5e7eb !important;
|
| 191 |
border-radius: 18px 18px 18px 4px !important;
|
|
|
|
| 192 |
}
|
| 193 |
|
| 194 |
+
/* Input inferior del chat */
|
| 195 |
.chat-input-area {
|
| 196 |
padding: 16px 24px 24px 24px;
|
| 197 |
+
display: flex; gap: 10px; align-items: center;
|
|
|
|
|
|
|
| 198 |
}
|
| 199 |
#msg-box textarea {
|
| 200 |
border-radius: 99px !important;
|
| 201 |
background: #ffffff !important;
|
| 202 |
+
color: #000 !important;
|
|
|
|
| 203 |
}
|
| 204 |
#send-btn {
|
| 205 |
background: #111827 !important;
|
| 206 |
color: white !important;
|
| 207 |
border-radius: 50% !important;
|
| 208 |
+
width: 50px; height: 50px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 210 |
"""
|
| 211 |
|
| 212 |
with gr.Blocks(css=CSS, title="Custom AI Layout") as demo:
|