diff --git a/app.py b/app.py index 08a4d89..bf1ce11 100644 --- a/app.py +++ b/app.py @@ -1342,6 +1342,7 @@ class HookRequest(BaseModel): position: Optional[str] = "top" # top, center, bottom size: Optional[str] = "M" # S, M, L duration_seconds: Optional[float] = None # None = hook visible for the whole clip + style: Optional[str] = "classic" # classic/dark/yellow/red/outline/outline_yellow @app.post("/api/hook") async def add_hook(req: HookRequest, request: Request): @@ -1395,7 +1396,7 @@ async def add_hook(req: HookRequest, request: Request): try: # Run in thread pool def run_hook(): - add_hook_to_video(input_path, req.text, output_path, position=req.position, font_scale=font_scale, duration=req.duration_seconds) + add_hook_to_video(input_path, req.text, output_path, position=req.position, font_scale=font_scale, duration=req.duration_seconds, style=req.style) loop = asyncio.get_event_loop() await loop.run_in_executor(None, run_hook) diff --git a/dashboard/src/components/HookModal.jsx b/dashboard/src/components/HookModal.jsx index e773be7..5259dc3 100644 --- a/dashboard/src/components/HookModal.jsx +++ b/dashboard/src/components/HookModal.jsx @@ -11,6 +11,16 @@ const ENTRANCE_OPTIONS = [ { value: 'none', label: 'None' }, ]; +// Must mirror hooks.py HOOK_STYLES. +const HOOK_STYLES = [ + { value: 'classic', label: 'Classic', box: 'rgba(255,255,255,0.94)', text: '#000' }, + { value: 'dark', label: 'Dark', box: 'rgba(18,18,20,0.92)', text: '#fff' }, + { value: 'yellow', label: 'Yellow', box: 'rgba(255,214,0,0.96)', text: '#000' }, + { value: 'red', label: 'Red', box: 'rgba(220,38,38,0.96)', text: '#fff' }, + { value: 'outline', label: 'Outline', box: 'transparent', text: '#fff', outline: true }, + { value: 'outline_yellow', label: 'Outline+', box: 'transparent', text: '#FFD600', outline: true }, +]; + const POSITION_OPTIONS = [ { value: 'top', label: 'top' }, { value: 'center', label: 'center' }, @@ -27,6 +37,7 @@ export default function HookModal({ isOpen, onClose, onGenerate, isProcessing, v const [text, setText] = useState(initialText || 'POV: You are using the viral hook feature'); const [position, setPosition] = useState('top'); const [size, setSize] = useState('M'); + const [style, setStyle] = useState('classic'); const [entranceAnimation, setEntranceAnimation] = useState('spring'); const [displayDuration, setDisplayDuration] = useState(5); @@ -37,6 +48,7 @@ export default function HookModal({ isOpen, onClose, onGenerate, isProcessing, v text: text || 'Enter your text...', position, size, + style, entranceAnimation, displayDurationSec: displayDuration, }; @@ -112,6 +124,32 @@ export default function HookModal({ isOpen, onClose, onGenerate, isProcessing, v /> + {/* Style (new) */} +
+

Style

+
+ {HOOK_STYLES.map((s) => ( + + ))} +
+
+ {/* Position Control */}

Position

@@ -177,7 +215,7 @@ export default function HookModal({ isOpen, onClose, onGenerate, isProcessing, v