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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
footer { display: none !important; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
"""
|
| 94 |
|
| 95 |
with gr.Blocks(title="DEFRAG NODE") as demo:
|
|
|
|
| 85 |
|
| 86 |
# --- THE UI ---
|
| 87 |
css = """
|
| 88 |
+
/* ====== DEFRAG.APP PREMIUM UI ====== */
|
| 89 |
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
| 90 |
+
|
| 91 |
+
body, html {
|
| 92 |
+
background: #0a0a0f;
|
| 93 |
+
color: #e0e4e8;
|
| 94 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
| 95 |
+
overflow: hidden;
|
| 96 |
+
}
|
| 97 |
+
|
| 98 |
+
/* Main Container - Mobile First */
|
| 99 |
+
.gradio-container {
|
| 100 |
+
max-width: 480px !important;
|
| 101 |
+
margin: 0 auto !important;
|
| 102 |
+
padding: 0 !important;
|
| 103 |
+
background: linear-gradient(135deg, #0a0a0f 0%, #141420 100%);
|
| 104 |
+
min-height: 100vh !important;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
/* Mandala Visual Frame - Glassmorphism */
|
| 108 |
+
#monitor-frame {
|
| 109 |
+
width: 100%;
|
| 110 |
+
height: 350px;
|
| 111 |
+
border: none;
|
| 112 |
+
border-radius: 0;
|
| 113 |
+
background: radial-gradient(circle at 50% 50%, rgba(80, 120, 255, 0.08) 0%, rgba(10, 10, 15, 0.95) 70%);
|
| 114 |
+
backdrop-filter: blur(20px);
|
| 115 |
+
-webkit-backdrop-filter: blur(20px);
|
| 116 |
+
position: relative;
|
| 117 |
+
overflow: hidden;
|
| 118 |
+
box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 20px 60px rgba(0,0,0,0.4);
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
#monitor-frame::before {
|
| 122 |
+
content: '';
|
| 123 |
+
position: absolute;
|
| 124 |
+
top: 50%;
|
| 125 |
+
left: 50%;
|
| 126 |
+
transform: translate(-50%, -50%);
|
| 127 |
+
width: 300px;
|
| 128 |
+
height: 300px;
|
| 129 |
+
background: radial-gradient(circle, rgba(100, 150, 255, 0.15) 0%, transparent 70%);
|
| 130 |
+
filter: blur(40px);
|
| 131 |
+
animation: subtleGlow 4s ease-in-out infinite;
|
| 132 |
+
pointer-events: none;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
@keyframes subtleGlow {
|
| 136 |
+
0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
|
| 137 |
+
50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.1); }
|
| 138 |
+
}
|
| 139 |
+
|
| 140 |
+
/* Audio Player - Hidden but Functional */
|
| 141 |
+
.audio-container {
|
| 142 |
+
display: none !important;
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
/* Chat Interface - ChatGPT Style Glassmorphism */
|
| 146 |
+
.chatbot-container {
|
| 147 |
+
background: rgba(20, 20, 32, 0.6) !important;
|
| 148 |
+
backdrop-filter: blur(30px) !important;
|
| 149 |
+
-webkit-backdrop-filter: blur(30px) !important;
|
| 150 |
+
border: 1px solid rgba(255,255,255,0.06) !important;
|
| 151 |
+
border-radius: 16px !important;
|
| 152 |
+
box-shadow: 0 8px 32px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.03) !important;
|
| 153 |
+
max-height: 450px !important;
|
| 154 |
+
overflow-y: auto !important;
|
| 155 |
+
padding: 20px !important;
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
.chat-window {
|
| 159 |
+
height: 450px !important;
|
| 160 |
+
overflow-y: auto !important;
|
| 161 |
+
scroll-behavior: smooth;
|
| 162 |
+
scrollbar-width: thin;
|
| 163 |
+
scrollbar-color: rgba(100,150,255,0.3) transparent;
|
| 164 |
+
}
|
| 165 |
+
|
| 166 |
+
.chat-window::-webkit-scrollbar {
|
| 167 |
+
width: 6px;
|
| 168 |
+
}
|
| 169 |
+
|
| 170 |
+
.chat-window::-webkit-scrollbar-track {
|
| 171 |
+
background: transparent;
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
.chat-window::-webkit-scrollbar-thumb {
|
| 175 |
+
background: rgba(100,150,255,0.3);
|
| 176 |
+
border-radius: 10px;
|
| 177 |
+
}
|
| 178 |
+
|
| 179 |
+
/* Message Bubbles - Premium Styling */
|
| 180 |
+
.message {
|
| 181 |
+
background: rgba(255,255,255,0.04) !important;
|
| 182 |
+
backdrop-filter: blur(10px);
|
| 183 |
+
border: 1px solid rgba(255,255,255,0.05);
|
| 184 |
+
border-radius: 12px;
|
| 185 |
+
padding: 12px 16px;
|
| 186 |
+
margin: 8px 0;
|
| 187 |
+
box-shadow: 0 4px 12px rgba(0,0,0,0.2);
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
.user-message {
|
| 191 |
+
background: linear-gradient(135deg, rgba(80,120,255,0.15), rgba(100,150,255,0.1)) !important;
|
| 192 |
+
border: 1px solid rgba(100,150,255,0.2);
|
| 193 |
+
}
|
| 194 |
+
|
| 195 |
+
.bot-message {
|
| 196 |
+
background: rgba(255,255,255,0.03) !important;
|
| 197 |
+
border: 1px solid rgba(255,255,255,0.06);
|
| 198 |
+
}
|
| 199 |
+
|
| 200 |
+
/* Input Box - Glassmorphism */
|
| 201 |
+
textarea, input[type="text"] {
|
| 202 |
+
background: rgba(30,30,45,0.8) !important;
|
| 203 |
+
border: 1px solid rgba(100,150,255,0.2) !important;
|
| 204 |
+
border-radius: 14px !important;
|
| 205 |
+
color: #e0e4e8 !important;
|
| 206 |
+
padding: 14px 18px !important;
|
| 207 |
+
font-size: 15px !important;
|
| 208 |
+
backdrop-filter: blur(20px);
|
| 209 |
+
-webkit-backdrop-filter: blur(20px);
|
| 210 |
+
box-shadow: inset 0 2px 8px rgba(0,0,0,0.2), 0 4px 16px rgba(0,0,0,0.1) !important;
|
| 211 |
+
transition: all 0.3s ease;
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
textarea:focus, input[type="text"]:focus {
|
| 215 |
+
outline: none !important;
|
| 216 |
+
border-color: rgba(100,150,255,0.5) !important;
|
| 217 |
+
box-shadow: inset 0 2px 8px rgba(0,0,0,0.2), 0 0 0 3px rgba(100,150,255,0.1), 0 4px 20px rgba(100,150,255,0.2) !important;
|
| 218 |
+
}
|
| 219 |
+
|
| 220 |
+
/* Buttons - Premium Glassmorphism */
|
| 221 |
+
button {
|
| 222 |
+
background: linear-gradient(135deg, rgba(80,120,255,0.2), rgba(100,150,255,0.15)) !important;
|
| 223 |
+
border: 1px solid rgba(100,150,255,0.3) !important;
|
| 224 |
+
border-radius: 12px !important;
|
| 225 |
+
color: #e0e4e8 !important;
|
| 226 |
+
padding: 12px 24px !important;
|
| 227 |
+
font-weight: 500 !important;
|
| 228 |
+
backdrop-filter: blur(20px) !important;
|
| 229 |
+
-webkit-backdrop-filter: blur(20px) !important;
|
| 230 |
+
box-shadow: 0 4px 16px rgba(100,150,255,0.15), inset 0 1px 0 rgba(255,255,255,0.1) !important;
|
| 231 |
+
transition: all 0.3s ease !important;
|
| 232 |
+
cursor: pointer !important;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
button:hover {
|
| 236 |
+
background: linear-gradient(135deg, rgba(80,120,255,0.3), rgba(100,150,255,0.25)) !important;
|
| 237 |
+
border-color: rgba(100,150,255,0.5) !important;
|
| 238 |
+
box-shadow: 0 6px 24px rgba(100,150,255,0.25), inset 0 1px 0 rgba(255,255,255,0.15) !important;
|
| 239 |
+
transform: translateY(-1px);
|
| 240 |
+
}
|
| 241 |
+
|
| 242 |
+
button:active {
|
| 243 |
+
transform: translateY(0);
|
| 244 |
+
box-shadow: 0 2px 8px rgba(100,150,255,0.2) !important;
|
| 245 |
+
}
|
| 246 |
+
|
| 247 |
+
/* Labels - Subtle Typography */
|
| 248 |
+
label {
|
| 249 |
+
color: rgba(224, 228, 232, 0.7) !important;
|
| 250 |
+
font-size: 13px !important;
|
| 251 |
+
font-weight: 500 !important;
|
| 252 |
+
text-transform: uppercase !important;
|
| 253 |
+
letter-spacing: 1.2px !important;
|
| 254 |
+
margin-bottom: 8px !important;
|
| 255 |
+
}
|
| 256 |
+
|
| 257 |
+
/* Remove Gradio Footer */
|
| 258 |
footer { display: none !important; }
|
| 259 |
+
|
| 260 |
+
/* Mobile Responsive */
|
| 261 |
+
@media (max-width: 480px) {
|
| 262 |
+
#monitor-frame { height: 300px; }
|
| 263 |
+
.chat-window { height: 400px !important; }
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
/* Subtle Animations */
|
| 267 |
+
@keyframes fadeIn {
|
| 268 |
+
from { opacity: 0; transform: translateY(10px); }
|
| 269 |
+
to { opacity: 1; transform: translateY(0); }
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
.message {
|
| 273 |
+
animation: fadeIn 0.3s ease;
|
| 274 |
+
}
|
| 275 |
"""
|
| 276 |
|
| 277 |
with gr.Blocks(title="DEFRAG NODE") as demo:
|