X STUDIO
import gradio as gr import os # --- CSS STYLING (Replicating the dark purple UI) --- # We inject custom CSS to make it match your screenshot design. custom_css = """ /* Overall App Background */ .gradio-container { background-color: #121212 !important; color: #E0E0E0 !important; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } /* Header Section */ .main-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; background-color: #1e1e1e; border-bottom: 1px solid #333; } .header-logo { font-size: 1.5em; font-weight: bold; color: #FFC107; /* Yellow AMINA text */ } .header-title { color: #E0E0E0; font-weight: 300; } .header-nav { display: flex; gap: 20px; color: #BDBDBD; } .header-nav a:hover { color: #BB86FC; /* Purple accent on hover */ } /* Sidebar Styling */ .sidebar { background-color: #1e1e1e !important; padding: 20px !important; border-right: 1px solid #333; } .new-project-btn button { background-color: #BB86FC !important; color: black !important; border-radius: 8px !important; font-weight: bold; } .recent-projects-label { color: #757575; margin-top: 30px; margin-bottom: 10px; font-size: 0.9em; } .project-item { padding: 10px; border-radius: 5px; color: #E0E0E0; cursor: pointer; } .project-item:hover { background-color: #333; } .project-item.active { background-color: #212121; border-left: 3px solid #BB86FC; } /* Main Content Area */ .content-area { background-color: #121212 !important; padding: 30px !important; } .video-title { font-size: 1.8em; font-weight: bold; color: #E0E0E0; margin-bottom: 20px; } /* Video Display Box */ .video-box { background-color: #1e1e1e; border-radius: 12px; padding: 20px; margin-bottom: 30px; border: 1px solid #333; } .video-box .wrap { background-color: #000; /* Black background for video player */ } .video-description { color: #BDBDBD; font-size: 0.95em; line-height: 1.5em; margin-top: 15px; } /* Prompt Input Box */ .prompt-box { background-color: #1e1e1e; border-radius: 12px; padding: 15px; border: 1px solid #333; } .prompt-box textarea { background-color: transparent !important; color: #E0E0E0 !important; border: none !important; font-size: 1.1em; } .prompt-box .label { display: none !important; /* Hide standard label */ } .tag-buttons { display: flex; gap: 10px; margin-bottom: 10px; } .tag-btn { background-color: #333 !important; color: #E0E0E0 !important; border: none !important; border-radius: 20px !important; padding: 5px 15px !important; font-size: 0.85em; cursor: pointer; } .tag-btn:hover { background-color: #444 !important; } .icon-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: #BB86FC; /* Purple icon color */ } .icon-row .left-icons, .icon-row .right-icons { display: flex; gap: 15px; font-size: 1.2em; } .icon-row svg { cursor: pointer; } """ # --- GRADIO UI LAYOUT --- with gr.Blocks(css=custom_css, theme=gr.themes.Base()) as demo: # 1. Header Component (Custom HTML to match screenshot) gr.HTML("""
""") with gr.Row(elem_classes="content-area"): # 2. Sidebar Component with gr.Column(scale=1, elem_classes="sidebar"): gr.Button("+ New Project", elem_classes="new-project-btn") gr.Markdown("Recent Project", elem_classes="recent-projects-label") # Project List Items (Clickable placeholders) gr.HTML('