Spaces:
Runtime error
Runtime error
| # modules/ui/common.py | |
| CSS_STYLES = """ | |
| body { font-family: 'Inter', 'Segoe UI', Arial, sans-serif; background: #f0f2f5; color: #333; } | |
| .gradio-container { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.07); border-radius: 12px; overflow: hidden; background: #ffffff; max-width: 96% !important; } | |
| h1, h2, h3, h4, h5, h6 { color: #2c3e50; font-weight: 600; } | |
| .tab-nav { display: flex; justify-content: center; width: 100%; } | |
| .gr-tab-item { padding: 15px 25px; font-size: 1.1em; font-weight: 500; } | |
| .gr-tab-item.selected { background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%); color: white; border-radius: 8px 8px 0 0; } | |
| .gr-button { border-radius: 8px; font-weight: 600; transition: all 0.3s ease; } | |
| .gr-button.primary { background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%); color: white; border: none; } | |
| .gr-button.primary:hover { opacity: 0.9; transform: translateY(-1px); } | |
| .gr-button.stop { background: linear-gradient(45deg, #ff4e50 0%, #f9d423 100%); color: white; border: none; } | |
| .gr-button.stop:hover { opacity: 0.9; transform: translateY(-1px); } | |
| .gr-textbox, .gr-dropdown, .gr-slider { border-radius: 8px; border: 1px solid #e0e0e0; box-shadow: inset 0 1px 3px rgba(0,0,0,0.05); } | |
| .gr-image, .gr-dataframe { border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06); } | |
| .kategori-grid-app2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 10px; } | |
| .kategori-card-app2 { background: #ffffff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 20px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); transition: all 0.3s ease; display: flex; flex-direction: column; } | |
| .kategori-card-app2:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); border-color: #cbd5e1; } | |
| .kategori-title-app2 { font-size: 1.25rem; font-weight: 700; color: #1e293b; margin-bottom: 12px; border-bottom: 2px solid #f1f5f9; padding-bottom: 8px; letter-spacing: -0.025em; } | |
| .kategori-tags-app2 { font-size: 0.95rem; color: #475569; line-height: 1.6; font-family: 'Consolas', 'Monaco', monospace; background: #f8fafc; padding: 10px; border-radius: 8px; border: 1px solid #e2e8f0; flex-grow: 1; } | |
| .grid-tag { background:#fff3; display:inline-block; margin:2px 6px 2px 0; padding:5px 10px; border-radius:12px; border:1px solid #cbd5e1; font-size:14px; color:#334155; } | |
| #alert-box { margin-top: 15px; padding: 12px 18px; border-radius: 8px; font-weight: 600; text-align: center; } | |
| #alert-box[value^="β "] { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; } | |
| #alert-box[value^="β οΈ"] { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; } | |
| #alert-box[value^="β"] { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; } | |
| #alert-box[value^="ποΈ"] { background-color: #e2e3e5; color: #383d41; border: 1px solid #d6d8db; } | |
| #renaming-alert-box { margin-top: 15px; padding: 12px 18px; border-radius: 8px; font-weight: 600; text-align: left; white-space: pre-wrap; } | |
| #renaming-alert-box[value^="β "] { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; } | |
| #renaming-alert-box[value^="β οΈ"] { background-color: #fff3cd; color: #856404; border: 1px solid #ffeeba; } | |
| #renaming-alert-box[value^="β"] { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; } | |
| #renaming-alert-box[value^="βΉοΈ"] { background-color: #cce5ff; color: #004085; border: 1px solid #b8daff; } | |
| .gr-box { border: 1px solid #e0e0e0 !important; border-radius: 12px !important; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important; } | |
| .gr-row, .gr-column { padding: 10px; } | |
| .copy-output-btn { margin-top: 10px; padding: 8px 12px; border-radius: 6px; background-color: #f0f0f0; border: 1px solid #ccc; cursor: pointer; font-weight: 500; transition: all 0.2s ease; width: 100%; } | |
| .copy-output-btn:hover { background-color: #e0e0e0; } | |
| .vertical-divider { border-left: 2px solid #e0e0e0; height: auto; margin: 0 20px; } | |
| /* --- Tab Styling Improvements --- */ | |
| .gradio-container .tabs > .tab-nav { | |
| border-bottom: 2px solid #e5e7eb; | |
| margin-bottom: 20px; | |
| background-color: #f8fafc; | |
| border-radius: 12px 12px 0 0; | |
| padding: 10px 10px 0 10px; | |
| /* Force single line */ | |
| display: flex; | |
| justify-content: center; /* Or center, depending on preference */ | |
| flex-wrap: nowrap; | |
| overflow-x: auto; /* Allow scrolling if it really doesn't fit */ | |
| white-space: nowrap; | |
| } | |
| .gradio-container .tabs > .tab-nav > button { | |
| display: inline-flex; | |
| justify-content: center; | |
| align-items: center; | |
| padding: 5px 8px; /* Reduced padding further */ | |
| font-size: 0.9em; /* Reduced font size further */ | |
| font-weight: 700 !important; | |
| color: #64748b; | |
| border: none; | |
| background: transparent; | |
| cursor: pointer; | |
| transition: all 0.2s ease; | |
| border-radius: 8px 8px 0 0; | |
| margin-right: 2px; | |
| font-family: 'Segoe UI', sans-serif; | |
| letter-spacing: 0.01em; | |
| flex-shrink: 0; /* Prevent squishing too much */ | |
| } | |
| .gradio-container .tabs > .tab-nav > button:hover { | |
| color: #3b82f6; | |
| background-color: #e2e8f0; | |
| } | |
| .gradio-container .tabs > .tab-nav > button.selected { | |
| color: #2563eb; | |
| background-color: #ffffff; | |
| border-bottom: 3px solid #2563eb; | |
| box-shadow: 0 -2px 4px -1px rgba(0, 0, 0, 0.05); | |
| font-size: 0.95em; /* Slightly larger than normal but smaller than before */ | |
| z-index: 10; | |
| } | |
| .footer-content { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 15px; } | |
| /* Hidden Timer Buttons */ | |
| #timer_btn, #main_loop_btn { display: none !important; } | |
| """ | |