Spaces:
Sleeping
Sleeping
File size: 13,805 Bytes
f510825 6b24f86 f510825 6b24f86 f510825 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
"""
🎨 Hacker Theme - Cyberpunk/Matrix Style UI
Modern, colorful, futuristic design for browser automation testing
"""
import gradio as gr
# Cyberpunk Hacker Theme with Neon Colors
hacker_theme = gr.themes.Base(
primary_hue=gr.themes.colors.cyan,
secondary_hue=gr.themes.colors.purple,
neutral_hue=gr.themes.colors.slate,
font=[
gr.themes.GoogleFont("Fira Code"),
gr.themes.GoogleFont("JetBrains Mono"),
"monospace"
],
).set(
# Background colors - Dark cyberpunk
body_background_fill="#0a0e27",
body_background_fill_dark="#050814",
# Panel backgrounds - Darker with glow
block_background_fill="#0f1729",
block_background_fill_dark="#0a0e1f",
# Border colors - Neon cyan/purple
block_border_color="#00ffff",
block_border_color_dark="#ff00ff",
block_border_width="2px",
# Input fields - Dark with neon borders
input_background_fill="#1a1f3a",
input_background_fill_dark="#0f1429",
input_border_color="#00ff88",
input_border_color_dark="#ff0088",
input_border_width="2px",
# Buttons - Neon gradient style
button_primary_background_fill="#00ff88",
button_primary_background_fill_dark="#ff0088",
button_primary_background_fill_hover="#00ffff",
button_primary_background_fill_hover_dark="#ff00ff",
button_primary_text_color="#000000",
button_primary_text_color_dark="#000000",
button_primary_border_color="#00ffff",
button_secondary_background_fill="#1a1f3a",
button_secondary_background_fill_dark="#0f1429",
button_secondary_background_fill_hover="#2a2f4a",
button_secondary_text_color="#00ff88",
button_secondary_text_color_dark="#ff0088",
button_secondary_border_color="#00ff88",
# Text colors - Bright neon
body_text_color="#00ffff",
body_text_color_dark="#00ff88",
# Link colors
link_text_color="#ff00ff",
link_text_color_dark="#00ffff",
link_text_color_hover="#ffff00",
# Slider colors
slider_color="#00ff88",
slider_color_dark="#ff0088",
# Shadow effects for glow
block_shadow="0 0 20px rgba(0, 255, 255, 0.3)",
block_shadow_dark="0 0 20px rgba(255, 0, 255, 0.3)",
# Tab colors
block_label_background_fill="#00ff88",
block_label_background_fill_dark="#ff0088",
block_label_text_color="#000000",
block_label_text_color_dark="#000000",
# Checkbox/Radio
checkbox_background_color="#1a1f3a",
checkbox_background_color_selected="#00ff88",
checkbox_background_color_selected_dark="#ff0088",
checkbox_border_color="#00ffff",
checkbox_border_color_dark="#ff00ff",
# Table colors
table_border_color="#00ff88",
table_even_background_fill="#0f1729",
table_odd_background_fill="#1a1f3a",
# Code block
code_background_fill="#0a0e1f",
# Radius for modern look
block_radius="8px",
button_large_radius="8px",
button_small_radius="6px",
input_radius="6px",
)
# Custom CSS for additional hacking effects
hacker_css = """
/* Matrix-style background animation */
@keyframes matrix-rain {
0% { background-position: 0% 0%; }
100% { background-position: 0% 100%; }
}
/* Glowing text effect */
@keyframes glow {
0%, 100% { text-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff, 0 0 15px #00ffff; }
50% { text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff, 0 0 30px #ff00ff; }
}
/* Neon border pulse */
@keyframes neon-pulse {
0%, 100% { border-color: #00ffff; box-shadow: 0 0 10px #00ffff; }
50% { border-color: #ff00ff; box-shadow: 0 0 20px #ff00ff; }
}
/* Apply to body */
body {
background: linear-gradient(135deg, #0a0e27 0%, #1a0e3a 50%, #0a0e27 100%);
background-size: 400% 400%;
animation: matrix-rain 20s ease infinite;
}
/* Main container glow */
.gradio-container {
box-shadow: 0 0 40px rgba(0, 255, 255, 0.2),
0 0 80px rgba(255, 0, 255, 0.1) !important;
border: 2px solid rgba(0, 255, 255, 0.3) !important;
border-radius: 12px !important;
}
/* Headers with glow effect */
h1, h2, h3 {
animation: glow 3s ease-in-out infinite !important;
font-family: 'Fira Code', 'JetBrains Mono', monospace !important;
font-weight: 700 !important;
letter-spacing: 2px !important;
}
/* Tab buttons */
.tab-nav button {
background: linear-gradient(135deg, #1a1f3a 0%, #2a2f4a 100%) !important;
border: 2px solid #00ff88 !important;
color: #00ffff !important;
font-family: 'Fira Code', monospace !important;
font-weight: 600 !important;
text-transform: uppercase !important;
letter-spacing: 1px !important;
transition: all 0.3s ease !important;
}
.tab-nav button:hover {
background: linear-gradient(135deg, #00ff88 0%, #00ffff 100%) !important;
color: #000000 !important;
box-shadow: 0 0 20px #00ffff !important;
transform: translateY(-2px) !important;
}
.tab-nav button.selected {
background: linear-gradient(135deg, #00ff88 0%, #ff0088 100%) !important;
color: #000000 !important;
border-color: #ff00ff !important;
box-shadow: 0 0 30px #ff00ff !important;
}
/* Input fields with neon glow */
input, textarea, select {
background: rgba(26, 31, 58, 0.8) !important;
border: 2px solid #00ff88 !important;
color: #00ffff !important;
font-family: 'Fira Code', monospace !important;
transition: all 0.3s ease !important;
}
input:focus, textarea:focus, select:focus {
border-color: #ff00ff !important;
box-shadow: 0 0 15px #ff00ff, inset 0 0 10px rgba(255, 0, 255, 0.2) !important;
background: rgba(26, 31, 58, 1) !important;
}
/* Buttons with cyberpunk style */
button {
background: linear-gradient(135deg, #00ff88 0%, #00ffff 100%) !important;
border: 2px solid #00ffff !important;
color: #000000 !important;
font-family: 'Fira Code', monospace !important;
font-weight: 700 !important;
text-transform: uppercase !important;
letter-spacing: 1px !important;
transition: all 0.3s ease !important;
position: relative !important;
overflow: hidden !important;
}
button:hover {
background: linear-gradient(135deg, #ff0088 0%, #ff00ff 100%) !important;
border-color: #ff00ff !important;
box-shadow: 0 0 25px #ff00ff !important;
transform: translateY(-2px) scale(1.02) !important;
}
button:active {
transform: translateY(0px) scale(0.98) !important;
}
/* Primary action buttons */
button.primary {
background: linear-gradient(135deg, #ff0088 0%, #ff00ff 100%) !important;
animation: neon-pulse 2s ease-in-out infinite !important;
}
/* Code blocks */
code, pre {
background: rgba(10, 14, 31, 0.9) !important;
border: 1px solid #00ff88 !important;
color: #00ffff !important;
font-family: 'Fira Code', monospace !important;
padding: 10px !important;
border-radius: 6px !important;
}
/* Progress bars */
.progress-bar {
background: linear-gradient(90deg, #00ff88 0%, #00ffff 50%, #ff00ff 100%) !important;
animation: matrix-rain 3s linear infinite !important;
}
/* Checkboxes and radio buttons */
input[type="checkbox"], input[type="radio"] {
accent-color: #00ff88 !important;
border: 2px solid #00ffff !important;
}
/* Scrollbar styling */
::-webkit-scrollbar {
width: 12px !important;
background: #0a0e27 !important;
}
::-webkit-scrollbar-track {
background: #0f1729 !important;
border: 1px solid #00ff88 !important;
}
::-webkit-scrollbar-thumb {
background: linear-gradient(180deg, #00ff88 0%, #00ffff 100%) !important;
border-radius: 6px !important;
border: 1px solid #00ffff !important;
}
::-webkit-scrollbar-thumb:hover {
background: linear-gradient(180deg, #ff0088 0%, #ff00ff 100%) !important;
}
/* Labels with neon effect */
label {
color: #00ffff !important;
font-family: 'Fira Code', monospace !important;
font-weight: 600 !important;
text-transform: uppercase !important;
letter-spacing: 1px !important;
font-size: 0.9em !important;
}
/* Info boxes */
.info, .warning, .error {
border-left: 4px solid #00ff88 !important;
background: rgba(0, 255, 136, 0.1) !important;
padding: 12px !important;
border-radius: 6px !important;
font-family: 'Fira Code', monospace !important;
}
.warning {
border-left-color: #ffff00 !important;
background: rgba(255, 255, 0, 0.1) !important;
}
.error {
border-left-color: #ff0088 !important;
background: rgba(255, 0, 136, 0.1) !important;
}
/* Ladybug Loading Animation */
.loading, .loader, [class*="loading"], .wrap.svelte-1cl284s {
position: relative !important;
width: 80px !important;
height: 80px !important;
border: none !important;
background: transparent !important;
}
.loading::before, .loader::before, [class*="loading"]::before {
content: "🐞" !important;
position: absolute !important;
top: 50% !important;
left: 50% !important;
transform: translate(-50%, -50%) !important;
font-size: 60px !important;
animation: ladybug-crawl 2s ease-in-out infinite !important;
filter: drop-shadow(0 0 10px #ff0088) !important;
}
.loading::after, .loader::after, [class*="loading"]::after {
content: "Loading..." !important;
position: absolute !important;
bottom: -30px !important;
left: 50% !important;
transform: translateX(-50%) !important;
color: #00ff88 !important;
font-family: 'Fira Code', monospace !important;
font-size: 12px !important;
letter-spacing: 2px !important;
text-shadow: 0 0 5px #00ff88 !important;
animation: pulse-text 1.5s ease-in-out infinite !important;
}
@keyframes ladybug-crawl {
0%, 100% {
transform: translate(-50%, -50%) rotate(0deg) scale(1);
}
25% {
transform: translate(-50%, -50%) rotate(-10deg) scale(1.1);
}
50% {
transform: translate(-50%, -50%) rotate(0deg) scale(1);
}
75% {
transform: translate(-50%, -50%) rotate(10deg) scale(1.1);
}
}
@keyframes pulse-text {
0%, 100% {
opacity: 0.6;
text-shadow: 0 0 5px #00ff88;
}
50% {
opacity: 1;
text-shadow: 0 0 15px #00ff88, 0 0 25px #00ff88;
}
}
/* Gradio specific loading indicators */
.pending, .generating {
position: relative !important;
}
.pending::before, .generating::before {
content: "🐞" !important;
font-size: 40px !important;
animation: ladybug-crawl 2s ease-in-out infinite !important;
filter: drop-shadow(0 0 10px #ff0088) !important;
}
/* Dropdown menus */
.dropdown {
background: rgba(26, 31, 58, 0.95) !important;
border: 2px solid #00ff88 !important;
box-shadow: 0 8px 32px rgba(0, 255, 255, 0.3) !important;
}
.dropdown-item:hover {
background: rgba(0, 255, 136, 0.2) !important;
color: #00ffff !important;
}
/* File upload area */
.file-upload {
border: 2px dashed #00ff88 !important;
background: rgba(26, 31, 58, 0.5) !important;
transition: all 0.3s ease !important;
}
.file-upload:hover {
border-color: #ff00ff !important;
background: rgba(255, 0, 255, 0.1) !important;
box-shadow: 0 0 20px rgba(255, 0, 255, 0.3) !important;
}
/* Status indicators */
.status-success {
color: #00ff88 !important;
text-shadow: 0 0 10px #00ff88 !important;
}
.status-error {
color: #ff0088 !important;
text-shadow: 0 0 10px #ff0088 !important;
}
.status-warning {
color: #ffff00 !important;
text-shadow: 0 0 10px #ffff00 !important;
}
/* Terminal-style output */
.terminal-output {
background: #0a0e1f !important;
border: 2px solid #00ff88 !important;
color: #00ff88 !important;
font-family: 'Fira Code', monospace !important;
padding: 15px !important;
border-radius: 8px !important;
box-shadow: inset 0 0 20px rgba(0, 255, 136, 0.1) !important;
}
/* Accordion/Collapsible sections */
.accordion-header {
background: linear-gradient(135deg, #1a1f3a 0%, #2a2f4a 100%) !important;
border: 2px solid #00ff88 !important;
color: #00ffff !important;
font-family: 'Fira Code', monospace !important;
font-weight: 600 !important;
}
.accordion-header:hover {
background: linear-gradient(135deg, #00ff88 0%, #00ffff 100%) !important;
color: #000000 !important;
box-shadow: 0 0 15px #00ffff !important;
}
/* Matrix-style text effect for headers */
.matrix-text {
background: linear-gradient(90deg, #00ff88, #00ffff, #ff00ff, #00ff88);
background-size: 200% auto;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
animation: matrix-rain 3s linear infinite;
}
/* Glitch effect for important elements */
@keyframes glitch {
0% { transform: translate(0); }
20% { transform: translate(-2px, 2px); }
40% { transform: translate(-2px, -2px); }
60% { transform: translate(2px, 2px); }
80% { transform: translate(2px, -2px); }
100% { transform: translate(0); }
}
.glitch-effect:hover {
animation: glitch 0.3s ease-in-out !important;
}
/* Neon divider */
hr {
border: none !important;
height: 2px !important;
background: linear-gradient(90deg, transparent, #00ffff, #ff00ff, #00ffff, transparent) !important;
margin: 20px 0 !important;
}
/* Card-style containers */
.card {
background: rgba(15, 23, 41, 0.8) !important;
border: 2px solid #00ff88 !important;
border-radius: 12px !important;
padding: 20px !important;
box-shadow: 0 0 30px rgba(0, 255, 255, 0.2) !important;
transition: all 0.3s ease !important;
}
.card:hover {
border-color: #ff00ff !important;
box-shadow: 0 0 40px rgba(255, 0, 255, 0.3) !important;
transform: translateY(-5px) !important;
}
"""
def get_hacker_theme():
"""Returns the hacker theme and CSS"""
return hacker_theme, hacker_css
|