import gradio as gr import os import datetime # --- Theme Configuration --- custom_theme = gr.themes.Default( primary_hue="blue", secondary_hue="blue", neutral_hue="slate", ).set( loader_color="#0071bb", button_primary_background_fill="#0071bb", button_primary_background_fill_hover="#005a94", button_primary_text_color="white", slider_color="#0071bb", checkbox_background_color_selected="#0071bb", checkbox_border_color_selected="#0071bb", body_background_fill="#0a0a0a", body_background_fill_dark="#0a0a0a", block_background_fill="#1a1a1a", block_background_fill_dark="#1a1a1a" ) # --- Environment Setup --- token = os.environ.get("TOKEN", "") model = os.environ.get("MODEL", "") # --- CSS --- css = ''' /* 1. Global Layout & Colors */ .gradio-container { max-width: 1200px !important; margin: 0 auto !important; padding: 0 1rem !important; background: #0a0a0a !important; color: #ffffff !important; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important; } a { color: #a0a0a0 !important; } footer, #huggingface-space-header { display: none !important; } /* 2. Header & Typography */ .header-container { text-align: center; padding: 2rem 0 1rem; } .logo-wrapper { display: flex; justify-content: center; align-items: center; gap: 2rem; margin-bottom: 1.5rem; } .logo-divider { width: 1px; height: 40px; background: #2a2a2a; } .main-title { font-size: 1.8rem; font-weight: 400; margin-bottom: 0.5rem; color: #fff; } .subtitle { color: #a0a0a0; font-size: 0.9rem; } .footer { text-align: center; padding: 3rem 0 2rem; border-top: 1px solid #2a2a2a; color: #a0a0a0; } /* 3. RESULT CARD STYLING */ .result-card { background: #111; border-radius: 12px; overflow: hidden; border: 1px solid #2a2a2a; margin-top: 1rem; } .video-wrapper { height: 420px; display: flex; align-items: center; justify-content: center; background: #000; } .video-wrapper video { max-height: 100%; max-width: 100%; object-fit: contain; } .controls-wrapper { padding: 12px; display: flex; justify-content: space-between; align-items: center; background: #161616; } .info { color: #a0a0a0; font-size: 0.9rem; } /* 4. BUTTON STYLING */ .action-btn-blue { background: #0071bb !important; color: white !important; padding: 10px 18px !important; border-radius: 8px !important; text-decoration: none !important; font-weight: 600 !important; font-size: 13px !important; border: none !important; cursor: pointer !important; transition: 0.2s !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; } .action-btn-blue:hover { background: #005a94 !important; transform: translateY(-1px) !important; } .md-button { background: #1a1a1a !important; border: 1px solid #2a2a2a !important; color: #a0a0a0 !important; border-radius: 6px !important; font-family: inherit !important; transition: 0.2s !important; cursor: pointer !important; } .md-button:hover { background: #252525 !important; border-color: #0071bb !important; color: #fff !important; } /* 5. Placeholder & Gear Spin Animation */ .placeholder-box { height: 480px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #111; border: 2px dashed #222; border-radius: 12px; color: #666; } .gear-spin { font-size: 40px; animation: spin 2s linear infinite; display: inline-block; } @keyframes spin { 100% { transform: rotate(360deg); } } .loading-pulse { animation: pulse 2s ease-in-out infinite !important; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } } ''' with gr.Blocks(fill_height=False, fill_width=True, css=css, js=""" () => { document.title ='AskCyph™ Video Studio - Cypher Tech Inc.'; const link = document.querySelector("link[rel~='icon']") || document.createElement('link'); link.type = 'image/svg+xml'; link.rel = 'icon'; link.href = 'https://cms.cypherchat.app/uploads/favicon_8bc904ca6b.svg'; document.getElementsByTagName('head')[0].appendChild(link); } """, theme=custom_theme) as demo: # Header Section gr.HTML("""
""") # Load Video generator with gr.Group(): loaded_demo = gr.load(model, src="spaces", token=token) # Footer Section current_year = datetime.datetime.now().year gr.HTML(f""" """) if __name__ == "__main__": demo.launch(show_api=False, show_error=False, quiet=True)