redesign: Lumen design system across landing, app and paywall
Full visual rework to a single locked design system (design.md, Lumen Night Foundry): dark violet canvas, molten-brass accent, Instrument Serif + Geist + JetBrains Mono, hairline cards, zero gradients and zero glassmorphism. - Landing: marquee hero with real vertical demo clip in an instrument bezel, meter strip, smart-crop before/after section, cloud-first copy (start free trial primary, self-host demoted to secondary), text density cut, SEO surfaces preserved (single h1, ids, FAQs, comparison table intact) - App: workbench restyle — sidebar with mono ordinals, unified header, settings/ai-agent/dashboard views on shared tokens; per-feature gradient identities retired - Shared UI: new Modal, SegmentedControl and StepIndicator replace 8+ duplicated modal shells and 2 wizard steppers - New pricing paywall page (#/pricing): demo proof strip, honest trust signals, billing FAQ - Routing: app logo links back to landing via #landing without resetting the skip-landing preference - Responsive: audited and fixed at 320/375/414/768px (no horizontal scroll, tables scroll in-container, single-line CTAs) - ScheduleWeekModal translated to English; ProcessingAnimation comment noise removed Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
parent
54bb701b83
commit
aa676a7814
40 changed files with 3466 additions and 2552 deletions
3
.hallmark/log.json
Normal file
3
.hallmark/log.json
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
[
|
||||||
|
{ "date": "2026-07-17", "scope": "app", "macrostructure": "Marquee Hero (marketing) / Workbench (app) / Long Document (content)", "theme": "lumen", "drop": "night", "enrichment": "filament-chamber apparatus + meter strip (landing only)", "brief": "OpenShorts · full app + landing redesign, design.md-managed" }
|
||||||
|
]
|
||||||
|
|
@ -6,6 +6,13 @@
|
||||||
<link rel="icon" type="image/png" href="/logo-openshorts.png" />
|
<link rel="icon" type="image/png" href="/logo-openshorts.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
|
||||||
|
<!-- Fonts: Lumen system (Instrument Serif display · Geist body · JetBrains Mono labels) -->
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Instrument+Serif&family=Geist:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap"
|
||||||
|
rel="stylesheet" />
|
||||||
|
|
||||||
<!-- Primary SEO Meta Tags -->
|
<!-- Primary SEO Meta Tags -->
|
||||||
<title>OpenShorts - Free Open Source Clip Generator & AI UGC Video Creator | TikTok, Reels & Shorts</title>
|
<title>OpenShorts - Free Open Source Clip Generator & AI UGC Video Creator | TikTok, Reels & Shorts</title>
|
||||||
<meta name="description" content="Free open source clip generator & AI UGC video creator. Turn your long-form videos into viral shorts or generate marketing videos with AI actors for any business. From $0.65/video." />
|
<meta name="description" content="Free open source clip generator & AI UGC video creator. Turn your long-form videos into viral shorts or generate marketing videos with AI actors for any business. From $0.65/video." />
|
||||||
|
|
|
||||||
BIN
dashboard/public/demo/clip-source.mp4
Normal file
BIN
dashboard/public/demo/clip-source.mp4
Normal file
Binary file not shown.
BIN
dashboard/public/demo/clip-vertical.mp4
Normal file
BIN
dashboard/public/demo/clip-vertical.mp4
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -7,46 +7,55 @@ const SUPPORT_EMAIL = 'info@openshorts.app';
|
||||||
|
|
||||||
function Section({ title, children }) {
|
function Section({ title, children }) {
|
||||||
return (
|
return (
|
||||||
<section className="mb-7">
|
<section className="mb-10">
|
||||||
<h2 className="text-lg font-bold text-white mb-2">{title}</h2>
|
<h2 className="font-display lowercase text-xl text-ink mb-3">{title}</h2>
|
||||||
<div className="text-zinc-300 leading-relaxed space-y-2 text-sm">{children}</div>
|
<div className="text-ink2 leading-relaxed space-y-3 text-sm">{children}</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function A({ href, children, external }) {
|
||||||
|
return (
|
||||||
|
<a
|
||||||
|
className="underline underline-offset-2 hover:text-brass transition-colors"
|
||||||
|
href={href}
|
||||||
|
{...(external ? { target: '_blank', rel: 'noopener noreferrer' } : {})}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default function Legal() {
|
export default function Legal() {
|
||||||
const handleBack = () => {
|
const handleBack = () => {
|
||||||
window.location.hash = '';
|
window.location.hash = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-bg text-white">
|
<div className="min-h-screen bg-paper text-ink2">
|
||||||
<header className="border-b border-white/5 sticky top-0 bg-bg/95 backdrop-blur z-10">
|
<header className="border-b border-rule sticky top-0 bg-paper z-10">
|
||||||
<div className="max-w-3xl mx-auto px-6 py-4 flex items-center">
|
<div className="max-w-[65ch] mx-auto px-6 py-3 flex items-center">
|
||||||
<button
|
<button onClick={handleBack} className="btn-quiet">
|
||||||
onClick={handleBack}
|
|
||||||
className="text-zinc-400 hover:text-white flex items-center gap-2 text-sm"
|
|
||||||
>
|
|
||||||
<ArrowLeft size={16} /> Back
|
<ArrowLeft size={16} /> Back
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main className="max-w-3xl mx-auto px-6 py-12">
|
<main className="max-w-[65ch] mx-auto px-6 py-12">
|
||||||
<h1 className="text-3xl md:text-4xl font-bold mb-2">Terms & Privacy</h1>
|
<h1 className="font-display lowercase text-3xl md:text-4xl text-ink mb-3">Terms & Privacy</h1>
|
||||||
<p className="text-zinc-500 text-sm mb-10">Last updated: {LAST_UPDATED}</p>
|
<p className="readout mb-12">Last updated: {LAST_UPDATED}</p>
|
||||||
|
|
||||||
<Section title="The short version">
|
<Section title="The short version">
|
||||||
<p>
|
<p>
|
||||||
OpenShorts is an AI clip generator. There are two ways to use it:
|
OpenShorts is an AI clip generator. There are two ways to use it:
|
||||||
</p>
|
</p>
|
||||||
<ul className="list-disc pl-6 space-y-1">
|
<ul className="list-disc pl-6 space-y-2">
|
||||||
<li>
|
<li>
|
||||||
<strong className="text-white">Self-hosted (free):</strong> the open-source software, run on
|
<strong className="text-ink">Self-hosted (free):</strong> the open-source software, run on
|
||||||
your own machine with your own API keys. No account, no payment, no data held by us.
|
your own machine with your own API keys. No account, no payment, no data held by us.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong className="text-white">Hosted at openshorts.app (paid):</strong> we run everything for
|
<strong className="text-ink">Hosted at openshorts.app (paid):</strong> we run everything for
|
||||||
you. It requires an account and a paid subscription (with a free trial), and we store the
|
you. It requires an account and a paid subscription (with a free trial), and we store the
|
||||||
videos you generate while your subscription is active.
|
videos you generate while your subscription is active.
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -64,28 +73,28 @@ export default function Legal() {
|
||||||
|
|
||||||
<Section title="Free trial, plans & billing">
|
<Section title="Free trial, plans & billing">
|
||||||
<p>
|
<p>
|
||||||
Paid plans are <strong className="text-white">Starter ($12/mo · 100 min)</strong>,{' '}
|
Paid plans are <strong className="text-ink">Starter ($12/mo · 100 min)</strong>,{' '}
|
||||||
<strong className="text-white">Creator ($29/mo · 300 min)</strong> and{' '}
|
<strong className="text-ink">Creator ($29/mo · 300 min)</strong> and{' '}
|
||||||
<strong className="text-white">Pro ($59/mo · 750 min)</strong>, each also available annually (two
|
<strong className="text-ink">Pro ($59/mo · 750 min)</strong>, each also available annually (two
|
||||||
months free). "Minutes" are minutes of input video processed per billing period; additional
|
months free). "Minutes" are minutes of input video processed per billing period; additional
|
||||||
minutes can be bought as one-off top-ups.
|
minutes can be bought as one-off top-ups.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong className="text-white">Free trial:</strong> new subscriptions start with a{' '}
|
<strong className="text-ink">Free trial:</strong> new subscriptions start with a{' '}
|
||||||
<strong className="text-white">3-day free trial</strong> that includes up to{' '}
|
<strong className="text-ink">3-day free trial</strong> that includes up to{' '}
|
||||||
<strong className="text-white">20 minutes</strong> of video processing. You provide a payment
|
<strong className="text-ink">20 minutes</strong> of video processing. You provide a payment
|
||||||
method up front but are <strong className="text-white">not charged during the trial</strong>. If
|
method up front but are <strong className="text-ink">not charged during the trial</strong>. If
|
||||||
you do not cancel before the trial ends, your subscription automatically begins, your full plan
|
you do not cancel before the trial ends, your subscription automatically begins, your full plan
|
||||||
minutes unlock, and your payment method is charged the plan price. You can cancel at any time from
|
minutes unlock, and your payment method is charged the plan price. You can cancel at any time from
|
||||||
your account.
|
your account.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong className="text-white">Auto-renewal:</strong> subscriptions renew automatically each
|
<strong className="text-ink">Auto-renewal:</strong> subscriptions renew automatically each
|
||||||
period (monthly or yearly) at the then-current price until you cancel. We'll email a reminder
|
period (monthly or yearly) at the then-current price until you cancel. We'll email a reminder
|
||||||
before the trial converts to a paid subscription.
|
before the trial converts to a paid subscription.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Payments are processed by <strong className="text-white">Stripe</strong>. We never see or store
|
Payments are processed by <strong className="text-ink">Stripe</strong>. We never see or store
|
||||||
your full card details. Prices are in USD and exclude any applicable taxes/VAT, which are added
|
your full card details. Prices are in USD and exclude any applicable taxes/VAT, which are added
|
||||||
at checkout where required.
|
at checkout where required.
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -97,12 +106,12 @@ export default function Legal() {
|
||||||
stays active until the end of the current paid period; we do not charge you again after that.
|
stays active until the end of the current paid period; we do not charge you again after that.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
Except where required by law, payments are <strong className="text-white">non-refundable</strong>{' '}
|
Except where required by law, payments are <strong className="text-ink">non-refundable</strong>{' '}
|
||||||
and we do not prorate partial periods. To avoid being charged for a period you don't want, cancel
|
and we do not prorate partial periods. To avoid being charged for a period you don't want, cancel
|
||||||
before it renews (and, for the trial, before it ends).
|
before it renews (and, for the trial, before it ends).
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong className="text-white">EU/EEA consumers:</strong> the Service is digital content/services
|
<strong className="text-ink">EU/EEA consumers:</strong> the Service is digital content/services
|
||||||
supplied immediately. By starting to use it (including during the trial) you request immediate
|
supplied immediately. By starting to use it (including during the trial) you request immediate
|
||||||
performance and acknowledge that you lose the 14-day right of withdrawal once performance has
|
performance and acknowledge that you lose the 14-day right of withdrawal once performance has
|
||||||
begun, to the extent permitted by law.
|
begun, to the extent permitted by law.
|
||||||
|
|
@ -114,7 +123,7 @@ export default function Legal() {
|
||||||
Before processing a video you must confirm — via the checkbox in the upload interface — that you
|
Before processing a video you must confirm — via the checkbox in the upload interface — that you
|
||||||
own the content or have the rights to process it. By doing so you represent and warrant that:
|
own the content or have the rights to process it. By doing so you represent and warrant that:
|
||||||
</p>
|
</p>
|
||||||
<ul className="list-disc pl-6 space-y-1">
|
<ul className="list-disc pl-6 space-y-2">
|
||||||
<li>You own all rights to the content, or have a valid license or permission to process it;</li>
|
<li>You own all rights to the content, or have a valid license or permission to process it;</li>
|
||||||
<li>The content does not infringe any third-party copyright, trademark, privacy, or other right;</li>
|
<li>The content does not infringe any third-party copyright, trademark, privacy, or other right;</li>
|
||||||
<li>The content is not unlawful, defamatory, or otherwise prohibited.</li>
|
<li>The content is not unlawful, defamatory, or otherwise prohibited.</li>
|
||||||
|
|
@ -127,31 +136,31 @@ export default function Legal() {
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
<Section title="What we store, and for how long">
|
<Section title="What we store, and for how long">
|
||||||
<ul className="list-disc pl-6 space-y-1">
|
<ul className="list-disc pl-6 space-y-2">
|
||||||
<li>
|
<li>
|
||||||
<strong className="text-white">Account data:</strong> your email address and your subscription
|
<strong className="text-ink">Account data:</strong> your email address and your subscription
|
||||||
status and usage (minutes used). Kept while your account exists.
|
status and usage (minutes used). Kept while your account exists.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong className="text-white">Generated videos:</strong> the clips you create are stored in
|
<strong className="text-ink">Generated videos:</strong> the clips you create are stored in
|
||||||
encrypted cloud storage and available in your library <strong className="text-white">while your
|
encrypted cloud storage and available in your library <strong className="text-ink">while your
|
||||||
subscription is active, plus 7 days after it ends</strong>, then permanently deleted.
|
subscription is active, plus 7 days after it ends</strong>, then permanently deleted.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong className="text-white">Uploaded/source files & working data:</strong> deleted from
|
<strong className="text-ink">Uploaded/source files & working data:</strong> deleted from
|
||||||
our processing servers shortly after the job finishes (typically within 1 hour).
|
our processing servers shortly after the job finishes (typically within 1 hour).
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong className="text-white">Billing data:</strong> handled by Stripe; we keep a reference
|
<strong className="text-ink">Billing data:</strong> handled by Stripe; we keep a reference
|
||||||
to your Stripe customer/subscription, not your card.
|
to your Stripe customer/subscription, not your card.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong className="text-white">Optional add-on keys (ElevenLabs, fal.ai):</strong> for BYOK
|
<strong className="text-ink">Optional add-on keys (ElevenLabs, fal.ai):</strong> for BYOK
|
||||||
features, stored encrypted in your browser and sent as request headers only when needed —
|
features, stored encrypted in your browser and sent as request headers only when needed —
|
||||||
never written to our database.
|
never written to our database.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong className="text-white">Server access logs:</strong> retained up to 30 days for
|
<strong className="text-ink">Server access logs:</strong> retained up to 30 days for
|
||||||
debugging and abuse prevention.
|
debugging and abuse prevention.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
@ -161,12 +170,12 @@ export default function Legal() {
|
||||||
<Section title="Subprocessors">
|
<Section title="Subprocessors">
|
||||||
<p>To provide the hosted Service we share the minimum necessary data with a small number of
|
<p>To provide the hosted Service we share the minimum necessary data with a small number of
|
||||||
trusted service providers, each acting on our behalf:</p>
|
trusted service providers, each acting on our behalf:</p>
|
||||||
<ul className="list-disc pl-6 space-y-1">
|
<ul className="list-disc pl-6 space-y-2">
|
||||||
<li><strong className="text-white">A payments provider</strong> — payments & subscriptions.</li>
|
<li><strong className="text-ink">A payments provider</strong> — payments & subscriptions.</li>
|
||||||
<li><strong className="text-white">A cloud infrastructure & storage provider</strong> — hosting and storing your generated videos.</li>
|
<li><strong className="text-ink">A cloud infrastructure & storage provider</strong> — hosting and storing your generated videos.</li>
|
||||||
<li><strong className="text-white">An AI provider</strong> — video analysis, titles and thumbnails.</li>
|
<li><strong className="text-ink">An AI provider</strong> — video analysis, titles and thumbnails.</li>
|
||||||
<li><strong className="text-white">A social-publishing provider</strong> — posting to TikTok, Instagram & YouTube (only when you connect them).</li>
|
<li><strong className="text-ink">A social-publishing provider</strong> — posting to TikTok, Instagram & YouTube (only when you connect them).</li>
|
||||||
<li><strong className="text-white">An email provider</strong> — transactional email (sign-in links, notices).</li>
|
<li><strong className="text-ink">An email provider</strong> — transactional email (sign-in links, notices).</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>Each is bound by its own terms and privacy policy. We can identify the specific providers to
|
<p>Each is bound by its own terms and privacy policy. We can identify the specific providers to
|
||||||
you on request where required by law.</p>
|
you on request where required by law.</p>
|
||||||
|
|
@ -187,11 +196,11 @@ export default function Legal() {
|
||||||
Under the GDPR / UK GDPR you may access, rectify, erase, restrict, object to, or port your
|
Under the GDPR / UK GDPR you may access, rectify, erase, restrict, object to, or port your
|
||||||
personal data. You can delete your account and its data — including your video library — by
|
personal data. You can delete your account and its data — including your video library — by
|
||||||
emailing{' '}
|
emailing{' '}
|
||||||
<a className="text-primary underline" href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a>. You may
|
<A href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</A>. You may
|
||||||
also lodge a complaint with your local supervisory authority (in Spain: AEPD,{' '}
|
also lodge a complaint with your local supervisory authority (in Spain: AEPD,{' '}
|
||||||
<a className="text-primary underline" href="https://www.aepd.es" target="_blank" rel="noopener noreferrer">
|
<A href="https://www.aepd.es" external>
|
||||||
aepd.es
|
aepd.es
|
||||||
</a>
|
</A>
|
||||||
).
|
).
|
||||||
</p>
|
</p>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
@ -199,7 +208,7 @@ export default function Legal() {
|
||||||
<Section title="Copyright takedowns">
|
<Section title="Copyright takedowns">
|
||||||
<p>
|
<p>
|
||||||
If you believe content processed through the Service infringes your copyright, email{' '}
|
If you believe content processed through the Service infringes your copyright, email{' '}
|
||||||
<a className="text-primary underline" href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a> with:
|
<A href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</A> with:
|
||||||
identification of the work, identification of the allegedly infringing material (enough detail to
|
identification of the work, identification of the allegedly infringing material (enough detail to
|
||||||
locate it), your contact information, and a statement that you are authorized to act for the
|
locate it), your contact information, and a statement that you are authorized to act for the
|
||||||
rights holder.
|
rights holder.
|
||||||
|
|
@ -219,10 +228,10 @@ export default function Legal() {
|
||||||
We may update this notice; the "Last updated" date reflects the latest revision. For material
|
We may update this notice; the "Last updated" date reflects the latest revision. For material
|
||||||
changes affecting paid subscribers we'll give reasonable notice. Continued use after a change
|
changes affecting paid subscribers we'll give reasonable notice. Continued use after a change
|
||||||
constitutes acceptance. Questions:{' '}
|
constitutes acceptance. Questions:{' '}
|
||||||
<a className="text-primary underline" href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a> or{' '}
|
<A href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</A> or{' '}
|
||||||
<a className="text-primary underline" href={ISSUES_URL} target="_blank" rel="noopener noreferrer">
|
<A href={ISSUES_URL} external>
|
||||||
GitHub Issues
|
GitHub Issues
|
||||||
</a>
|
</A>
|
||||||
.
|
.
|
||||||
</p>
|
</p>
|
||||||
<p>These terms are governed by the laws of Spain.</p>
|
<p>These terms are governed by the laws of Spain.</p>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useState, useEffect, useCallback } from 'react';
|
import React, { useState, useEffect, useCallback } from 'react';
|
||||||
import { Loader2, CreditCard, LogOut, Zap, Plus } from 'lucide-react';
|
import { Loader2, CreditCard, LogOut, Plus } from 'lucide-react';
|
||||||
import { useAuth } from '../contexts/AuthContext';
|
import { useAuth } from '../contexts/AuthContext';
|
||||||
import { apiJson } from '../lib/api';
|
import { apiJson } from '../lib/api';
|
||||||
|
|
||||||
|
|
@ -62,76 +62,77 @@ export default function AccountPage() {
|
||||||
} catch (e) { setBusy(false); alert('Could not start checkout.'); }
|
} catch (e) { setBusy(false); alert('Could not start checkout.'); }
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (!me) return <div className="flex justify-center py-16"><Loader2 className="animate-spin text-primary" /></div>;
|
if (!me) return <div className="flex justify-center py-16"><Loader2 className="animate-spin text-brass" /></div>;
|
||||||
|
|
||||||
const m = minutes || {};
|
const m = minutes || {};
|
||||||
const total = (m.plan_allowance || 0) + (m.topup_remaining || 0) + (m.plan_used || 0);
|
const total = (m.plan_allowance || 0) + (m.topup_remaining || 0) + (m.plan_used || 0);
|
||||||
const usedPct = total > 0 ? Math.min(100, ((m.plan_used || 0) / (m.plan_allowance || 1)) * 100) : 0;
|
const usedPct = total > 0 ? Math.min(100, ((m.plan_used || 0) / (m.plan_allowance || 1)) * 100) : 0;
|
||||||
|
const low = total > 0 && (m.remaining || 0) <= total * 0.2;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="max-w-2xl mx-auto space-y-6">
|
<div className="max-w-2xl mx-auto space-y-6">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-end justify-between gap-4">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-2xl font-bold">Your account</h2>
|
<p className="eyebrow mb-1.5">ACCOUNT</p>
|
||||||
<p className="text-zinc-400 text-sm">{me.user?.email}</p>
|
<h2 className="font-display lowercase text-2xl text-ink leading-tight">Your account</h2>
|
||||||
|
<p className="text-muted text-sm mt-1">{me.user?.email}</p>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={logout} className="text-zinc-400 hover:text-white flex items-center gap-2 text-sm">
|
<button onClick={logout} className="btn-quiet shrink-0">
|
||||||
<LogOut size={16} /> Sign out
|
<LogOut size={16} /> Sign out
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{activating && (
|
{activating && (
|
||||||
<div className="bg-primary/10 border border-primary/30 rounded-xl p-4 text-sm flex items-center gap-2">
|
<div className="card px-4 py-3 text-sm text-ink2 flex items-center gap-2 lowercase">
|
||||||
<Loader2 size={16} className="animate-spin" /> Activating your plan…
|
<Loader2 size={16} className="animate-spin text-brass" /> Activating your plan…
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="bg-surface border border-white/10 rounded-2xl p-6">
|
<div className="card p-6">
|
||||||
<div className="flex items-center justify-between mb-4">
|
<div className="flex items-center justify-between gap-4 mb-4">
|
||||||
<div>
|
<div className="flex items-center gap-2 flex-wrap">
|
||||||
<span className="text-lg font-semibold capitalize">{plan ? `${plan} plan` : 'No active plan'}</span>
|
<span className="text-ink font-medium capitalize">{plan ? `${plan} plan` : 'No active plan'}</span>
|
||||||
{me.status && me.status !== 'active' && (
|
{me.status && me.status !== 'active' && (
|
||||||
<span className="ml-2 text-xs px-2 py-0.5 rounded-full bg-yellow-500/20 text-yellow-400">{me.status}</span>
|
<span className="badge-warn">{me.status}</span>
|
||||||
)}
|
)}
|
||||||
{me.cancel_at_period_end && (
|
{me.cancel_at_period_end && (
|
||||||
<span className="ml-2 text-xs px-2 py-0.5 rounded-full bg-zinc-500/20 text-zinc-300">cancels at period end</span>
|
<span className="badge-warn">cancels at period end</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<button onClick={openPortal} disabled={busy}
|
<button onClick={openPortal} disabled={busy} className="btn-ghost px-4 py-2 shrink-0">
|
||||||
className="text-sm bg-white/10 hover:bg-white/20 px-4 py-2 rounded-lg flex items-center gap-2">
|
|
||||||
<CreditCard size={16} /> Manage billing
|
<CreditCard size={16} /> Manage billing
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex justify-between text-sm">
|
<div className="flex justify-between text-sm">
|
||||||
<span className="text-zinc-400">Plan minutes</span>
|
<span className="text-muted lowercase">Plan minutes</span>
|
||||||
<span>{fmt1(m.plan_used)} / {fmt1(m.plan_allowance)} used</span>
|
<span className="text-ink2">{fmt1(m.plan_used)} / {fmt1(m.plan_allowance)} used</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="h-2 bg-white/10 rounded-full overflow-hidden">
|
<div className="h-1.5 bg-paper3 rounded-full overflow-hidden">
|
||||||
<div className="h-full bg-primary transition-all" style={{ width: `${usedPct}%` }} />
|
<div className={`h-full transition-all ${low ? 'bg-warn' : 'bg-brass'}`} style={{ width: `${usedPct}%` }} />
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between text-sm pt-1">
|
<div className="flex justify-between text-sm pt-1">
|
||||||
<span className="text-zinc-400">Top-up minutes</span>
|
<span className="text-muted lowercase">Top-up minutes</span>
|
||||||
<span>{fmt1(m.topup_remaining)} remaining</span>
|
<span className="text-ink2">{fmt1(m.topup_remaining)} remaining</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between text-base font-semibold pt-2 border-t border-white/5">
|
<div className="flex justify-between text-sm pt-2 border-t border-rule">
|
||||||
<span>Total remaining</span>
|
<span className="text-ink font-medium lowercase">Total remaining</span>
|
||||||
<span className="text-primary">{fmt1(m.remaining)} min</span>
|
<span className="text-brass font-medium">{fmt1(m.remaining)} min</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{topups.length > 0 && (
|
{topups.length > 0 && (
|
||||||
<div className="bg-surface border border-white/10 rounded-2xl p-6">
|
<div className="card p-6">
|
||||||
<h3 className="font-semibold mb-1 flex items-center gap-2"><Plus size={16} /> Buy more minutes</h3>
|
<h3 className="font-display lowercase text-lg text-ink mb-1 flex items-center gap-2"><Plus size={16} className="text-brass" /> Buy more minutes</h3>
|
||||||
<p className="text-zinc-400 text-sm mb-4">Top-ups never expire while your plan is active.</p>
|
<p className="text-muted text-sm mb-4 lowercase">Top-ups never expire while your plan is active.</p>
|
||||||
<div className="grid grid-cols-2 gap-3">
|
<div className="grid grid-cols-2 gap-3">
|
||||||
{topups.map((t) => (
|
{topups.map((t) => (
|
||||||
<button key={t.price_id} onClick={() => buyTopup(t.price_id)} disabled={busy}
|
<button key={t.price_id} onClick={() => buyTopup(t.price_id)} disabled={busy}
|
||||||
className="border border-white/10 hover:border-primary rounded-xl p-4 text-left transition-all">
|
className="border border-rule hover:border-brass rounded-card p-4 text-left transition-colors disabled:opacity-50">
|
||||||
<div className="text-lg font-bold">+{t.minutes} min</div>
|
<div className="text-ink font-medium">+{t.minutes} min</div>
|
||||||
<div className="text-zinc-400 text-sm">
|
<div className="readout mt-1">
|
||||||
{new Intl.NumberFormat('en-US', { style: 'currency', currency: (t.currency || 'usd').toUpperCase(), maximumFractionDigits: 0 }).format((t.amount || 0) / 100)}
|
{new Intl.NumberFormat('en-US', { style: 'currency', currency: (t.currency || 'usd').toUpperCase(), maximumFractionDigits: 0 }).format((t.amount || 0) / 100)}
|
||||||
</div>
|
</div>
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -6,19 +6,19 @@ import { KeyRound, ArrowRight } from 'lucide-react';
|
||||||
// own keys for the premium generation. If they have no plan yet, also nudge trial.
|
// own keys for the premium generation. If they have no plan yet, also nudge trial.
|
||||||
export default function AdvancedBanner({ needsPlan, onKeys }) {
|
export default function AdvancedBanner({ needsPlan, onKeys }) {
|
||||||
return (
|
return (
|
||||||
<div className="mx-6 mt-3 p-3 bg-amber-500/10 border border-amber-500/30 rounded-xl flex items-center justify-between gap-4 shrink-0 animate-[fadeIn_0.3s_ease-out]">
|
<div className="card mx-6 mt-3 px-4 py-3 flex items-center justify-between gap-4 shrink-0 animate-fade">
|
||||||
<div className="flex items-center gap-3 text-sm">
|
<div className="flex items-center gap-3 text-sm">
|
||||||
<KeyRound size={16} className="shrink-0 text-amber-400" />
|
<KeyRound size={16} className="shrink-0 text-warn" />
|
||||||
<div className="text-amber-100/90">
|
<div className="text-ink2 lowercase">
|
||||||
<span className="font-semibold text-white">Advanced tool.</span>{' '}
|
<span className="font-medium text-ink">Advanced tool.</span>{' '}
|
||||||
{needsPlan
|
{needsPlan
|
||||||
? <>Start your <span className="font-semibold text-white">3-day free trial</span> to unlock. This tool also uses your own <span className="font-semibold text-white">fal.ai + ElevenLabs</span> keys (you pay those providers).</>
|
? <>Start your <span className="font-medium text-ink">3-day free trial</span> to unlock. This tool also uses your own <span className="font-medium text-ink normal-case">fal.ai + ElevenLabs</span> keys (you pay those providers).</>
|
||||||
: <>AI video & voice generation use your own <span className="font-semibold text-white">fal.ai + ElevenLabs</span> keys — add them in Settings. Script & orchestration are included in your plan.</>}
|
: <>AI video & voice generation use your own <span className="font-medium text-ink normal-case">fal.ai + ElevenLabs</span> keys — add them in Settings. Script & orchestration are included in your plan.</>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={needsPlan ? () => { window.location.hash = '#/pricing'; } : onKeys}
|
onClick={needsPlan ? () => { window.location.hash = '#/pricing'; } : onKeys}
|
||||||
className="shrink-0 inline-flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-lg bg-amber-500 hover:bg-amber-400 text-black transition-colors"
|
className="btn-quiet shrink-0 text-xs px-3 py-1.5"
|
||||||
>
|
>
|
||||||
{needsPlan ? <>See plans <ArrowRight size={14} /></> : 'Add keys'}
|
{needsPlan ? <>See plans <ArrowRight size={14} /></> : 'Add keys'}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
import React, { useState, useEffect, useRef, useCallback } from 'react';
|
||||||
import { LayoutGrid, AlertCircle, Loader2 } from 'lucide-react';
|
import { AlertCircle, Loader2 } from 'lucide-react';
|
||||||
import { getApiUrl } from '../config';
|
import { getApiUrl } from '../config';
|
||||||
import GalleryCard from './GalleryCard';
|
import GalleryCard from './GalleryCard';
|
||||||
|
|
||||||
|
|
@ -62,29 +62,30 @@ export default function Gallery() {
|
||||||
{ rootMargin: '200px', threshold: 0.1 }
|
{ rootMargin: '200px', threshold: 0.1 }
|
||||||
);
|
);
|
||||||
|
|
||||||
if (loaderRef.current) {
|
const node = loaderRef.current;
|
||||||
observer.observe(loaderRef.current);
|
if (node) {
|
||||||
|
observer.observe(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
if (loaderRef.current) {
|
if (node) {
|
||||||
observer.unobserve(loaderRef.current);
|
observer.unobserve(node);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [hasMore, loadingMore, loading, offset, fetchClips]);
|
}, [hasMore, loadingMore, loading, offset, fetchClips]);
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col items-center justify-center text-zinc-500 animate-[fadeIn_0.5s_ease-out]">
|
<div className="h-full flex flex-col items-center justify-center text-muted animate-fade">
|
||||||
<Loader2 size={32} className="animate-spin mb-4 text-primary" />
|
<Loader2 size={32} className="animate-spin mb-4 text-brass" />
|
||||||
<p>Loading your viral history...</p>
|
<p className="lowercase">Loading your viral history...</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col items-center justify-center text-red-400 p-6">
|
<div className="h-full flex flex-col items-center justify-center text-danger p-6">
|
||||||
<AlertCircle size={32} className="mb-4" />
|
<AlertCircle size={32} className="mb-4" />
|
||||||
<p>Error loading gallery: {error}</p>
|
<p>Error loading gallery: {error}</p>
|
||||||
<button
|
<button
|
||||||
|
|
@ -93,7 +94,7 @@ export default function Gallery() {
|
||||||
setOffset(0);
|
setOffset(0);
|
||||||
fetchClips(0, false);
|
fetchClips(0, false);
|
||||||
}}
|
}}
|
||||||
className="mt-4 px-4 py-2 bg-white/5 hover:bg-white/10 rounded-lg text-sm text-white transition-colors"
|
className="btn-quiet mt-4"
|
||||||
>
|
>
|
||||||
Retry
|
Retry
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -102,25 +103,26 @@ export default function Gallery() {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full overflow-y-auto p-6 md:p-8 animate-[fadeIn_0.3s_ease-out]">
|
<div className="h-full overflow-y-auto p-6 md:p-8 animate-fade">
|
||||||
<div className="flex items-center justify-between mb-8">
|
<div className="flex items-end justify-between mb-8">
|
||||||
<h1 className="text-2xl font-bold flex items-center gap-3">
|
<div>
|
||||||
<LayoutGrid className="text-primary" /> Clip Gallery
|
<p className="eyebrow mb-1.5">Library</p>
|
||||||
</h1>
|
<h1 className="font-display lowercase text-2xl text-ink">Clip Gallery</h1>
|
||||||
<span className="text-xs bg-white/10 text-white px-3 py-1 rounded-full border border-white/5">
|
</div>
|
||||||
|
<span className="readout">
|
||||||
{clips.length} {clips.length === 1 ? 'Clip' : 'Clips'}{hasMore ? '+' : ''}
|
{clips.length} {clips.length === 1 ? 'Clip' : 'Clips'}{hasMore ? '+' : ''}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{clips.length === 0 ? (
|
{clips.length === 0 ? (
|
||||||
<div className="text-center py-20 text-zinc-500">
|
<div className="text-center py-20 text-muted">
|
||||||
<p className="text-lg mb-2">No clips found yet.</p>
|
<p className="text-lg mb-2 lowercase">No clips found yet.</p>
|
||||||
<p className="text-sm">Process some videos to populate your gallery!</p>
|
<p className="text-sm lowercase">Process some videos to populate your gallery!</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-6 pb-10">
|
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-6 pb-10">
|
||||||
{clips.map((clip, i) => (
|
{clips.map((clip) => (
|
||||||
<GalleryCard key={`${clip.job_id}-${clip.index}`} clip={clip} />
|
<GalleryCard key={`${clip.job_id}-${clip.index}`} clip={clip} />
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -132,9 +134,9 @@ export default function Gallery() {
|
||||||
className="flex justify-center py-8"
|
className="flex justify-center py-8"
|
||||||
>
|
>
|
||||||
{loadingMore && (
|
{loadingMore && (
|
||||||
<div className="flex items-center gap-2 text-zinc-500">
|
<div className="flex items-center gap-2 text-muted">
|
||||||
<Loader2 size={20} className="animate-spin" />
|
<Loader2 size={20} className="animate-spin" />
|
||||||
<span className="text-sm">Loading more clips...</span>
|
<span className="text-sm lowercase">Loading more clips...</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -144,4 +146,3 @@ export default function Gallery() {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
import React, { useRef, useState, useEffect } from 'react';
|
import React, { useRef, useState, useEffect } from 'react';
|
||||||
import { Download, Youtube, Instagram, Video, Copy, Check, Play } from 'lucide-react';
|
import { Download, Copy, Check, Play } from 'lucide-react';
|
||||||
|
|
||||||
export default function GalleryCard({ clip }) {
|
export default function GalleryCard({ clip }) {
|
||||||
const [copied, setCopied] = useState(null);
|
const [copied, setCopied] = useState(null);
|
||||||
const [isVisible, setIsVisible] = useState(false);
|
const [isVisible, setIsVisible] = useState(false);
|
||||||
const [hasLoaded, setHasLoaded] = useState(false);
|
const [_hasLoaded, setHasLoaded] = useState(false);
|
||||||
const cardRef = useRef(null);
|
const cardRef = useRef(null);
|
||||||
const videoRef = useRef(null);
|
const videoRef = useRef(null);
|
||||||
|
|
||||||
|
|
@ -26,13 +26,14 @@ export default function GalleryCard({ clip }) {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (cardRef.current) {
|
const node = cardRef.current;
|
||||||
observer.observe(cardRef.current);
|
if (node) {
|
||||||
|
observer.observe(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
if (cardRef.current) {
|
if (node) {
|
||||||
observer.unobserve(cardRef.current);
|
observer.unobserve(node);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, []);
|
}, []);
|
||||||
|
|
@ -67,7 +68,7 @@ export default function GalleryCard({ clip }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={cardRef}
|
ref={cardRef}
|
||||||
className="bg-surface border border-white/5 rounded-xl overflow-hidden flex flex-col hover:border-white/10 transition-all group animate-[fadeIn_0.5s_ease-out]"
|
className="card card-hover overflow-hidden flex flex-col group animate-fade"
|
||||||
>
|
>
|
||||||
{/* Video Player - Lazy loaded */}
|
{/* Video Player - Lazy loaded */}
|
||||||
<div className="aspect-[9/16] bg-black relative group/video">
|
<div className="aspect-[9/16] bg-black relative group/video">
|
||||||
|
|
@ -82,63 +83,57 @@ export default function GalleryCard({ clip }) {
|
||||||
onLoadedData={() => setHasLoaded(true)}
|
onLoadedData={() => setHasLoaded(true)}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="w-full h-full flex items-center justify-center bg-zinc-900">
|
<div className="w-full h-full flex items-center justify-center bg-paper">
|
||||||
<div className="w-12 h-12 rounded-full bg-white/10 flex items-center justify-center">
|
<div className="w-12 h-12 rounded-full bg-paper3 flex items-center justify-center">
|
||||||
<Play size={24} className="text-white/50 ml-1" />
|
<Play size={24} className="text-muted ml-1" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="absolute top-2 left-2">
|
<div className="absolute top-2 left-2">
|
||||||
<span className="bg-black/60 backdrop-blur-md text-white text-[10px] font-bold px-2 py-1 rounded-md border border-white/10 tracking-wide">
|
<span className="readout bg-black/70 px-2 py-1 rounded-full">
|
||||||
{new Date(clip.created_at).toLocaleDateString()}
|
{new Date(clip.created_at).toLocaleDateString()}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Content & Details */}
|
{/* Content & Details */}
|
||||||
<div className="flex-1 p-4 flex flex-col bg-[#121214] min-w-0">
|
<div className="flex-1 p-4 flex flex-col min-w-0">
|
||||||
<div className="mb-3">
|
<div className="mb-3">
|
||||||
<h3 className="text-sm font-bold text-white leading-tight line-clamp-2 mb-2 break-words" title={clip.title}>
|
<h3 className="text-sm font-semibold text-ink leading-tight line-clamp-2 mb-2 break-words" title={clip.title}>
|
||||||
{clip.title}
|
{clip.title}
|
||||||
</h3>
|
</h3>
|
||||||
<div className="flex flex-wrap gap-2 text-[10px] text-zinc-500 font-mono">
|
<div className="flex flex-wrap gap-2">
|
||||||
<span className="bg-white/5 px-1.5 py-0.5 rounded border border-white/5">{clip.duration.toFixed(1)}s</span>
|
<span className="readout bg-paper3 px-1.5 py-0.5 rounded-full">{clip.duration.toFixed(1)}s</span>
|
||||||
<span className="bg-white/5 px-1.5 py-0.5 rounded border border-white/5 truncate max-w-[150px]" title={clip.job_id}>ID: {clip.job_id.substring(0, 8)}</span>
|
<span className="readout bg-paper3 px-1.5 py-0.5 rounded-full truncate max-w-[150px]" title={clip.job_id}>ID: {clip.job_id.substring(0, 8)}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="space-y-2 flex-1 overflow-y-auto custom-scrollbar max-h-[150px] pr-1 mb-3">
|
<div className="space-y-2 flex-1 overflow-y-auto custom-scrollbar max-h-[150px] pr-1 mb-3">
|
||||||
{/* YouTube Title */}
|
{/* YouTube Title */}
|
||||||
<div className="bg-black/20 rounded-lg p-2 border border-white/5 relative group/item">
|
<div className="bg-paper rounded-input p-2 relative group/item">
|
||||||
<div className="flex items-center gap-1.5 text-[10px] font-bold text-red-400 mb-1 uppercase tracking-wider">
|
<p className="eyebrow mb-1">YouTube Title</p>
|
||||||
<Youtube size={10} className="shrink-0" /> YouTube Title
|
<p className="text-xs text-ink2 select-all line-clamp-2 hover:line-clamp-none transition-all">{clip.title}</p>
|
||||||
</div>
|
|
||||||
<p className="text-xs text-zinc-300 select-all line-clamp-2 hover:line-clamp-none transition-all">{clip.title}</p>
|
|
||||||
<button
|
<button
|
||||||
onClick={() => handleCopy(clip.title, 'yt')}
|
onClick={() => handleCopy(clip.title, 'yt')}
|
||||||
className="absolute top-2 right-2 p-1 text-zinc-500 hover:text-white transition-colors opacity-0 group-hover/item:opacity-100"
|
className="absolute top-2 right-2 p-1 text-muted hover:text-brass transition-colors opacity-0 group-hover/item:opacity-100"
|
||||||
title="Copy Title"
|
title="Copy Title"
|
||||||
>
|
>
|
||||||
{copied === 'yt' ? <Check size={12} className="text-green-400" /> : <Copy size={12} />}
|
{copied === 'yt' ? <Check size={12} className="text-ok" /> : <Copy size={12} />}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* TikTok / IG Caption */}
|
{/* TikTok / IG Caption */}
|
||||||
<div className="bg-black/20 rounded-lg p-2 border border-white/5 relative group/item">
|
<div className="bg-paper rounded-input p-2 relative group/item">
|
||||||
<div className="flex items-center gap-1.5 text-[10px] font-bold text-zinc-400 mb-1 uppercase tracking-wider">
|
<p className="eyebrow mb-1">TikTok · IG Caption</p>
|
||||||
<Video size={10} className="text-cyan-400 shrink-0" />
|
<p className="text-xs text-ink2 select-all line-clamp-3 hover:line-clamp-none transition-all cursor-pointer">
|
||||||
<span className="text-zinc-600">/</span>
|
|
||||||
<Instagram size={10} className="text-pink-400 shrink-0" /> Caption
|
|
||||||
</div>
|
|
||||||
<p className="text-xs text-zinc-300 select-all line-clamp-3 hover:line-clamp-none transition-all cursor-pointer">
|
|
||||||
{clip.tiktok_desc || clip.insta_desc}
|
{clip.tiktok_desc || clip.insta_desc}
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
onClick={() => handleCopy(clip.tiktok_desc || clip.insta_desc, 'caption')}
|
onClick={() => handleCopy(clip.tiktok_desc || clip.insta_desc, 'caption')}
|
||||||
className="absolute top-2 right-2 p-1 text-zinc-500 hover:text-white transition-colors opacity-0 group-hover/item:opacity-100"
|
className="absolute top-2 right-2 p-1 text-muted hover:text-brass transition-colors opacity-0 group-hover/item:opacity-100"
|
||||||
title="Copy Caption"
|
title="Copy Caption"
|
||||||
>
|
>
|
||||||
{copied === 'caption' ? <Check size={12} className="text-green-400" /> : <Copy size={12} />}
|
{copied === 'caption' ? <Check size={12} className="text-ok" /> : <Copy size={12} />}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -146,7 +141,7 @@ export default function GalleryCard({ clip }) {
|
||||||
{/* Footer Action */}
|
{/* Footer Action */}
|
||||||
<button
|
<button
|
||||||
onClick={handleDownload}
|
onClick={handleDownload}
|
||||||
className="w-full py-2 bg-white/5 hover:bg-white/10 text-zinc-300 hover:text-white rounded-lg text-xs font-medium transition-colors flex items-center justify-center gap-2 border border-white/5"
|
className="btn-quiet w-full"
|
||||||
>
|
>
|
||||||
<Download size={14} className="shrink-0" /> Download Clip
|
<Download size={14} className="shrink-0" /> Download Clip
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Loader2, Download, History as HistoryIcon, Film } from 'lucide-react';
|
import { Loader2, Download, Film } from 'lucide-react';
|
||||||
import { apiJson } from '../lib/api';
|
import { apiJson } from '../lib/api';
|
||||||
|
|
||||||
// The signed-in user's saved video library (stored in R2). Private, signed links.
|
// The signed-in user's saved video library (stored in R2). Private, signed links.
|
||||||
|
|
@ -16,39 +16,37 @@ export default function HistoryTab() {
|
||||||
const fmtDate = (iso) => (iso ? new Date(iso).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' }) : '');
|
const fmtDate = (iso) => (iso ? new Date(iso).toLocaleDateString(undefined, { year: 'numeric', month: 'short', day: 'numeric' }) : '');
|
||||||
|
|
||||||
if (videos === null && !error) {
|
if (videos === null && !error) {
|
||||||
return <div className="flex justify-center py-20"><Loader2 className="animate-spin text-primary" /></div>;
|
return <div className="flex justify-center py-20"><Loader2 className="animate-spin text-brass" /></div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full overflow-y-auto p-8 max-w-5xl mx-auto animate-[fadeIn_0.3s_ease-out]">
|
<div className="h-full overflow-y-auto p-8 max-w-5xl mx-auto animate-fade">
|
||||||
<div className="flex items-center gap-3 mb-2">
|
<p className="eyebrow mb-1.5">06 · HISTORY</p>
|
||||||
<HistoryIcon className="text-primary" />
|
<h1 className="font-display lowercase text-2xl text-ink mb-2">Your library</h1>
|
||||||
<h1 className="text-2xl font-bold">Your library</h1>
|
<p className="text-muted text-sm mb-8 lowercase">
|
||||||
</div>
|
|
||||||
<p className="text-zinc-400 text-sm mb-8">
|
|
||||||
All the shorts you've generated, saved while your plan is active. Kept for 7 days after your plan ends.
|
All the shorts you've generated, saved while your plan is active. Kept for 7 days after your plan ends.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{error && <p className="text-red-400 text-sm">{error}</p>}
|
{error && <p className="text-danger text-sm">{error}</p>}
|
||||||
|
|
||||||
{videos && videos.length === 0 && (
|
{videos && videos.length === 0 && (
|
||||||
<div className="text-center py-20 text-zinc-500">
|
<div className="text-center py-20 text-muted">
|
||||||
<Film size={40} className="mx-auto mb-4 opacity-50" />
|
<Film size={40} className="mx-auto mb-4 text-muted" />
|
||||||
<p>No videos yet. Generate your first short from the Clip Generator.</p>
|
<p className="lowercase">No videos yet. Generate your first short from the Clip Generator.</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-5">
|
<div className="grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-5">
|
||||||
{(videos || []).map((v) => (
|
{(videos || []).map((v) => (
|
||||||
<div key={v.id} className="bg-surface border border-white/10 rounded-xl overflow-hidden group">
|
<div key={v.id} className="card card-hover overflow-hidden group">
|
||||||
<div className="aspect-[9/16] bg-black">
|
<div className="aspect-[9/16] bg-black">
|
||||||
<video src={v.view_url} controls preload="metadata" className="w-full h-full object-contain" />
|
<video src={v.view_url} controls preload="metadata" className="w-full h-full object-contain" />
|
||||||
</div>
|
</div>
|
||||||
<div className="p-3">
|
<div className="p-3">
|
||||||
<p className="text-sm font-medium line-clamp-2 mb-1" title={v.title}>{v.title || 'Short'}</p>
|
<p className="text-sm text-ink font-medium line-clamp-2 mb-1" title={v.title}>{v.title || 'Short'}</p>
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<span className="text-[11px] text-zinc-500">{fmtDate(v.created_at)}</span>
|
<span className="readout">{fmtDate(v.created_at)}</span>
|
||||||
<a href={v.download_url} className="text-primary hover:text-blue-400 flex items-center gap-1 text-xs" title="Download">
|
<a href={v.download_url} className="text-micro font-mono uppercase text-brass hover:text-ink flex items-center gap-1 transition-colors" title="Download">
|
||||||
<Download size={14} /> Download
|
<Download size={14} /> Download
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { X, Sparkles, Loader2, Maximize, MoveVertical, Zap } from 'lucide-react';
|
import { Loader2 } from 'lucide-react';
|
||||||
import RemotionPreview from './RemotionPreview';
|
import RemotionPreview from './RemotionPreview';
|
||||||
|
import Modal from './ui/Modal';
|
||||||
|
import SegmentedControl from './ui/SegmentedControl';
|
||||||
|
|
||||||
const ENTRANCE_OPTIONS = [
|
const ENTRANCE_OPTIONS = [
|
||||||
{ value: 'spring', label: 'Bounce' },
|
{ value: 'spring', label: 'Bounce' },
|
||||||
|
|
@ -9,6 +11,18 @@ const ENTRANCE_OPTIONS = [
|
||||||
{ value: 'none', label: 'None' },
|
{ value: 'none', label: 'None' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const POSITION_OPTIONS = [
|
||||||
|
{ value: 'top', label: 'top' },
|
||||||
|
{ value: 'center', label: 'center' },
|
||||||
|
{ value: 'bottom', label: 'bottom' },
|
||||||
|
];
|
||||||
|
|
||||||
|
const SIZE_OPTIONS = [
|
||||||
|
{ value: 'S', label: 'Small' },
|
||||||
|
{ value: 'M', label: 'Medium' },
|
||||||
|
{ value: 'L', label: 'Large' },
|
||||||
|
];
|
||||||
|
|
||||||
export default function HookModal({ isOpen, onClose, onGenerate, isProcessing, videoUrl, initialText, durationInSeconds, existingSubtitles }) {
|
export default function HookModal({ isOpen, onClose, onGenerate, isProcessing, videoUrl, initialText, durationInSeconds, existingSubtitles }) {
|
||||||
const [text, setText] = useState(initialText || 'POV: You are using the viral hook feature');
|
const [text, setText] = useState(initialText || 'POV: You are using the viral hook feature');
|
||||||
const [position, setPosition] = useState('top');
|
const [position, setPosition] = useState('top');
|
||||||
|
|
@ -47,17 +61,10 @@ export default function HookModal({ isOpen, onClose, onGenerate, isProcessing, v
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-[fadeIn_0.2s_ease-out]">
|
<Modal isOpen={isOpen} onClose={onClose} size="lg" eyebrow="EDITOR · HOOK" title="viral hook">
|
||||||
<div className="bg-[#121214] border border-white/10 p-6 rounded-2xl w-full max-w-4xl shadow-2xl relative flex flex-col md:flex-row gap-6 max-h-[90vh]">
|
<div className="flex flex-col md:flex-row gap-6">
|
||||||
<button
|
|
||||||
onClick={onClose}
|
|
||||||
className="absolute top-4 right-4 text-zinc-500 hover:text-white z-10"
|
|
||||||
>
|
|
||||||
<X size={20} />
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{/* Left: Preview */}
|
{/* Left: Preview */}
|
||||||
<div className="flex-1 flex flex-col items-center justify-center bg-black rounded-lg border border-white/5 overflow-hidden relative aspect-[9/16] max-h-[600px]">
|
<div className="flex-1 flex flex-col items-center justify-center bg-black rounded-card border border-rule overflow-hidden relative aspect-[9/16] max-h-[600px]">
|
||||||
{useRemotionPreview ? (
|
{useRemotionPreview ? (
|
||||||
<RemotionPreview
|
<RemotionPreview
|
||||||
videoUrl={videoUrl}
|
videoUrl={videoUrl}
|
||||||
|
|
@ -91,122 +98,98 @@ export default function HookModal({ isOpen, onClose, onGenerate, isProcessing, v
|
||||||
|
|
||||||
{/* Right: Controls */}
|
{/* Right: Controls */}
|
||||||
<div className="w-full md:w-80 flex flex-col">
|
<div className="w-full md:w-80 flex flex-col">
|
||||||
<h3 className="text-xl font-bold text-white mb-6 flex items-center gap-2">
|
<div className="space-y-5 flex-1 overflow-y-auto custom-scrollbar pr-1">
|
||||||
<Sparkles className="text-yellow-400" /> Viral Hook
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="space-y-6 flex-1 overflow-y-auto custom-scrollbar pr-2">
|
|
||||||
{/* Text Input */}
|
{/* Text Input */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-3 block">Text</label>
|
<p className="eyebrow mb-2">Text</p>
|
||||||
<textarea
|
<textarea
|
||||||
value={text}
|
value={text}
|
||||||
onChange={(e) => setText(e.target.value)}
|
onChange={(e) => setText(e.target.value)}
|
||||||
rows={4}
|
rows={4}
|
||||||
className="w-full bg-black/40 border border-white/10 rounded-xl p-3 text-white placeholder-zinc-600 focus:outline-none focus:border-yellow-500/50 resize-none font-serif"
|
className="input-field resize-none font-serif"
|
||||||
|
style={{ fontFamily: 'Noto Serif, serif' }}
|
||||||
placeholder="Enter text that will stop the scroll..."
|
placeholder="Enter text that will stop the scroll..."
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Position Control */}
|
{/* Position Control */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-3 flex items-center gap-2">
|
<p className="eyebrow mb-2">Position</p>
|
||||||
<MoveVertical size={12} /> Position
|
<SegmentedControl
|
||||||
</label>
|
options={POSITION_OPTIONS}
|
||||||
<div className="grid grid-cols-3 gap-2">
|
value={position}
|
||||||
{['top', 'center', 'bottom'].map((pos) => (
|
onChange={setPosition}
|
||||||
<button
|
size="sm"
|
||||||
key={pos}
|
/>
|
||||||
onClick={() => setPosition(pos)}
|
|
||||||
className={`py-2 px-1 rounded-lg text-xs font-bold capitalize transition-all border ${position === pos
|
|
||||||
? 'bg-white text-black border-white'
|
|
||||||
: 'bg-white/5 text-zinc-400 border-white/5 hover:bg-white/10'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{pos}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Size Control */}
|
{/* Size Control */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-3 flex items-center gap-2">
|
<p className="eyebrow mb-2">Size</p>
|
||||||
<Maximize size={12} /> Size
|
<SegmentedControl
|
||||||
</label>
|
options={SIZE_OPTIONS}
|
||||||
<div className="grid grid-cols-3 gap-2">
|
value={size}
|
||||||
{['S', 'M', 'L'].map((sz) => (
|
onChange={setSize}
|
||||||
<button
|
size="sm"
|
||||||
key={sz}
|
/>
|
||||||
onClick={() => setSize(sz)}
|
|
||||||
className={`py-2 px-1 rounded-lg text-xs font-bold transition-all border ${size === sz
|
|
||||||
? 'bg-white text-black border-white'
|
|
||||||
: 'bg-white/5 text-zinc-400 border-white/5 hover:bg-white/10'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{sz === 'S' ? 'Small' : sz === 'M' ? 'Medium' : 'Large'}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Entrance Animation (new) */}
|
{/* Entrance Animation (new) */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-3 flex items-center gap-2">
|
<p className="eyebrow mb-2">Entrance</p>
|
||||||
<Zap size={12} /> Entrance
|
<SegmentedControl
|
||||||
</label>
|
options={ENTRANCE_OPTIONS}
|
||||||
<div className="grid grid-cols-2 gap-2">
|
value={entranceAnimation}
|
||||||
{ENTRANCE_OPTIONS.map((opt) => (
|
onChange={setEntranceAnimation}
|
||||||
<button
|
columns={2}
|
||||||
key={opt.value}
|
size="sm"
|
||||||
onClick={() => setEntranceAnimation(opt.value)}
|
/>
|
||||||
className={`py-2 px-1 rounded-lg text-xs font-bold transition-all border ${entranceAnimation === opt.value
|
|
||||||
? 'bg-white text-black border-white'
|
|
||||||
: 'bg-white/5 text-zinc-400 border-white/5 hover:bg-white/10'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{opt.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Display Duration (new) */}
|
{/* Display Duration (new) */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-2 block">Duration: {displayDuration}s</label>
|
<div className="flex items-center justify-between mb-2">
|
||||||
|
<p className="eyebrow">Duration</p>
|
||||||
|
<span className="readout">{displayDuration}S</span>
|
||||||
|
</div>
|
||||||
<input
|
<input
|
||||||
type="range"
|
type="range"
|
||||||
min="2"
|
min="2"
|
||||||
max="15"
|
max="15"
|
||||||
value={displayDuration}
|
value={displayDuration}
|
||||||
onChange={(e) => setDisplayDuration(parseInt(e.target.value))}
|
onChange={(e) => setDisplayDuration(parseInt(e.target.value))}
|
||||||
className="w-full accent-yellow-500"
|
className="w-full accent-[var(--color-accent)]"
|
||||||
/>
|
/>
|
||||||
<div className="flex justify-between text-[10px] text-zinc-500">
|
<div className="flex justify-between">
|
||||||
<span>2s</span>
|
<span className="readout">2S</span>
|
||||||
<span>15s</span>
|
<span className="readout">15S</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="p-3 bg-white/5 rounded-lg border border-white/5 text-[11px] text-zinc-400">
|
<div className="p-3 border border-rule rounded-input text-xs text-muted">
|
||||||
<strong>Tip:</strong> Keep it short and punchy. Using "POV:" or specific questions works best for retention.
|
Tip: keep it short and punchy. Using "POV:" or specific questions works best for retention.
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<div className="flex gap-2 mt-5 shrink-0">
|
||||||
onClick={() => onGenerate({
|
<button onClick={onClose} className="btn-ghost">
|
||||||
text, position, size,
|
cancel
|
||||||
// Remotion data
|
</button>
|
||||||
remotion: hookConfig,
|
<button
|
||||||
})}
|
onClick={() => onGenerate({
|
||||||
disabled={isProcessing || !text.trim()}
|
text, position, size,
|
||||||
className="w-full py-4 mt-4 bg-gradient-to-r from-yellow-500 to-amber-600 hover:from-yellow-400 hover:to-amber-500 text-black font-bold rounded-xl shadow-lg shadow-amber-500/20 transition-all active:scale-[0.98] flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed shrink-0"
|
// Remotion data
|
||||||
>
|
remotion: hookConfig,
|
||||||
{isProcessing ? <Loader2 size={20} className="animate-spin" /> : <Sparkles size={20} />}
|
})}
|
||||||
{isProcessing ? 'Generating...' : 'Add Hook'}
|
disabled={isProcessing || !text.trim()}
|
||||||
</button>
|
className="btn-primary flex-1"
|
||||||
|
>
|
||||||
|
{isProcessing && <Loader2 size={16} className="animate-spin text-brassink" />}
|
||||||
|
{isProcessing ? 'generating...' : 'add hook'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,16 +18,16 @@ export default function KeyInput({ onKeySet, savedKey }) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-surface border border-white/5 rounded-2xl p-6 mb-8 animate-[fadeIn_0.5s_ease-out]">
|
<div className="card p-4 sm:p-6 mb-8 animate-fade">
|
||||||
<div className="flex items-center gap-3 mb-4">
|
<div className="flex items-center gap-3 mb-4">
|
||||||
<div className="p-2 bg-accent/20 rounded-lg text-accent">
|
<div className="p-2 bg-paper3 rounded-input text-brass">
|
||||||
<Key size={20} />
|
<Key size={18} />
|
||||||
</div>
|
</div>
|
||||||
<h2 className="text-lg font-semibold">Gemini API Key</h2>
|
<h2 className="font-display lowercase text-lg text-ink">Gemini API Key</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex gap-3">
|
<div className="flex flex-col sm:flex-row gap-3">
|
||||||
<div className="relative flex-1">
|
<div className="relative sm:flex-1">
|
||||||
<input
|
<input
|
||||||
type={isVisible ? "text" : "password"}
|
type={isVisible ? "text" : "password"}
|
||||||
value={key}
|
value={key}
|
||||||
|
|
@ -40,7 +40,7 @@ export default function KeyInput({ onKeySet, savedKey }) {
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
onClick={() => setIsVisible(!isVisible)}
|
onClick={() => setIsVisible(!isVisible)}
|
||||||
className="absolute right-3 top-1/2 -translate-y-1/2 text-zinc-400 hover:text-white transition-colors"
|
className="absolute right-3 top-1/2 -translate-y-1/2 text-muted hover:text-ink transition-colors"
|
||||||
>
|
>
|
||||||
{isVisible ? <EyeOff size={18} /> : <Eye size={18} />}
|
{isVisible ? <EyeOff size={18} /> : <Eye size={18} />}
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -48,22 +48,19 @@ export default function KeyInput({ onKeySet, savedKey }) {
|
||||||
<button
|
<button
|
||||||
onClick={handleSave}
|
onClick={handleSave}
|
||||||
disabled={!key || isSaved}
|
disabled={!key || isSaved}
|
||||||
className={`px-6 rounded-xl font-medium transition-all flex items-center gap-2 ${isSaved
|
className={isSaved ? 'badge-ok px-4 cursor-default' : 'btn-primary'}
|
||||||
? 'bg-green-500/20 text-green-400 cursor-default'
|
|
||||||
: 'bg-primary hover:bg-blue-600 text-white shadow-lg shadow-primary/20'
|
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
{isSaved ? <><Check size={18} /> Ready</> : 'Set Key'}
|
{isSaved ? <><Check size={14} /> Ready</> : 'Set Key'}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p className="mt-3 text-xs text-zinc-500">
|
<p className="mt-3 text-xs text-muted">
|
||||||
Your key is stored locally in your browser for convenience.
|
Your key is stored locally in your browser for convenience.
|
||||||
<br />
|
<br />
|
||||||
<a
|
<a
|
||||||
href="https://aistudio.google.com/app/apikey"
|
href="https://aistudio.google.com/app/apikey"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
className="text-primary hover:underline mt-1 inline-block"
|
className="text-brass hover:underline mt-1 inline-block"
|
||||||
>
|
>
|
||||||
Get your free Gemini API Key here →
|
Get your free Gemini API Key here →
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { X, Mail, Check, Loader2 } from 'lucide-react';
|
import { Mail, Check, Loader2 } from 'lucide-react';
|
||||||
import { useAuth } from '../contexts/AuthContext';
|
import { useAuth } from '../contexts/AuthContext';
|
||||||
|
import Modal from './ui/Modal';
|
||||||
|
|
||||||
// Sign-in modal: magic link (email) + Google OAuth.
|
// Sign-in modal: magic link (email) + Google OAuth.
|
||||||
export default function LoginModal({ onClose }) {
|
export default function LoginModal({ onClose }) {
|
||||||
|
|
@ -26,66 +27,57 @@ export default function LoginModal({ onClose }) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm p-4">
|
<Modal isOpen onClose={onClose} eyebrow="ACCOUNT" title="Sign in to OpenShorts" size="md">
|
||||||
<div className="bg-surface border border-white/10 rounded-2xl p-8 w-full max-w-md relative animate-[fadeIn_0.3s_ease-out]">
|
<p className="text-muted text-sm mb-6 lowercase">Access your plan and generate shorts with no API keys.</p>
|
||||||
<button onClick={onClose} className="absolute right-4 top-4 text-zinc-400 hover:text-white transition-colors">
|
|
||||||
<X size={20} />
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<h2 className="text-2xl font-bold mb-1">Sign in to OpenShorts</h2>
|
{sent ? (
|
||||||
<p className="text-zinc-400 text-sm mb-6">Access your plan and generate shorts with no API keys.</p>
|
<div className="text-center py-6">
|
||||||
|
<span className="badge-ok px-3 py-1"><Check size={14} /> sent</span>
|
||||||
{sent ? (
|
<p className="text-ink font-medium lowercase mt-4">Check your inbox</p>
|
||||||
<div className="text-center py-6">
|
<p className="text-muted text-sm mt-1">We sent a sign-in link to <b className="text-ink font-medium">{email}</b>. It expires in 15 minutes.</p>
|
||||||
<div className="inline-flex p-3 bg-green-500/20 rounded-full text-green-400 mb-4">
|
</div>
|
||||||
<Check size={28} />
|
) : (
|
||||||
|
<>
|
||||||
|
<form onSubmit={submit} className="space-y-3">
|
||||||
|
<div className="relative">
|
||||||
|
<Mail size={18} className="absolute left-3 top-1/2 -translate-y-1/2 text-muted" />
|
||||||
|
<input
|
||||||
|
type="email"
|
||||||
|
value={email}
|
||||||
|
onChange={(e) => setEmail(e.target.value)}
|
||||||
|
placeholder="you@email.com"
|
||||||
|
className="input-field pl-10"
|
||||||
|
autoFocus
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<p className="font-medium">Check your inbox</p>
|
{error && <p className="text-danger text-sm">{error}</p>}
|
||||||
<p className="text-zinc-400 text-sm mt-1">We sent a sign-in link to <b>{email}</b>. It expires in 15 minutes.</p>
|
<button
|
||||||
</div>
|
type="submit"
|
||||||
) : (
|
disabled={busy || !email.trim()}
|
||||||
<>
|
className="btn-primary w-full"
|
||||||
<form onSubmit={submit} className="space-y-3">
|
>
|
||||||
<div className="relative">
|
{busy ? <Loader2 size={18} className="animate-spin" /> : 'Email me a sign-in link'}
|
||||||
<Mail size={18} className="absolute left-3 top-1/2 -translate-y-1/2 text-zinc-500" />
|
</button>
|
||||||
<input
|
</form>
|
||||||
type="email"
|
|
||||||
value={email}
|
|
||||||
onChange={(e) => setEmail(e.target.value)}
|
|
||||||
placeholder="you@email.com"
|
|
||||||
className="input-field pl-10"
|
|
||||||
autoFocus
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{error && <p className="text-red-400 text-sm">{error}</p>}
|
|
||||||
<button
|
|
||||||
type="submit"
|
|
||||||
disabled={busy || !email.trim()}
|
|
||||||
className="w-full bg-primary hover:bg-blue-600 disabled:opacity-50 text-white font-medium py-3 rounded-xl transition-all flex items-center justify-center gap-2"
|
|
||||||
>
|
|
||||||
{busy ? <Loader2 size={18} className="animate-spin" /> : 'Email me a sign-in link'}
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
{googleAuthEnabled && (
|
{googleAuthEnabled && (
|
||||||
<>
|
<>
|
||||||
<div className="flex items-center gap-3 my-5">
|
<div className="flex items-center gap-3 my-5">
|
||||||
<div className="flex-1 h-px bg-white/10" />
|
<div className="flex-1 border-t border-rule" />
|
||||||
<span className="text-xs text-zinc-500">or</span>
|
<span className="readout">or</span>
|
||||||
<div className="flex-1 h-px bg-white/10" />
|
<div className="flex-1 border-t border-rule" />
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={loginWithGoogle}
|
onClick={loginWithGoogle}
|
||||||
className="w-full bg-white text-zinc-900 font-medium py-3 rounded-xl hover:bg-zinc-100 transition-all flex items-center justify-center gap-2"
|
className="btn-ghost w-full"
|
||||||
>
|
>
|
||||||
<svg width="18" height="18" viewBox="0 0 24 24"><path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="#FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/></svg>
|
<svg width="18" height="18" viewBox="0 0 24 24"><path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="#FBBC05" d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l3.66-2.84z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"/></svg>
|
||||||
Continue with Google
|
Continue with Google
|
||||||
</button>
|
</button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</Modal>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { Link2, Upload, FileVideo, X, Info } from 'lucide-react';
|
import { Link2, Upload, FileVideo, X, Info, Loader2 } from 'lucide-react';
|
||||||
import { getApiUrl } from '../config';
|
import { getApiUrl } from '../config';
|
||||||
|
|
||||||
const SUPPORTED_PLATFORMS = [
|
const SUPPORTED_PLATFORMS = [
|
||||||
|
|
@ -58,27 +58,27 @@ export default function MediaInput({ onProcess, isProcessing }) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-surface border border-white/5 rounded-2xl p-6 animate-[fadeIn_0.6s_ease-out]">
|
<div className="card p-4 sm:p-6 animate-fade">
|
||||||
<div className="flex gap-4 mb-6 border-b border-white/5 pb-4">
|
<div className="flex gap-4 sm:gap-6 mb-6 border-b border-rule">
|
||||||
<button
|
<button
|
||||||
onClick={() => setMode('file')}
|
onClick={() => setMode('file')}
|
||||||
className={`flex items-center gap-2 pb-2 px-2 transition-all ${mode === 'file'
|
className={`flex items-center gap-2 pb-3 px-1 -mb-px border-b-2 text-sm lowercase whitespace-nowrap transition-colors ${mode === 'file'
|
||||||
? 'text-primary border-b-2 border-primary -mb-[17px]'
|
? 'text-ink border-brass'
|
||||||
: 'text-zinc-400 hover:text-white'
|
: 'text-muted border-transparent hover:text-ink2'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<Upload size={18} />
|
<Upload size={16} className={`hidden sm:block ${mode === 'file' ? 'text-brass' : ''}`} />
|
||||||
Upload File
|
Upload File
|
||||||
</button>
|
</button>
|
||||||
{youtubeUrlEnabled && (
|
{youtubeUrlEnabled && (
|
||||||
<button
|
<button
|
||||||
onClick={() => setMode('url')}
|
onClick={() => setMode('url')}
|
||||||
className={`flex items-center gap-2 pb-2 px-2 transition-all ${mode === 'url'
|
className={`flex items-center gap-2 pb-3 px-1 -mb-px border-b-2 text-sm lowercase whitespace-nowrap transition-colors ${mode === 'url'
|
||||||
? 'text-primary border-b-2 border-primary -mb-[17px]'
|
? 'text-ink border-brass'
|
||||||
: 'text-zinc-400 hover:text-white'
|
: 'text-muted border-transparent hover:text-ink2'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<Link2 size={18} />
|
<Link2 size={16} className={`hidden sm:block ${mode === 'url' ? 'text-brass' : ''}`} />
|
||||||
Video URL
|
Video URL
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
@ -101,21 +101,21 @@ export default function MediaInput({ onProcess, isProcessing }) {
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setShowInfo((v) => !v)}
|
onClick={() => setShowInfo((v) => !v)}
|
||||||
aria-label="Supported platforms"
|
aria-label="Supported platforms"
|
||||||
className="p-1.5 text-zinc-500 hover:text-primary transition-colors"
|
className="p-1.5 text-muted hover:text-brass transition-colors"
|
||||||
>
|
>
|
||||||
<Info size={18} />
|
<Info size={16} />
|
||||||
</button>
|
</button>
|
||||||
{showInfo && (
|
{showInfo && (
|
||||||
<div className="absolute right-0 top-full mt-2 w-64 z-20 bg-surface border border-white/10 rounded-xl shadow-xl p-4 text-left animate-[fadeIn_0.15s_ease-out]">
|
<div className="absolute right-0 top-full mt-2 w-64 z-20 card p-4 text-left animate-fade">
|
||||||
<p className="text-xs font-semibold text-white mb-2">Paste a link from</p>
|
<p className="eyebrow mb-2">Paste a link from</p>
|
||||||
<div className="flex flex-wrap gap-1.5">
|
<div className="flex flex-wrap gap-1.5">
|
||||||
{SUPPORTED_PLATFORMS.map((p) => (
|
{SUPPORTED_PLATFORMS.map((p) => (
|
||||||
<span key={p} className="text-[11px] px-2 py-0.5 rounded-full bg-white/5 text-zinc-300 border border-white/5">
|
<span key={p} className="text-xs px-2 py-0.5 rounded-full bg-paper3 text-ink2">
|
||||||
{p}
|
{p}
|
||||||
</span>
|
</span>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
<p className="text-[11px] text-zinc-500 mt-2.5 leading-relaxed">
|
<p className="text-xs text-muted mt-2.5 leading-relaxed">
|
||||||
…and 1,000+ more sites. If a link has a public video, we can usually fetch it.
|
…and 1,000+ more sites. If a link has a public video, we can usually fetch it.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -125,19 +125,19 @@ export default function MediaInput({ onProcess, isProcessing }) {
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div
|
<div
|
||||||
className={`border-2 border-dashed rounded-xl p-8 text-center transition-all ${file ? 'border-primary/50 bg-primary/5' : 'border-zinc-700 hover:border-zinc-500 bg-white/5'
|
className={`border-2 border-dashed rounded-card p-6 sm:p-8 text-center transition-colors ${file ? 'border-brass' : 'border-rule2 hover:border-brass'
|
||||||
}`}
|
}`}
|
||||||
onDragOver={(e) => e.preventDefault()}
|
onDragOver={(e) => e.preventDefault()}
|
||||||
onDrop={handleDrop}
|
onDrop={handleDrop}
|
||||||
>
|
>
|
||||||
{file ? (
|
{file ? (
|
||||||
<div className="flex items-center justify-center gap-3 text-white">
|
<div className="flex items-center justify-center gap-3 text-ok min-w-0">
|
||||||
<FileVideo className="text-primary" />
|
<FileVideo size={18} className="shrink-0" />
|
||||||
<span className="font-medium">{file.name}</span>
|
<span className="font-medium truncate">{file.name}</span>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setFile(null)}
|
onClick={() => setFile(null)}
|
||||||
className="p-1 hover:bg-white/10 rounded-full"
|
className="p-1 text-muted hover:text-ink hover:bg-paper3 rounded-full transition-colors"
|
||||||
>
|
>
|
||||||
<X size={16} />
|
<X size={16} />
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -150,34 +150,34 @@ export default function MediaInput({ onProcess, isProcessing }) {
|
||||||
onChange={(e) => setFile(e.target.files?.[0] || null)}
|
onChange={(e) => setFile(e.target.files?.[0] || null)}
|
||||||
className="hidden"
|
className="hidden"
|
||||||
/>
|
/>
|
||||||
<Upload className="mx-auto mb-3 text-zinc-500" size={24} />
|
<Upload className="mx-auto mb-3 text-muted" size={18} />
|
||||||
<p className="text-zinc-400">Click to upload or drag and drop</p>
|
<p className="text-ink2 lowercase">Click to upload or drag and drop</p>
|
||||||
<p className="text-xs text-zinc-600 mt-1">MP4, MOV up to 500MB</p>
|
<p className="readout mt-2">MP4, MOV up to 500MB</p>
|
||||||
</label>
|
</label>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<label className="flex items-start gap-2 mt-5 text-xs text-zinc-400 cursor-pointer select-none">
|
<label className="flex items-start gap-2 mt-5 text-xs text-muted cursor-pointer select-none">
|
||||||
<input
|
<input
|
||||||
type="checkbox"
|
type="checkbox"
|
||||||
checked={acknowledged}
|
checked={acknowledged}
|
||||||
onChange={(e) => setAcknowledged(e.target.checked)}
|
onChange={(e) => setAcknowledged(e.target.checked)}
|
||||||
className="mt-0.5 accent-primary cursor-pointer"
|
className="mt-0.5 accent-[var(--color-accent)] cursor-pointer"
|
||||||
/>
|
/>
|
||||||
<span>
|
<span>
|
||||||
I confirm I own this content or have the rights to process it. I am responsible for any content I submit. See our <a href="/#legal" target="_blank" rel="noopener noreferrer" className="text-primary underline" onClick={(e) => e.stopPropagation()}>Terms & Privacy</a>.
|
I confirm I own this content or have the rights to process it. I am responsible for any content I submit. See our <a href="/#legal" target="_blank" rel="noopener noreferrer" className="text-ink2 underline underline-offset-2 hover:text-brass transition-colors" onClick={(e) => e.stopPropagation()}>Terms & Privacy</a>.
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={isProcessing || !acknowledged || (mode === 'url' && !url) || (mode === 'file' && !file)}
|
disabled={isProcessing || !acknowledged || (mode === 'url' && !url) || (mode === 'file' && !file)}
|
||||||
className="w-full btn-primary mt-4 flex items-center justify-center gap-2"
|
className="w-full btn-primary mt-4"
|
||||||
>
|
>
|
||||||
{isProcessing ? (
|
{isProcessing ? (
|
||||||
<>
|
<>
|
||||||
<div className="w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin" />
|
<Loader2 size={16} className="animate-spin" />
|
||||||
Processing Video...
|
Processing Video...
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|
|
||||||
233
dashboard/src/components/PricingPage.jsx
Normal file
233
dashboard/src/components/PricingPage.jsx
Normal file
|
|
@ -0,0 +1,233 @@
|
||||||
|
import React, { useState } from 'react';
|
||||||
|
import { ArrowDown, ArrowRight, Check, ChevronDown, Github, MoveRight } from 'lucide-react';
|
||||||
|
import PricingSection from './PricingSection';
|
||||||
|
|
||||||
|
// Billing / value questions reused verbatim from Landing.jsx faqs
|
||||||
|
const FAQS = [
|
||||||
|
{
|
||||||
|
question: "Is OpenShorts really free? What's the catch?",
|
||||||
|
answer: "There are two ways to use OpenShorts. (1) Self-hosted is 100% free and open source: you run it with Docker on your own machine, bring your own API keys, and there are no watermarks, no usage limits, and no subscription. Google Gemini API (required) powers the AI analysis — its free tier includes 1,500 requests/day. ElevenLabs (optional) enables AI dubbing in 30+ languages. Upload-Post (optional) publishes to YouTube, TikTok, and Instagram. (2) Hosted at openshorts.app is the no-setup option: we run all the AI and compute for you and you don't need any API keys — it's a paid service with a 3-day free trial, then plans from $12/mo for 100 minutes of video. So: free if you self-host, paid if you want us to host it for you. Both are far cheaper than Opus Clip ($15-228/month) or Kapwing ($24-79/month)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question: "How does OpenShorts compare to Opus Clip?",
|
||||||
|
answer: "OpenShorts is a free, self-hosted alternative to Opus Clip. Both offer AI viral moment detection and smart vertical cropping. Key differences: OpenShorts is completely free vs Opus Clip's $15-228/month pricing. OpenShorts runs on your infrastructure (full data privacy) vs cloud-only. OpenShorts uses Google Gemini 3.0 Flash for AI analysis vs Opus Clip's proprietary model. OpenShorts adds AI voice dubbing in 30+ languages, AI-generated video effects, and hook text overlays. The trade-off is that OpenShorts requires Docker self-hosting, while Opus Clip is a ready-to-use cloud service."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question: "Can OpenShorts generate YouTube thumbnails and titles for free?",
|
||||||
|
answer: "Yes. OpenShorts includes a free AI YouTube thumbnail generator, a free AI YouTube title generator, and a free AI YouTube description generator — all powered by Google Gemini 3.0 Flash. Upload your video and the AI suggests 10 viral title options with an interactive refinement chat. Then it generates multiple thumbnail designs using AI image generation — upload a face photo and background image for personalized results. The studio also auto-generates YouTube descriptions with chapter timestamps and lets you publish directly to YouTube. Everything is 100% free with the Gemini free tier."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question: "Is there a free open source clip generator?",
|
||||||
|
answer: "Yes — OpenShorts is a 100% free, open source clip generator. Unlike paid clip generators like Opus Clip ($15-228/month) or Kapwing ($24-79/month), OpenShorts lets you generate unlimited clips with no watermarks, no usage limits, and no subscription fees. It also includes a free AI YouTube thumbnail generator, free AI YouTube title generator, and free AI YouTube description generator — features that other clip generators charge extra for. You self-host it with Docker on your own machine for full privacy and control."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question: "How much does it cost to generate an AI UGC video?",
|
||||||
|
answer: "OpenShorts itself is free, but the AI Shorts feature uses external APIs (fal.ai for video generation, ElevenLabs for voiceover) that charge per use. Low Cost mode costs approximately $0.65 per video (Flux image $0.05 + ElevenLabs voice $0.10 + Hailuo img2video $0.19 + VEED Lipsync $0.20 + b-roll $0.10). Premium mode costs approximately $2.00 per video using Kling Avatar v2 for higher quality. Both modes are significantly cheaper than hiring UGC creators ($50-500 per video) or using platforms like HeyGen ($24-180/month)."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
question: "What are the system requirements to run OpenShorts?",
|
||||||
|
answer: "OpenShorts runs on any system with Docker installed. The recommended setup is 8GB+ RAM and a modern multi-core CPU. GPU acceleration (NVIDIA CUDA) is optional but speeds up video processing significantly. The Docker Compose setup handles all dependencies automatically — Python 3.11, FFmpeg, YOLOv8, MediaPipe, faster-whisper, and the React dashboard. It works on Linux, macOS, and Windows (via WSL2/Docker Desktop)."
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
const TRUST_CARDS = [
|
||||||
|
{
|
||||||
|
eyebrow: 'open source',
|
||||||
|
body: (
|
||||||
|
<>
|
||||||
|
The full code is public on{' '}
|
||||||
|
<a
|
||||||
|
href="https://github.com/mutonby/openshorts"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="text-ink underline decoration-1 underline-offset-2 hover:text-brass transition-colors"
|
||||||
|
>
|
||||||
|
GitHub
|
||||||
|
</a>
|
||||||
|
. Run it with Docker on your own machine and use it completely free — forever.
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
eyebrow: 'no watermarks · no per-clip credits',
|
||||||
|
body: (
|
||||||
|
<>
|
||||||
|
Clips export clean — no watermarks. Plans meter minutes of input video per billing
|
||||||
|
period, never per-clip credits.
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
eyebrow: 'cancel anytime',
|
||||||
|
body: (
|
||||||
|
<>
|
||||||
|
3-day free trial with up to 20 minutes included; you are not charged during the trial.
|
||||||
|
Billing runs on Stripe — cancel anytime from your account.
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const FAQItem = ({ question, answer, isOpen, onClick }) => (
|
||||||
|
<div>
|
||||||
|
<button
|
||||||
|
onClick={onClick}
|
||||||
|
className="w-full flex items-center justify-between px-1 py-5 text-left"
|
||||||
|
>
|
||||||
|
<span className="text-ink font-medium pr-4">{question}</span>
|
||||||
|
<ChevronDown
|
||||||
|
size={18}
|
||||||
|
className={`text-muted flex-shrink-0 transition-transform ${isOpen ? 'rotate-180' : ''}`}
|
||||||
|
/>
|
||||||
|
</button>
|
||||||
|
{isOpen && (
|
||||||
|
<div className="px-1 pb-6">
|
||||||
|
<p className="text-muted text-sm leading-relaxed">{answer}</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
const DemoFigure = ({ src, label, className = '', children }) => (
|
||||||
|
<figure className={`border border-rule rounded-card overflow-hidden bg-paper2 ${className}`}>
|
||||||
|
<div className="relative">
|
||||||
|
<video
|
||||||
|
src={src}
|
||||||
|
autoPlay
|
||||||
|
muted
|
||||||
|
loop
|
||||||
|
playsInline
|
||||||
|
preload="metadata"
|
||||||
|
className="block w-full h-auto"
|
||||||
|
/>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
<figcaption className="readout px-3 py-2 border-t border-rule">{label}</figcaption>
|
||||||
|
</figure>
|
||||||
|
);
|
||||||
|
|
||||||
|
// Conversion-focused paywall / pricing page (#/pricing). Wraps <PricingSection/>.
|
||||||
|
export default function PricingPage({ onRequireLogin }) {
|
||||||
|
const [openFaq, setOpenFaq] = useState(null);
|
||||||
|
|
||||||
|
const scrollToPlans = () => {
|
||||||
|
document.getElementById('pricing-plans')?.scrollIntoView({ behavior: 'smooth' });
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="min-h-screen bg-paper text-ink2 animate-fade">
|
||||||
|
{/* Header */}
|
||||||
|
<header className="px-6 pt-20 pb-12">
|
||||||
|
<div className="max-w-6xl mx-auto text-center">
|
||||||
|
<p className="eyebrow mb-5">Pricing</p>
|
||||||
|
<h1 className="font-display lowercase text-ink tracking-tight text-4xl md:text-6xl leading-[1.02] mb-5">
|
||||||
|
start clipping in minutes.
|
||||||
|
</h1>
|
||||||
|
<p className="readout">3-day free trial · 20 free minutes · cancel anytime</p>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{/* Demo proof strip */}
|
||||||
|
<section className="px-6 pb-16">
|
||||||
|
<div className="max-w-4xl mx-auto">
|
||||||
|
<div className="grid grid-cols-1 md:grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-5 md:gap-6">
|
||||||
|
<DemoFigure src="/demo/clip-source.mp4" label="input · 16:9">
|
||||||
|
{/* 9:16 crop window over the 16:9 source: window width = height x 9/16 = 31.64% of frame width */}
|
||||||
|
<div className="absolute inset-y-0 left-0 bg-black/50" style={{ width: '34.18%' }} />
|
||||||
|
<div className="absolute inset-y-0 right-0 bg-black/50" style={{ width: '34.18%' }} />
|
||||||
|
<div
|
||||||
|
className="absolute inset-y-0 left-1/2 -translate-x-1/2 border border-brass"
|
||||||
|
style={{ width: '31.64%' }}
|
||||||
|
>
|
||||||
|
<span className="absolute top-1.5 left-1/2 -translate-x-1/2 readout text-brass bg-black/70 rounded-full px-2 py-0.5 whitespace-nowrap">
|
||||||
|
9:16
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</DemoFigure>
|
||||||
|
|
||||||
|
<MoveRight size={20} className="text-brass hidden md:block" aria-hidden="true" />
|
||||||
|
<ArrowDown size={20} className="text-brass md:hidden justify-self-center" aria-hidden="true" />
|
||||||
|
|
||||||
|
<DemoFigure
|
||||||
|
src="/demo/clip-vertical.mp4"
|
||||||
|
label="output · 9:16 · tracked"
|
||||||
|
className="w-44 sm:w-48 justify-self-center md:justify-self-auto"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<p className="text-center text-xs text-muted lowercase mt-4">
|
||||||
|
real output from the clip generator — same footage, reframed by AI face tracking.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Pricing grid */}
|
||||||
|
<section id="pricing-plans" className="px-6 py-16 border-t border-rule scroll-mt-8">
|
||||||
|
<div className="max-w-6xl mx-auto">
|
||||||
|
<PricingSection onRequireLogin={onRequireLogin} />
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Trust strip */}
|
||||||
|
<section className="px-6 py-16 border-t border-rule">
|
||||||
|
<div className="max-w-5xl mx-auto grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||||
|
{TRUST_CARDS.map((card) => (
|
||||||
|
<div key={card.eyebrow} className="card p-6">
|
||||||
|
<div className="flex items-center gap-2 mb-3">
|
||||||
|
<Check size={16} className="text-ok shrink-0" />
|
||||||
|
<span className="eyebrow">{card.eyebrow}</span>
|
||||||
|
</div>
|
||||||
|
<p className="text-sm text-muted leading-relaxed">{card.body}</p>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Mini FAQ */}
|
||||||
|
<section className="px-6 py-16 border-t border-rule">
|
||||||
|
<div className="max-w-3xl mx-auto">
|
||||||
|
<div className="mb-10">
|
||||||
|
<p className="eyebrow mb-3">Billing · FAQ</p>
|
||||||
|
<h2 className="font-display text-3xl md:text-4xl lowercase text-ink tracking-tight">
|
||||||
|
common questions
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
<div className="divide-y divide-rule border-y border-rule">
|
||||||
|
{FAQS.map((faq, i) => (
|
||||||
|
<FAQItem
|
||||||
|
key={i}
|
||||||
|
question={faq.question}
|
||||||
|
answer={faq.answer}
|
||||||
|
isOpen={openFaq === i}
|
||||||
|
onClick={() => setOpenFaq(openFaq === i ? null : i)}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{/* Closing statement */}
|
||||||
|
<section className="px-6 py-24 border-t border-rule">
|
||||||
|
<div className="max-w-3xl mx-auto text-center">
|
||||||
|
<h2 className="font-display text-4xl md:text-5xl lowercase text-ink tracking-tight mb-10">
|
||||||
|
three free days. twenty free minutes. no charge until you decide.
|
||||||
|
</h2>
|
||||||
|
<div className="flex flex-wrap items-center justify-center gap-4">
|
||||||
|
<button onClick={scrollToPlans} className="btn-primary whitespace-nowrap">
|
||||||
|
start free trial
|
||||||
|
<ArrowRight size={16} />
|
||||||
|
</button>
|
||||||
|
<a
|
||||||
|
href="https://github.com/mutonby/openshorts"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="btn-ghost whitespace-nowrap"
|
||||||
|
>
|
||||||
|
<Github size={16} />
|
||||||
|
view source
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
|
||||||
import { Check, Loader2, Zap, Github, Server } from 'lucide-react';
|
import { Check, Loader2, Zap, Github, Server } from 'lucide-react';
|
||||||
import { useAuth } from '../contexts/AuthContext';
|
import { useAuth } from '../contexts/AuthContext';
|
||||||
import { apiJson } from '../lib/api';
|
import { apiJson } from '../lib/api';
|
||||||
|
import SegmentedControl from './ui/SegmentedControl';
|
||||||
|
|
||||||
const PLAN_ORDER = ['starter', 'creator', 'pro'];
|
const PLAN_ORDER = ['starter', 'creator', 'pro'];
|
||||||
const PLAN_BLURB = {
|
const PLAN_BLURB = {
|
||||||
|
|
@ -46,24 +47,23 @@ export default function PricingSection({ onRequireLogin }) {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return <div className="flex justify-center py-16"><Loader2 className="animate-spin text-primary" /></div>;
|
return <div className="flex justify-center py-16"><Loader2 className="animate-spin text-brass" /></div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const byPlan = (plan) => plans.find((p) => p.plan === plan && p.interval === interval);
|
const byPlan = (plan) => plans.find((p) => p.plan === plan && p.interval === interval);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="max-w-5xl mx-auto">
|
<div className="max-w-5xl mx-auto">
|
||||||
<div className="flex items-center justify-center gap-3 mb-10">
|
<div className="max-w-xs mx-auto mb-10">
|
||||||
<span className={interval === 'month' ? 'text-white' : 'text-zinc-500'}>Monthly</span>
|
<SegmentedControl
|
||||||
<button
|
size="sm"
|
||||||
onClick={() => setInterval(interval === 'month' ? 'year' : 'month')}
|
value={interval}
|
||||||
className="relative w-14 h-7 rounded-full bg-white/10 transition-colors"
|
onChange={setInterval}
|
||||||
>
|
options={[
|
||||||
<span className={`absolute top-1 w-5 h-5 rounded-full bg-primary transition-all ${interval === 'year' ? 'left-8' : 'left-1'}`} />
|
{ value: 'month', label: 'Monthly' },
|
||||||
</button>
|
{ value: 'year', label: 'Yearly', hint: '2 months free' },
|
||||||
<span className={interval === 'year' ? 'text-white' : 'text-zinc-500'}>
|
]}
|
||||||
Yearly <span className="text-green-400 text-sm">· 2 months free</span>
|
/>
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="grid md:grid-cols-3 gap-6">
|
<div className="grid md:grid-cols-3 gap-6">
|
||||||
|
|
@ -74,33 +74,33 @@ export default function PricingSection({ onRequireLogin }) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={plan}
|
key={plan}
|
||||||
className={`relative rounded-2xl p-6 border flex flex-col ${highlight ? 'border-primary bg-primary/5 shadow-xl shadow-primary/10' : 'border-white/10 bg-surface'}`}
|
className={`relative card p-6 flex flex-col ${highlight ? 'border-brass' : ''}`}
|
||||||
>
|
>
|
||||||
{highlight && (
|
{highlight && (
|
||||||
<span className="absolute -top-3 left-1/2 -translate-x-1/2 bg-primary text-white text-xs font-semibold px-3 py-1 rounded-full">
|
<span className="absolute -top-3 left-1/2 -translate-x-1/2 badge-brass">
|
||||||
Most popular
|
Most popular
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<h3 className="text-xl font-bold capitalize">{plan}</h3>
|
<h3 className="font-display lowercase text-xl text-ink">{plan}</h3>
|
||||||
<p className="text-zinc-400 text-sm mb-4">{PLAN_BLURB[plan]}</p>
|
<p className="text-muted text-sm mb-4 lowercase">{PLAN_BLURB[plan]}</p>
|
||||||
<div className="mb-4">
|
<div className="mb-4 flex items-baseline gap-1.5">
|
||||||
<span className="text-4xl font-bold">{fmt(entry.amount, entry.currency)}</span>
|
<span className="font-display text-4xl text-ink tabular-nums">{fmt(entry.amount, entry.currency)}</span>
|
||||||
<span className="text-zinc-400">/{interval === 'month' ? 'mo' : 'yr'}</span>
|
<span className="readout">/{interval === 'month' ? 'mo' : 'yr'}</span>
|
||||||
</div>
|
</div>
|
||||||
<ul className="space-y-2 text-sm mb-6 flex-1">
|
<ul className="space-y-2 text-sm text-ink2 mb-6 flex-1">
|
||||||
<li className="flex items-center gap-2"><Check size={16} className="text-green-400" /> <b>{entry.minutes} min</b> of video / month</li>
|
<li className="flex items-start gap-2"><Check size={16} className="text-ok shrink-0 mt-0.5" /> <span><b>{entry.minutes} min</b> of video / month</span></li>
|
||||||
<li className="flex items-center gap-2"><Check size={16} className="text-green-400" /> No API keys needed</li>
|
<li className="flex items-start gap-2"><Check size={16} className="text-ok shrink-0 mt-0.5" /> <span>No API keys needed</span></li>
|
||||||
<li className="flex items-center gap-2"><Check size={16} className="text-green-400" /> Gemini + auto-posting included</li>
|
<li className="flex items-start gap-2"><Check size={16} className="text-ok shrink-0 mt-0.5" /> <span>Gemini + auto-posting included</span></li>
|
||||||
{plan === 'pro' && <li className="flex items-center gap-2"><Zap size={16} className="text-yellow-400" /> Priority processing queue</li>}
|
{plan === 'pro' && <li className="flex items-start gap-2"><Zap size={16} className="text-brass shrink-0 mt-0.5" /> <span>Priority processing queue</span></li>}
|
||||||
</ul>
|
</ul>
|
||||||
<button
|
<button
|
||||||
onClick={() => checkout(entry.price_id)}
|
onClick={() => checkout(entry.price_id)}
|
||||||
disabled={busyPrice === entry.price_id}
|
disabled={busyPrice === entry.price_id}
|
||||||
className={`w-full py-3 rounded-xl font-medium transition-all flex items-center justify-center gap-2 ${highlight ? 'bg-primary hover:bg-blue-600 text-white' : 'bg-white/10 hover:bg-white/20 text-white'}`}
|
className={`w-full ${highlight ? 'btn-primary' : 'btn-ghost'}`}
|
||||||
>
|
>
|
||||||
{busyPrice === entry.price_id ? <Loader2 size={18} className="animate-spin" /> : 'Start 3-day free trial'}
|
{busyPrice === entry.price_id ? <Loader2 size={18} className="animate-spin" /> : 'Start 3-day free trial'}
|
||||||
</button>
|
</button>
|
||||||
<p className="text-center text-[11px] text-zinc-500 mt-2">3 days free, then billed monthly. Cancel anytime.</p>
|
<p className="text-center text-xs text-muted mt-2 lowercase">3 days free, then billed monthly. Cancel anytime.</p>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
|
@ -108,62 +108,62 @@ export default function PricingSection({ onRequireLogin }) {
|
||||||
|
|
||||||
{/* What every plan includes vs what's bring-your-own-key */}
|
{/* What every plan includes vs what's bring-your-own-key */}
|
||||||
<div className="mt-10 grid md:grid-cols-2 gap-4">
|
<div className="mt-10 grid md:grid-cols-2 gap-4">
|
||||||
<div className="rounded-2xl border border-green-500/20 bg-green-500/5 p-6">
|
<div className="card p-6">
|
||||||
<h3 className="font-semibold mb-3 flex items-center gap-2">
|
<div className="mb-4">
|
||||||
<Check size={18} className="text-green-400" /> Included in every plan
|
<span className="badge-ok"><Check size={12} /> Included in every plan</span>
|
||||||
</h3>
|
</div>
|
||||||
<ul className="space-y-2 text-sm text-zinc-300">
|
<ul className="space-y-2 text-sm text-ink2">
|
||||||
<li className="flex items-center gap-2"><Check size={15} className="text-green-400 shrink-0" /> <b>Clip Generator</b> — fully managed, no API keys</li>
|
<li className="flex items-start gap-2"><Check size={15} className="text-ok shrink-0 mt-0.5" /> <span><b>Clip Generator</b> — fully managed, no API keys</span></li>
|
||||||
<li className="flex items-center gap-2"><Check size={15} className="text-green-400 shrink-0" /> <b>YouTube Studio</b> — titles, thumbnails, descriptions</li>
|
<li className="flex items-start gap-2"><Check size={15} className="text-ok shrink-0 mt-0.5" /> <span><b>YouTube Studio</b> — titles, thumbnails, descriptions</span></li>
|
||||||
<li className="flex items-center gap-2"><Check size={15} className="text-green-400 shrink-0" /> Auto-posting to TikTok, Reels & Shorts</li>
|
<li className="flex items-start gap-2"><Check size={15} className="text-ok shrink-0 mt-0.5" /> <span>Auto-posting to TikTok, Reels & Shorts</span></li>
|
||||||
<li className="flex items-center gap-2"><Check size={15} className="text-green-400 shrink-0" /> All the AI & compute run on our servers</li>
|
<li className="flex items-start gap-2"><Check size={15} className="text-ok shrink-0 mt-0.5" /> <span>All the AI & compute run on our servers</span></li>
|
||||||
</ul>
|
</ul>
|
||||||
<p className="text-[11px] text-zinc-500 mt-3 pt-3 border-t border-white/5">
|
<p className="text-xs text-muted mt-3 pt-3 border-t border-rule">
|
||||||
Your monthly minutes cover video processing. Titles & descriptions are free;
|
Your monthly minutes cover video processing. Titles & descriptions are free;
|
||||||
AI <b>thumbnail image generation</b> uses ~3 min of your quota per batch.
|
AI <b>thumbnail image generation</b> uses ~3 min of your quota per batch.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="rounded-2xl border border-amber-500/20 bg-amber-500/5 p-6">
|
<div className="card p-6">
|
||||||
<h3 className="font-semibold mb-3 flex items-center gap-2">
|
<div className="mb-4">
|
||||||
<Zap size={18} className="text-amber-400" /> Bring your own key
|
<span className="badge-warn"><Zap size={12} /> Bring your own key</span>
|
||||||
</h3>
|
</div>
|
||||||
<p className="text-sm text-zinc-400 mb-3 leading-relaxed">
|
<p className="text-sm text-muted mb-3 leading-relaxed">
|
||||||
<b>AI Shorts</b> (AI-actor UGC videos) and <b>voice dubbing</b> use premium generation from
|
<b className="text-ink2">AI Shorts</b> (AI-actor UGC videos) and <b className="text-ink2">voice dubbing</b> use premium generation from
|
||||||
<b> fal.ai</b> and <b>ElevenLabs</b>. Connect your own keys for those — you're billed by those
|
<b className="text-ink2"> fal.ai</b> and <b className="text-ink2">ElevenLabs</b>. Connect your own keys for those — you're billed by those
|
||||||
providers directly (typically ~$0.65-2 per video). Your plan still covers the script & orchestration.
|
providers directly (typically ~$0.65-2 per video). Your plan still covers the script & orchestration.
|
||||||
</p>
|
</p>
|
||||||
<p className="text-[11px] text-zinc-500">Managed credits for these are coming later — no keys needed.</p>
|
<p className="text-xs text-muted">Managed credits for these are coming later — no keys needed.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Free self-hosted path — the honest "free" option */}
|
{/* Free self-hosted path — the honest "free" option */}
|
||||||
<div className="mt-10 rounded-2xl border border-white/10 bg-surface/60 p-6 md:p-8">
|
<div className="mt-10 card p-6 md:p-8">
|
||||||
<div className="flex flex-col md:flex-row md:items-center gap-6 justify-between">
|
<div className="flex flex-col md:flex-row md:items-center gap-6 justify-between">
|
||||||
<div className="flex items-start gap-4">
|
<div className="flex flex-col sm:flex-row items-start gap-4 min-w-0">
|
||||||
<div className="p-3 rounded-xl bg-white/5 text-zinc-300"><Server size={22} /></div>
|
<div className="p-3 rounded-input bg-paper3 text-muted shrink-0"><Server size={18} /></div>
|
||||||
<div>
|
<div className="min-w-0">
|
||||||
<h3 className="text-lg font-bold flex items-center gap-2">
|
<h3 className="font-display lowercase text-lg text-ink flex flex-wrap items-center gap-2">
|
||||||
Free forever — self-hosted
|
Free forever — self-hosted
|
||||||
<span className="text-[10px] bg-green-500/10 border border-green-500/30 px-2 py-0.5 rounded text-green-400 uppercase tracking-wider">$0</span>
|
<span className="badge-ok">$0</span>
|
||||||
</h3>
|
</h3>
|
||||||
<p className="text-zinc-400 text-sm mt-1 max-w-xl leading-relaxed">
|
<p className="text-muted text-sm mt-1 max-w-xl leading-relaxed">
|
||||||
OpenShorts is open source. Run it on your own machine with Docker and use it <b>completely free</b> —
|
OpenShorts is open source. Run it on your own machine with Docker and use it <b className="text-ink2">completely free</b> —
|
||||||
you just bring your own API keys and your own hardware. The plans above are for the
|
you just bring your own API keys and your own hardware. The plans above are for the
|
||||||
<b> hosted version on this site</b>: zero setup, no keys, we run everything for you.
|
<b className="text-ink2"> hosted version on this site</b>: zero setup, no keys, we run everything for you.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
href="https://github.com/mutonby/openshorts"
|
href="https://github.com/mutonby/openshorts"
|
||||||
target="_blank" rel="noopener noreferrer"
|
target="_blank" rel="noopener noreferrer"
|
||||||
className="shrink-0 inline-flex items-center gap-2 bg-white/10 hover:bg-white/20 text-white px-5 py-3 rounded-xl font-medium transition-all"
|
className="shrink-0 btn-ghost whitespace-nowrap"
|
||||||
>
|
>
|
||||||
<Github size={18} /> Self-host free
|
<Github size={16} /> Self-host free
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p className="text-center text-zinc-500 text-xs mt-6">
|
<p className="text-center text-muted text-xs mt-6 lowercase">
|
||||||
Use it free on your own computer, or skip the setup and use it here — 3 days free, then a plan.
|
Use it free on your own computer, or skip the setup and use it here — 3 days free, then a plan.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useEffect, useState, useRef } from 'react';
|
import React, { useEffect, useState, useRef } from 'react';
|
||||||
import { Scan, Scissors, Activity, Radio, CheckCircle, Play } from 'lucide-react';
|
import { Scan, Scissors, Activity, Radio, CheckCircle } from 'lucide-react';
|
||||||
|
|
||||||
const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, syncTrigger }) => {
|
const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, syncTrigger }) => {
|
||||||
const [videoSrc, setVideoSrc] = useState(null);
|
const [videoSrc, setVideoSrc] = useState(null);
|
||||||
|
|
@ -31,72 +31,9 @@ const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, s
|
||||||
videoRef.current.loop = false;
|
videoRef.current.loop = false;
|
||||||
videoRef.current.muted = true; // Keep muted to avoid double audio with clip
|
videoRef.current.muted = true; // Keep muted to avoid double audio with clip
|
||||||
} else {
|
} else {
|
||||||
// Stop Sync: Pause
|
// Stop Sync: Pause. Once analysis is complete, resume the ambient loop.
|
||||||
videoRef.current.pause();
|
videoRef.current.pause();
|
||||||
|
|
||||||
// If Analysis Complete and we just stopped syncing (paused clip), we might want to return to ambient loop?
|
|
||||||
// User issue: "ahora el video loop original que sale oscurito ahora bien pero es una imagen estatica no se está reproduciendo el video en bucle como antes"
|
|
||||||
// This means when NOT synced, it should loop.
|
|
||||||
|
|
||||||
// HOWEVER, previously user asked: "si pauso el video preview y lo reanudo el video original se vuelve al princpio en vez de contnuar igual"
|
|
||||||
// This implies:
|
|
||||||
// 1. If I PAUSE the clip -> Left video should PAUSE (static image) so it can resume.
|
|
||||||
// 2. If I STOP (or it finishes? or just idle state?) -> It should LOOP.
|
|
||||||
|
|
||||||
// The problem is we only have onPause from the clip.
|
|
||||||
// Maybe we need to distinguish "Pause" vs "Idle/Stop".
|
|
||||||
// But currently we just get `isSyncedPlaying = false`.
|
|
||||||
|
|
||||||
// If the user wants "resume from where left off", it MUST be static (paused).
|
|
||||||
// If the user wants "loop when not playing", it MUST play.
|
|
||||||
// These are contradictory for the "Paused" state.
|
|
||||||
|
|
||||||
// BUT, maybe the "loop original" refers to the initial state BEFORE any clip is played?
|
|
||||||
// OR when the clip finishes?
|
|
||||||
|
|
||||||
// Let's look at the logic:
|
|
||||||
// isSyncedPlaying is true ONLY when a clip is playing.
|
|
||||||
// When clip pauses, isSyncedPlaying becomes false.
|
|
||||||
|
|
||||||
// If we want it to loop "como antes", we should set it to loop.
|
|
||||||
// But then we lose the "resume" position because it starts looping.
|
|
||||||
// Unless... we only loop if we haven't started syncing yet? Or if explicitly reset?
|
|
||||||
|
|
||||||
// Wait, the user said: "ahora el video loop original que sale oscurito ahora bien pero es una imagen estatica"
|
|
||||||
// This likely refers to the state AFTER analysis is complete but BEFORE (or after) playing a clip.
|
|
||||||
// If I haven't touched a clip yet, `isSyncedPlaying` is false.
|
|
||||||
// In that case, it SHOULD be looping.
|
|
||||||
|
|
||||||
// My previous change removed the "else { play loop }" block entirely.
|
|
||||||
// I need to restore the loop for the IDLE state, but keep the PAUSE for the "paused clip" state?
|
|
||||||
// That requires knowing WHY `isSyncedPlaying` is false.
|
|
||||||
|
|
||||||
// Actually, if `isSyncedPlaying` is false, it means no clip is controlling it.
|
|
||||||
// If I want it to loop in the background, I can just let it loop.
|
|
||||||
// BUT if I play a clip later, it will jump to the sync time anyway (handled by the `if (isSyncedPlaying)` block).
|
|
||||||
// The only issue is if I PAUSE the clip, `isSyncedPlaying` becomes false, and if I immediately start looping,
|
|
||||||
// visually it might jump or start moving when it should be "paused".
|
|
||||||
|
|
||||||
// Let's try this:
|
|
||||||
// If `syncedTime` is 0 (or we track if we ever started syncing?), we loop.
|
|
||||||
// But `syncedTime` updates on play.
|
|
||||||
|
|
||||||
// Alternative interpretation: The user sees it static because I removed `videoRef.current.play()` in the else block.
|
|
||||||
// If I put it back, it fixes the "loop" issue.
|
|
||||||
// Does it break the "resume" issue?
|
|
||||||
// "si pauso el video preview y lo reanudo el video original se vuelve al princpio en vez de contnuar igual"
|
|
||||||
// If I pause the clip -> `isSyncedPlaying` = false.
|
|
||||||
// If logic says -> Loop from 0.
|
|
||||||
// Then I resume -> `isSyncedPlaying` = true -> Jump to `syncedTime`.
|
|
||||||
// This actually SHOULD work fine for "resume", because `syncedTime` comes from the clip's current time.
|
|
||||||
// The only visual glitch is that while paused, the left video is looping instead of frozen on the frame.
|
|
||||||
|
|
||||||
// If the user accepts that "Paused Clip" = "Background Loop", then we are good.
|
|
||||||
// If the user wants "Paused Clip" = "Frozen Frame" AND "Idle" = "Background Loop", we need more state.
|
|
||||||
// But typically "Idle" implies we aren't focusing on a clip.
|
|
||||||
|
|
||||||
// Let's restore the loop behavior because "video loop original... es una imagen estatica" sounds like a bug to them.
|
|
||||||
|
|
||||||
if (isComplete) {
|
if (isComplete) {
|
||||||
videoRef.current.loop = true;
|
videoRef.current.loop = true;
|
||||||
videoRef.current.play().catch(e => console.log("Ambient play prevented", e));
|
videoRef.current.play().catch(e => console.log("Ambient play prevented", e));
|
||||||
|
|
@ -115,8 +52,6 @@ const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, s
|
||||||
iframeWindow.postMessage(JSON.stringify({ event: 'command', func: 'playVideo', args: [] }), '*');
|
iframeWindow.postMessage(JSON.stringify({ event: 'command', func: 'playVideo', args: [] }), '*');
|
||||||
} else {
|
} else {
|
||||||
// Pause
|
// Pause
|
||||||
// iframeWindow.postMessage(JSON.stringify({ event: 'command', func: 'pauseVideo', args: [] }), '*'); // Removed pause to allow loop if needed, but YT embeds are tricky with custom loops via API.
|
|
||||||
// For now, let's just pause YouTube as complex looping is harder without state.
|
|
||||||
iframeWindow.postMessage(JSON.stringify({ event: 'command', func: 'pauseVideo', args: [] }), '*');
|
iframeWindow.postMessage(JSON.stringify({ event: 'command', func: 'pauseVideo', args: [] }), '*');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -129,9 +64,9 @@ const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, s
|
||||||
return (match && match[2].length === 11) ? match[2] : null;
|
return (match && match[2].length === 11) ? match[2] : null;
|
||||||
};
|
};
|
||||||
|
|
||||||
const containerClasses = `relative w-full aspect-video rounded-xl overflow-hidden bg-black border border-white/10 shadow-2xl mb-8 group animate-[fadeIn_0.5s_ease-out] transition-all duration-500
|
const containerClasses = `relative w-full aspect-video rounded-card overflow-hidden bg-black border border-rule2 mb-8 group animate-fade transition-all duration-500
|
||||||
${isComplete && !isSyncedPlaying ? 'grayscale brightness-50' : ''}
|
${isComplete && !isSyncedPlaying ? 'grayscale brightness-50' : ''}
|
||||||
${isSyncedPlaying ? 'ring-2 ring-primary ring-offset-2 ring-offset-black shadow-primary/20' : ''}`;
|
${isSyncedPlaying ? 'ring-2 ring-brass ring-offset-2 ring-offset-black' : ''}`;
|
||||||
|
|
||||||
const getVideoOpacityClass = () => {
|
const getVideoOpacityClass = () => {
|
||||||
if (isSyncedPlaying) return 'opacity-100'; // Playing: Full visibility
|
if (isSyncedPlaying) return 'opacity-100'; // Playing: Full visibility
|
||||||
|
|
@ -164,8 +99,8 @@ const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, s
|
||||||
playsInline
|
playsInline
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="w-full h-full flex items-center justify-center bg-zinc-900">
|
<div className="w-full h-full flex items-center justify-center bg-paper">
|
||||||
<div className="w-16 h-16 border-4 border-zinc-700 border-t-zinc-500 rounded-full animate-spin"></div>
|
<div className="w-16 h-16 border-4 border-paper3 border-t-muted rounded-full animate-spin"></div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -173,15 +108,15 @@ const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, s
|
||||||
{/* Overlays - Hide when synced playing so user sees clean video */}
|
{/* Overlays - Hide when synced playing so user sees clean video */}
|
||||||
{!isSyncedPlaying && !isComplete && (
|
{!isSyncedPlaying && !isComplete && (
|
||||||
<>
|
<>
|
||||||
<div className="absolute inset-0 bg-[linear-gradient(rgba(255,255,255,0.03)_1px,transparent_1px),linear-gradient(90deg,rgba(255,255,255,0.03)_1px,transparent_1px)] bg-[size:40px_40px] z-10 pointer-events-none"></div>
|
<div className="absolute inset-0 bg-[linear-gradient(var(--rule-blueprint)_1px,transparent_1px),linear-gradient(90deg,var(--rule-blueprint)_1px,transparent_1px)] bg-[size:40px_40px] z-10 pointer-events-none"></div>
|
||||||
<div className="absolute left-0 w-full h-[2px] bg-primary shadow-[0_0_15px_2px_rgba(59,130,246,0.5)] animate-[scan_2.5s_linear_infinite] z-20 pointer-events-none"></div>
|
<div className="absolute left-0 w-full h-[2px] bg-brass shadow-[0_0_15px_2px_var(--color-glow)] animate-[scan_2.5s_linear_infinite] z-20 pointer-events-none"></div>
|
||||||
<div className="absolute left-0 w-full h-[15%] bg-gradient-to-b from-primary/0 via-primary/5 to-primary/0 animate-[scan-overlay_2.5s_linear_infinite] z-10 pointer-events-none"></div>
|
<div className="absolute left-0 w-full h-[15%] bg-[var(--color-paper-emit)] animate-[scan-overlay_2.5s_linear_infinite] z-10 pointer-events-none"></div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* HUD Elements - Hide when synced playing */}
|
{/* HUD Elements - Hide when synced playing */}
|
||||||
{!isSyncedPlaying && (
|
{!isSyncedPlaying && (
|
||||||
<div className={`absolute top-4 left-4 z-30 flex items-center gap-2 px-3 py-1.5 backdrop-blur-md rounded-lg border text-xs font-mono font-bold uppercase transition-all duration-500 ${isComplete ? 'bg-green-500/10 border-green-500/20 text-green-400' : 'bg-black/60 border-primary/30 text-primary animate-pulse'}`}>
|
<div className={`absolute top-4 left-4 z-30 flex items-center gap-2 px-3 py-1.5 rounded-full bg-black/70 readout transition-colors duration-500 ${isComplete ? 'text-ok' : 'text-brass animate-pulse'}`}>
|
||||||
{isComplete ? (
|
{isComplete ? (
|
||||||
<>
|
<>
|
||||||
<CheckCircle size={14} /> Analysis Complete
|
<CheckCircle size={14} /> Analysis Complete
|
||||||
|
|
@ -195,7 +130,7 @@ const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, s
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!isSyncedPlaying && !isComplete && (
|
{!isSyncedPlaying && !isComplete && (
|
||||||
<div className="absolute top-4 right-4 z-30 flex items-center gap-2 px-3 py-1.5 bg-black/60 backdrop-blur-md rounded-lg border border-white/10 text-white/50 text-[10px] font-mono">
|
<div className="absolute top-4 right-4 z-30 flex items-center gap-2 px-3 py-1.5 bg-black/70 rounded-full readout">
|
||||||
AI_MODEL: GEMINI-2.5-PRO
|
AI_MODEL: GEMINI-2.5-PRO
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -203,10 +138,10 @@ const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, s
|
||||||
{/* Visual Flair */}
|
{/* Visual Flair */}
|
||||||
{!isSyncedPlaying && !isComplete && (
|
{!isSyncedPlaying && !isComplete && (
|
||||||
<div className="absolute inset-0 pointer-events-none z-20 overflow-hidden">
|
<div className="absolute inset-0 pointer-events-none z-20 overflow-hidden">
|
||||||
<div className="absolute top-0 bottom-0 left-[35%] w-[1px] bg-yellow-500/20 border-r border-dashed border-yellow-500/40"></div>
|
<div className="absolute top-0 bottom-0 left-[35%] w-px border-r border-dashed border-brass opacity-40"></div>
|
||||||
<div className="absolute top-0 bottom-0 right-[35%] w-[1px] bg-yellow-500/20 border-l border-dashed border-yellow-500/40"></div>
|
<div className="absolute top-0 bottom-0 right-[35%] w-px border-l border-dashed border-brass opacity-40"></div>
|
||||||
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-12 h-12 border border-white/20 rounded-full flex items-center justify-center">
|
<div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-12 h-12 border border-rule2 rounded-full flex items-center justify-center">
|
||||||
<div className="w-1 h-1 bg-red-500 rounded-full animate-ping"></div>
|
<div className="w-1 h-1 bg-brass rounded-full animate-ping"></div>
|
||||||
</div>
|
</div>
|
||||||
<div className="absolute bottom-1/3 left-1/2 -translate-x-1/2 flex flex-col items-center justify-center gap-2 opacity-60">
|
<div className="absolute bottom-1/3 left-1/2 -translate-x-1/2 flex flex-col items-center justify-center gap-2 opacity-60">
|
||||||
<Scissors size={24} className="text-white/20" />
|
<Scissors size={24} className="text-white/20" />
|
||||||
|
|
@ -216,24 +151,24 @@ const ProcessingAnimation = ({ media, isComplete, syncedTime, isSyncedPlaying, s
|
||||||
|
|
||||||
{/* Synced Playing Indicator */}
|
{/* Synced Playing Indicator */}
|
||||||
{isSyncedPlaying && (
|
{isSyncedPlaying && (
|
||||||
<div className="absolute top-4 right-4 z-30 flex items-center gap-2 px-3 py-1.5 bg-red-600/90 backdrop-blur text-white rounded-lg shadow-lg animate-pulse font-bold text-[10px] uppercase tracking-wider border border-white/20">
|
<div className="absolute top-4 right-4 z-30 badge-brass bg-black/70 animate-pulse">
|
||||||
<Activity size={12} /> Live Sync
|
<Activity size={12} /> Live Sync
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Bottom Info Bar */}
|
{/* Bottom Info Bar */}
|
||||||
{!isSyncedPlaying && !isComplete && (
|
{!isSyncedPlaying && !isComplete && (
|
||||||
<div className="absolute bottom-0 left-0 right-0 p-4 bg-gradient-to-t from-black/90 to-transparent z-30 flex justify-between items-end border-t border-white/5">
|
<div className="absolute bottom-0 left-0 right-0 p-4 bg-black/70 z-30 flex justify-between items-end border-t border-rule">
|
||||||
<div className="font-mono text-[10px] text-primary/80 space-y-1">
|
<div className="readout text-brass space-y-1">
|
||||||
<div className="flex items-center gap-2"><Activity size={10} className="animate-bounce" /> > ANALYSIS_THREAD_01: ACTIVE</div>
|
<div className="flex items-center gap-2"><Activity size={10} className="animate-pulse" /> {'>'} ANALYSIS_THREAD_01: ACTIVE</div>
|
||||||
<div className="flex items-center gap-2"><Radio size={10} /> > AUDIO_TRANSCRIPT: PROCESSING</div>
|
<div className="flex items-center gap-2"><Radio size={10} /> {'>'} AUDIO_TRANSCRIPT: PROCESSING</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex gap-1">
|
<div className="flex gap-1">
|
||||||
<div className="w-1 h-3 bg-primary/40 animate-[pulse_0.5s_infinite]"></div>
|
<div className="w-1 h-3 bg-brass opacity-40 animate-[pulse_0.5s_infinite]"></div>
|
||||||
<div className="w-1 h-5 bg-primary/60 animate-[pulse_0.7s_infinite]"></div>
|
<div className="w-1 h-5 bg-brass opacity-60 animate-[pulse_0.7s_infinite]"></div>
|
||||||
<div className="w-1 h-2 bg-primary/30 animate-[pulse_0.4s_infinite]"></div>
|
<div className="w-1 h-2 bg-brass opacity-30 animate-[pulse_0.4s_infinite]"></div>
|
||||||
<div className="w-1 h-4 bg-primary/80 animate-[pulse_0.6s_infinite]"></div>
|
<div className="w-1 h-4 bg-brass opacity-80 animate-[pulse_0.6s_infinite]"></div>
|
||||||
<div className="w-1 h-3 bg-primary/50 animate-[pulse_0.5s_infinite]"></div>
|
<div className="w-1 h-3 bg-brass opacity-50 animate-[pulse_0.5s_infinite]"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useState, useRef, useEffect } from 'react';
|
import React, { useState, useRef, useEffect } from 'react';
|
||||||
import { User, CreditCard, LogOut, Sparkles } from 'lucide-react';
|
import { CreditCard, LogOut, Sparkles } from 'lucide-react';
|
||||||
import { useAuth } from '../contexts/AuthContext';
|
import { useAuth } from '../contexts/AuthContext';
|
||||||
|
|
||||||
// Header avatar + dropdown for signed-in cloud users: shows the email and gives
|
// Header avatar + dropdown for signed-in cloud users: shows the email and gives
|
||||||
|
|
@ -24,36 +24,36 @@ export default function ProfileMenu() {
|
||||||
<button
|
<button
|
||||||
onClick={() => setOpen((v) => !v)}
|
onClick={() => setOpen((v) => !v)}
|
||||||
aria-label="Account menu"
|
aria-label="Account menu"
|
||||||
className="w-8 h-8 rounded-full bg-primary/20 border border-primary/30 text-primary flex items-center justify-center text-sm font-semibold hover:bg-primary/30 transition-colors"
|
className="w-8 h-8 rounded-full bg-paper3 border border-rule hover:border-rule2 text-brass flex items-center justify-center text-sm font-medium transition-colors"
|
||||||
>
|
>
|
||||||
{initial}
|
{initial}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{open && (
|
{open && (
|
||||||
<div className="absolute right-0 top-full mt-2 w-60 z-30 bg-surface border border-white/10 rounded-xl shadow-xl overflow-hidden animate-[fadeIn_0.15s_ease-out]">
|
<div className="card absolute right-0 top-full mt-2 w-56 z-30 shadow-none overflow-hidden animate-fade">
|
||||||
<div className="px-4 py-3 border-b border-white/5">
|
<div className="px-4 py-3 border-b border-rule">
|
||||||
<p className="text-xs text-zinc-500">Signed in as</p>
|
<p className="eyebrow">Signed in as</p>
|
||||||
<p className="text-sm text-white truncate" title={user.email}>{user.email}</p>
|
<p className="text-sm text-ink truncate mt-0.5" title={user.email}>{user.email}</p>
|
||||||
</div>
|
</div>
|
||||||
{!isManaged && (
|
{!isManaged && (
|
||||||
<button
|
<button
|
||||||
onClick={() => { setOpen(false); window.location.hash = '#/pricing'; }}
|
onClick={() => { setOpen(false); window.location.hash = '#/pricing'; }}
|
||||||
className="w-full flex items-center gap-3 px-4 py-2.5 text-sm text-primary hover:bg-white/5 transition-colors"
|
className="w-full flex items-center gap-3 px-4 py-2.5 text-sm lowercase text-brass hover:bg-paper3 transition-colors"
|
||||||
>
|
>
|
||||||
<Sparkles size={16} /> Start free trial
|
<Sparkles size={16} /> Start free trial
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
<button
|
<button
|
||||||
onClick={() => { setOpen(false); window.location.hash = '#/account'; }}
|
onClick={() => { setOpen(false); window.location.hash = '#/account'; }}
|
||||||
className="w-full flex items-center gap-3 px-4 py-2.5 text-sm text-zinc-200 hover:bg-white/5 transition-colors"
|
className="w-full flex items-center gap-3 px-4 py-2.5 text-sm lowercase text-ink2 hover:bg-paper3 transition-colors"
|
||||||
>
|
>
|
||||||
<CreditCard size={16} /> Account & billing
|
<CreditCard size={16} className="text-muted" /> Account & billing
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => { setOpen(false); logout(); }}
|
onClick={() => { setOpen(false); logout(); }}
|
||||||
className="w-full flex items-center gap-3 px-4 py-2.5 text-sm text-zinc-200 hover:bg-white/5 transition-colors border-t border-white/5"
|
className="w-full flex items-center gap-3 px-4 py-2.5 text-sm lowercase text-ink2 hover:bg-paper3 transition-colors border-t border-rule"
|
||||||
>
|
>
|
||||||
<LogOut size={16} /> Sign out
|
<LogOut size={16} className="text-muted" /> Sign out
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,28 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { Download, Share2, Instagram, Youtube, Video, CheckCircle, AlertCircle, X, Loader2, Copy, Wand2, Type, Calendar, Clock, Languages } from 'lucide-react';
|
import { Download, Share2, Instagram, Youtube, Video, AlertCircle, Loader2, Copy, Check, Wand2, Type, Calendar, Languages } from 'lucide-react';
|
||||||
import { getApiUrl } from '../config';
|
import { getApiUrl } from '../config';
|
||||||
import { apiFetch } from '../lib/api';
|
import { apiFetch } from '../lib/api';
|
||||||
import SubtitleModal from './SubtitleModal';
|
import SubtitleModal from './SubtitleModal';
|
||||||
import HookModal from './HookModal';
|
import HookModal from './HookModal';
|
||||||
import TranslateModal from './TranslateModal';
|
import TranslateModal from './TranslateModal';
|
||||||
|
import Modal from './ui/Modal';
|
||||||
|
import SegmentedControl from './ui/SegmentedControl';
|
||||||
import { renderInBrowser } from '../lib/renderInBrowser';
|
import { renderInBrowser } from '../lib/renderInBrowser';
|
||||||
|
|
||||||
|
const QUIET_BTN = 'group flex items-center justify-center gap-2 py-2 px-2 rounded-input border border-rule hover:bg-paper3 text-xs lowercase text-ink2 transition-colors disabled:opacity-45 disabled:cursor-not-allowed';
|
||||||
|
|
||||||
|
const PLATFORM_OPTIONS = [
|
||||||
|
{ value: 'tiktok', label: 'tiktok', icon: <Video size={16} /> },
|
||||||
|
{ value: 'instagram', label: 'instagram', icon: <Instagram size={16} /> },
|
||||||
|
{ value: 'youtube', label: 'youtube', icon: <Youtube size={16} /> },
|
||||||
|
];
|
||||||
|
|
||||||
|
function formatDuration(clip) {
|
||||||
|
const secs = clip.end && clip.start ? Math.floor(clip.end - clip.start) : NaN;
|
||||||
|
if (!Number.isFinite(secs) || secs < 0) return null;
|
||||||
|
return `${String(Math.floor(secs / 60)).padStart(2, '0')}:${String(secs % 60).padStart(2, '0')}`;
|
||||||
|
}
|
||||||
|
|
||||||
export default function ResultCard({ clip, index, jobId, durableUrl, uploadPostKey, uploadUserId, geminiApiKey, elevenLabsKey, isManaged, onPlay, onPause }) {
|
export default function ResultCard({ clip, index, jobId, durableUrl, uploadPostKey, uploadUserId, geminiApiKey, elevenLabsKey, isManaged, onPlay, onPause }) {
|
||||||
const [showModal, setShowModal] = useState(false);
|
const [showModal, setShowModal] = useState(false);
|
||||||
const [showSubtitleModal, setShowSubtitleModal] = useState(false);
|
const [showSubtitleModal, setShowSubtitleModal] = useState(false);
|
||||||
|
|
@ -36,6 +52,17 @@ export default function ResultCard({ clip, index, jobId, durableUrl, uploadPostK
|
||||||
|
|
||||||
const [posting, setPosting] = useState(false);
|
const [posting, setPosting] = useState(false);
|
||||||
const [postResult, setPostResult] = useState(null);
|
const [postResult, setPostResult] = useState(null);
|
||||||
|
const [copied, setCopied] = useState(null);
|
||||||
|
|
||||||
|
const handleCopy = async (field, text) => {
|
||||||
|
try {
|
||||||
|
await navigator.clipboard.writeText(text || '');
|
||||||
|
setCopied(field);
|
||||||
|
setTimeout(() => setCopied(null), 2000);
|
||||||
|
} catch {
|
||||||
|
// clipboard unavailable — silent
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const [isEditing, setIsEditing] = useState(false);
|
const [isEditing, setIsEditing] = useState(false);
|
||||||
const [isSubtitling, setIsSubtitling] = useState(false);
|
const [isSubtitling, setIsSubtitling] = useState(false);
|
||||||
|
|
@ -396,8 +423,10 @@ export default function ResultCard({ clip, index, jobId, durableUrl, uploadPostK
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const durationReadout = formatDuration(clip);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-surface border border-white/5 rounded-2xl overflow-hidden flex flex-col md:flex-row group hover:border-white/10 transition-all animate-[fadeIn_0.5s_ease-out] min-h-[300px] h-auto" style={{ animationDelay: `${index * 0.1}s` }}>
|
<div className="card overflow-hidden flex flex-col md:flex-row group hover:border-rule2 transition-colors animate-fade min-h-[300px] h-auto" style={{ animationDelay: `${index * 0.1}s` }}>
|
||||||
{/* Left: Video Preview (Responsive Width) */}
|
{/* Left: Video Preview (Responsive Width) */}
|
||||||
<div className="w-full md:w-[180px] lg:w-[200px] bg-black relative shrink-0 aspect-[9/16] md:aspect-auto group/video">
|
<div className="w-full md:w-[180px] lg:w-[200px] bg-black relative shrink-0 aspect-[9/16] md:aspect-auto group/video">
|
||||||
<video
|
<video
|
||||||
|
|
@ -426,55 +455,66 @@ export default function ResultCard({ clip, index, jobId, durableUrl, uploadPostK
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div className="absolute top-3 left-3 flex gap-2">
|
<div className="absolute top-3 left-3 flex gap-2">
|
||||||
<span className="bg-black/60 backdrop-blur-md text-white text-[10px] font-bold px-2 py-1 rounded-md border border-white/10 uppercase tracking-wide">
|
<span className="bg-black/70 text-ink font-mono text-micro uppercase px-2 py-1 rounded-full">
|
||||||
Clip {index + 1}
|
Clip {index + 1}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Auto Edit Overlay if Processing */}
|
{/* Auto Edit Overlay if Processing */}
|
||||||
{isEditing && (
|
{isEditing && (
|
||||||
<div className="absolute inset-0 bg-black/60 backdrop-blur-sm flex flex-col items-center justify-center z-10 p-4 text-center">
|
<div className="absolute inset-0 bg-black/70 flex flex-col items-center justify-center z-10 p-4 text-center">
|
||||||
<Loader2 size={32} className="text-primary animate-spin mb-3" />
|
<Loader2 size={28} className="text-brass animate-spin mb-3" />
|
||||||
<span className="text-xs font-bold text-white uppercase tracking-wider">AI Magic in Progress...</span>
|
<span className="text-xs text-ink lowercase">ai magic in progress…</span>
|
||||||
<span className="text-[10px] text-zinc-400 mt-1">Applying viral edits & zooms</span>
|
<span className="readout mt-1.5">APPLYING VIRAL EDITS · ZOOMS</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Right: Content & Details */}
|
{/* Right: Content & Details */}
|
||||||
<div className="flex-1 p-4 md:p-5 flex flex-col bg-[#121214] overflow-hidden min-w-0">
|
<div className="flex-1 p-4 md:p-5 flex flex-col overflow-hidden min-w-0">
|
||||||
<div className="mb-4">
|
<div className="mb-4">
|
||||||
<h3 className="text-base font-bold text-white leading-tight line-clamp-2 mb-2 break-words" title={clip.video_title_for_youtube_short}>
|
<h3 className="text-base font-medium text-ink leading-tight line-clamp-2 mb-2 break-words" title={clip.video_title_for_youtube_short}>
|
||||||
{clip.video_title_for_youtube_short || "Viral Clip Generated"}
|
{clip.video_title_for_youtube_short || "Viral Clip Generated"}
|
||||||
</h3>
|
</h3>
|
||||||
<div className="flex flex-wrap gap-2 text-[10px] text-zinc-500 font-mono">
|
<div className="flex flex-wrap gap-1.5">
|
||||||
<span className="bg-white/5 px-1.5 py-0.5 rounded border border-white/5 shrink-0">{Math.floor(clip.end - clip.start)}s</span>
|
{durationReadout && <span className="readout bg-paper3 px-2 py-0.5 rounded-full shrink-0">{durationReadout}</span>}
|
||||||
<span className="bg-white/5 px-1.5 py-0.5 rounded border border-white/5 shrink-0">#shorts</span>
|
<span className="readout bg-paper3 px-2 py-0.5 rounded-full shrink-0">#shorts</span>
|
||||||
<span className="bg-white/5 px-1.5 py-0.5 rounded border border-white/5 shrink-0">#viral</span>
|
<span className="readout bg-paper3 px-2 py-0.5 rounded-full shrink-0">#viral</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Scrollable Descriptions Area */}
|
{/* Scrollable Descriptions Area */}
|
||||||
<div className="flex-1 overflow-y-auto custom-scrollbar space-y-3 pr-2 mb-4">
|
<div className="flex-1 overflow-y-auto custom-scrollbar space-y-3 pr-2 mb-4">
|
||||||
{/* YouTube */}
|
{/* YouTube */}
|
||||||
<div className="bg-black/20 rounded-lg p-3 border border-white/5">
|
<div className="bg-paper rounded-input p-3 border border-rule">
|
||||||
<div className="flex items-center gap-2 text-[10px] font-bold text-red-400 mb-1.5 uppercase tracking-wider">
|
<div className="flex items-center justify-between gap-2 mb-1.5">
|
||||||
<Youtube size={12} className="shrink-0" /> <span className="truncate">YouTube Title</span>
|
<span className="eyebrow truncate">YOUTUBE</span>
|
||||||
|
<button
|
||||||
|
onClick={() => handleCopy('youtube', clip.video_title_for_youtube_short || "Viral Short Video")}
|
||||||
|
aria-label="copy youtube title"
|
||||||
|
className="p-1 rounded-full text-muted hover:text-brass transition-colors shrink-0"
|
||||||
|
>
|
||||||
|
{copied === 'youtube' ? <Check size={14} className="text-ok" /> : <Copy size={14} />}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs text-zinc-300 select-all break-words">
|
<p className="text-xs text-ink2 select-all break-words">
|
||||||
{clip.video_title_for_youtube_short || "Viral Short Video"}
|
{clip.video_title_for_youtube_short || "Viral Short Video"}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* TikTok / IG */}
|
{/* TikTok / IG */}
|
||||||
<div className="bg-black/20 rounded-lg p-3 border border-white/5">
|
<div className="bg-paper rounded-input p-3 border border-rule">
|
||||||
<div className="flex items-center gap-2 text-[10px] font-bold text-zinc-400 mb-1.5 uppercase tracking-wider">
|
<div className="flex items-center justify-between gap-2 mb-1.5">
|
||||||
<Video size={12} className="text-cyan-400 shrink-0" />
|
<span className="eyebrow truncate">TIKTOK · IG</span>
|
||||||
<span className="text-zinc-500">/</span>
|
<button
|
||||||
<Instagram size={12} className="text-pink-400 shrink-0" />
|
onClick={() => handleCopy('caption', clip.video_description_for_tiktok || clip.video_description_for_instagram)}
|
||||||
<span className="truncate">Caption</span>
|
aria-label="copy caption"
|
||||||
|
className="p-1 rounded-full text-muted hover:text-brass transition-colors shrink-0"
|
||||||
|
>
|
||||||
|
{copied === 'caption' ? <Check size={14} className="text-ok" /> : <Copy size={14} />}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs text-zinc-300 line-clamp-3 hover:line-clamp-none transition-all cursor-pointer select-all break-words">
|
<p className="text-xs text-ink2 line-clamp-3 hover:line-clamp-none transition-all cursor-pointer select-all break-words">
|
||||||
{clip.video_description_for_tiktok || clip.video_description_for_instagram}
|
{clip.video_description_for_tiktok || clip.video_description_for_instagram}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -482,55 +522,55 @@ export default function ResultCard({ clip, index, jobId, durableUrl, uploadPostK
|
||||||
|
|
||||||
{/* Error Message */}
|
{/* Error Message */}
|
||||||
{editError && (
|
{editError && (
|
||||||
<div className="mb-3 p-2 bg-red-500/10 border border-red-500/20 text-red-400 text-[10px] rounded-lg flex items-center gap-2">
|
<div className="mb-3 px-3 py-2 rounded-input text-xs text-danger bg-[color-mix(in_oklab,var(--color-danger)_10%,transparent)] flex items-center gap-2">
|
||||||
<AlertCircle size={12} className="shrink-0" />
|
<AlertCircle size={14} className="shrink-0" />
|
||||||
{editError}
|
{editError}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Actions Footer */}
|
{/* Actions Footer */}
|
||||||
<div className="grid grid-cols-2 gap-3 mt-auto pt-4 border-t border-white/5">
|
<div className="grid grid-cols-2 gap-2 mt-auto pt-4 border-t border-rule">
|
||||||
<button
|
<button
|
||||||
onClick={handleAutoEdit}
|
onClick={handleAutoEdit}
|
||||||
disabled={isEditing}
|
disabled={isEditing}
|
||||||
className="col-span-1 py-2 bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 hover:to-indigo-500 text-white rounded-lg text-xs font-bold shadow-lg shadow-purple-500/20 transition-all active:scale-[0.98] flex items-center justify-center gap-2 mb-1 truncate px-1"
|
className={QUIET_BTN}
|
||||||
>
|
>
|
||||||
{isEditing ? <Loader2 size={14} className="animate-spin" /> : <Wand2 size={14} />}
|
{isEditing ? <Loader2 size={16} className="animate-spin text-brass shrink-0" /> : <Wand2 size={16} className="text-muted group-hover:text-brass transition-colors shrink-0" />}
|
||||||
{isEditing ? 'Editing...' : 'Auto Edit'}
|
{isEditing ? 'editing…' : 'auto edit'}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={() => setShowSubtitleModal(true)}
|
onClick={() => setShowSubtitleModal(true)}
|
||||||
disabled={isSubtitling}
|
disabled={isSubtitling}
|
||||||
className="col-span-1 py-2 bg-gradient-to-r from-yellow-600 to-orange-600 hover:from-yellow-500 hover:to-orange-500 text-white rounded-lg text-xs font-bold shadow-lg shadow-orange-500/20 transition-all active:scale-[0.98] flex items-center justify-center gap-2 mb-1 truncate px-1"
|
className={QUIET_BTN}
|
||||||
>
|
>
|
||||||
{isSubtitling ? <Loader2 size={14} className="animate-spin" /> : <Type size={14} />}
|
{isSubtitling ? <Loader2 size={16} className="animate-spin text-brass shrink-0" /> : <Type size={16} className="text-muted group-hover:text-brass transition-colors shrink-0" />}
|
||||||
{isSubtitling ? 'Adding...' : 'Subtitles'}
|
{isSubtitling ? 'adding…' : 'subtitles'}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={() => setShowHookModal(true)}
|
onClick={() => setShowHookModal(true)}
|
||||||
disabled={isHooking}
|
disabled={isHooking}
|
||||||
className="col-span-1 py-2 bg-gradient-to-r from-amber-400 to-yellow-500 hover:from-amber-300 hover:to-yellow-400 text-black rounded-lg text-xs font-bold shadow-lg shadow-yellow-500/20 transition-all active:scale-[0.98] flex items-center justify-center gap-2 mb-1 truncate px-1"
|
className={QUIET_BTN}
|
||||||
>
|
>
|
||||||
{isHooking ? <Loader2 size={14} className="animate-spin" /> : <Wand2 size={14} />}
|
{isHooking ? <Loader2 size={16} className="animate-spin text-brass shrink-0" /> : <Wand2 size={16} className="text-muted group-hover:text-brass transition-colors shrink-0" />}
|
||||||
{isHooking ? 'Adding...' : 'Viral Hook'}
|
{isHooking ? 'adding…' : 'viral hook'}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={() => setShowTranslateModal(true)}
|
onClick={() => setShowTranslateModal(true)}
|
||||||
disabled={isTranslating}
|
disabled={isTranslating}
|
||||||
className="col-span-1 py-2 bg-gradient-to-r from-green-500 to-teal-600 hover:from-green-400 hover:to-teal-500 text-white rounded-lg text-xs font-bold shadow-lg shadow-green-500/20 transition-all active:scale-[0.98] flex items-center justify-center gap-2 mb-1 truncate px-1"
|
className={QUIET_BTN}
|
||||||
>
|
>
|
||||||
{isTranslating ? <Loader2 size={14} className="animate-spin" /> : <Languages size={14} />}
|
{isTranslating ? <Loader2 size={16} className="animate-spin text-brass shrink-0" /> : <Languages size={16} className="text-muted group-hover:text-brass transition-colors shrink-0" />}
|
||||||
{isTranslating ? 'Translating...' : 'Dub Voice'}
|
{isTranslating ? 'translating…' : 'dub voice'}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={() => setShowModal(true)}
|
onClick={() => setShowModal(true)}
|
||||||
className="col-span-1 py-2 bg-primary hover:bg-blue-600 text-white rounded-lg text-xs font-bold shadow-lg shadow-primary/20 transition-all active:scale-[0.98] flex items-center justify-center gap-2 truncate px-2"
|
className="btn-primary py-2 px-2 text-xs"
|
||||||
>
|
>
|
||||||
<Share2 size={14} className="shrink-0" /> Post
|
<Share2 size={16} className="shrink-0" /> post
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={async (e) => {
|
onClick={async (e) => {
|
||||||
|
|
@ -553,122 +593,112 @@ export default function ResultCard({ clip, index, jobId, durableUrl, uploadPostK
|
||||||
window.open(currentVideoUrl, '_blank');
|
window.open(currentVideoUrl, '_blank');
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
className="col-span-1 py-2 bg-white/5 hover:bg-white/10 text-zinc-300 hover:text-white rounded-lg text-xs font-medium transition-colors flex items-center justify-center gap-2 border border-white/5 truncate px-2"
|
className={QUIET_BTN}
|
||||||
>
|
>
|
||||||
<Download size={14} className="shrink-0" /> Download
|
<Download size={16} className="text-muted group-hover:text-brass transition-colors shrink-0" /> download
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Post Modal */}
|
{/* Post Modal */}
|
||||||
{showModal && (
|
<Modal
|
||||||
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-[fadeIn_0.2s_ease-out]">
|
isOpen={showModal}
|
||||||
<div className="bg-[#121214] border border-white/10 p-6 rounded-2xl w-full max-w-md shadow-2xl relative max-h-[90vh] overflow-y-auto custom-scrollbar">
|
onClose={() => setShowModal(false)}
|
||||||
<button
|
eyebrow="PUBLISH"
|
||||||
onClick={() => setShowModal(false)}
|
title="post clip"
|
||||||
className="absolute top-4 right-4 text-zinc-500 hover:text-white"
|
size="md"
|
||||||
>
|
footer={
|
||||||
<X size={20} />
|
<button
|
||||||
</button>
|
onClick={handlePost}
|
||||||
|
disabled={posting || !canPost}
|
||||||
<h3 className="text-lg font-bold text-white mb-4">Post / Schedule</h3>
|
className="btn-primary w-full"
|
||||||
|
>
|
||||||
{!canPost && (
|
{posting ? <><Loader2 size={16} className="animate-spin" /> {isScheduling ? 'scheduling…' : 'publishing…'}</> : <><Share2 size={16} /> {isScheduling ? 'schedule post' : 'publish now'}</>}
|
||||||
<div className="mb-4 p-3 bg-yellow-500/10 border border-yellow-500/20 text-yellow-200 text-xs rounded-lg flex items-start gap-2">
|
</button>
|
||||||
<AlertCircle size={14} className="mt-0.5 shrink-0" />
|
}
|
||||||
<div>Configure API Key in Settings first.</div>
|
>
|
||||||
</div>
|
{!canPost && (
|
||||||
)}
|
<div className="mb-4 px-3 py-2 rounded-input text-xs text-warn bg-[color-mix(in_oklab,var(--color-warn)_10%,transparent)] flex items-start gap-2">
|
||||||
|
<AlertCircle size={14} className="mt-0.5 shrink-0" />
|
||||||
<div className="space-y-4 mb-6">
|
<div className="lowercase">configure api key in settings first.</div>
|
||||||
{/* Title & Description */}
|
|
||||||
<div>
|
|
||||||
<label className="block text-xs font-bold text-zinc-400 mb-1">Video Title</label>
|
|
||||||
<input
|
|
||||||
type="text"
|
|
||||||
value={postTitle}
|
|
||||||
onChange={(e) => setPostTitle(e.target.value)}
|
|
||||||
className="w-full bg-black/40 border border-white/10 rounded-lg p-2 text-sm text-white focus:outline-none focus:border-primary/50 placeholder-zinc-600"
|
|
||||||
placeholder="Enter a catchy title..."
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<label className="block text-xs font-bold text-zinc-400 mb-1">Caption / Description</label>
|
|
||||||
<textarea
|
|
||||||
value={postDescription}
|
|
||||||
onChange={(e) => setPostDescription(e.target.value)}
|
|
||||||
rows={4}
|
|
||||||
className="w-full bg-black/40 border border-white/10 rounded-lg p-2 text-sm text-white focus:outline-none focus:border-primary/50 placeholder-zinc-600 resize-none"
|
|
||||||
placeholder="Write a caption for your post..."
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Scheduling */}
|
|
||||||
<div className="p-3 bg-white/5 rounded-lg border border-white/5">
|
|
||||||
<div className="flex items-center justify-between mb-2">
|
|
||||||
<div className="flex items-center gap-2 text-sm text-white font-medium">
|
|
||||||
<Calendar size={16} className="text-purple-400" /> Schedule Post
|
|
||||||
</div>
|
|
||||||
<label className="relative inline-flex items-center cursor-pointer">
|
|
||||||
<input type="checkbox" checked={isScheduling} onChange={(e) => setIsScheduling(e.target.checked)} className="sr-only peer" />
|
|
||||||
<div className="w-9 h-5 bg-zinc-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-purple-600"></div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{isScheduling && (
|
|
||||||
<div className="mt-3 animate-[fadeIn_0.2s_ease-out]">
|
|
||||||
<label className="block text-xs text-zinc-400 mb-1">Select Date & Time</label>
|
|
||||||
<div className="relative">
|
|
||||||
<input
|
|
||||||
type="datetime-local"
|
|
||||||
value={scheduleDate}
|
|
||||||
onChange={(e) => setScheduleDate(e.target.value)}
|
|
||||||
className="w-full bg-black/40 border border-white/10 rounded-lg p-2 pl-9 text-sm text-white focus:outline-none focus:border-purple-500/50 [color-scheme:dark]"
|
|
||||||
/>
|
|
||||||
<Clock size={14} className="absolute left-3 top-2.5 text-zinc-500" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Platforms */}
|
|
||||||
<div>
|
|
||||||
<label className="block text-xs font-bold text-zinc-400 mb-2">Select Platforms</label>
|
|
||||||
<div className="grid grid-cols-1 gap-2">
|
|
||||||
<label className="flex items-center gap-3 p-3 bg-white/5 rounded-lg cursor-pointer hover:bg-white/10 transition-colors border border-white/5">
|
|
||||||
<input type="checkbox" checked={platforms.tiktok} onChange={e => setPlatforms({ ...platforms, tiktok: e.target.checked })} className="w-4 h-4 rounded border-zinc-600 bg-black/50 text-primary focus:ring-primary" />
|
|
||||||
<div className="flex items-center gap-2 text-sm text-white"><Video size={16} className="text-cyan-400" /> TikTok</div>
|
|
||||||
</label>
|
|
||||||
<label className="flex items-center gap-3 p-3 bg-white/5 rounded-lg cursor-pointer hover:bg-white/10 transition-colors border border-white/5">
|
|
||||||
<input type="checkbox" checked={platforms.instagram} onChange={e => setPlatforms({ ...platforms, instagram: e.target.checked })} className="w-4 h-4 rounded border-zinc-600 bg-black/50 text-primary focus:ring-primary" />
|
|
||||||
<div className="flex items-center gap-2 text-sm text-white"><Instagram size={16} className="text-pink-400" /> Instagram</div>
|
|
||||||
</label>
|
|
||||||
<label className="flex items-center gap-3 p-3 bg-white/5 rounded-lg cursor-pointer hover:bg-white/10 transition-colors border border-white/5">
|
|
||||||
<input type="checkbox" checked={platforms.youtube} onChange={e => setPlatforms({ ...platforms, youtube: e.target.checked })} className="w-4 h-4 rounded border-zinc-600 bg-black/50 text-primary focus:ring-primary" />
|
|
||||||
<div className="flex items-center gap-2 text-sm text-white"><Youtube size={16} className="text-red-400" /> YouTube Shorts</div>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{postResult && (
|
|
||||||
<div className={`mb-4 p-3 rounded-lg text-xs flex items-start gap-2 ${postResult.success ? 'bg-green-500/10 text-green-400' : 'bg-red-500/10 text-red-400'}`}>
|
|
||||||
{postResult.success ? <CheckCircle size={14} className="mt-0.5 shrink-0" /> : <AlertCircle size={14} className="mt-0.5 shrink-0" />}
|
|
||||||
<div>{postResult.msg}</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<button
|
|
||||||
onClick={handlePost}
|
|
||||||
disabled={posting || !canPost}
|
|
||||||
className="w-full py-3 bg-primary hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed rounded-xl text-white font-bold transition-all flex items-center justify-center gap-2"
|
|
||||||
>
|
|
||||||
{posting ? <><Loader2 size={16} className="animate-spin" /> {isScheduling ? 'Scheduling...' : 'Publishing...'}</> : <><Share2 size={16} /> {isScheduling ? 'Schedule Post' : 'Publish Now'}</>}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<div className="space-y-4">
|
||||||
|
{/* Title & Description */}
|
||||||
|
<div>
|
||||||
|
<label className="eyebrow block mb-1.5">TITLE</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
value={postTitle}
|
||||||
|
onChange={(e) => setPostTitle(e.target.value)}
|
||||||
|
className="input-field"
|
||||||
|
placeholder="enter a catchy title…"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label className="eyebrow block mb-1.5">CAPTION</label>
|
||||||
|
<textarea
|
||||||
|
value={postDescription}
|
||||||
|
onChange={(e) => setPostDescription(e.target.value)}
|
||||||
|
rows={4}
|
||||||
|
className="input-field resize-none"
|
||||||
|
placeholder="write a caption for your post…"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Scheduling */}
|
||||||
|
<div className="p-3 bg-paper rounded-input border border-rule">
|
||||||
|
<label className="flex items-center justify-between cursor-pointer">
|
||||||
|
<span className="flex items-center gap-2 text-sm text-ink2 lowercase">
|
||||||
|
<Calendar size={16} className={isScheduling ? 'text-brass' : 'text-muted'} /> schedule post
|
||||||
|
</span>
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={isScheduling}
|
||||||
|
onChange={(e) => setIsScheduling(e.target.checked)}
|
||||||
|
className="w-4 h-4 accent-brass cursor-pointer"
|
||||||
|
/>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
{isScheduling && (
|
||||||
|
<div className="mt-3 animate-fade">
|
||||||
|
<label className="eyebrow block mb-1.5">DATE · TIME</label>
|
||||||
|
<input
|
||||||
|
type="datetime-local"
|
||||||
|
value={scheduleDate}
|
||||||
|
onChange={(e) => setScheduleDate(e.target.value)}
|
||||||
|
className="input-field [color-scheme:dark]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Platforms */}
|
||||||
|
<div>
|
||||||
|
<label className="eyebrow block mb-2">PLATFORMS</label>
|
||||||
|
<SegmentedControl
|
||||||
|
multi
|
||||||
|
columns={3}
|
||||||
|
options={PLATFORM_OPTIONS}
|
||||||
|
value={Object.keys(platforms).filter(k => platforms[k])}
|
||||||
|
onChange={(arr) => setPlatforms({
|
||||||
|
tiktok: arr.includes('tiktok'),
|
||||||
|
instagram: arr.includes('instagram'),
|
||||||
|
youtube: arr.includes('youtube'),
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{postResult && (
|
||||||
|
<div className={postResult.success ? 'badge-ok' : 'badge-danger'}>
|
||||||
|
{postResult.success ? <Check size={12} className="shrink-0" /> : <AlertCircle size={12} className="shrink-0" />}
|
||||||
|
{postResult.msg}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
)}
|
</Modal>
|
||||||
|
|
||||||
<SubtitleModal
|
<SubtitleModal
|
||||||
isOpen={showSubtitleModal}
|
isOpen={showSubtitleModal}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,43 +1,50 @@
|
||||||
import React, { useState, useMemo } from 'react';
|
import React, { useState, useMemo } from 'react';
|
||||||
import { X, Loader2, Calendar, Clock, CheckCircle, AlertCircle, Video, Instagram, Youtube, ChevronLeft, ChevronRight, Globe, ExternalLink } from 'lucide-react';
|
import { Loader2, Calendar, CheckCircle, AlertCircle, Video, Instagram, Youtube, ChevronLeft, ChevronRight, Circle, ExternalLink } from 'lucide-react';
|
||||||
import { getApiUrl } from '../config';
|
|
||||||
import { apiFetch } from '../lib/api';
|
import { apiFetch } from '../lib/api';
|
||||||
|
import Modal from './ui/Modal';
|
||||||
|
import SegmentedControl from './ui/SegmentedControl';
|
||||||
|
|
||||||
const DAYS = ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb'];
|
const DAYS = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
||||||
const MONTHS = ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic'];
|
const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
||||||
|
|
||||||
const TIMEZONES = [
|
const TIMEZONES = [
|
||||||
{ value: 'Pacific/Midway', label: '(GMT-11:00) Midway' },
|
{ value: 'Pacific/Midway', label: '(GMT-11:00) Midway' },
|
||||||
{ value: 'Pacific/Honolulu', label: '(GMT-10:00) Honolulu' },
|
{ value: 'Pacific/Honolulu', label: '(GMT-10:00) Honolulu' },
|
||||||
{ value: 'America/Anchorage', label: '(GMT-09:00) Alaska' },
|
{ value: 'America/Anchorage', label: '(GMT-09:00) Alaska' },
|
||||||
{ value: 'America/Los_Angeles', label: '(GMT-08:00) Los Ángeles' },
|
{ value: 'America/Los_Angeles', label: '(GMT-08:00) Los Angeles' },
|
||||||
{ value: 'America/Denver', label: '(GMT-07:00) Denver' },
|
{ value: 'America/Denver', label: '(GMT-07:00) Denver' },
|
||||||
{ value: 'America/Mexico_City', label: '(GMT-06:00) Ciudad de México' },
|
{ value: 'America/Mexico_City', label: '(GMT-06:00) Mexico City' },
|
||||||
{ value: 'America/Chicago', label: '(GMT-06:00) Chicago' },
|
{ value: 'America/Chicago', label: '(GMT-06:00) Chicago' },
|
||||||
{ value: 'America/New_York', label: '(GMT-05:00) Nueva York' },
|
{ value: 'America/New_York', label: '(GMT-05:00) New York' },
|
||||||
{ value: 'America/Bogota', label: '(GMT-05:00) Bogotá' },
|
{ value: 'America/Bogota', label: '(GMT-05:00) Bogota' },
|
||||||
{ value: 'America/Caracas', label: '(GMT-04:00) Caracas' },
|
{ value: 'America/Caracas', label: '(GMT-04:00) Caracas' },
|
||||||
{ value: 'America/Santiago', label: '(GMT-04:00) Santiago' },
|
{ value: 'America/Santiago', label: '(GMT-04:00) Santiago' },
|
||||||
{ value: 'America/Argentina/Buenos_Aires', label: '(GMT-03:00) Buenos Aires' },
|
{ value: 'America/Argentina/Buenos_Aires', label: '(GMT-03:00) Buenos Aires' },
|
||||||
{ value: 'America/Sao_Paulo', label: '(GMT-03:00) São Paulo' },
|
{ value: 'America/Sao_Paulo', label: '(GMT-03:00) Sao Paulo' },
|
||||||
{ value: 'Atlantic/Azores', label: '(GMT-01:00) Azores' },
|
{ value: 'Atlantic/Azores', label: '(GMT-01:00) Azores' },
|
||||||
{ value: 'UTC', label: '(GMT+00:00) UTC' },
|
{ value: 'UTC', label: '(GMT+00:00) UTC' },
|
||||||
{ value: 'Europe/London', label: '(GMT+00:00) Londres' },
|
{ value: 'Europe/London', label: '(GMT+00:00) London' },
|
||||||
{ value: 'Europe/Madrid', label: '(GMT+01:00) Madrid' },
|
{ value: 'Europe/Madrid', label: '(GMT+01:00) Madrid' },
|
||||||
{ value: 'Europe/Paris', label: '(GMT+01:00) París' },
|
{ value: 'Europe/Paris', label: '(GMT+01:00) Paris' },
|
||||||
{ value: 'Europe/Berlin', label: '(GMT+01:00) Berlín' },
|
{ value: 'Europe/Berlin', label: '(GMT+01:00) Berlin' },
|
||||||
{ value: 'Europe/Rome', label: '(GMT+01:00) Roma' },
|
{ value: 'Europe/Rome', label: '(GMT+01:00) Rome' },
|
||||||
{ value: 'Africa/Lagos', label: '(GMT+01:00) Lagos' },
|
{ value: 'Africa/Lagos', label: '(GMT+01:00) Lagos' },
|
||||||
{ value: 'Europe/Istanbul', label: '(GMT+03:00) Estambul' },
|
{ value: 'Europe/Istanbul', label: '(GMT+03:00) Istanbul' },
|
||||||
{ value: 'Asia/Dubai', label: '(GMT+04:00) Dubái' },
|
{ value: 'Asia/Dubai', label: '(GMT+04:00) Dubai' },
|
||||||
{ value: 'Asia/Kolkata', label: '(GMT+05:30) India' },
|
{ value: 'Asia/Kolkata', label: '(GMT+05:30) India' },
|
||||||
{ value: 'Asia/Bangkok', label: '(GMT+07:00) Bangkok' },
|
{ value: 'Asia/Bangkok', label: '(GMT+07:00) Bangkok' },
|
||||||
{ value: 'Asia/Shanghai', label: '(GMT+08:00) Shanghái' },
|
{ value: 'Asia/Shanghai', label: '(GMT+08:00) Shanghai' },
|
||||||
{ value: 'Asia/Tokyo', label: '(GMT+09:00) Tokio' },
|
{ value: 'Asia/Tokyo', label: '(GMT+09:00) Tokyo' },
|
||||||
{ value: 'Australia/Sydney', label: '(GMT+10:00) Sídney' },
|
{ value: 'Australia/Sydney', label: '(GMT+10:00) Sydney' },
|
||||||
{ value: 'Pacific/Auckland', label: '(GMT+12:00) Auckland' },
|
{ value: 'Pacific/Auckland', label: '(GMT+12:00) Auckland' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const PLATFORM_OPTIONS = [
|
||||||
|
{ value: 'tiktok', label: 'TikTok', icon: <Video size={16} /> },
|
||||||
|
{ value: 'instagram', label: 'Instagram', icon: <Instagram size={16} /> },
|
||||||
|
{ value: 'youtube', label: 'YouTube', icon: <Youtube size={16} /> },
|
||||||
|
];
|
||||||
|
|
||||||
function getDayLabel(date) {
|
function getDayLabel(date) {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
today.setHours(0, 0, 0, 0);
|
today.setHours(0, 0, 0, 0);
|
||||||
|
|
@ -46,13 +53,13 @@ function getDayLabel(date) {
|
||||||
const target = new Date(date);
|
const target = new Date(date);
|
||||||
target.setHours(0, 0, 0, 0);
|
target.setHours(0, 0, 0, 0);
|
||||||
|
|
||||||
if (target.getTime() === today.getTime()) return 'Hoy';
|
if (target.getTime() === today.getTime()) return 'Today';
|
||||||
if (target.getTime() === tomorrow.getTime()) return 'Mañana';
|
if (target.getTime() === tomorrow.getTime()) return 'Tomorrow';
|
||||||
return DAYS[target.getDay()];
|
return DAYS[target.getDay()];
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDate(date) {
|
function formatDate(date) {
|
||||||
return `${date.getDate()} ${MONTHS[date.getMonth()]}`;
|
return `${MONTHS[date.getMonth()]} ${date.getDate()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function detectTimezone() {
|
function detectTimezone() {
|
||||||
|
|
@ -164,229 +171,194 @@ export default function ScheduleWeekModal({ isOpen, onClose, clips, jobId, uploa
|
||||||
const successCount = progress.results.filter(r => r.success).length;
|
const successCount = progress.results.filter(r => r.success).length;
|
||||||
const failCount = progress.results.filter(r => !r.success).length;
|
const failCount = progress.results.filter(r => !r.success).length;
|
||||||
|
|
||||||
return (
|
const footer = (
|
||||||
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-[fadeIn_0.2s_ease-out]">
|
<div className="flex flex-col sm:flex-row gap-3">
|
||||||
<div className="bg-[#121214] border border-white/10 p-6 rounded-2xl w-full max-w-lg shadow-2xl relative max-h-[90vh] overflow-y-auto custom-scrollbar">
|
<button
|
||||||
|
onClick={onClose}
|
||||||
|
disabled={scheduling}
|
||||||
|
className="btn-ghost flex-1"
|
||||||
|
>
|
||||||
|
{done ? 'close' : 'cancel'}
|
||||||
|
</button>
|
||||||
|
{!done ? (
|
||||||
<button
|
<button
|
||||||
onClick={onClose}
|
onClick={handleScheduleAll}
|
||||||
disabled={scheduling}
|
disabled={scheduling || !canPost || selectedPlatforms.length === 0}
|
||||||
className="absolute top-4 right-4 text-zinc-500 hover:text-white disabled:opacity-50"
|
className="btn-primary flex-1"
|
||||||
>
|
>
|
||||||
<X size={20} />
|
{scheduling ? (
|
||||||
</button>
|
<>
|
||||||
|
<Loader2 size={16} className="animate-spin" />
|
||||||
{/* Header */}
|
scheduling...
|
||||||
<div className="flex items-center gap-3 mb-6">
|
</>
|
||||||
<div className="w-10 h-10 rounded-xl bg-gradient-to-br from-purple-500 to-indigo-600 flex items-center justify-center">
|
|
||||||
<Calendar size={20} className="text-white" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h3 className="text-lg font-bold text-white">Programar Semana</h3>
|
|
||||||
<p className="text-xs text-zinc-500">{clips?.length || 0} clips · 1 por día</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{!canPost && (
|
|
||||||
<div className="mb-4 p-3 bg-yellow-500/10 border border-yellow-500/20 text-yellow-200 text-xs rounded-lg flex items-start gap-2">
|
|
||||||
<AlertCircle size={14} className="mt-0.5 shrink-0" />
|
|
||||||
<div>Configura tu API Key de Upload-Post en Settings primero.</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Time + Timezone */}
|
|
||||||
<div className="mb-5 grid grid-cols-2 gap-3">
|
|
||||||
<div>
|
|
||||||
<label className="block text-xs font-bold text-zinc-400 mb-2 flex items-center gap-2">
|
|
||||||
<Clock size={14} className="text-purple-400" />
|
|
||||||
Hora
|
|
||||||
</label>
|
|
||||||
<input
|
|
||||||
type="time"
|
|
||||||
value={time}
|
|
||||||
onChange={(e) => setTime(e.target.value)}
|
|
||||||
disabled={scheduling}
|
|
||||||
className="w-full bg-black/40 border border-white/10 rounded-lg p-3 text-sm text-white focus:outline-none focus:border-purple-500/50 [color-scheme:dark]"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label className="block text-xs font-bold text-zinc-400 mb-2 flex items-center gap-2">
|
|
||||||
<Globe size={14} className="text-indigo-400" />
|
|
||||||
Zona horaria
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
value={timezone}
|
|
||||||
onChange={(e) => setTimezone(e.target.value)}
|
|
||||||
disabled={scheduling}
|
|
||||||
className="w-full bg-black/40 border border-white/10 rounded-lg p-3 text-sm text-white focus:outline-none focus:border-indigo-500/50 appearance-none cursor-pointer"
|
|
||||||
>
|
|
||||||
{TIMEZONES.map(tz => (
|
|
||||||
<option key={tz.value} value={tz.value}>{tz.label}</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Start day offset */}
|
|
||||||
<div className="mb-5 flex items-center justify-between">
|
|
||||||
<span className="text-xs font-bold text-zinc-400">Empezar desde</span>
|
|
||||||
<div className="flex items-center gap-2">
|
|
||||||
<button
|
|
||||||
onClick={() => setStartOffset(Math.max(1, startOffset - 1))}
|
|
||||||
disabled={startOffset <= 1 || scheduling}
|
|
||||||
className="p-1.5 rounded-lg bg-white/5 hover:bg-white/10 text-zinc-400 hover:text-white disabled:opacity-30 transition-colors"
|
|
||||||
>
|
|
||||||
<ChevronLeft size={16} />
|
|
||||||
</button>
|
|
||||||
<span className="text-sm text-white font-medium min-w-[90px] text-center">
|
|
||||||
{(() => {
|
|
||||||
const d = new Date();
|
|
||||||
d.setDate(d.getDate() + startOffset);
|
|
||||||
return `${getDayLabel(d)} ${formatDate(d)}`;
|
|
||||||
})()}
|
|
||||||
</span>
|
|
||||||
<button
|
|
||||||
onClick={() => setStartOffset(startOffset + 1)}
|
|
||||||
disabled={scheduling}
|
|
||||||
className="p-1.5 rounded-lg bg-white/5 hover:bg-white/10 text-zinc-400 hover:text-white disabled:opacity-30 transition-colors"
|
|
||||||
>
|
|
||||||
<ChevronRight size={16} />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Calendar grid */}
|
|
||||||
<div className="mb-5 space-y-2">
|
|
||||||
{schedule.map(({ clip, index, date }) => (
|
|
||||||
<div key={index} className="flex items-center gap-3 p-3 bg-white/5 rounded-xl border border-white/5 hover:border-white/10 transition-colors">
|
|
||||||
<div className="w-14 shrink-0 text-center">
|
|
||||||
<div className="text-[10px] font-bold text-purple-400 uppercase">{getDayLabel(date)}</div>
|
|
||||||
<div className="text-lg font-bold text-white leading-tight">{date.getDate()}</div>
|
|
||||||
<div className="text-[10px] text-zinc-500">{MONTHS[date.getMonth()]}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="flex-1 min-w-0">
|
|
||||||
<div className="text-xs font-bold text-white truncate">
|
|
||||||
Clip {index + 1}
|
|
||||||
</div>
|
|
||||||
<div className="text-[10px] text-zinc-500 truncate">
|
|
||||||
{clip.video_title_for_youtube_short || 'Viral Short'}
|
|
||||||
</div>
|
|
||||||
<div className="text-[10px] text-zinc-600 mt-0.5">
|
|
||||||
{time}h · {TIMEZONES.find(t => t.value === timezone)?.label || timezone}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="shrink-0">
|
|
||||||
{progress.results[index]?.success === true && (
|
|
||||||
<CheckCircle size={18} className="text-green-400" />
|
|
||||||
)}
|
|
||||||
{progress.results[index]?.success === false && (
|
|
||||||
<AlertCircle size={18} className="text-red-400" />
|
|
||||||
)}
|
|
||||||
{scheduling && progress.current === index && (
|
|
||||||
<Loader2 size={18} className="text-purple-400 animate-spin" />
|
|
||||||
)}
|
|
||||||
{!scheduling && progress.results[index] === undefined && (
|
|
||||||
<div className="w-4 h-4 rounded-full border-2 border-zinc-700" />
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Platforms */}
|
|
||||||
<div className="mb-5">
|
|
||||||
<label className="block text-xs font-bold text-zinc-400 mb-2">Plataformas</label>
|
|
||||||
<div className="flex gap-2">
|
|
||||||
<button
|
|
||||||
onClick={() => setPlatforms(p => ({ ...p, tiktok: !p.tiktok }))}
|
|
||||||
disabled={scheduling}
|
|
||||||
className={`flex-1 flex items-center justify-center gap-2 p-2.5 rounded-lg text-xs font-bold border transition-all ${platforms.tiktok ? 'bg-cyan-500/10 border-cyan-500/30 text-cyan-400' : 'bg-white/5 border-white/5 text-zinc-500'}`}
|
|
||||||
>
|
|
||||||
<Video size={14} /> TikTok
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
onClick={() => setPlatforms(p => ({ ...p, instagram: !p.instagram }))}
|
|
||||||
disabled={scheduling}
|
|
||||||
className={`flex-1 flex items-center justify-center gap-2 p-2.5 rounded-lg text-xs font-bold border transition-all ${platforms.instagram ? 'bg-pink-500/10 border-pink-500/30 text-pink-400' : 'bg-white/5 border-white/5 text-zinc-500'}`}
|
|
||||||
>
|
|
||||||
<Instagram size={14} /> Instagram
|
|
||||||
</button>
|
|
||||||
<button
|
|
||||||
onClick={() => setPlatforms(p => ({ ...p, youtube: !p.youtube }))}
|
|
||||||
disabled={scheduling}
|
|
||||||
className={`flex-1 flex items-center justify-center gap-2 p-2.5 rounded-lg text-xs font-bold border transition-all ${platforms.youtube ? 'bg-red-500/10 border-red-500/30 text-red-400' : 'bg-white/5 border-white/5 text-zinc-500'}`}
|
|
||||||
>
|
|
||||||
<Youtube size={14} /> YouTube
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Progress bar */}
|
|
||||||
{(scheduling || done) && (
|
|
||||||
<div className="mb-5">
|
|
||||||
<div className="flex items-center justify-between text-xs text-zinc-400 mb-2">
|
|
||||||
<span>{scheduling ? 'Programando...' : 'Completado'}</span>
|
|
||||||
<span>{progress.current}/{progress.total}</span>
|
|
||||||
</div>
|
|
||||||
<div className="w-full h-2 bg-white/5 rounded-full overflow-hidden">
|
|
||||||
<div
|
|
||||||
className={`h-full rounded-full transition-all duration-500 ${done && failCount === 0 ? 'bg-green-500' : done && failCount > 0 ? 'bg-yellow-500' : 'bg-purple-500'}`}
|
|
||||||
style={{ width: `${(progress.current / progress.total) * 100}%` }}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
{done && (
|
|
||||||
<div className="mt-3 text-xs text-center">
|
|
||||||
{failCount === 0 ? (
|
|
||||||
<span className="text-green-400">Todos los clips programados correctamente</span>
|
|
||||||
) : (
|
|
||||||
<span className="text-yellow-400">{successCount} programados, {failCount} fallidos</span>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Actions */}
|
|
||||||
<div className="flex gap-3">
|
|
||||||
<button
|
|
||||||
onClick={onClose}
|
|
||||||
disabled={scheduling}
|
|
||||||
className="flex-1 py-3 bg-white/5 hover:bg-white/10 text-zinc-300 rounded-xl font-medium transition-colors disabled:opacity-50"
|
|
||||||
>
|
|
||||||
{done ? 'Cerrar' : 'Cancelar'}
|
|
||||||
</button>
|
|
||||||
{!done ? (
|
|
||||||
<button
|
|
||||||
onClick={handleScheduleAll}
|
|
||||||
disabled={scheduling || !canPost || selectedPlatforms.length === 0}
|
|
||||||
className="flex-1 py-3 bg-gradient-to-r from-purple-500 to-indigo-600 hover:from-purple-400 hover:to-indigo-500 text-white rounded-xl font-bold transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2"
|
|
||||||
>
|
|
||||||
{scheduling ? (
|
|
||||||
<>
|
|
||||||
<Loader2 size={16} className="animate-spin" />
|
|
||||||
Programando...
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<Calendar size={16} />
|
|
||||||
Programar {clips?.length || 0} Clips
|
|
||||||
</>
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
) : (
|
) : (
|
||||||
<a
|
<>
|
||||||
href="https://app.upload-post.com/calendar"
|
<Calendar size={16} />
|
||||||
target="_blank"
|
schedule {clips?.length || 0} clips
|
||||||
rel="noopener noreferrer"
|
</>
|
||||||
className="flex-1 py-3 bg-gradient-to-r from-violet-500 to-purple-600 hover:from-violet-400 hover:to-purple-500 text-white rounded-xl font-bold transition-all flex items-center justify-center gap-2 no-underline"
|
|
||||||
>
|
|
||||||
<ExternalLink size={16} />
|
|
||||||
Ver Calendario
|
|
||||||
</a>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</button>
|
||||||
</div>
|
) : (
|
||||||
|
<a
|
||||||
|
href="https://app.upload-post.com/calendar"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
className="btn-primary flex-1 no-underline"
|
||||||
|
>
|
||||||
|
<ExternalLink size={16} />
|
||||||
|
view calendar
|
||||||
|
</a>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal
|
||||||
|
isOpen={isOpen}
|
||||||
|
onClose={scheduling ? undefined : onClose}
|
||||||
|
eyebrow="PUBLISH · WEEK"
|
||||||
|
title="schedule week"
|
||||||
|
size="md"
|
||||||
|
footer={footer}
|
||||||
|
>
|
||||||
|
<p className="readout mb-4">{clips?.length || 0} CLIPS · 1/DAY</p>
|
||||||
|
|
||||||
|
{!canPost && (
|
||||||
|
<div className="mb-4 p-3 bg-warn/10 text-warn text-xs rounded-input flex items-start gap-2">
|
||||||
|
<AlertCircle size={14} className="mt-0.5 shrink-0" />
|
||||||
|
<div>Set your Upload-Post API key in Settings first.</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Time + Timezone */}
|
||||||
|
<div className="mb-5 grid grid-cols-2 gap-3">
|
||||||
|
<div>
|
||||||
|
<label className="eyebrow block mb-2">time</label>
|
||||||
|
<input
|
||||||
|
type="time"
|
||||||
|
value={time}
|
||||||
|
onChange={(e) => setTime(e.target.value)}
|
||||||
|
disabled={scheduling}
|
||||||
|
className="input-field [color-scheme:dark]"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label className="eyebrow block mb-2">timezone</label>
|
||||||
|
<select
|
||||||
|
value={timezone}
|
||||||
|
onChange={(e) => setTimezone(e.target.value)}
|
||||||
|
disabled={scheduling}
|
||||||
|
className="input-field appearance-none cursor-pointer"
|
||||||
|
>
|
||||||
|
{TIMEZONES.map(tz => (
|
||||||
|
<option key={tz.value} value={tz.value}>{tz.label}</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Start day offset */}
|
||||||
|
<div className="mb-5 flex flex-wrap items-center justify-between gap-2">
|
||||||
|
<span className="eyebrow">start from</span>
|
||||||
|
<div className="flex items-center gap-2">
|
||||||
|
<button
|
||||||
|
onClick={() => setStartOffset(Math.max(1, startOffset - 1))}
|
||||||
|
disabled={startOffset <= 1 || scheduling}
|
||||||
|
className="btn-quiet px-2 py-2 disabled:opacity-40 disabled:cursor-not-allowed"
|
||||||
|
>
|
||||||
|
<ChevronLeft size={16} />
|
||||||
|
</button>
|
||||||
|
<span className="readout text-ink2 min-w-[110px] text-center">
|
||||||
|
{(() => {
|
||||||
|
const d = new Date();
|
||||||
|
d.setDate(d.getDate() + startOffset);
|
||||||
|
return `${getDayLabel(d)} · ${formatDate(d)}`;
|
||||||
|
})()}
|
||||||
|
</span>
|
||||||
|
<button
|
||||||
|
onClick={() => setStartOffset(startOffset + 1)}
|
||||||
|
disabled={scheduling}
|
||||||
|
className="btn-quiet px-2 py-2 disabled:opacity-40 disabled:cursor-not-allowed"
|
||||||
|
>
|
||||||
|
<ChevronRight size={16} />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Calendar list */}
|
||||||
|
<div className="mb-5 border-y border-rule divide-y divide-rule">
|
||||||
|
{schedule.map(({ clip, index, date }) => (
|
||||||
|
<div key={index} className="flex items-center gap-3 py-2.5">
|
||||||
|
<div className="w-24 shrink-0">
|
||||||
|
<span className="readout">{getDayLabel(date)} · {formatDate(date)}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="flex-1 min-w-0">
|
||||||
|
<div className="text-xs text-ink truncate">
|
||||||
|
{clip.video_title_for_youtube_short || 'Viral Short'}
|
||||||
|
</div>
|
||||||
|
<div className="readout mt-0.5 truncate">
|
||||||
|
{time} · {TIMEZONES.find(t => t.value === timezone)?.label || timezone}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="shrink-0">
|
||||||
|
{progress.results[index]?.success === true && (
|
||||||
|
<CheckCircle size={16} className="text-ok" />
|
||||||
|
)}
|
||||||
|
{progress.results[index]?.success === false && (
|
||||||
|
<AlertCircle size={16} className="text-danger" />
|
||||||
|
)}
|
||||||
|
{scheduling && progress.current === index && (
|
||||||
|
<Loader2 size={16} className="text-brass animate-spin" />
|
||||||
|
)}
|
||||||
|
{!scheduling && progress.results[index] === undefined && (
|
||||||
|
<Circle size={16} className="text-muted" />
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Platforms */}
|
||||||
|
<div className="mb-5">
|
||||||
|
<label className="eyebrow block mb-2">platforms</label>
|
||||||
|
<SegmentedControl
|
||||||
|
multi
|
||||||
|
options={PLATFORM_OPTIONS.map(opt => ({ ...opt, disabled: scheduling }))}
|
||||||
|
value={selectedPlatforms}
|
||||||
|
onChange={(arr) => setPlatforms({
|
||||||
|
tiktok: arr.includes('tiktok'),
|
||||||
|
instagram: arr.includes('instagram'),
|
||||||
|
youtube: arr.includes('youtube')
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Progress bar */}
|
||||||
|
{(scheduling || done) && (
|
||||||
|
<div className="mb-1">
|
||||||
|
<div className="flex items-center justify-between mb-2">
|
||||||
|
<span className="text-xs text-muted lowercase">{scheduling ? 'scheduling...' : 'complete'}</span>
|
||||||
|
<span className="readout">{progress.current}/{progress.total}</span>
|
||||||
|
</div>
|
||||||
|
<div className="w-full h-1.5 bg-paper3 rounded-full overflow-hidden">
|
||||||
|
<div
|
||||||
|
className={`h-full rounded-full transition-all duration-500 ${done && failCount === 0 ? 'bg-ok' : done && failCount > 0 ? 'bg-danger' : 'bg-brass'}`}
|
||||||
|
style={{ width: `${(progress.current / progress.total) * 100}%` }}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{done && (
|
||||||
|
<div className="mt-3 text-xs text-center lowercase">
|
||||||
|
{failCount === 0 ? (
|
||||||
|
<span className="text-ok">all clips scheduled</span>
|
||||||
|
) : (
|
||||||
|
<span className="text-danger">{successCount} scheduled, {failCount} failed</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { X, Type, Loader2 } from 'lucide-react';
|
import { Loader2 } from 'lucide-react';
|
||||||
import { getApiUrl } from '../config';
|
|
||||||
import { apiFetch } from '../lib/api';
|
import { apiFetch } from '../lib/api';
|
||||||
import RemotionPreview from './RemotionPreview';
|
import RemotionPreview from './RemotionPreview';
|
||||||
|
import Modal from './ui/Modal';
|
||||||
|
import SegmentedControl from './ui/SegmentedControl';
|
||||||
|
|
||||||
const FONT_OPTIONS = [
|
const FONT_OPTIONS = [
|
||||||
{ value: 'Verdana', label: 'Verdana' },
|
{ value: 'Verdana', label: 'Verdana' },
|
||||||
|
|
@ -22,6 +23,14 @@ const COLOR_PRESETS = [
|
||||||
{ color: '#FF69B4', label: 'Pink' },
|
{ color: '#FF69B4', label: 'Pink' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const HIGHLIGHT_PRESETS = [
|
||||||
|
{ color: '#FFDD00', label: 'Gold' },
|
||||||
|
{ color: '#FF4444', label: 'Red' },
|
||||||
|
{ color: '#00FF88', label: 'Green' },
|
||||||
|
{ color: '#00BBFF', label: 'Blue' },
|
||||||
|
{ color: '#FF69B4', label: 'Pink' },
|
||||||
|
];
|
||||||
|
|
||||||
const ANIMATION_OPTIONS = [
|
const ANIMATION_OPTIONS = [
|
||||||
{ value: 'pop', label: 'Pop' },
|
{ value: 'pop', label: 'Pop' },
|
||||||
{ value: 'word-highlight', label: 'Glow' },
|
{ value: 'word-highlight', label: 'Glow' },
|
||||||
|
|
@ -29,9 +38,20 @@ const ANIMATION_OPTIONS = [
|
||||||
{ value: 'none', label: 'None' },
|
{ value: 'none', label: 'None' },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const POSITION_OPTIONS = [
|
||||||
|
{ value: 'top', label: 'top' },
|
||||||
|
{ value: 'middle', label: 'middle' },
|
||||||
|
{ value: 'bottom', label: 'bottom' },
|
||||||
|
];
|
||||||
|
|
||||||
|
const swatchClass = (selected) =>
|
||||||
|
`w-6 h-6 rounded-full transition-all ${selected
|
||||||
|
? 'ring-2 ring-[color:var(--color-accent)] ring-offset-2 ring-offset-[color:var(--color-paper-2)]'
|
||||||
|
: 'ring-1 ring-[color:var(--color-rule-2)] hover:ring-[color:var(--color-accent)]'}`;
|
||||||
|
|
||||||
export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessing, videoUrl, jobId, clipIndex, existingHook }) {
|
export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessing, videoUrl, jobId, clipIndex, existingHook }) {
|
||||||
const [position, setPosition] = useState('bottom');
|
const [position, setPosition] = useState('bottom');
|
||||||
const [fontSize, setFontSize] = useState(24);
|
const [fontSize] = useState(24);
|
||||||
const [fontName, setFontName] = useState('Verdana');
|
const [fontName, setFontName] = useState('Verdana');
|
||||||
const [fontColor, setFontColor] = useState('#FFFFFF');
|
const [fontColor, setFontColor] = useState('#FFFFFF');
|
||||||
const [highlightColor, setHighlightColor] = useState('#FFDD00');
|
const [highlightColor, setHighlightColor] = useState('#FFDD00');
|
||||||
|
|
@ -143,21 +163,14 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-[fadeIn_0.2s_ease-out]">
|
<Modal isOpen={isOpen} onClose={onClose} size="xl" eyebrow="EDITOR · SUBTITLES" title="subtitles">
|
||||||
<div className="bg-[#121214] border border-white/10 p-6 rounded-2xl w-full max-w-5xl shadow-2xl relative flex flex-col md:flex-row gap-6 max-h-[90vh]">
|
<div className="flex flex-col md:flex-row gap-6">
|
||||||
<button
|
|
||||||
onClick={onClose}
|
|
||||||
className="absolute top-4 right-4 text-zinc-500 hover:text-white z-10"
|
|
||||||
>
|
|
||||||
<X size={20} />
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{/* Left: Preview */}
|
{/* Left: Preview */}
|
||||||
<div className="flex-1 flex flex-col items-center justify-center bg-black rounded-lg border border-white/5 overflow-hidden relative aspect-[9/16] max-h-[600px]">
|
<div className="flex-1 flex flex-col items-center justify-center bg-black rounded-card border border-rule overflow-hidden relative aspect-[9/16] max-h-[600px]">
|
||||||
{captionsLoading ? (
|
{captionsLoading ? (
|
||||||
<div className="flex items-center gap-2 text-zinc-400">
|
<div className="flex items-center gap-2 text-muted">
|
||||||
<Loader2 size={16} className="animate-spin" />
|
<Loader2 size={16} className="animate-spin" />
|
||||||
<span className="text-sm">Loading preview...</span>
|
<span className="text-sm lowercase">Loading preview...</span>
|
||||||
</div>
|
</div>
|
||||||
) : useRemotionPreview ? (
|
) : useRemotionPreview ? (
|
||||||
<RemotionPreview
|
<RemotionPreview
|
||||||
|
|
@ -184,41 +197,28 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
|
|
||||||
{/* Right: Controls */}
|
{/* Right: Controls */}
|
||||||
<div className="w-full md:w-80 flex flex-col">
|
<div className="w-full md:w-80 flex flex-col">
|
||||||
<h3 className="text-xl font-bold text-white mb-4 flex items-center gap-2 shrink-0">
|
|
||||||
<Type className="text-primary" /> Auto Subtitles
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<div className="space-y-5 flex-1 overflow-y-auto custom-scrollbar pr-1">
|
<div className="space-y-5 flex-1 overflow-y-auto custom-scrollbar pr-1">
|
||||||
{/* Position Selector */}
|
{/* Position Selector */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-2 block">Position</label>
|
<p className="eyebrow mb-2">Position</p>
|
||||||
<div className="grid grid-cols-3 gap-2">
|
<SegmentedControl
|
||||||
{['top', 'middle', 'bottom'].map((pos) => (
|
options={POSITION_OPTIONS}
|
||||||
<button
|
value={position}
|
||||||
key={pos}
|
onChange={setPosition}
|
||||||
onClick={() => setPosition(pos)}
|
size="sm"
|
||||||
className={`p-2 rounded-lg border text-center text-xs font-medium transition-all ${position === pos ? 'bg-primary/20 border-primary text-white' : 'bg-white/5 border-white/5 text-zinc-400 hover:bg-white/10'}`}
|
/>
|
||||||
>
|
|
||||||
{pos.charAt(0).toUpperCase() + pos.slice(1)}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Animation Style (new) */}
|
{/* Animation Style (new) */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-2 block">Animation</label>
|
<p className="eyebrow mb-2">Animation</p>
|
||||||
<div className="grid grid-cols-2 gap-2">
|
<SegmentedControl
|
||||||
{ANIMATION_OPTIONS.map((opt) => (
|
options={ANIMATION_OPTIONS}
|
||||||
<button
|
value={animation}
|
||||||
key={opt.value}
|
onChange={setAnimation}
|
||||||
onClick={() => setAnimation(opt.value)}
|
columns={2}
|
||||||
className={`p-2 rounded-lg border text-center text-xs font-medium transition-all ${animation === opt.value ? 'bg-primary/20 border-primary text-white' : 'bg-white/5 border-white/5 text-zinc-400 hover:bg-white/10'}`}
|
size="sm"
|
||||||
>
|
/>
|
||||||
{opt.label}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Editable Transcript (collapsible) */}
|
{/* Editable Transcript (collapsible) */}
|
||||||
|
|
@ -227,17 +227,17 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
onClick={() => setShowTextEditor(!showTextEditor)}
|
onClick={() => setShowTextEditor(!showTextEditor)}
|
||||||
className="w-full flex items-center justify-between text-xs font-bold text-zinc-400 uppercase tracking-wider mb-2"
|
className="w-full flex items-center justify-between mb-2"
|
||||||
>
|
>
|
||||||
<span>Edit Text ({captions.length} words)</span>
|
<span className="eyebrow">Edit text ({captions.length} words)</span>
|
||||||
<span className={`transition-transform ${showTextEditor ? 'rotate-180' : ''}`}>▾</span>
|
<span className={`text-muted transition-transform ${showTextEditor ? 'rotate-180' : ''}`}>▾</span>
|
||||||
</button>
|
</button>
|
||||||
{showTextEditor && (
|
{showTextEditor && (
|
||||||
<textarea
|
<textarea
|
||||||
value={editableText}
|
value={editableText}
|
||||||
onChange={(e) => handleTextEdit(e.target.value)}
|
onChange={(e) => handleTextEdit(e.target.value)}
|
||||||
rows={5}
|
rows={5}
|
||||||
className="w-full bg-black/40 border border-white/10 rounded-lg p-2.5 text-sm text-white focus:outline-none focus:border-primary/50 resize-none leading-relaxed animate-[fadeIn_0.15s_ease-out]"
|
className="input-field resize-none leading-relaxed animate-fade"
|
||||||
placeholder="Edit subtitle text..."
|
placeholder="Edit subtitle text..."
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
@ -246,11 +246,11 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
|
|
||||||
{/* Font Family */}
|
{/* Font Family */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-2 block">Font</label>
|
<p className="eyebrow mb-2">Font</p>
|
||||||
<select
|
<select
|
||||||
value={fontName}
|
value={fontName}
|
||||||
onChange={(e) => setFontName(e.target.value)}
|
onChange={(e) => setFontName(e.target.value)}
|
||||||
className="w-full bg-black/40 border border-white/10 rounded-lg p-2 text-sm text-white focus:outline-none focus:border-primary/50"
|
className="input-field"
|
||||||
>
|
>
|
||||||
{FONT_OPTIONS.map((f) => (
|
{FONT_OPTIONS.map((f) => (
|
||||||
<option key={f.value} value={f.value} style={{ fontFamily: f.value }}>{f.label}</option>
|
<option key={f.value} value={f.value} style={{ fontFamily: f.value }}>{f.label}</option>
|
||||||
|
|
@ -260,19 +260,19 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
|
|
||||||
{/* Text Color */}
|
{/* Text Color */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-2 block">Text Color</label>
|
<p className="eyebrow mb-2">Text color</p>
|
||||||
<div className="flex flex-wrap gap-2">
|
<div className="flex flex-wrap items-center gap-2.5">
|
||||||
{COLOR_PRESETS.map((c) => (
|
{COLOR_PRESETS.map((c) => (
|
||||||
<button
|
<button
|
||||||
key={c.color}
|
key={c.color}
|
||||||
onClick={() => setFontColor(c.color)}
|
onClick={() => setFontColor(c.color)}
|
||||||
className={`w-7 h-7 rounded-full border-2 transition-all ${fontColor === c.color ? 'border-white scale-110' : 'border-white/20 hover:border-white/50'}`}
|
className={swatchClass(fontColor === c.color)}
|
||||||
style={{ backgroundColor: c.color }}
|
style={{ backgroundColor: c.color }}
|
||||||
title={c.label}
|
title={c.label}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
<label className="w-7 h-7 rounded-full border-2 border-dashed border-white/20 cursor-pointer flex items-center justify-center hover:border-white/50 transition-all overflow-hidden relative" title="Custom color">
|
<label className="w-6 h-6 rounded-full border border-dashed border-rule2 cursor-pointer flex items-center justify-center hover:border-brass transition-colors overflow-hidden relative" title="Custom color">
|
||||||
<span className="text-[10px] text-zinc-400">+</span>
|
<span className="text-xs text-muted leading-none">+</span>
|
||||||
<input type="color" value={fontColor} onChange={(e) => setFontColor(e.target.value)} className="absolute inset-0 opacity-0 cursor-pointer" />
|
<input type="color" value={fontColor} onChange={(e) => setFontColor(e.target.value)} className="absolute inset-0 opacity-0 cursor-pointer" />
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -280,13 +280,13 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
|
|
||||||
{/* Highlight Color (new) */}
|
{/* Highlight Color (new) */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-2 block">Highlight Color</label>
|
<p className="eyebrow mb-2">Highlight</p>
|
||||||
<div className="flex flex-wrap gap-2">
|
<div className="flex flex-wrap items-center gap-2.5">
|
||||||
{[{ color: '#FFDD00', label: 'Gold' }, { color: '#FF4444', label: 'Red' }, { color: '#00FF88', label: 'Green' }, { color: '#00BBFF', label: 'Blue' }, { color: '#FF69B4', label: 'Pink' }].map((c) => (
|
{HIGHLIGHT_PRESETS.map((c) => (
|
||||||
<button
|
<button
|
||||||
key={c.color}
|
key={c.color}
|
||||||
onClick={() => setHighlightColor(c.color)}
|
onClick={() => setHighlightColor(c.color)}
|
||||||
className={`w-7 h-7 rounded-full border-2 transition-all ${highlightColor === c.color ? 'border-white scale-110' : 'border-white/20 hover:border-white/50'}`}
|
className={swatchClass(highlightColor === c.color)}
|
||||||
style={{ backgroundColor: c.color }}
|
style={{ backgroundColor: c.color }}
|
||||||
title={c.label}
|
title={c.label}
|
||||||
/>
|
/>
|
||||||
|
|
@ -296,9 +296,9 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
|
|
||||||
{/* Border / Outline */}
|
{/* Border / Outline */}
|
||||||
<div>
|
<div>
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider mb-2 block">Border</label>
|
<p className="eyebrow mb-2">Border</p>
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<label className="relative w-8 h-8 rounded-lg border border-white/10 cursor-pointer overflow-hidden shrink-0" title="Border color">
|
<label className="relative w-8 h-8 rounded-input border border-rule2 cursor-pointer overflow-hidden shrink-0" title="Border color">
|
||||||
<div className="w-full h-full" style={{ backgroundColor: borderColor }} />
|
<div className="w-full h-full" style={{ backgroundColor: borderColor }} />
|
||||||
<input type="color" value={borderColor} onChange={(e) => setBorderColor(e.target.value)} className="absolute inset-0 opacity-0 cursor-pointer" />
|
<input type="color" value={borderColor} onChange={(e) => setBorderColor(e.target.value)} className="absolute inset-0 opacity-0 cursor-pointer" />
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -309,11 +309,11 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
max="5"
|
max="5"
|
||||||
value={borderWidth}
|
value={borderWidth}
|
||||||
onChange={(e) => setBorderWidth(parseInt(e.target.value))}
|
onChange={(e) => setBorderWidth(parseInt(e.target.value))}
|
||||||
className="w-full accent-primary"
|
className="w-full accent-[var(--color-accent)]"
|
||||||
/>
|
/>
|
||||||
<div className="flex justify-between text-[10px] text-zinc-500">
|
<div className="flex justify-between">
|
||||||
<span>None</span>
|
<span className="readout">None</span>
|
||||||
<span>Thick</span>
|
<span className="readout">Thick</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -322,16 +322,16 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
{/* Background Box */}
|
{/* Background Box */}
|
||||||
<div>
|
<div>
|
||||||
<div className="flex items-center justify-between mb-2">
|
<div className="flex items-center justify-between mb-2">
|
||||||
<label className="text-xs font-bold text-zinc-400 uppercase tracking-wider">Background Box</label>
|
<p className="eyebrow">Background</p>
|
||||||
<label className="relative inline-flex items-center cursor-pointer">
|
<label className="relative inline-flex items-center cursor-pointer">
|
||||||
<input type="checkbox" checked={bgOpacity > 0} onChange={(e) => setBgOpacity(e.target.checked ? 0.5 : 0)} className="sr-only peer" />
|
<input type="checkbox" checked={bgOpacity > 0} onChange={(e) => setBgOpacity(e.target.checked ? 0.5 : 0)} className="sr-only peer" />
|
||||||
<div className="w-8 h-4 bg-zinc-700 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[0px] after:left-[0px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-primary"></div>
|
<div className="w-8 h-4 rounded-full bg-paper3 peer-checked:bg-brass transition-colors after:content-[''] after:absolute after:top-0 after:left-0 after:h-4 after:w-4 after:rounded-full after:bg-ink after:transition-all peer-checked:after:translate-x-full"></div>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
{bgOpacity > 0 && (
|
{bgOpacity > 0 && (
|
||||||
<div className="space-y-3 animate-[fadeIn_0.2s_ease-out]">
|
<div className="space-y-3 animate-fade">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<label className="relative w-8 h-8 rounded-lg border border-white/10 cursor-pointer overflow-hidden shrink-0" title="Background color">
|
<label className="relative w-8 h-8 rounded-input border border-rule2 cursor-pointer overflow-hidden shrink-0" title="Background color">
|
||||||
<div className="w-full h-full" style={{ backgroundColor: bgColor }} />
|
<div className="w-full h-full" style={{ backgroundColor: bgColor }} />
|
||||||
<input type="color" value={bgColor} onChange={(e) => setBgColor(e.target.value)} className="absolute inset-0 opacity-0 cursor-pointer" />
|
<input type="color" value={bgColor} onChange={(e) => setBgColor(e.target.value)} className="absolute inset-0 opacity-0 cursor-pointer" />
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -342,11 +342,11 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
max="100"
|
max="100"
|
||||||
value={Math.round(bgOpacity * 100)}
|
value={Math.round(bgOpacity * 100)}
|
||||||
onChange={(e) => setBgOpacity(parseInt(e.target.value) / 100)}
|
onChange={(e) => setBgOpacity(parseInt(e.target.value) / 100)}
|
||||||
className="w-full accent-primary"
|
className="w-full accent-[var(--color-accent)]"
|
||||||
/>
|
/>
|
||||||
<div className="flex justify-between text-[10px] text-zinc-500">
|
<div className="flex justify-between">
|
||||||
<span>Transparent</span>
|
<span className="readout">Transparent</span>
|
||||||
<span>{Math.round(bgOpacity * 100)}%</span>
|
<span className="readout">{Math.round(bgOpacity * 100)}%</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -355,20 +355,25 @@ export default function SubtitleModal({ isOpen, onClose, onGenerate, isProcessin
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<div className="flex gap-2 mt-5 shrink-0">
|
||||||
onClick={() => onGenerate({
|
<button onClick={onClose} className="btn-ghost">
|
||||||
position, fontSize, fontName, fontColor, borderColor, borderWidth, bgColor, bgOpacity,
|
cancel
|
||||||
// Remotion data
|
</button>
|
||||||
remotion: useRemotionPreview ? subtitleConfig : null,
|
<button
|
||||||
})}
|
onClick={() => onGenerate({
|
||||||
disabled={isProcessing}
|
position, fontSize, fontName, fontColor, borderColor, borderWidth, bgColor, bgOpacity,
|
||||||
className="w-full py-3 mt-4 bg-gradient-to-r from-yellow-500 to-orange-500 hover:from-yellow-400 hover:to-orange-400 text-black font-bold rounded-xl shadow-lg shadow-orange-500/20 transition-all active:scale-[0.98] flex items-center justify-center gap-2 shrink-0"
|
// Remotion data
|
||||||
>
|
remotion: useRemotionPreview ? subtitleConfig : null,
|
||||||
{isProcessing ? <Loader2 size={20} className="animate-spin" /> : <Type size={20} />}
|
})}
|
||||||
{isProcessing ? 'Generating...' : 'Generate Subtitles'}
|
disabled={isProcessing}
|
||||||
</button>
|
className="btn-primary flex-1"
|
||||||
|
>
|
||||||
|
{isProcessing && <Loader2 size={16} className="animate-spin text-brassink" />}
|
||||||
|
{isProcessing ? 'generating...' : 'apply subtitles'}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,14 @@
|
||||||
import React, { useState, useRef, useCallback } from 'react';
|
import { useState, useRef, useCallback } from 'react';
|
||||||
import { Upload, Image, Loader2, Send, Check, Download, ArrowRight, ArrowLeft, Sparkles, Video, Type, X, Plus, MessageSquare, FileText, Youtube, AlertCircle, CheckCircle2, Settings } from 'lucide-react';
|
import { Upload, Image, Loader2, Send, Check, Download, ArrowRight, ArrowLeft, Sparkles, Video, Type, X, Plus, MessageSquare, FileText, Youtube, AlertCircle, Settings } from 'lucide-react';
|
||||||
import { getApiUrl } from '../config';
|
import { getApiUrl } from '../config';
|
||||||
import { apiFetch } from '../lib/api';
|
import { apiFetch } from '../lib/api';
|
||||||
|
import StepIndicator from './ui/StepIndicator';
|
||||||
|
import SegmentedControl from './ui/SegmentedControl';
|
||||||
|
|
||||||
const STEPS = ['Input', 'Titles', 'Generate', 'Description', 'Publish'];
|
const STEPS = ['Input', 'Titles', 'Generate', 'Description', 'Publish'];
|
||||||
|
|
||||||
function StepIndicator({ currentStep }) {
|
function DragDropZone({ label, accept, onFile, file, onClear, icon }) {
|
||||||
return (
|
const Icon = icon;
|
||||||
<div className="flex items-center gap-2 mb-8">
|
|
||||||
{STEPS.map((label, i) => (
|
|
||||||
<React.Fragment key={label}>
|
|
||||||
<div className={`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-medium transition-all ${i < currentStep ? 'bg-green-500/20 text-green-400 border border-green-500/30' :
|
|
||||||
i === currentStep ? 'bg-primary/20 text-primary border border-primary/30' :
|
|
||||||
'bg-white/5 text-zinc-500 border border-white/5'
|
|
||||||
}`}>
|
|
||||||
<span className={`w-5 h-5 rounded-full flex items-center justify-center text-[10px] font-bold ${i < currentStep ? 'bg-green-500 text-black' :
|
|
||||||
i === currentStep ? 'bg-primary text-black' :
|
|
||||||
'bg-white/10 text-zinc-500'
|
|
||||||
}`}>
|
|
||||||
{i < currentStep ? <Check size={10} /> : i + 1}
|
|
||||||
</span>
|
|
||||||
<span className="hidden sm:inline">{label}</span>
|
|
||||||
</div>
|
|
||||||
{i < STEPS.length - 1 && (
|
|
||||||
<div className={`w-8 h-px ${i < currentStep ? 'bg-green-500/50' : 'bg-white/10'}`} />
|
|
||||||
)}
|
|
||||||
</React.Fragment>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function DragDropZone({ label, accept, onFile, file, onClear, icon: Icon }) {
|
|
||||||
const [isDragging, setIsDragging] = useState(false);
|
const [isDragging, setIsDragging] = useState(false);
|
||||||
const inputRef = useRef(null);
|
const inputRef = useRef(null);
|
||||||
|
|
||||||
|
|
@ -49,20 +26,20 @@ function DragDropZone({ label, accept, onFile, file, onClear, icon: Icon }) {
|
||||||
|
|
||||||
if (file) {
|
if (file) {
|
||||||
return (
|
return (
|
||||||
<div className="relative border border-white/10 rounded-xl p-3 bg-white/5">
|
<div className="relative border border-rule2 rounded-card p-3 bg-paper3">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
{file.type?.startsWith('image/') ? (
|
{file.type?.startsWith('image/') ? (
|
||||||
<img src={URL.createObjectURL(file)} className="w-12 h-12 rounded-lg object-cover" alt="" />
|
<img src={URL.createObjectURL(file)} className="w-12 h-12 rounded-input object-cover" alt="" />
|
||||||
) : (
|
) : (
|
||||||
<div className="w-12 h-12 rounded-lg bg-white/10 flex items-center justify-center">
|
<div className="w-12 h-12 rounded-input bg-paper2 border border-rule flex items-center justify-center">
|
||||||
<Icon size={20} className="text-zinc-400" />
|
<Icon size={18} className="text-muted" />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="flex-1 min-w-0">
|
<div className="flex-1 min-w-0">
|
||||||
<p className="text-sm text-white truncate">{file.name}</p>
|
<p className="text-sm text-ink truncate">{file.name}</p>
|
||||||
<p className="text-xs text-zinc-500">{(file.size / 1024 / 1024).toFixed(1)} MB</p>
|
<p className="readout mt-0.5">{(file.size / 1024 / 1024).toFixed(1)} MB</p>
|
||||||
</div>
|
</div>
|
||||||
<button onClick={onClear} className="text-zinc-500 hover:text-white transition-colors">
|
<button onClick={onClear} className="text-muted hover:text-ink transition-colors">
|
||||||
<X size={16} />
|
<X size={16} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -76,12 +53,12 @@ function DragDropZone({ label, accept, onFile, file, onClear, icon: Icon }) {
|
||||||
onDrop={handleDrop}
|
onDrop={handleDrop}
|
||||||
onDragOver={handleDragOver}
|
onDragOver={handleDragOver}
|
||||||
onDragLeave={() => setIsDragging(false)}
|
onDragLeave={() => setIsDragging(false)}
|
||||||
className={`border-2 border-dashed rounded-xl p-6 text-center cursor-pointer transition-all ${isDragging ? 'border-primary/50 bg-primary/5' : 'border-white/10 hover:border-white/20 bg-white/[0.02]'
|
className={`border-2 border-dashed rounded-card p-6 text-center cursor-pointer transition-colors duration-200 ${isDragging ? 'border-brass bg-paper3' : 'border-rule2 hover:border-brass'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<Icon size={24} className="mx-auto text-zinc-500 mb-2" />
|
<Icon size={18} className="mx-auto text-muted mb-2" />
|
||||||
<p className="text-sm text-zinc-400">{label}</p>
|
<p className="text-sm text-ink2 lowercase">{label}</p>
|
||||||
<p className="text-xs text-zinc-600 mt-1">Drop or click to upload</p>
|
<p className="text-xs text-muted mt-1 lowercase">Drop or click to upload</p>
|
||||||
<input
|
<input
|
||||||
ref={inputRef}
|
ref={inputRef}
|
||||||
type="file"
|
type="file"
|
||||||
|
|
@ -202,7 +179,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
setRecommended(data.recommended || []);
|
setRecommended(data.recommended || []);
|
||||||
setChatHistory([{
|
setChatHistory([{
|
||||||
role: 'assistant',
|
role: 'assistant',
|
||||||
content: `Here are 10 viral title suggestions based on your video. Titles marked ⭐ are my top picks. Click one to select it, or tell me how to refine them.`
|
content: `Here are 10 viral title suggestions based on your video. Titles marked TOP PICK are my top picks. Click one to select it, or tell me how to refine them.`
|
||||||
}]);
|
}]);
|
||||||
setStep(1);
|
setStep(1);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
@ -331,7 +308,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
URL.revokeObjectURL(blobUrl);
|
URL.revokeObjectURL(blobUrl);
|
||||||
} catch (e) {
|
} catch {
|
||||||
// Fallback: open in new tab if fetch fails
|
// Fallback: open in new tab if fetch fails
|
||||||
window.open(getApiUrl(url), '_blank');
|
window.open(getApiUrl(url), '_blank');
|
||||||
}
|
}
|
||||||
|
|
@ -457,33 +434,38 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full overflow-y-auto p-6 md:p-8 animate-[fadeIn_0.3s_ease-out]">
|
<div className="h-full overflow-y-auto p-6 md:p-8 animate-fade">
|
||||||
<div className="max-w-5xl mx-auto">
|
<div className="max-w-5xl mx-auto">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex items-center justify-between mb-2">
|
<div className="flex items-end justify-between mb-2">
|
||||||
<h1 className="text-2xl font-bold flex items-center gap-3">
|
<div>
|
||||||
<div className="w-10 h-10 rounded-xl bg-gradient-to-br from-orange-500 to-pink-600 flex items-center justify-center">
|
<p className="eyebrow mb-2">05 · YOUTUBE STUDIO</p>
|
||||||
<Image size={20} className="text-white" />
|
<h1 className="font-display lowercase text-2xl text-ink flex items-center gap-3">
|
||||||
</div>
|
<span className="w-10 h-10 rounded-card bg-paper3 flex items-center justify-center">
|
||||||
YouTube Studio
|
<Image size={18} className="text-brass" />
|
||||||
</h1>
|
</span>
|
||||||
|
YouTube Studio
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
{step > 0 && (
|
{step > 0 && (
|
||||||
<button onClick={handleReset} className="text-xs text-zinc-500 hover:text-white transition-colors flex items-center gap-1">
|
<button onClick={handleReset} className="text-xs lowercase text-muted hover:text-ink transition-colors flex items-center gap-1">
|
||||||
<Plus size={12} /> New Project
|
<Plus size={12} /> New Project
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<p className="text-sm text-zinc-500 mb-6">Generate viral titles, AI thumbnails, descriptions and publish directly to YouTube</p>
|
<p className="text-sm lowercase text-muted mb-6">Generate viral titles, AI thumbnails, descriptions and publish directly to YouTube</p>
|
||||||
|
|
||||||
<StepIndicator currentStep={step} />
|
<div className="mb-8">
|
||||||
|
<StepIndicator steps={STEPS} current={step} />
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Gemini API Key Warning (self-host BYOK only; managed uses server key) */}
|
{/* Gemini API Key Warning (self-host BYOK only; managed uses server key) */}
|
||||||
{needsKey && (
|
{needsKey && (
|
||||||
<div className="mb-6 p-5 bg-amber-500/10 border border-amber-500/30 rounded-xl flex items-start gap-3">
|
<div className="mb-6 p-5 bg-warn/10 rounded-card flex items-start gap-3">
|
||||||
<AlertCircle size={20} className="text-amber-400 shrink-0 mt-0.5" />
|
<AlertCircle size={18} className="text-warn shrink-0 mt-0.5" />
|
||||||
<div>
|
<div>
|
||||||
<p className="text-sm font-semibold text-amber-300">Gemini API Key Required</p>
|
<p className="text-sm font-medium text-warn lowercase">Gemini API Key Required</p>
|
||||||
<p className="text-xs text-amber-400/70 mt-1">YouTube Studio requires a Google Gemini API key to function. Please configure it in the <strong>Settings</strong> tab before using this feature. Gemini's free tier includes 1,500 requests per day.</p>
|
<p className="text-xs text-muted mt-1">YouTube Studio requires a Google Gemini API key to function. Please configure it in the <strong>Settings</strong> tab before using this feature. Gemini's free tier includes 1,500 requests per day.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -492,14 +474,14 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
{step === 0 && (
|
{step === 0 && (
|
||||||
<div className={`grid md:grid-cols-2 gap-6 ${needsKey ? 'opacity-50 pointer-events-none select-none' : ''}`}>
|
<div className={`grid md:grid-cols-2 gap-6 ${needsKey ? 'opacity-50 pointer-events-none select-none' : ''}`}>
|
||||||
{/* Mode A: Video Analysis */}
|
{/* Mode A: Video Analysis */}
|
||||||
<div className="glass-panel p-6 space-y-4">
|
<div className="card card-hover p-6 space-y-4">
|
||||||
<div className="flex items-center gap-3 mb-2">
|
<div className="flex items-center gap-3 mb-2">
|
||||||
<div className="w-8 h-8 rounded-lg bg-blue-500/20 flex items-center justify-center">
|
<div className="w-8 h-8 rounded-input bg-paper3 flex items-center justify-center">
|
||||||
<Video size={16} className="text-blue-400" />
|
<Video size={16} className="text-brass" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-sm font-semibold text-white">Analyze Video</h3>
|
<p className="eyebrow">A · ANALYZE VIDEO</p>
|
||||||
<p className="text-xs text-zinc-500">AI suggests viral titles from your content</p>
|
<p className="text-xs text-muted mt-0.5">AI suggests viral titles from your content</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -513,13 +495,13 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{isPreprocessing && (
|
{isPreprocessing && (
|
||||||
<div className="flex items-center gap-2 text-xs text-blue-400 bg-blue-500/10 border border-blue-500/20 rounded-lg px-3 py-2">
|
<div className="flex items-center gap-2 text-xs lowercase text-muted bg-paper3 rounded-input px-3 py-2">
|
||||||
<Loader2 size={12} className="animate-spin" />
|
<Loader2 size={12} className="animate-spin text-brass" />
|
||||||
Pre-processing video (Whisper transcription starting)...
|
Pre-processing video (Whisper transcription starting)...
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{preprocessSessionId && !isPreprocessing && (
|
{preprocessSessionId && !isPreprocessing && (
|
||||||
<div className="flex items-center gap-2 text-xs text-green-400 bg-green-500/10 border border-green-500/20 rounded-lg px-3 py-2">
|
<div className="flex items-center gap-2 text-xs lowercase text-ok bg-ok/10 rounded-input px-3 py-2">
|
||||||
<Check size={12} />
|
<Check size={12} />
|
||||||
Video uploaded — transcription running in background
|
Video uploaded — transcription running in background
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -528,7 +510,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<button
|
<button
|
||||||
onClick={handleAnalyze}
|
onClick={handleAnalyze}
|
||||||
disabled={isAnalyzing || !videoFile}
|
disabled={isAnalyzing || !videoFile}
|
||||||
className="w-full btn-primary py-3 text-sm font-semibold flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"
|
className="w-full btn-primary"
|
||||||
>
|
>
|
||||||
{isAnalyzing ? (
|
{isAnalyzing ? (
|
||||||
<>
|
<>
|
||||||
|
|
@ -537,22 +519,22 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<Sparkles size={16} />
|
<Sparkles size={16} className="hidden sm:block" />
|
||||||
Analyze & Get Titles
|
<span className="whitespace-nowrap">Analyze & Get Titles</span>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Mode B: Manual Title */}
|
{/* Mode B: Manual Title */}
|
||||||
<div className="glass-panel p-6 space-y-4 flex flex-col">
|
<div className="card card-hover p-6 space-y-4 flex flex-col">
|
||||||
<div className="flex items-center gap-3 mb-2">
|
<div className="flex items-center gap-3 mb-2">
|
||||||
<div className="w-8 h-8 rounded-lg bg-purple-500/20 flex items-center justify-center">
|
<div className="w-8 h-8 rounded-input bg-paper3 flex items-center justify-center">
|
||||||
<Type size={16} className="text-purple-400" />
|
<Type size={16} className="text-brass" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h3 className="text-sm font-semibold text-white">Write Your Own</h3>
|
<p className="eyebrow">B · WRITE YOUR OWN</p>
|
||||||
<p className="text-xs text-zinc-500">Skip analysis, enter your title directly</p>
|
<p className="text-xs text-muted mt-0.5">Skip analysis, enter your title directly</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -565,13 +547,13 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
className="input-field text-sm mb-4"
|
className="input-field text-sm mb-4"
|
||||||
maxLength={70}
|
maxLength={70}
|
||||||
/>
|
/>
|
||||||
<p className="text-xs text-zinc-600 mb-4">{manualTitle.length}/70 characters</p>
|
<p className="readout mb-4">{manualTitle.length} / 70</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={handleManualMode}
|
onClick={handleManualMode}
|
||||||
disabled={!manualTitle.trim()}
|
disabled={!manualTitle.trim()}
|
||||||
className="w-full py-3 bg-white/5 hover:bg-white/10 text-white rounded-xl text-sm font-semibold flex items-center justify-center gap-2 transition-colors border border-white/10 disabled:opacity-50 disabled:cursor-not-allowed"
|
className="w-full btn-ghost disabled:opacity-45 disabled:cursor-not-allowed"
|
||||||
>
|
>
|
||||||
<ArrowRight size={16} />
|
<ArrowRight size={16} />
|
||||||
Use This Title
|
Use This Title
|
||||||
|
|
@ -586,8 +568,8 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
{/* Left: Chat / Controls */}
|
{/* Left: Chat / Controls */}
|
||||||
<div className="md:col-span-2 flex flex-col gap-4">
|
<div className="md:col-span-2 flex flex-col gap-4">
|
||||||
{mode === 'manual' ? (
|
{mode === 'manual' ? (
|
||||||
<div className="glass-panel p-6 space-y-4">
|
<div className="card p-6 space-y-4">
|
||||||
<h3 className="text-sm font-semibold text-white">Your Title</h3>
|
<p className="eyebrow">YOUR TITLE</p>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={manualTitle}
|
value={manualTitle}
|
||||||
|
|
@ -595,30 +577,30 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
className="input-field text-sm"
|
className="input-field text-sm"
|
||||||
maxLength={70}
|
maxLength={70}
|
||||||
/>
|
/>
|
||||||
<p className="text-xs text-zinc-600">{manualTitle.length}/70 characters</p>
|
<p className="readout">{manualTitle.length} / 70</p>
|
||||||
<button
|
<button
|
||||||
onClick={handleConfirmTitle}
|
onClick={handleConfirmTitle}
|
||||||
disabled={!manualTitle.trim()}
|
disabled={!manualTitle.trim()}
|
||||||
className="w-full btn-primary py-3 text-sm font-semibold flex items-center justify-center gap-2 disabled:opacity-50"
|
className="w-full btn-primary"
|
||||||
>
|
>
|
||||||
<ArrowRight size={16} />
|
<ArrowRight size={16} />
|
||||||
Continue to Thumbnails
|
Continue to Thumbnails
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="glass-panel p-4 flex flex-col h-[500px]">
|
<div className="card p-4 flex flex-col h-[500px]">
|
||||||
<div className="flex items-center gap-2 mb-3 pb-3 border-b border-white/5">
|
<div className="flex items-center gap-2 mb-3 pb-3 border-b border-rule">
|
||||||
<MessageSquare size={14} className="text-primary" />
|
<MessageSquare size={14} className="text-brass" />
|
||||||
<span className="text-xs font-medium text-zinc-400">Title Refinement Chat</span>
|
<span className="eyebrow">TITLE REFINEMENT CHAT</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Chat messages */}
|
{/* Chat messages */}
|
||||||
<div className="flex-1 overflow-y-auto space-y-3 custom-scrollbar mb-3">
|
<div className="flex-1 overflow-y-auto space-y-3 custom-scrollbar mb-3">
|
||||||
{chatHistory.map((msg, i) => (
|
{chatHistory.map((msg, i) => (
|
||||||
<div key={i} className={`flex ${msg.role === 'user' ? 'justify-end' : 'justify-start'}`}>
|
<div key={i} className={`flex ${msg.role === 'user' ? 'justify-end' : 'justify-start'}`}>
|
||||||
<div className={`max-w-[90%] px-3 py-2 rounded-xl text-xs ${msg.role === 'user'
|
<div className={`max-w-[90%] px-3 py-2 rounded-card text-xs ${msg.role === 'user'
|
||||||
? 'bg-primary/20 text-primary border border-primary/20'
|
? 'bg-paper3 text-ink2'
|
||||||
: 'bg-white/5 text-zinc-300 border border-white/5'
|
: 'border border-rule text-ink2'
|
||||||
}`}>
|
}`}>
|
||||||
{msg.content}
|
{msg.content}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -641,9 +623,9 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<button
|
<button
|
||||||
onClick={handleRefine}
|
onClick={handleRefine}
|
||||||
disabled={isRefining || !chatInput.trim()}
|
disabled={isRefining || !chatInput.trim()}
|
||||||
className="btn-primary p-2 rounded-xl disabled:opacity-50"
|
className="btn-quiet px-3 disabled:opacity-45 disabled:cursor-not-allowed"
|
||||||
>
|
>
|
||||||
{isRefining ? <Loader2 size={14} className="animate-spin" /> : <Send size={14} />}
|
{isRefining ? <Loader2 size={14} className="animate-spin text-brass" /> : <Send size={14} />}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -652,7 +634,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
{mode !== 'manual' && selectedTitle && (
|
{mode !== 'manual' && selectedTitle && (
|
||||||
<button
|
<button
|
||||||
onClick={handleConfirmTitle}
|
onClick={handleConfirmTitle}
|
||||||
className="w-full btn-primary py-3 text-sm font-semibold flex items-center justify-center gap-2"
|
className="w-full btn-primary"
|
||||||
>
|
>
|
||||||
<ArrowRight size={16} />
|
<ArrowRight size={16} />
|
||||||
Use Selected Title
|
Use Selected Title
|
||||||
|
|
@ -663,9 +645,9 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
{/* Right: Title Cards */}
|
{/* Right: Title Cards */}
|
||||||
<div className="md:col-span-3 space-y-3">
|
<div className="md:col-span-3 space-y-3">
|
||||||
{selectedTitle && (
|
{selectedTitle && (
|
||||||
<div className="p-3 bg-green-500/10 border border-green-500/20 rounded-xl flex items-center gap-2 text-sm">
|
<div className="p-3 bg-ok/10 rounded-card flex items-center gap-2 text-sm">
|
||||||
<Check size={14} className="text-green-400 shrink-0" />
|
<Check size={14} className="text-ok shrink-0" />
|
||||||
<span className="text-green-300 font-medium truncate">Selected: {selectedTitle}</span>
|
<span className="text-ok font-medium truncate">Selected: {selectedTitle}</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
|
@ -678,17 +660,15 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<button
|
<button
|
||||||
key={i}
|
key={i}
|
||||||
onClick={() => handleSelectTitle(title)}
|
onClick={() => handleSelectTitle(title)}
|
||||||
className={`w-full text-left p-4 rounded-xl border transition-all text-sm ${selectedTitle === title
|
className={`w-full text-left p-4 rounded-card border transition-colors duration-200 text-sm ${selectedTitle === title
|
||||||
? 'bg-primary/10 border-primary/30 text-white'
|
? 'bg-paper3 border-brass text-ink'
|
||||||
: rec
|
: 'border-rule text-ink2 hover:bg-paper3 hover:border-rule2'
|
||||||
? 'bg-amber-500/5 border-amber-500/20 text-zinc-200 hover:bg-amber-500/10'
|
|
||||||
: 'bg-white/[0.02] border-white/5 text-zinc-300 hover:bg-white/5 hover:border-white/10'
|
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="flex items-start gap-3">
|
<div className="flex items-start gap-3">
|
||||||
<span className={`w-6 h-6 rounded-full flex items-center justify-center text-[10px] font-bold shrink-0 mt-0.5 ${selectedTitle === title ? 'bg-primary text-black' :
|
<span className={`w-6 h-6 rounded-full border flex items-center justify-center font-mono text-micro shrink-0 mt-0.5 ${selectedTitle === title ? 'bg-brass border-brass text-brassink' :
|
||||||
rec ? 'bg-amber-400 text-black' :
|
rec ? 'border-rule2 text-brass' :
|
||||||
'bg-white/10 text-zinc-500'
|
'border-rule text-muted'
|
||||||
}`}>
|
}`}>
|
||||||
{selectedTitle === title ? <Check size={10} /> : rec ? '★' : i + 1}
|
{selectedTitle === title ? <Check size={10} /> : rec ? '★' : i + 1}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -696,13 +676,13 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<div className="flex items-center gap-2 flex-wrap">
|
<div className="flex items-center gap-2 flex-wrap">
|
||||||
<span className="leading-relaxed">{title}</span>
|
<span className="leading-relaxed">{title}</span>
|
||||||
{rec && (
|
{rec && (
|
||||||
<span className="text-[10px] font-semibold px-1.5 py-0.5 rounded-full bg-amber-400/20 text-amber-400 border border-amber-400/30 shrink-0">
|
<span className="badge-brass shrink-0">
|
||||||
{recRank === 0 ? '⭐ TOP PICK' : '⭐ 2nd PICK'}
|
{recRank === 0 ? 'TOP PICK' : '2ND PICK'}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{rec && (
|
{rec && (
|
||||||
<p className="text-[11px] text-amber-300/70 mt-1.5 leading-relaxed italic">{rec.reason}</p>
|
<p className="text-xs text-muted mt-1.5 leading-relaxed">{rec.reason}</p>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -713,9 +693,9 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{isRefining && (
|
{isRefining && (
|
||||||
<div className="flex items-center justify-center py-8 text-zinc-500">
|
<div className="flex items-center justify-center py-8 text-muted">
|
||||||
<Loader2 size={20} className="animate-spin mr-2" />
|
<Loader2 size={18} className="animate-spin mr-2 text-brass" />
|
||||||
<span className="text-sm">Refining titles...</span>
|
<span className="text-sm lowercase">Refining titles...</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -727,22 +707,22 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<div className="grid md:grid-cols-5 gap-6">
|
<div className="grid md:grid-cols-5 gap-6">
|
||||||
{/* Left: Controls */}
|
{/* Left: Controls */}
|
||||||
<div className="md:col-span-2 space-y-4">
|
<div className="md:col-span-2 space-y-4">
|
||||||
<div className="glass-panel p-6 space-y-4">
|
<div className="card p-6 space-y-4">
|
||||||
<h3 className="text-sm font-semibold text-white mb-1">Selected Title</h3>
|
<p className="eyebrow mb-1">TITLE</p>
|
||||||
<div className="p-3 bg-primary/10 border border-primary/20 rounded-lg text-sm text-primary">
|
<div className="p-3 bg-paper3 border border-rule rounded-input text-sm text-ink">
|
||||||
{selectedTitle || manualTitle}
|
{selectedTitle || manualTitle}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={() => setStep(1)}
|
onClick={() => setStep(1)}
|
||||||
className="text-xs text-zinc-500 hover:text-white transition-colors flex items-center gap-1"
|
className="text-xs lowercase text-muted hover:text-ink transition-colors flex items-center gap-1"
|
||||||
>
|
>
|
||||||
<ArrowLeft size={12} /> Change title
|
<ArrowLeft size={12} /> Change title
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="glass-panel p-6 space-y-4">
|
<div className="card p-6 space-y-4">
|
||||||
<h3 className="text-sm font-semibold text-white">Face Image <span className="text-zinc-600 font-normal">(optional)</span></h3>
|
<p className="eyebrow">FACE IMAGE · OPTIONAL</p>
|
||||||
<DragDropZone
|
<DragDropZone
|
||||||
label="Upload face / person photo"
|
label="Upload face / person photo"
|
||||||
accept="image/*"
|
accept="image/*"
|
||||||
|
|
@ -753,8 +733,8 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="glass-panel p-6 space-y-4">
|
<div className="card p-6 space-y-4">
|
||||||
<h3 className="text-sm font-semibold text-white">Background Image <span className="text-zinc-600 font-normal">(optional)</span></h3>
|
<p className="eyebrow">BACKGROUND · OPTIONAL</p>
|
||||||
<DragDropZone
|
<DragDropZone
|
||||||
label="Upload background image"
|
label="Upload background image"
|
||||||
accept="image/*"
|
accept="image/*"
|
||||||
|
|
@ -765,8 +745,8 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="glass-panel p-6 space-y-4">
|
<div className="card p-6 space-y-4">
|
||||||
<h3 className="text-sm font-semibold text-white">Extra Instructions <span className="text-zinc-600 font-normal">(optional)</span></h3>
|
<p className="eyebrow">INSTRUCTIONS · OPTIONAL</p>
|
||||||
<textarea
|
<textarea
|
||||||
value={extraPrompt}
|
value={extraPrompt}
|
||||||
onChange={(e) => setExtraPrompt(e.target.value)}
|
onChange={(e) => setExtraPrompt(e.target.value)}
|
||||||
|
|
@ -775,28 +755,20 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="glass-panel p-6 space-y-4">
|
<div className="card p-6 space-y-4">
|
||||||
<h3 className="text-sm font-semibold text-white">Number of Thumbnails</h3>
|
<p className="eyebrow">COUNT</p>
|
||||||
<div className="flex gap-2">
|
<SegmentedControl
|
||||||
{[1, 2, 3, 4].map(n => (
|
options={[1, 2, 3, 4].map(n => ({ value: n, label: String(n) }))}
|
||||||
<button
|
value={thumbnailCount}
|
||||||
key={n}
|
onChange={setThumbnailCount}
|
||||||
onClick={() => setThumbnailCount(n)}
|
size="sm"
|
||||||
className={`flex-1 py-2 rounded-lg text-sm font-medium transition-all ${thumbnailCount === n
|
/>
|
||||||
? 'bg-primary/20 text-primary border border-primary/30'
|
|
||||||
: 'bg-white/5 text-zinc-400 border border-white/5 hover:bg-white/10'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{n}
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={handleGenerate}
|
onClick={handleGenerate}
|
||||||
disabled={isGenerating}
|
disabled={isGenerating}
|
||||||
className="w-full btn-primary py-4 text-sm font-bold flex items-center justify-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"
|
className="w-full btn-primary"
|
||||||
>
|
>
|
||||||
{isGenerating ? (
|
{isGenerating ? (
|
||||||
<>
|
<>
|
||||||
|
|
@ -817,13 +789,13 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<div className="md:col-span-3">
|
<div className="md:col-span-3">
|
||||||
{generatedThumbnails.length > 0 ? (
|
{generatedThumbnails.length > 0 ? (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<h3 className="text-sm font-semibold text-zinc-400">Generated Thumbnails — click to select for publishing</h3>
|
<p className="text-sm lowercase text-muted">Generated Thumbnails — click to select for publishing</p>
|
||||||
<div className="grid gap-4">
|
<div className="grid gap-4">
|
||||||
{generatedThumbnails.map((url, i) => (
|
{generatedThumbnails.map((url, i) => (
|
||||||
<div
|
<div
|
||||||
key={i}
|
key={i}
|
||||||
onClick={() => setSelectedThumbnail(url)}
|
onClick={() => setSelectedThumbnail(url)}
|
||||||
className={`glass-panel overflow-hidden group relative cursor-pointer transition-all ${selectedThumbnail === url ? 'ring-2 ring-primary ring-offset-2 ring-offset-background' : ''
|
className={`glass-panel overflow-hidden group relative cursor-pointer transition-colors duration-200 ${selectedThumbnail === url ? 'border-2 border-brass' : ''
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
|
@ -834,22 +806,22 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<div className="absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-all flex items-center justify-center gap-3 opacity-0 group-hover:opacity-100">
|
<div className="absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-all flex items-center justify-center gap-3 opacity-0 group-hover:opacity-100">
|
||||||
<button
|
<button
|
||||||
onClick={(e) => { e.stopPropagation(); handleDownload(url); }}
|
onClick={(e) => { e.stopPropagation(); handleDownload(url); }}
|
||||||
className="bg-white text-black px-4 py-2 rounded-lg text-sm font-semibold flex items-center gap-2 hover:bg-zinc-200 transition-colors"
|
className="btn-quiet"
|
||||||
>
|
>
|
||||||
<Download size={14} />
|
<Download size={14} />
|
||||||
Download
|
Download
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-3 flex items-center justify-between">
|
<div className="p-3 flex items-center justify-between">
|
||||||
<span className="text-xs text-zinc-500 flex items-center gap-2">
|
<span className="text-xs lowercase text-muted flex items-center gap-2">
|
||||||
Thumbnail {i + 1}
|
Thumbnail {i + 1}
|
||||||
{selectedThumbnail === url && (
|
{selectedThumbnail === url && (
|
||||||
<span className="text-primary flex items-center gap-1"><Check size={10} /> Selected</span>
|
<span className="text-brass flex items-center gap-1"><Check size={10} /> Selected</span>
|
||||||
)}
|
)}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
onClick={(e) => { e.stopPropagation(); handleDownload(url); }}
|
onClick={(e) => { e.stopPropagation(); handleDownload(url); }}
|
||||||
className="text-xs text-zinc-400 hover:text-white transition-colors flex items-center gap-1"
|
className="text-xs lowercase text-muted hover:text-ink transition-colors flex items-center gap-1"
|
||||||
>
|
>
|
||||||
<Download size={12} /> Save
|
<Download size={12} /> Save
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -862,11 +834,11 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<button
|
<button
|
||||||
onClick={handleGenerate}
|
onClick={handleGenerate}
|
||||||
disabled={isGenerating}
|
disabled={isGenerating}
|
||||||
className="w-full py-3 bg-white/5 hover:bg-white/10 text-zinc-300 rounded-xl text-sm font-medium flex items-center justify-center gap-2 transition-colors border border-white/10 disabled:opacity-50"
|
className="w-full btn-ghost"
|
||||||
>
|
>
|
||||||
{isGenerating ? (
|
{isGenerating ? (
|
||||||
<>
|
<>
|
||||||
<Loader2 size={14} className="animate-spin" />
|
<Loader2 size={14} className="animate-spin text-brass" />
|
||||||
Regenerating...
|
Regenerating...
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -881,7 +853,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
{selectedThumbnail && (
|
{selectedThumbnail && (
|
||||||
<button
|
<button
|
||||||
onClick={() => setStep(3)}
|
onClick={() => setStep(3)}
|
||||||
className="w-full btn-primary py-4 text-sm font-bold flex items-center justify-center gap-2"
|
className="w-full btn-primary"
|
||||||
>
|
>
|
||||||
<ArrowRight size={16} />
|
<ArrowRight size={16} />
|
||||||
Next: Description
|
Next: Description
|
||||||
|
|
@ -889,21 +861,21 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
) : isGenerating ? (
|
) : isGenerating ? (
|
||||||
<div className="h-full flex flex-col items-center justify-center text-zinc-500 space-y-4 min-h-[400px]">
|
<div className="h-full flex flex-col items-center justify-center text-muted space-y-4 min-h-[400px]">
|
||||||
<div className="w-16 h-16 rounded-full border-2 border-zinc-800 border-t-primary animate-spin" />
|
<div className="w-16 h-16 rounded-full border-2 border-rule2 border-t-brass animate-spin" />
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<p className="text-sm font-medium text-zinc-400">Generating thumbnails...</p>
|
<p className="text-sm lowercase font-medium text-ink2">Generating thumbnails...</p>
|
||||||
<p className="text-xs text-zinc-600 mt-1">This may take a minute per thumbnail</p>
|
<p className="text-xs lowercase text-muted mt-1">This may take a minute per thumbnail</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="h-full flex flex-col items-center justify-center text-zinc-500 space-y-4 min-h-[400px]">
|
<div className="h-full flex flex-col items-center justify-center text-muted space-y-4 min-h-[400px]">
|
||||||
<div className="w-20 h-20 rounded-2xl bg-white/5 border border-white/10 flex items-center justify-center">
|
<div className="w-20 h-20 rounded-card bg-paper3 border border-rule flex items-center justify-center">
|
||||||
<Image size={32} className="text-zinc-600" />
|
<Image size={28} className="text-muted" />
|
||||||
</div>
|
</div>
|
||||||
<div className="text-center">
|
<div className="text-center">
|
||||||
<p className="text-sm text-zinc-400">Your thumbnails will appear here</p>
|
<p className="text-sm lowercase text-ink2">Your thumbnails will appear here</p>
|
||||||
<p className="text-xs text-zinc-600 mt-1">Configure options and click Generate</p>
|
<p className="text-xs lowercase text-muted mt-1">Configure options and click Generate</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -918,7 +890,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<div className="md:col-span-2 space-y-4">
|
<div className="md:col-span-2 space-y-4">
|
||||||
<button
|
<button
|
||||||
onClick={() => setStep(2)}
|
onClick={() => setStep(2)}
|
||||||
className="text-xs text-zinc-500 hover:text-white transition-colors flex items-center gap-1 mb-2"
|
className="text-xs lowercase text-muted hover:text-ink transition-colors flex items-center gap-1 mb-2"
|
||||||
>
|
>
|
||||||
<ArrowLeft size={12} /> Back to Generate
|
<ArrowLeft size={12} /> Back to Generate
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -932,15 +904,15 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
className="w-full aspect-video object-cover"
|
className="w-full aspect-video object-cover"
|
||||||
/>
|
/>
|
||||||
<div className="p-3">
|
<div className="p-3">
|
||||||
<span className="text-xs text-green-400 flex items-center gap-1"><Check size={10} /> Selected Thumbnail</span>
|
<span className="text-xs lowercase text-brass flex items-center gap-1"><Check size={10} /> Selected Thumbnail</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Title */}
|
{/* Title */}
|
||||||
<div className="glass-panel p-6 space-y-3">
|
<div className="glass-panel p-6 space-y-3">
|
||||||
<h3 className="text-sm font-semibold text-white">Video Title</h3>
|
<p className="eyebrow">TITLE</p>
|
||||||
<div className="p-3 bg-primary/10 border border-primary/20 rounded-lg text-sm text-primary">
|
<div className="p-3 bg-paper3 border border-rule rounded-input text-sm text-ink">
|
||||||
{selectedTitle || manualTitle}
|
{selectedTitle || manualTitle}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -949,23 +921,23 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
{mode === 'video' && (
|
{mode === 'video' && (
|
||||||
<div className="glass-panel p-6 space-y-4">
|
<div className="glass-panel p-6 space-y-4">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h3 className="text-sm font-semibold text-white flex items-center gap-2">
|
<p className="eyebrow flex items-center gap-2">
|
||||||
<Sparkles size={14} className="text-yellow-400" />
|
<Sparkles size={14} className="text-brass" />
|
||||||
AI Description
|
AI DESCRIPTION
|
||||||
</h3>
|
</p>
|
||||||
<span className="text-[10px] text-zinc-600">with chapters</span>
|
<span className="readout">WITH CHAPTERS</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs text-zinc-500">
|
<p className="text-xs text-muted">
|
||||||
Generate a YouTube description with chapter timestamps from your video transcript.
|
Generate a YouTube description with chapter timestamps from your video transcript.
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
onClick={handleGenerateDescription}
|
onClick={handleGenerateDescription}
|
||||||
disabled={isDescribing}
|
disabled={isDescribing}
|
||||||
className="w-full py-3 bg-red-500/10 hover:bg-red-500/20 text-red-400 rounded-xl text-sm font-medium flex items-center justify-center gap-2 transition-colors border border-red-500/20 disabled:opacity-50"
|
className="w-full btn-ghost"
|
||||||
>
|
>
|
||||||
{isDescribing ? (
|
{isDescribing ? (
|
||||||
<>
|
<>
|
||||||
<Loader2 size={14} className="animate-spin" />
|
<Loader2 size={14} className="animate-spin text-brass" />
|
||||||
Generating description...
|
Generating description...
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
|
|
@ -982,7 +954,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
{description && (
|
{description && (
|
||||||
<button
|
<button
|
||||||
onClick={() => setStep(4)}
|
onClick={() => setStep(4)}
|
||||||
className="w-full btn-primary py-4 text-sm font-bold flex items-center justify-center gap-2"
|
className="w-full btn-primary"
|
||||||
>
|
>
|
||||||
<ArrowRight size={16} />
|
<ArrowRight size={16} />
|
||||||
Next: Publish
|
Next: Publish
|
||||||
|
|
@ -994,11 +966,11 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<div className="md:col-span-3 space-y-4">
|
<div className="md:col-span-3 space-y-4">
|
||||||
<div className="glass-panel p-6 space-y-4 h-full flex flex-col">
|
<div className="glass-panel p-6 space-y-4 h-full flex flex-col">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h3 className="text-sm font-semibold text-white flex items-center gap-2">
|
<p className="eyebrow flex items-center gap-2">
|
||||||
<FileText size={14} className="text-red-400" />
|
<FileText size={14} className="text-muted" />
|
||||||
YouTube Description
|
YOUTUBE DESCRIPTION
|
||||||
</h3>
|
</p>
|
||||||
<span className="text-[10px] text-zinc-600">{description.length}/5000</span>
|
<span className="readout">{description.length} / 5000</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<textarea
|
<textarea
|
||||||
|
|
@ -1013,7 +985,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{!description && (
|
{!description && (
|
||||||
<p className="text-xs text-zinc-600">
|
<p className="text-xs text-muted">
|
||||||
{mode === 'video'
|
{mode === 'video'
|
||||||
? "AI will generate a compelling description with chapter timestamps from your video's Whisper transcript."
|
? "AI will generate a compelling description with chapter timestamps from your video's Whisper transcript."
|
||||||
: "Write a description for your YouTube video. You can proceed to publish once you have a description."}
|
: "Write a description for your YouTube video. You can proceed to publish once you have a description."}
|
||||||
|
|
@ -1031,7 +1003,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<div className="md:col-span-2 space-y-4">
|
<div className="md:col-span-2 space-y-4">
|
||||||
<button
|
<button
|
||||||
onClick={() => setStep(3)}
|
onClick={() => setStep(3)}
|
||||||
className="text-xs text-zinc-500 hover:text-white transition-colors flex items-center gap-1 mb-2"
|
className="text-xs lowercase text-muted hover:text-ink transition-colors flex items-center gap-1 mb-2"
|
||||||
>
|
>
|
||||||
<ArrowLeft size={12} /> Back to Description
|
<ArrowLeft size={12} /> Back to Description
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -1045,14 +1017,14 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
className="w-full aspect-video object-cover"
|
className="w-full aspect-video object-cover"
|
||||||
/>
|
/>
|
||||||
<div className="p-3">
|
<div className="p-3">
|
||||||
<span className="text-xs text-green-400 flex items-center gap-1"><Check size={10} /> Selected Thumbnail</span>
|
<span className="text-xs lowercase text-brass flex items-center gap-1"><Check size={10} /> Selected Thumbnail</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Editable Title */}
|
{/* Editable Title */}
|
||||||
<div className="glass-panel p-6 space-y-3">
|
<div className="glass-panel p-6 space-y-3">
|
||||||
<h3 className="text-sm font-semibold text-white">Video Title</h3>
|
<p className="eyebrow">TITLE</p>
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
value={selectedTitle || manualTitle}
|
value={selectedTitle || manualTitle}
|
||||||
|
|
@ -1065,16 +1037,16 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
{/* Publish Button */}
|
{/* Publish Button */}
|
||||||
{(!managed && (!uploadPostKey || !uploadUserId)) ? (
|
{(!managed && (!uploadPostKey || !uploadUserId)) ? (
|
||||||
<div className="glass-panel p-6 space-y-3">
|
<div className="glass-panel p-6 space-y-3">
|
||||||
<div className="flex items-center gap-2 text-amber-400">
|
<div className="flex items-center gap-2 text-warn">
|
||||||
<AlertCircle size={16} />
|
<AlertCircle size={16} />
|
||||||
<span className="text-sm font-medium">Upload-Post Not Configured</span>
|
<span className="text-sm font-medium lowercase">Upload-Post Not Configured</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs text-zinc-500">
|
<p className="text-xs text-muted">
|
||||||
To publish directly to YouTube, configure your Upload-Post API key and connect a profile in Settings.
|
To publish directly to YouTube, configure your Upload-Post API key and connect a profile in Settings.
|
||||||
</p>
|
</p>
|
||||||
<button
|
<button
|
||||||
onClick={() => { }}
|
onClick={() => { }}
|
||||||
className="text-xs text-primary hover:underline flex items-center gap-1"
|
className="text-xs lowercase text-brass hover:underline flex items-center gap-1"
|
||||||
>
|
>
|
||||||
<Settings size={12} /> Go to Settings
|
<Settings size={12} /> Go to Settings
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -1083,7 +1055,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<button
|
<button
|
||||||
onClick={handlePublish}
|
onClick={handlePublish}
|
||||||
disabled={isPublishing}
|
disabled={isPublishing}
|
||||||
className="w-full py-4 bg-red-600 hover:bg-red-700 text-white rounded-xl text-sm font-bold flex items-center justify-center gap-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
|
className="w-full btn-primary"
|
||||||
>
|
>
|
||||||
{isPublishing ? (
|
{isPublishing ? (
|
||||||
<>
|
<>
|
||||||
|
|
@ -1099,24 +1071,28 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* Polling status */}
|
||||||
|
{isPublishing && (
|
||||||
|
<div className="readout flex items-center gap-2">
|
||||||
|
<Loader2 size={12} className="animate-spin text-brass" />
|
||||||
|
UPLOADING — POLLING STATUS EVERY 2S
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Publish Result */}
|
{/* Publish Result */}
|
||||||
{publishResult && (
|
{publishResult && (
|
||||||
<div className={`glass-panel p-4 ${publishResult.success ? 'border-green-500/30' : 'border-red-500/30'}`}>
|
<div className="glass-panel p-4">
|
||||||
{publishResult.success ? (
|
{publishResult.success ? (
|
||||||
<div className="flex items-center gap-2 text-green-400">
|
<div className="space-y-2">
|
||||||
<CheckCircle2 size={16} />
|
<span className="badge-ok">PUBLISHED</span>
|
||||||
<div>
|
<p className="text-sm lowercase font-medium text-ink">Published successfully!</p>
|
||||||
<p className="text-sm font-medium">Published successfully!</p>
|
<p className="text-xs text-muted">Your video is being uploaded to YouTube asynchronously.</p>
|
||||||
<p className="text-xs text-zinc-500 mt-1">Your video is being uploaded to YouTube asynchronously.</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="flex items-center gap-2 text-red-400">
|
<div className="space-y-2">
|
||||||
<AlertCircle size={16} />
|
<span className="badge-danger">FAILED</span>
|
||||||
<div>
|
<p className="text-sm lowercase font-medium text-danger">Publish failed</p>
|
||||||
<p className="text-sm font-medium">Publish failed</p>
|
<p className="text-xs text-muted">{publishResult.error}</p>
|
||||||
<p className="text-xs text-zinc-500 mt-1">{publishResult.error}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1127,13 +1103,13 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
|
||||||
<div className="md:col-span-3 space-y-4">
|
<div className="md:col-span-3 space-y-4">
|
||||||
<div className="glass-panel p-6 space-y-4 h-full flex flex-col">
|
<div className="glass-panel p-6 space-y-4 h-full flex flex-col">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
<h3 className="text-sm font-semibold text-white flex items-center gap-2">
|
<p className="eyebrow flex items-center gap-2">
|
||||||
<FileText size={14} className="text-red-400" />
|
<FileText size={14} className="text-muted" />
|
||||||
YouTube Description
|
YOUTUBE DESCRIPTION
|
||||||
</h3>
|
</p>
|
||||||
<button
|
<button
|
||||||
onClick={() => setStep(3)}
|
onClick={() => setStep(3)}
|
||||||
className="text-xs text-zinc-400 hover:text-white flex items-center gap-1 transition-colors"
|
className="text-xs lowercase text-muted hover:text-ink flex items-center gap-1 transition-colors"
|
||||||
>
|
>
|
||||||
<ArrowLeft size={10} /> Edit
|
<ArrowLeft size={10} /> Edit
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { X, Loader2, Zap } from 'lucide-react';
|
import { Loader2, Zap } from 'lucide-react';
|
||||||
import { apiJson } from '../lib/api';
|
import { apiJson } from '../lib/api';
|
||||||
|
import Modal from './ui/Modal';
|
||||||
|
|
||||||
// Opens when a job hits a 402 (quota exceeded). Lets the user buy more minutes.
|
// Opens when a job hits a 402 (quota exceeded). Lets the user buy more minutes.
|
||||||
export default function TopUpModal({ onClose, required, remaining }) {
|
export default function TopUpModal({ onClose, required, remaining }) {
|
||||||
|
|
@ -25,28 +26,26 @@ export default function TopUpModal({ onClose, required, remaining }) {
|
||||||
const fmt = (a, c) => new Intl.NumberFormat('en-US', { style: 'currency', currency: (c || 'usd').toUpperCase(), maximumFractionDigits: 0 }).format((a || 0) / 100);
|
const fmt = (a, c) => new Intl.NumberFormat('en-US', { style: 'currency', currency: (c || 'usd').toUpperCase(), maximumFractionDigits: 0 }).format((a || 0) / 100);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm p-4">
|
<Modal isOpen onClose={onClose} eyebrow="QUOTA" title="You're out of minutes" size="md">
|
||||||
<div className="bg-surface border border-white/10 rounded-2xl p-8 w-full max-w-md relative">
|
<div className="flex items-start gap-3 mb-5">
|
||||||
<button onClick={onClose} className="absolute right-4 top-4 text-zinc-400 hover:text-white"><X size={20} /></button>
|
<div className="p-2 bg-paper3 rounded-input text-warn shrink-0"><Zap size={18} /></div>
|
||||||
<div className="inline-flex p-3 bg-amber-500/20 rounded-full text-amber-400 mb-4"><Zap size={24} /></div>
|
<p className="text-muted text-sm pt-1">
|
||||||
<h2 className="text-xl font-bold mb-1">You're out of minutes</h2>
|
|
||||||
<p className="text-zinc-400 text-sm mb-6">
|
|
||||||
{typeof required === 'number'
|
{typeof required === 'number'
|
||||||
? <>This video needs <b>{required} min</b> but you have <b>{Math.round((remaining || 0) * 10) / 10} min</b> left.</>
|
? <>This video needs <b className="text-ink font-medium">{required} min</b> but you have <b className="text-ink font-medium">{Math.round((remaining || 0) * 10) / 10} min</b> left.</>
|
||||||
: 'Add more minutes to keep generating.'}
|
: 'Add more minutes to keep generating.'}
|
||||||
</p>
|
</p>
|
||||||
<div className="grid grid-cols-2 gap-3">
|
|
||||||
{topups.map((t) => (
|
|
||||||
<button key={t.price_id} onClick={() => buy(t.price_id)} disabled={busy}
|
|
||||||
className="border border-white/10 hover:border-primary rounded-xl p-4 text-left transition-all disabled:opacity-50">
|
|
||||||
<div className="text-lg font-bold">+{t.minutes} min</div>
|
|
||||||
<div className="text-zinc-400 text-sm">{fmt(t.amount, t.currency)}</div>
|
|
||||||
</button>
|
|
||||||
))}
|
|
||||||
{topups.length === 0 && <div className="col-span-2 flex justify-center py-4"><Loader2 className="animate-spin text-primary" /></div>}
|
|
||||||
</div>
|
|
||||||
<p className="text-zinc-500 text-xs mt-4 text-center">Or upgrade your plan for more monthly minutes.</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="grid grid-cols-2 gap-3">
|
||||||
|
{topups.map((t) => (
|
||||||
|
<button key={t.price_id} onClick={() => buy(t.price_id)} disabled={busy}
|
||||||
|
className="border border-rule hover:border-brass rounded-card p-4 text-left transition-colors disabled:opacity-50">
|
||||||
|
<div className="text-ink font-medium">+{t.minutes} min</div>
|
||||||
|
<div className="readout mt-1">{fmt(t.amount, t.currency)}</div>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
{topups.length === 0 && <div className="col-span-2 flex justify-center py-4"><Loader2 className="animate-spin text-brass" /></div>}
|
||||||
|
</div>
|
||||||
|
<p className="text-muted text-xs mt-4 text-center lowercase">Or upgrade your plan for more monthly minutes.</p>
|
||||||
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { X, Loader2, Globe, Languages, AlertCircle } from 'lucide-react';
|
import { Loader2, Languages, AlertCircle } from 'lucide-react';
|
||||||
import { getApiUrl } from '../config';
|
import Modal from './ui/Modal';
|
||||||
|
|
||||||
const LANGUAGES = {
|
const LANGUAGES = {
|
||||||
"es": "Spanish",
|
"es": "Spanish",
|
||||||
|
|
@ -47,97 +47,25 @@ export default function TranslateModal({ isOpen, onClose, onTranslate, isProcess
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 z-[100] flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-[fadeIn_0.2s_ease-out]">
|
<Modal
|
||||||
<div className="bg-[#121214] border border-white/10 p-6 rounded-2xl w-full max-w-md shadow-2xl relative">
|
isOpen={isOpen}
|
||||||
<button
|
onClose={isProcessing ? undefined : onClose}
|
||||||
onClick={onClose}
|
eyebrow="DUB"
|
||||||
disabled={isProcessing}
|
title="dub voice"
|
||||||
className="absolute top-4 right-4 text-zinc-500 hover:text-white disabled:opacity-50"
|
size="md"
|
||||||
>
|
footer={
|
||||||
<X size={20} />
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div className="flex items-center gap-3 mb-6">
|
|
||||||
<div className="w-10 h-10 rounded-xl bg-gradient-to-br from-green-500 to-teal-600 flex items-center justify-center">
|
|
||||||
<Languages size={20} className="text-white" />
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h3 className="text-lg font-bold text-white">Dub Voice</h3>
|
|
||||||
<p className="text-xs text-zinc-500">AI voice translation by ElevenLabs</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{!hasApiKey && (
|
|
||||||
<div className="mb-4 p-3 bg-yellow-500/10 border border-yellow-500/20 text-yellow-200 text-xs rounded-lg flex items-start gap-2">
|
|
||||||
<AlertCircle size={14} className="mt-0.5 shrink-0" />
|
|
||||||
<div>Configure ElevenLabs API Key in Settings first.</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Preview */}
|
|
||||||
<div className="mb-6 rounded-xl overflow-hidden bg-black aspect-video relative">
|
|
||||||
<video
|
|
||||||
src={videoUrl}
|
|
||||||
className="w-full h-full object-contain"
|
|
||||||
muted
|
|
||||||
playsInline
|
|
||||||
/>
|
|
||||||
<div className="absolute inset-0 bg-gradient-to-t from-black/60 to-transparent pointer-events-none" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Language Selection */}
|
|
||||||
<div className="mb-6">
|
|
||||||
<label className="block text-sm font-medium text-zinc-400 mb-2">
|
|
||||||
<Globe size={14} className="inline mr-2" />
|
|
||||||
Target Language
|
|
||||||
</label>
|
|
||||||
<select
|
|
||||||
value={targetLanguage}
|
|
||||||
onChange={(e) => setTargetLanguage(e.target.value)}
|
|
||||||
className="w-full bg-black/40 border border-white/10 rounded-lg p-3 text-sm text-white focus:outline-none focus:border-green-500/50 appearance-none cursor-pointer"
|
|
||||||
disabled={isProcessing}
|
|
||||||
>
|
|
||||||
{Object.entries(LANGUAGES).sort((a, b) => a[1].localeCompare(b[1])).map(([code, name]) => (
|
|
||||||
<option key={code} value={code}>
|
|
||||||
{name}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Info */}
|
|
||||||
<div className="mb-6 p-3 bg-green-500/10 border border-green-500/20 rounded-lg">
|
|
||||||
<p className="text-xs text-green-400">
|
|
||||||
The audio will be dubbed with AI-generated voice in the selected language, matching the original speaker's characteristics.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{/* Processing State */}
|
|
||||||
{isProcessing && (
|
|
||||||
<div className="mb-4 p-4 bg-white/5 rounded-lg border border-white/10">
|
|
||||||
<div className="flex items-center gap-3">
|
|
||||||
<Loader2 size={20} className="text-green-400 animate-spin" />
|
|
||||||
<div>
|
|
||||||
<p className="text-sm text-white font-medium">Dubbing audio...</p>
|
|
||||||
<p className="text-xs text-zinc-500">This may take a few minutes</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{/* Actions */}
|
|
||||||
<div className="flex gap-3">
|
<div className="flex gap-3">
|
||||||
<button
|
<button
|
||||||
onClick={onClose}
|
onClick={onClose}
|
||||||
disabled={isProcessing}
|
disabled={isProcessing}
|
||||||
className="flex-1 py-3 bg-white/5 hover:bg-white/10 text-zinc-300 rounded-xl font-medium transition-colors disabled:opacity-50"
|
className="btn-ghost flex-1"
|
||||||
>
|
>
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
disabled={isProcessing || !hasApiKey}
|
disabled={isProcessing || !hasApiKey}
|
||||||
className="flex-1 py-3 bg-gradient-to-r from-green-500 to-teal-600 hover:from-green-400 hover:to-teal-500 text-white rounded-xl font-bold transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2"
|
className="btn-primary flex-1"
|
||||||
>
|
>
|
||||||
{isProcessing ? (
|
{isProcessing ? (
|
||||||
<>
|
<>
|
||||||
|
|
@ -152,7 +80,68 @@ export default function TranslateModal({ isOpen, onClose, onTranslate, isProcess
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<div className="flex items-center gap-3 mb-5">
|
||||||
|
<div className="w-10 h-10 rounded-input bg-paper3 flex items-center justify-center shrink-0">
|
||||||
|
<Languages size={18} className="text-brass" />
|
||||||
|
</div>
|
||||||
|
<p className="text-xs text-muted">AI voice translation by ElevenLabs</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
{!hasApiKey && (
|
||||||
|
<div className="mb-4 flex items-start gap-2">
|
||||||
|
<span className="badge-warn shrink-0"><AlertCircle size={12} /> key missing</span>
|
||||||
|
<p className="text-sm text-muted">Configure ElevenLabs API Key in Settings first.</p>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* Preview */}
|
||||||
|
<div className="mb-5 rounded-card overflow-hidden bg-black aspect-video">
|
||||||
|
<video
|
||||||
|
src={videoUrl}
|
||||||
|
className="w-full h-full object-contain"
|
||||||
|
muted
|
||||||
|
playsInline
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Language Selection */}
|
||||||
|
<div className="mb-5">
|
||||||
|
<label className="eyebrow block mb-2">
|
||||||
|
Target Language
|
||||||
|
</label>
|
||||||
|
<select
|
||||||
|
value={targetLanguage}
|
||||||
|
onChange={(e) => setTargetLanguage(e.target.value)}
|
||||||
|
className="input-field appearance-none cursor-pointer"
|
||||||
|
disabled={isProcessing}
|
||||||
|
>
|
||||||
|
{Object.entries(LANGUAGES).sort((a, b) => a[1].localeCompare(b[1])).map(([code, name]) => (
|
||||||
|
<option key={code} value={code}>
|
||||||
|
{name}
|
||||||
|
</option>
|
||||||
|
))}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Info */}
|
||||||
|
<p className="text-xs text-muted leading-relaxed mb-2">
|
||||||
|
The audio will be dubbed with AI-generated voice in the selected language, matching the original speaker's characteristics.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{/* Processing State */}
|
||||||
|
{isProcessing && (
|
||||||
|
<div className="mt-4 p-3 bg-paper3 rounded-input">
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<Loader2 size={18} className="text-brass animate-spin" />
|
||||||
|
<div>
|
||||||
|
<p className="text-sm text-ink font-medium lowercase">Dubbing audio...</p>
|
||||||
|
<p className="text-xs text-muted lowercase">This may take a few minutes</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</Modal>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,18 @@ import { Sparkles, ArrowRight } from 'lucide-react';
|
||||||
// plan/trial. The tool stays visible below; actions still route to pricing.
|
// plan/trial. The tool stays visible below; actions still route to pricing.
|
||||||
export default function TrialGate({ toolName = 'this' }) {
|
export default function TrialGate({ toolName = 'this' }) {
|
||||||
return (
|
return (
|
||||||
<div className="mx-6 mt-3 p-3 bg-primary/10 border border-primary/30 rounded-xl flex items-center justify-between gap-4 shrink-0 animate-[fadeIn_0.3s_ease-out]">
|
<div className="card mx-6 mt-3 px-4 py-3 flex items-center justify-between gap-4 shrink-0 animate-fade">
|
||||||
<div className="flex items-center gap-3 text-sm">
|
<div className="flex items-center gap-3 text-sm">
|
||||||
<Sparkles size={16} className="shrink-0 text-primary" />
|
<Sparkles size={16} className="shrink-0 text-brass" />
|
||||||
<div className="text-primary/90">
|
<div className="text-ink2 lowercase">
|
||||||
<span className="font-semibold text-white">Preview mode.</span>{' '}
|
<span className="font-medium text-ink">Preview mode.</span>{' '}
|
||||||
Start your <span className="font-semibold text-white">3-day free trial</span> to generate with {toolName} —
|
Start your <span className="font-medium text-ink">3-day free trial</span> to generate with {toolName} —
|
||||||
no API keys, from $12/mo. <span className="text-zinc-400">Or run it free by self-hosting.</span>
|
no API keys, from $12/mo. <span className="text-muted">Or run it free by self-hosting.</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
onClick={() => { window.location.hash = '#/pricing'; }}
|
onClick={() => { window.location.hash = '#/pricing'; }}
|
||||||
className="shrink-0 inline-flex items-center gap-1.5 text-xs font-medium px-3 py-1.5 rounded-lg bg-primary hover:bg-blue-600 text-white transition-colors"
|
className="btn-primary shrink-0 text-xs px-4 py-2"
|
||||||
>
|
>
|
||||||
See plans <ArrowRight size={14} />
|
See plans <ArrowRight size={14} />
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { X, Loader2, Rocket, CheckCircle2 } from 'lucide-react';
|
import { Loader2, Rocket, CheckCircle2 } from 'lucide-react';
|
||||||
import { apiJson } from '../lib/api';
|
import { apiJson } from '../lib/api';
|
||||||
|
import Modal from './ui/Modal';
|
||||||
|
|
||||||
// Shown when a TRIALING user hits the trial minute cap. Lets them end the trial
|
// Shown when a TRIALING user hits the trial minute cap. Lets them end the trial
|
||||||
// and activate the paid plan right away (charges the card now, unlocks the full
|
// and activate the paid plan right away (charges the card now, unlocks the full
|
||||||
|
|
@ -49,45 +50,41 @@ export default function TrialUpgradeModal({ plan, onActivated, onClose }) {
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/70 backdrop-blur-sm p-4">
|
<Modal isOpen onClose={onClose} eyebrow="TRIAL" size="md">
|
||||||
<div className="bg-surface border border-white/10 rounded-2xl p-8 w-full max-w-md relative">
|
{done ? (
|
||||||
<button onClick={onClose} className="absolute right-4 top-4 text-zinc-400 hover:text-white"><X size={20} /></button>
|
<div className="text-center py-4">
|
||||||
|
<div className="inline-flex p-3 bg-paper3 rounded-full text-ok mb-4"><CheckCircle2 size={24} /></div>
|
||||||
|
<h2 className="font-display lowercase text-xl text-ink mb-1">You're all set</h2>
|
||||||
|
<p className="text-muted text-sm">Your plan is active{planMinutes ? ` with ${planMinutes} minutes` : ''}. Go ahead and generate your clips.</p>
|
||||||
|
</div>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<div className="inline-flex p-3 bg-paper3 rounded-full text-brass mb-4"><Rocket size={24} /></div>
|
||||||
|
<h2 className="font-display lowercase text-xl text-ink mb-1">You've used your free trial minutes</h2>
|
||||||
|
<p className="text-muted text-sm mb-6">
|
||||||
|
Activate your{plan ? <> <span className="capitalize font-medium text-ink">{plan}</span></> : ''} plan now to unlock{' '}
|
||||||
|
{planMinutes ? <><b className="text-ink font-medium">{planMinutes} minutes</b> every month</> : 'your full monthly minutes'} and keep creating.
|
||||||
|
Your card is charged today and your 3-day trial ends now.
|
||||||
|
</p>
|
||||||
|
|
||||||
{done ? (
|
{error && <p className="text-warn text-xs mb-4">{error}</p>}
|
||||||
<div className="text-center py-4">
|
|
||||||
<div className="inline-flex p-3 bg-green-500/20 rounded-full text-green-400 mb-4"><CheckCircle2 size={24} /></div>
|
|
||||||
<h2 className="text-xl font-bold mb-1">You're all set 🎉</h2>
|
|
||||||
<p className="text-zinc-400 text-sm">Your plan is active{planMinutes ? ` with ${planMinutes} minutes` : ''}. Go ahead and generate your clips.</p>
|
|
||||||
</div>
|
|
||||||
) : (
|
|
||||||
<>
|
|
||||||
<div className="inline-flex p-3 bg-primary/20 rounded-full text-primary mb-4"><Rocket size={24} /></div>
|
|
||||||
<h2 className="text-xl font-bold mb-1">You've used your free trial minutes</h2>
|
|
||||||
<p className="text-zinc-400 text-sm mb-6">
|
|
||||||
Activate your{plan ? <> <span className="capitalize font-semibold text-white">{plan}</span></> : ''} plan now to unlock{' '}
|
|
||||||
{planMinutes ? <><b className="text-white">{planMinutes} minutes</b> every month</> : 'your full monthly minutes'} and keep creating.
|
|
||||||
Your card is charged today and your 3-day trial ends now.
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{error && <p className="text-amber-400 text-xs mb-4">{error}</p>}
|
<button
|
||||||
|
onClick={activate}
|
||||||
<button
|
disabled={busy}
|
||||||
onClick={activate}
|
className="btn-primary w-full"
|
||||||
disabled={busy}
|
>
|
||||||
className="w-full btn-primary py-3 flex items-center justify-center gap-2 disabled:opacity-60"
|
{busy ? <><Loader2 size={18} className="animate-spin" /> Activating…</> : <>Activate my plan now</>}
|
||||||
>
|
</button>
|
||||||
{busy ? <><Loader2 size={18} className="animate-spin" /> Activating…</> : <>Activate my plan now</>}
|
<button
|
||||||
</button>
|
onClick={onClose}
|
||||||
<button
|
disabled={busy}
|
||||||
onClick={onClose}
|
className="w-full mt-2 text-muted hover:text-ink text-sm lowercase py-2 disabled:opacity-60 transition-colors"
|
||||||
disabled={busy}
|
>
|
||||||
className="w-full mt-2 text-zinc-400 hover:text-white text-sm py-2 disabled:opacity-60"
|
Maybe later
|
||||||
>
|
</button>
|
||||||
Maybe later
|
</>
|
||||||
</button>
|
)}
|
||||||
</>
|
</Modal>
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import React, { useState, useEffect, useRef } from 'react';
|
import React, { useState, useEffect, useRef } from 'react';
|
||||||
import { Film, Download, Copy, Check, ExternalLink, Loader2, Play, User } from 'lucide-react';
|
import { Film, Download, Copy, Check, ExternalLink, Loader2, Play, User } from 'lucide-react';
|
||||||
import { getApiUrl } from '../config';
|
import { getApiUrl } from '../config';
|
||||||
|
import SegmentedControl from './ui/SegmentedControl';
|
||||||
|
|
||||||
export default function UGCGallery() {
|
export default function UGCGallery() {
|
||||||
const [tab, setTab] = useState('videos');
|
const [tab, setTab] = useState('videos');
|
||||||
|
|
@ -32,8 +33,8 @@ export default function UGCGallery() {
|
||||||
if (loading) {
|
if (loading) {
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center h-64">
|
<div className="flex items-center justify-center h-64">
|
||||||
<Loader2 size={24} className="animate-spin text-violet-400" />
|
<Loader2 size={24} className="animate-spin text-brass" />
|
||||||
<span className="ml-2 text-zinc-400">Loading gallery...</span>
|
<span className="ml-2 text-muted lowercase">Loading gallery...</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -41,47 +42,41 @@ export default function UGCGallery() {
|
||||||
return (
|
return (
|
||||||
<div className="space-y-6">
|
<div className="space-y-6">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex flex-wrap items-end justify-between gap-3">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-lg font-bold text-zinc-200">UGC Gallery</h2>
|
<p className="eyebrow mb-1">04 · UGC GALLERY</p>
|
||||||
<p className="text-xs text-zinc-500">{videos.length} videos · {avatars.length} avatars</p>
|
<h2 className="font-display lowercase text-2xl md:text-3xl text-ink">ugc gallery</h2>
|
||||||
|
<p className="readout mt-2">{videos.length} videos · {avatars.length} avatars</p>
|
||||||
</div>
|
</div>
|
||||||
<a
|
<a
|
||||||
href={getApiUrl('/gallery')}
|
href={getApiUrl('/gallery')}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
className="text-xs text-violet-400 hover:text-violet-300 flex items-center gap-1"
|
className="btn-quiet text-xs shrink-0"
|
||||||
>
|
>
|
||||||
<ExternalLink size={12} /> Public Gallery
|
<ExternalLink size={13} /> public gallery
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tabs */}
|
{/* Tabs */}
|
||||||
<div className="flex gap-1 bg-white/5 p-1 rounded-lg w-fit">
|
<div className="max-w-xs">
|
||||||
<button
|
<SegmentedControl
|
||||||
onClick={() => setTab('videos')}
|
size="sm"
|
||||||
className={`px-4 py-1.5 rounded-md text-xs font-medium transition-all ${
|
value={tab}
|
||||||
tab === 'videos' ? 'bg-violet-500/20 text-violet-300' : 'text-zinc-400 hover:text-white'
|
onChange={setTab}
|
||||||
}`}
|
options={[
|
||||||
>
|
{ value: 'videos', label: `Videos (${videos.length})`, icon: <Film size={14} /> },
|
||||||
<Film size={12} className="inline mr-1.5" />Videos ({videos.length})
|
{ value: 'avatars', label: `Avatars (${avatars.length})`, icon: <User size={14} /> },
|
||||||
</button>
|
]}
|
||||||
<button
|
/>
|
||||||
onClick={() => setTab('avatars')}
|
|
||||||
className={`px-4 py-1.5 rounded-md text-xs font-medium transition-all ${
|
|
||||||
tab === 'avatars' ? 'bg-violet-500/20 text-violet-300' : 'text-zinc-400 hover:text-white'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
<User size={12} className="inline mr-1.5" />Avatars ({avatars.length})
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Videos Tab */}
|
{/* Videos Tab */}
|
||||||
{tab === 'videos' && (
|
{tab === 'videos' && (
|
||||||
videos.length === 0 ? (
|
videos.length === 0 ? (
|
||||||
<div className="text-center py-16">
|
<div className="text-center py-16">
|
||||||
<Film size={40} className="mx-auto text-zinc-700 mb-3" />
|
<Film size={40} className="mx-auto text-muted opacity-40 mb-3" />
|
||||||
<p className="text-sm text-zinc-500">No videos yet. Generate one from AI Shorts.</p>
|
<p className="text-sm text-muted lowercase">No videos yet. Generate one from AI Shorts.</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="grid grid-cols-3 sm:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-3">
|
<div className="grid grid-cols-3 sm:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-3">
|
||||||
|
|
@ -96,11 +91,11 @@ export default function UGCGallery() {
|
||||||
{tab === 'avatars' && (
|
{tab === 'avatars' && (
|
||||||
avatars.length === 0 ? (
|
avatars.length === 0 ? (
|
||||||
<div className="text-center py-16">
|
<div className="text-center py-16">
|
||||||
<User size={40} className="mx-auto text-zinc-700 mb-3" />
|
<User size={40} className="mx-auto text-muted opacity-40 mb-3" />
|
||||||
<p className="text-sm text-zinc-500">No avatars yet. Generate actors from AI Shorts.</p>
|
<p className="text-sm text-muted lowercase">No avatars yet. Generate actors from AI Shorts.</p>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<div className="grid grid-cols-3 sm:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 gap-3">
|
<div className="grid grid-cols-3 sm:grid-cols-4 lg:grid-cols-6 gap-3">
|
||||||
{avatars.map((avatar, i) => (
|
{avatars.map((avatar, i) => (
|
||||||
<AvatarCard key={avatar.key || i} avatar={avatar} copied={copied} onCopy={handleCopy} />
|
<AvatarCard key={avatar.key || i} avatar={avatar} copied={copied} onCopy={handleCopy} />
|
||||||
))}
|
))}
|
||||||
|
|
@ -113,31 +108,31 @@ export default function UGCGallery() {
|
||||||
|
|
||||||
function AvatarCard({ avatar, copied, onCopy }) {
|
function AvatarCard({ avatar, copied, onCopy }) {
|
||||||
return (
|
return (
|
||||||
<div className="group rounded-xl overflow-hidden border border-white/10 bg-white/5 hover:border-white/20 transition-all">
|
<div className="group card overflow-hidden transition-colors hover:border-rule2">
|
||||||
<div className="aspect-[3/4] bg-black">
|
<div className="aspect-[3/4] bg-black">
|
||||||
<img src={avatar.url} alt="Avatar" className="w-full h-full object-cover" />
|
<img src={avatar.url} alt="Avatar" className="w-full h-full object-cover" />
|
||||||
</div>
|
</div>
|
||||||
<div className="p-2 space-y-1">
|
<div className="p-2 space-y-1">
|
||||||
{avatar.description ? (
|
{avatar.description ? (
|
||||||
<div className="relative pr-4">
|
<div className="relative pr-4">
|
||||||
<p className="text-[9px] text-zinc-400 line-clamp-2">{avatar.description}</p>
|
<p className="text-micro text-muted line-clamp-2">{avatar.description}</p>
|
||||||
<button
|
<button
|
||||||
onClick={() => onCopy(avatar.description, `avatar-${avatar.key}`)}
|
onClick={() => onCopy(avatar.description, `avatar-${avatar.key}`)}
|
||||||
className="absolute top-0 right-0 p-0.5 text-zinc-600 hover:text-zinc-300"
|
className="absolute top-0 right-0 p-0.5 text-muted hover:text-brass transition-colors"
|
||||||
title="Copy prompt"
|
title="Copy prompt"
|
||||||
>
|
>
|
||||||
{copied === `avatar-${avatar.key}` ? <Check size={9} /> : <Copy size={9} />}
|
{copied === `avatar-${avatar.key}` ? <Check size={10} className="text-ok" /> : <Copy size={10} />}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<p className="text-[9px] text-zinc-600 italic">No description</p>
|
<p className="text-micro text-muted opacity-60 lowercase">No description</p>
|
||||||
)}
|
)}
|
||||||
<a
|
<a
|
||||||
href={avatar.url}
|
href={avatar.url}
|
||||||
download
|
download
|
||||||
className="block text-center text-[9px] bg-white/5 hover:bg-white/10 text-zinc-400 py-1 rounded-md transition-colors"
|
className="block text-center text-micro lowercase bg-paper3 hover:brightness-110 text-muted hover:text-ink2 py-1 rounded-full transition-all"
|
||||||
>
|
>
|
||||||
<Download size={9} className="inline mr-0.5" />Download
|
<Download size={10} className="inline mr-0.5" />Download
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -168,7 +163,7 @@ function VideoCard({ video, copied, onCopy }) {
|
||||||
const hashtags = (video.hashtags || []).join(' ');
|
const hashtags = (video.hashtags || []).join(' ');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="group rounded-xl overflow-hidden border border-white/10 bg-white/5 hover:border-white/20 transition-all">
|
<div className="group card overflow-hidden transition-colors hover:border-rule2">
|
||||||
<div
|
<div
|
||||||
className="relative aspect-[9/16] bg-black cursor-pointer"
|
className="relative aspect-[9/16] bg-black cursor-pointer"
|
||||||
onMouseEnter={handleMouseEnter}
|
onMouseEnter={handleMouseEnter}
|
||||||
|
|
@ -189,28 +184,26 @@ function VideoCard({ video, copied, onCopy }) {
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
<div className="absolute top-1.5 right-1.5">
|
<div className="absolute top-1.5 right-1.5">
|
||||||
<span className={`text-[8px] font-bold px-1.5 py-0.5 rounded-full ${
|
<span className={`${mode === 'lowcost' ? 'badge-ok' : 'badge-brass'} bg-black/70`}>
|
||||||
mode === 'lowcost' ? 'bg-green-500 text-black' : 'bg-violet-500 text-white'
|
|
||||||
}`}>
|
|
||||||
{mode === 'lowcost' ? 'LOW COST' : 'PREMIUM'}
|
{mode === 'lowcost' ? 'LOW COST' : 'PREMIUM'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="p-2 space-y-1">
|
<div className="p-2 space-y-1">
|
||||||
<h3 className="text-[11px] font-semibold text-zinc-200 truncate">{video.title || 'Untitled'}</h3>
|
<h3 className="text-xs font-semibold text-ink truncate">{video.title || 'Untitled'}</h3>
|
||||||
<p className="text-[9px] text-zinc-500">
|
<p className="readout">
|
||||||
{video.duration?.toFixed(0)}s · ${video.cost_estimate?.total?.toFixed(2) || '?'}
|
{video.duration?.toFixed(0)}s · ${video.cost_estimate?.total?.toFixed(2) || '?'}
|
||||||
</p>
|
</p>
|
||||||
{caption && (
|
{caption && (
|
||||||
<div className="relative pr-4">
|
<div className="relative pr-4">
|
||||||
<p className="text-[9px] text-zinc-400 line-clamp-2">{caption}</p>
|
<p className="text-micro text-muted line-clamp-2">{caption}</p>
|
||||||
<button
|
<button
|
||||||
onClick={() => onCopy(`${caption}\n${hashtags}`, `caption-${video.video_id}`)}
|
onClick={() => onCopy(`${caption}\n${hashtags}`, `caption-${video.video_id}`)}
|
||||||
className="absolute top-0 right-0 p-0.5 text-zinc-600 hover:text-zinc-300"
|
className="absolute top-0 right-0 p-0.5 text-muted hover:text-brass transition-colors"
|
||||||
title="Copy caption"
|
title="Copy caption"
|
||||||
>
|
>
|
||||||
{copied === `caption-${video.video_id}` ? <Check size={9} /> : <Copy size={9} />}
|
{copied === `caption-${video.video_id}` ? <Check size={10} className="text-ok" /> : <Copy size={10} />}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -218,17 +211,17 @@ function VideoCard({ video, copied, onCopy }) {
|
||||||
<a
|
<a
|
||||||
href={video.video_url}
|
href={video.video_url}
|
||||||
download
|
download
|
||||||
className="flex-1 text-center text-[9px] bg-white/5 hover:bg-white/10 text-zinc-400 py-1 rounded-md transition-colors"
|
className="flex-1 text-center text-micro lowercase bg-paper3 hover:brightness-110 text-muted hover:text-ink2 py-1 rounded-full transition-all"
|
||||||
>
|
>
|
||||||
<Download size={9} className="inline mr-0.5" />Download
|
<Download size={10} className="inline mr-0.5" />Download
|
||||||
</a>
|
</a>
|
||||||
<a
|
<a
|
||||||
href={getApiUrl(`/video/${video.video_id}`)}
|
href={getApiUrl(`/video/${video.video_id}`)}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
className="flex-1 text-center text-[9px] bg-violet-500/10 hover:bg-violet-500/20 text-violet-400 py-1 rounded-md transition-colors"
|
className="flex-1 text-center text-micro lowercase bg-paper3 hover:brightness-110 text-brass py-1 rounded-full transition-all"
|
||||||
>
|
>
|
||||||
<ExternalLink size={9} className="inline mr-0.5" />View
|
<ExternalLink size={10} className="inline mr-0.5" />View
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,12 @@ export default function UsageMeter({ onClick }) {
|
||||||
<button
|
<button
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
title="Manage your plan"
|
title="Manage your plan"
|
||||||
className={`flex items-center gap-2 px-3 py-1.5 rounded-full border text-xs transition-colors ${low ? 'border-amber-500/40 bg-amber-500/10 text-amber-300 hover:bg-amber-500/20' : 'border-white/10 bg-white/5 text-zinc-300 hover:bg-white/10'}`}
|
className="flex items-center gap-2 px-3 py-1.5 rounded-full border border-rule2 bg-paper2 hover:bg-paper3 transition-colors"
|
||||||
>
|
>
|
||||||
<Zap size={13} className={low ? 'text-amber-400' : 'text-primary'} />
|
<Zap size={14} className={low ? 'text-warn' : 'text-brass'} />
|
||||||
<span className="font-medium">{remaining} min</span>
|
<span className={`readout ${low ? 'text-warn' : ''}`}>{remaining} min</span>
|
||||||
<span className="w-12 h-1.5 rounded-full bg-white/10 overflow-hidden hidden sm:inline-block">
|
<span className="w-12 h-1.5 rounded-full bg-paper3 overflow-hidden hidden sm:inline-block">
|
||||||
<span className={`block h-full ${low ? 'bg-amber-400' : 'bg-primary'}`} style={{ width: `${pct}%` }} />
|
<span className={`block h-full ${low ? 'bg-warn' : 'bg-brass'}`} style={{ width: `${pct}%` }} />
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
60
dashboard/src/components/ui/Modal.jsx
Normal file
60
dashboard/src/components/ui/Modal.jsx
Normal file
|
|
@ -0,0 +1,60 @@
|
||||||
|
import { X } from 'lucide-react';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The single modal shell for the app (design.md).
|
||||||
|
* Plain dark overlay (no backdrop-blur), hairline paper2 panel.
|
||||||
|
*
|
||||||
|
* Props:
|
||||||
|
* - isOpen / onClose
|
||||||
|
* - title (string, rendered lowercase serif) — optional
|
||||||
|
* - eyebrow (string, mono UPPERCASE micro label above title) — optional
|
||||||
|
* - size: 'sm' | 'md' | 'lg' | 'xl' (max width; default 'md')
|
||||||
|
* - children: body content
|
||||||
|
* - footer: optional node pinned under the body
|
||||||
|
* - hideClose: hide the X button
|
||||||
|
*/
|
||||||
|
const SIZES = {
|
||||||
|
sm: 'max-w-sm',
|
||||||
|
md: 'max-w-md',
|
||||||
|
lg: 'max-w-2xl',
|
||||||
|
xl: 'max-w-5xl',
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function Modal({ isOpen, onClose, title, eyebrow, size = 'md', children, footer, hideClose = false }) {
|
||||||
|
if (!isOpen) return null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="fixed inset-0 z-[100] flex items-center justify-center bg-black/70 p-4 animate-fade"
|
||||||
|
onMouseDown={(e) => { if (e.target === e.currentTarget && onClose) onClose(); }}
|
||||||
|
role="dialog"
|
||||||
|
aria-modal="true"
|
||||||
|
>
|
||||||
|
<div className={`card relative w-full ${SIZES[size] || SIZES.md} max-h-[90vh] flex flex-col`}>
|
||||||
|
{!hideClose && onClose && (
|
||||||
|
<button
|
||||||
|
onClick={onClose}
|
||||||
|
aria-label="close"
|
||||||
|
className="absolute top-4 right-4 z-10 p-1.5 rounded-full text-muted hover:text-ink hover:bg-paper3 transition-colors"
|
||||||
|
>
|
||||||
|
<X size={16} />
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
{(title || eyebrow) && (
|
||||||
|
<div className="px-4 sm:px-6 pt-6 pb-4 border-b border-rule shrink-0">
|
||||||
|
{eyebrow && <p className="eyebrow mb-1.5">{eyebrow}</p>}
|
||||||
|
{title && <h2 className="font-display lowercase text-2xl text-ink leading-tight break-words pr-8">{title}</h2>}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
<div className="px-4 sm:px-6 py-5 overflow-y-auto custom-scrollbar grow">
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
{footer && (
|
||||||
|
<div className="px-4 sm:px-6 py-4 border-t border-rule shrink-0">
|
||||||
|
{footer}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
57
dashboard/src/components/ui/SegmentedControl.jsx
Normal file
57
dashboard/src/components/ui/SegmentedControl.jsx
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
/**
|
||||||
|
* The single option-toggle group (design.md). Replaces every ad-hoc
|
||||||
|
* grid of toggle buttons (position/size/animation pickers, platform
|
||||||
|
* selectors, mode switches).
|
||||||
|
*
|
||||||
|
* Props:
|
||||||
|
* - options: [{ value, label, icon?, hint?, disabled? }]
|
||||||
|
* - value: selected value (or array when multi)
|
||||||
|
* - onChange(value)
|
||||||
|
* - multi: allow multiple selections (value must be an array)
|
||||||
|
* - columns: grid column count (default: options.length, capped at 4)
|
||||||
|
* - size: 'sm' | 'md'
|
||||||
|
*/
|
||||||
|
export default function SegmentedControl({ options, value, onChange, multi = false, columns, size = 'md' }) {
|
||||||
|
const cols = columns || Math.min(options.length, 4);
|
||||||
|
const isActive = (v) => (multi ? Array.isArray(value) && value.includes(v) : value === v);
|
||||||
|
|
||||||
|
const toggle = (v) => {
|
||||||
|
if (!multi) return onChange(v);
|
||||||
|
const arr = Array.isArray(value) ? value : [];
|
||||||
|
onChange(arr.includes(v) ? arr.filter((x) => x !== v) : [...arr, v]);
|
||||||
|
};
|
||||||
|
|
||||||
|
const pad = size === 'sm' ? 'px-2.5 py-1.5' : 'px-3 py-2.5';
|
||||||
|
|
||||||
|
// Responsive tracks: `cols` columns when they fit, wrapping to fewer on
|
||||||
|
// narrow containers so options never crush below a readable width.
|
||||||
|
const minCol = size === 'sm' ? 48 : 88;
|
||||||
|
const gridTemplateColumns = `repeat(auto-fill, minmax(max(${minCol}px, calc((100% - ${(cols - 1) * 6}px) / ${cols})), 1fr))`;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="grid gap-1.5" style={{ gridTemplateColumns }} role={multi ? 'group' : 'radiogroup'}>
|
||||||
|
{options.map((opt) => {
|
||||||
|
const active = isActive(opt.value);
|
||||||
|
return (
|
||||||
|
<button
|
||||||
|
key={opt.value}
|
||||||
|
type="button"
|
||||||
|
role={multi ? 'checkbox' : 'radio'}
|
||||||
|
aria-checked={active}
|
||||||
|
disabled={opt.disabled}
|
||||||
|
onClick={() => toggle(opt.value)}
|
||||||
|
className={`${pad} rounded-input border text-xs lowercase flex flex-col items-center justify-center gap-1 transition-colors duration-200
|
||||||
|
${active
|
||||||
|
? 'border-brass bg-paper3 text-ink'
|
||||||
|
: 'border-rule bg-paper text-muted hover:text-ink2 hover:border-rule2'}
|
||||||
|
disabled:opacity-40 disabled:cursor-not-allowed`}
|
||||||
|
>
|
||||||
|
{opt.icon && <span className={active ? 'text-brass' : 'text-muted'}>{opt.icon}</span>}
|
||||||
|
<span className="font-medium">{opt.label}</span>
|
||||||
|
{opt.hint && <span className="readout normal-case">{opt.hint}</span>}
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
46
dashboard/src/components/ui/StepIndicator.jsx
Normal file
46
dashboard/src/components/ui/StepIndicator.jsx
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
import { Check } from 'lucide-react';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The single wizard stepper (design.md) — shared by ThumbnailStudio and
|
||||||
|
* SaaShortsTab. Mono ordinals, hairline connectors, brass current step.
|
||||||
|
*
|
||||||
|
* Props:
|
||||||
|
* - steps: string[] (labels)
|
||||||
|
* - current: index of the active step
|
||||||
|
* - onStepClick(index)? — optional, only past steps are clickable
|
||||||
|
*/
|
||||||
|
export default function StepIndicator({ steps, current, onStepClick }) {
|
||||||
|
return (
|
||||||
|
<ol className="flex items-center w-full" aria-label="progress">
|
||||||
|
{steps.map((label, i) => {
|
||||||
|
const done = i < current;
|
||||||
|
const active = i === current;
|
||||||
|
const clickable = done && typeof onStepClick === 'function';
|
||||||
|
return (
|
||||||
|
<li key={label} className={`flex items-center ${i < steps.length - 1 ? 'flex-1' : ''}`}>
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
disabled={!clickable}
|
||||||
|
onClick={() => clickable && onStepClick(i)}
|
||||||
|
className={`flex items-center gap-2 shrink-0 ${clickable ? 'cursor-pointer' : 'cursor-default'}`}
|
||||||
|
aria-current={active ? 'step' : undefined}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className={`w-6 h-6 rounded-full border flex items-center justify-center font-mono text-[10px] transition-colors duration-200
|
||||||
|
${active ? 'border-brass text-brass' : done ? 'border-rule2 text-ok' : 'border-rule text-muted'}`}
|
||||||
|
>
|
||||||
|
{done ? <Check size={11} /> : String(i + 1).padStart(2, '0')}
|
||||||
|
</span>
|
||||||
|
<span className={`hidden sm:block text-micro font-mono uppercase tracking-widest ${active ? 'text-ink' : 'text-muted'}`}>
|
||||||
|
{label}
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
{i < steps.length - 1 && (
|
||||||
|
<span className={`h-px flex-1 mx-1.5 sm:mx-3 ${done ? 'bg-brass/40' : 'bg-[color:var(--color-rule)]'}`} aria-hidden="true" />
|
||||||
|
)}
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</ol>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -1,24 +1,141 @@
|
||||||
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:wght@700&display=swap');
|
/* Hallmark · genre: atmospheric · theme: lumen (night foundry) · design-system: design.md · designed-as-app */
|
||||||
|
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif:wght@700&display=swap'); /* hook-overlay font burned into videos — not UI */
|
||||||
|
@import './tokens.css';
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
@layer base {
|
@layer base {
|
||||||
body {
|
body {
|
||||||
@apply bg-background text-white antialiased;
|
@apply bg-paper text-ink2 antialiased;
|
||||||
|
font-family: var(--font-body);
|
||||||
|
font-variant-numeric: tabular-nums;
|
||||||
|
}
|
||||||
|
|
||||||
|
::selection {
|
||||||
|
background: var(--color-accent);
|
||||||
|
color: var(--color-accent-ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
:focus-visible {
|
||||||
|
outline: 2px solid var(--color-focus);
|
||||||
|
outline-offset: 2px;
|
||||||
|
transition: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.glass-panel {
|
@layer components {
|
||||||
@apply bg-surface/50 backdrop-blur-xl border border-white/10 rounded-2xl shadow-xl;
|
/* hairline card, lit from within — replaces every glass/surface card */
|
||||||
}
|
.card,
|
||||||
|
.glass-panel {
|
||||||
|
background:
|
||||||
|
radial-gradient(120% 90% at 50% 0%, var(--color-paper-emit) 0%, transparent 70%),
|
||||||
|
var(--color-paper-2);
|
||||||
|
border: 1px solid var(--color-rule);
|
||||||
|
border-radius: var(--radius-card);
|
||||||
|
}
|
||||||
|
|
||||||
.input-field {
|
.card-hover {
|
||||||
@apply w-full bg-white/5 border border-white/10 rounded-xl px-4 py-3 outline-none focus:border-primary/50 focus:ring-1 focus:ring-primary/50 transition-all text-sm placeholder:text-zinc-500;
|
transition: transform var(--dur-short) var(--ease-out),
|
||||||
}
|
border-color var(--dur-short) var(--ease-out),
|
||||||
|
background-color var(--dur-short) var(--ease-out);
|
||||||
|
}
|
||||||
|
.card-hover:hover {
|
||||||
|
transform: translateY(-4px);
|
||||||
|
border-color: var(--color-rule-2);
|
||||||
|
}
|
||||||
|
|
||||||
.btn-primary {
|
/* mono UPPERCASE micro label — the only uppercase surface */
|
||||||
@apply bg-primary hover:bg-blue-600 text-white px-6 py-3 rounded-xl font-medium transition-all active:scale-[0.98] disabled:opacity-50 disabled:cursor-not-allowed shadow-lg shadow-primary/20;
|
.eyebrow {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: var(--tracking-micro);
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--color-ink);
|
||||||
|
opacity: 0.55;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* mono value chip for machine data: 00:42 · 9:16 · $0.65 */
|
||||||
|
.readout {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 10.5px;
|
||||||
|
letter-spacing: var(--tracking-micro);
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--color-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-field {
|
||||||
|
@apply w-full text-sm text-ink2;
|
||||||
|
background: var(--color-paper);
|
||||||
|
border: 1px solid var(--color-rule-2);
|
||||||
|
border-radius: var(--radius-input);
|
||||||
|
padding: 0.75rem 1rem;
|
||||||
|
outline: none;
|
||||||
|
transition: border-color var(--dur-short) var(--ease-out);
|
||||||
|
}
|
||||||
|
.input-field::placeholder { color: var(--color-muted); opacity: 0.7; }
|
||||||
|
.input-field:focus { border-color: var(--color-accent); }
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
@apply inline-flex items-center justify-center gap-2 px-6 py-3 text-sm font-medium lowercase;
|
||||||
|
background: var(--color-accent);
|
||||||
|
color: var(--color-accent-ink);
|
||||||
|
border-radius: 999px;
|
||||||
|
transition: filter var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
|
||||||
|
}
|
||||||
|
.btn-primary:hover { filter: brightness(1.08); }
|
||||||
|
.btn-primary:active { transform: translateY(1px); }
|
||||||
|
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
|
||||||
|
|
||||||
|
.btn-ghost {
|
||||||
|
@apply inline-flex items-center justify-center gap-2 px-6 py-3 text-sm font-medium lowercase text-ink;
|
||||||
|
background: transparent;
|
||||||
|
border: 1px solid var(--color-rule-2);
|
||||||
|
border-radius: 999px;
|
||||||
|
transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
|
||||||
|
}
|
||||||
|
.btn-ghost:hover { border-color: var(--color-accent); }
|
||||||
|
.btn-ghost:active { transform: translateY(1px); }
|
||||||
|
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }
|
||||||
|
|
||||||
|
.btn-quiet {
|
||||||
|
@apply inline-flex items-center justify-center gap-2 px-4 py-2 text-sm lowercase text-ink2;
|
||||||
|
background: var(--color-paper-3);
|
||||||
|
border-radius: 999px;
|
||||||
|
transition: filter var(--dur-short) var(--ease-out);
|
||||||
|
}
|
||||||
|
.btn-quiet:hover { filter: brightness(1.15); }
|
||||||
|
|
||||||
|
.btn-danger {
|
||||||
|
@apply inline-flex items-center justify-center gap-2 px-4 py-2 text-sm lowercase;
|
||||||
|
color: var(--color-danger);
|
||||||
|
border: 1px solid color-mix(in oklab, var(--color-danger) 40%, transparent);
|
||||||
|
border-radius: 999px;
|
||||||
|
transition: background-color var(--dur-short) var(--ease-out);
|
||||||
|
}
|
||||||
|
.btn-danger:hover { background: color-mix(in oklab, var(--color-danger) 12%, transparent); }
|
||||||
|
|
||||||
|
.badge-ok, .badge-warn, .badge-danger, .badge-brass {
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 10.5px;
|
||||||
|
letter-spacing: var(--tracking-micro);
|
||||||
|
text-transform: uppercase;
|
||||||
|
border-radius: 999px;
|
||||||
|
padding: 2px 10px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
.badge-ok { color: var(--color-ok); background: color-mix(in oklab, var(--color-ok) 12%, transparent); }
|
||||||
|
.badge-warn { color: var(--color-warn); background: color-mix(in oklab, var(--color-warn) 12%, transparent); }
|
||||||
|
.badge-danger { color: var(--color-danger); background: color-mix(in oklab, var(--color-danger) 12%, transparent); }
|
||||||
|
.badge-brass { color: var(--color-accent); background: color-mix(in oklab, var(--color-accent) 12%, transparent); }
|
||||||
|
|
||||||
|
/* narrow phones: tighter pill padding so CTA labels stay on one line */
|
||||||
|
@media (max-width: 379px) {
|
||||||
|
.btn-primary, .btn-ghost { padding-left: 1rem; padding-right: 1rem; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Custom Scrollbar */
|
/* Custom Scrollbar */
|
||||||
|
|
@ -32,15 +149,20 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-scrollbar::-webkit-scrollbar-thumb {
|
.custom-scrollbar::-webkit-scrollbar-thumb {
|
||||||
background: rgba(255, 255, 255, 0.1);
|
background: var(--color-rule-2);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
|
||||||
background: rgba(255, 255, 255, 0.2);
|
background: var(--color-rule);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Custom Animations */
|
/* Custom Animations */
|
||||||
|
@keyframes fadeIn {
|
||||||
|
from { opacity: 0; }
|
||||||
|
to { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
@keyframes scan {
|
@keyframes scan {
|
||||||
0% {
|
0% {
|
||||||
top: 0%;
|
top: 0%;
|
||||||
|
|
@ -70,3 +192,16 @@
|
||||||
top: 100%;
|
top: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes filament-pulse {
|
||||||
|
0%, 100% { opacity: 1; }
|
||||||
|
50% { opacity: 0.86; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
*, *::before, *::after {
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
animation-iteration-count: 1 !important;
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
227
dashboard/src/landing.css
Normal file
227
dashboard/src/landing.css
Normal file
|
|
@ -0,0 +1,227 @@
|
||||||
|
/* Hallmark · genre: atmospheric · macrostructure: Marquee Hero · theme: lumen (night) · design-system: design.md · designed-as-app · nav: N9 · footer: Ft5 · enrichment: filament apparatus */
|
||||||
|
|
||||||
|
/* ---- hero: blueprint grid + paper emission (top-right) ---- */
|
||||||
|
.hero-blueprint {
|
||||||
|
background-image:
|
||||||
|
radial-gradient(55% 45% at 82% 0%, var(--color-paper-emit) 0%, transparent 70%),
|
||||||
|
linear-gradient(to right, var(--rule-blueprint) 1px, transparent 1px),
|
||||||
|
linear-gradient(to bottom, var(--rule-blueprint) 1px, transparent 1px);
|
||||||
|
background-size: 100% 100%, 48px 48px, 48px 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- hero headline + coral verb landmark ---- */
|
||||||
|
.hero-h1 {
|
||||||
|
font-family: var(--font-display);
|
||||||
|
font-size: clamp(2.75rem, 5vw + 1rem, 5rem);
|
||||||
|
letter-spacing: -0.032em;
|
||||||
|
line-height: 1.05;
|
||||||
|
text-transform: lowercase;
|
||||||
|
color: var(--color-ink);
|
||||||
|
}
|
||||||
|
.hero-h1 em {
|
||||||
|
font-style: normal;
|
||||||
|
color: var(--color-accent-2);
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.hero-h1 em::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0.04em;
|
||||||
|
height: 1px;
|
||||||
|
background: var(--color-accent-2);
|
||||||
|
transform: scaleX(0);
|
||||||
|
transform-origin: left center;
|
||||||
|
animation: verb-underline 320ms var(--ease-out) 900ms forwards;
|
||||||
|
}
|
||||||
|
@keyframes verb-underline {
|
||||||
|
to { transform: scaleX(1); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- apparatus: instrument bezel holding a real 9:16 clip ---- */
|
||||||
|
.apparatus {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 2rem;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.apparatus-shell {
|
||||||
|
position: relative;
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
.apparatus-glow {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
border-radius: 18px;
|
||||||
|
box-shadow: 0 0 28px 2px var(--color-glow);
|
||||||
|
opacity: 0.4;
|
||||||
|
animation: filament-pulse var(--dur-pulse) var(--ease-out) infinite;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.apparatus-chamber {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
width: clamp(200px, 20vw, 260px);
|
||||||
|
aspect-ratio: 9 / 16;
|
||||||
|
border: 1px solid var(--color-rule-2);
|
||||||
|
border-radius: 18px;
|
||||||
|
background: color-mix(in oklab, var(--color-paper-2) 72%, var(--color-paper-3));
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.apparatus-chamber video {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
.apparatus-stencil {
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
bottom: 10px;
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 10.5px;
|
||||||
|
letter-spacing: var(--tracking-micro);
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--color-ink-2);
|
||||||
|
background: rgb(0 0 0 / 0.7);
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 999px;
|
||||||
|
}
|
||||||
|
.apparatus-callouts {
|
||||||
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2.5rem;
|
||||||
|
}
|
||||||
|
.apparatus-callouts li {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
font-family: var(--font-mono);
|
||||||
|
font-size: 10.5px;
|
||||||
|
letter-spacing: var(--tracking-micro);
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: var(--color-muted);
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.apparatus-leader {
|
||||||
|
flex: none;
|
||||||
|
width: 40px;
|
||||||
|
height: 1px;
|
||||||
|
background: var(--color-rule-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- smart crop: 16:9 source → 9:16 result, real product output ---- */
|
||||||
|
.crop-frame {
|
||||||
|
position: relative;
|
||||||
|
margin: 0;
|
||||||
|
border: 1px solid var(--color-rule);
|
||||||
|
border-radius: var(--radius-card);
|
||||||
|
overflow: hidden;
|
||||||
|
background: var(--color-paper-2);
|
||||||
|
}
|
||||||
|
.crop-frame video {
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
.crop-window {
|
||||||
|
position: absolute;
|
||||||
|
top: 5%;
|
||||||
|
bottom: 5%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
aspect-ratio: 9 / 16;
|
||||||
|
border: 1px solid var(--color-accent);
|
||||||
|
border-radius: 6px;
|
||||||
|
box-shadow: 0 0 0 200vmax rgb(0 0 0 / 0.22);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.crop-leader {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.625rem;
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
.crop-leader-line {
|
||||||
|
position: relative;
|
||||||
|
width: 56px;
|
||||||
|
height: 1px;
|
||||||
|
background: var(--color-rule-2);
|
||||||
|
}
|
||||||
|
.crop-leader-line::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
right: -1px;
|
||||||
|
top: -3px;
|
||||||
|
border-left: 5px solid var(--color-rule-2);
|
||||||
|
border-top: 3.5px solid transparent;
|
||||||
|
border-bottom: 3.5px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---- meter strip (below the fold) ---- */
|
||||||
|
.meter-strip {
|
||||||
|
height: 40px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 1.5rem;
|
||||||
|
}
|
||||||
|
.meter-ticks {
|
||||||
|
flex: 1 1 0%;
|
||||||
|
min-width: 0;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.meter-tick {
|
||||||
|
flex: none;
|
||||||
|
width: 1px;
|
||||||
|
background: var(--color-accent);
|
||||||
|
opacity: 0.65;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.apparatus { gap: 1.25rem; }
|
||||||
|
.apparatus-chamber { width: 180px; }
|
||||||
|
.apparatus-leader { width: 20px; }
|
||||||
|
.apparatus-callouts { gap: 1.5rem; }
|
||||||
|
.crop-leader-line {
|
||||||
|
width: 1px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
.crop-leader-line::after {
|
||||||
|
right: -3px;
|
||||||
|
top: auto;
|
||||||
|
bottom: -1px;
|
||||||
|
border-left: 3.5px solid transparent;
|
||||||
|
border-right: 3.5px solid transparent;
|
||||||
|
border-top: 5px solid var(--color-rule-2);
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* narrow phones: stack callouts under the chamber so nothing overflows */
|
||||||
|
@media (max-width: 519px) {
|
||||||
|
.apparatus { flex-direction: column; gap: 1.25rem; }
|
||||||
|
.apparatus-callouts {
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 0.625rem 1.25rem;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
.apparatus-callouts li { gap: 0.5rem; }
|
||||||
|
.apparatus-leader { width: 12px; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.apparatus-glow { animation: none; }
|
||||||
|
.hero-h1 em::after { animation: none; transform: scaleX(1); }
|
||||||
|
}
|
||||||
|
|
@ -5,19 +5,19 @@ import App from './App.jsx'
|
||||||
import Landing from './Landing.jsx'
|
import Landing from './Landing.jsx'
|
||||||
import Legal from './Legal.jsx'
|
import Legal from './Legal.jsx'
|
||||||
import { AuthProvider, useAuth } from './contexts/AuthContext'
|
import { AuthProvider, useAuth } from './contexts/AuthContext'
|
||||||
import PricingSection from './components/PricingSection'
|
import PricingPage from './components/PricingPage'
|
||||||
import AccountPage from './components/AccountPage'
|
import AccountPage from './components/AccountPage'
|
||||||
import LoginModal from './components/LoginModal'
|
import LoginModal from './components/LoginModal'
|
||||||
|
|
||||||
function PageShell({ title, children }) {
|
function PageShell({ title, children }) {
|
||||||
return (
|
return (
|
||||||
<div className="min-h-screen bg-background text-white">
|
<div className="min-h-screen bg-paper text-ink2">
|
||||||
<header className="h-16 border-b border-white/5 flex items-center justify-between px-6">
|
<header className="h-16 border-b border-rule bg-paper flex items-center justify-between px-6">
|
||||||
<a href="#app" className="font-bold text-lg">OpenShorts</a>
|
<a href="#app" className="font-display lowercase text-lg text-ink">OpenShorts</a>
|
||||||
<a href="#app" className="text-sm text-zinc-400 hover:text-white">← Back to app</a>
|
<a href="#app" className="text-sm lowercase text-muted hover:text-ink transition-colors">← Back to app</a>
|
||||||
</header>
|
</header>
|
||||||
<main className="p-8">
|
<main className="p-8">
|
||||||
{title && <h1 className="text-3xl font-bold text-center mb-10">{title}</h1>}
|
{title && <h1 className="font-display lowercase text-3xl text-ink text-center mb-10">{title}</h1>}
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -27,8 +27,8 @@ function PageShell({ title, children }) {
|
||||||
function PricingView() {
|
function PricingView() {
|
||||||
const [showLogin, setShowLogin] = useState(false);
|
const [showLogin, setShowLogin] = useState(false);
|
||||||
return (
|
return (
|
||||||
<PageShell title="Choose your plan">
|
<PageShell>
|
||||||
<PricingSection onRequireLogin={() => setShowLogin(true)} />
|
<PricingPage onRequireLogin={() => setShowLogin(true)} />
|
||||||
{showLogin && <LoginModal onClose={() => setShowLogin(false)} />}
|
{showLogin && <LoginModal onClose={() => setShowLogin(false)} />}
|
||||||
</PageShell>
|
</PageShell>
|
||||||
);
|
);
|
||||||
|
|
@ -49,6 +49,8 @@ function Root() {
|
||||||
if (hash.startsWith('#/account')) return 'account';
|
if (hash.startsWith('#/account')) return 'account';
|
||||||
if (hash.startsWith('#/pricing')) return 'pricing';
|
if (hash.startsWith('#/pricing')) return 'pricing';
|
||||||
if (hash === '#legal') return 'legal';
|
if (hash === '#legal') return 'legal';
|
||||||
|
// #landing = explicit landing view (app logo); section anchors keep the landing mounted
|
||||||
|
if (['#landing', '#features', '#how-it-works', '#pricing', '#comparison', '#faq'].includes(hash)) return 'landing';
|
||||||
if (hash === '#app' || localStorage.getItem('openshorts_skip_landing') === '1') return 'app';
|
if (hash === '#app' || localStorage.getItem('openshorts_skip_landing') === '1') return 'app';
|
||||||
return 'landing';
|
return 'landing';
|
||||||
};
|
};
|
||||||
|
|
|
||||||
53
dashboard/src/tokens.css
Normal file
53
dashboard/src/tokens.css
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
/* Hallmark · genre: atmospheric · theme: lumen (night foundry) · design-system: design.md · designed-as-app
|
||||||
|
* macrostructure: Marquee Hero (marketing) / Workbench (app) / Long Document (content)
|
||||||
|
* nav: N9 edge-aligned · footer: Ft5 statement · enrichment: filament apparatus (landing only)
|
||||||
|
* pre-emit critique: P5 H4 E4 S5 R5 V4
|
||||||
|
*/
|
||||||
|
|
||||||
|
:root {
|
||||||
|
/* paper */
|
||||||
|
--color-paper: oklch(13% 0.014 265);
|
||||||
|
--color-paper-2: oklch(16.5% 0.015 265);
|
||||||
|
--color-paper-3: oklch(20% 0.016 265);
|
||||||
|
|
||||||
|
/* ink */
|
||||||
|
--color-ink: oklch(96% 0.006 262);
|
||||||
|
--color-ink-2: oklch(86% 0.01 262);
|
||||||
|
--color-muted: oklch(64% 0.012 262);
|
||||||
|
|
||||||
|
/* rules */
|
||||||
|
--color-rule: oklch(96% 0.006 262 / 0.08);
|
||||||
|
--color-rule-2: oklch(96% 0.006 262 / 0.14);
|
||||||
|
--rule-blueprint: oklch(96% 0.006 262 / 0.04);
|
||||||
|
|
||||||
|
/* accents */
|
||||||
|
--color-accent: oklch(76% 0.17 50);
|
||||||
|
--color-accent-ink: oklch(17% 0.03 50);
|
||||||
|
--color-accent-2: oklch(68% 0.16 18);
|
||||||
|
--color-glow: oklch(80% 0.16 50 / 0.42);
|
||||||
|
--color-paper-emit: oklch(76% 0.17 50 / 0.04);
|
||||||
|
--color-focus: oklch(76% 0.17 50);
|
||||||
|
|
||||||
|
/* states */
|
||||||
|
--color-ok: oklch(75% 0.11 150);
|
||||||
|
--color-danger: oklch(66% 0.18 25);
|
||||||
|
--color-warn: oklch(78% 0.14 75);
|
||||||
|
|
||||||
|
/* type */
|
||||||
|
--font-display: "Instrument Serif", ui-serif, Georgia, serif;
|
||||||
|
--font-body: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
|
||||||
|
--font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
|
||||||
|
--text-display: clamp(3rem, 6vw + 1rem, 6rem);
|
||||||
|
--tracking-display: -0.032em;
|
||||||
|
--tracking-micro: 0.10em;
|
||||||
|
|
||||||
|
/* geometry */
|
||||||
|
--radius-card: 10px;
|
||||||
|
--radius-input: 8px;
|
||||||
|
|
||||||
|
/* motion */
|
||||||
|
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
|
--dur-short: 220ms;
|
||||||
|
--dur-reveal: 600ms;
|
||||||
|
--dur-pulse: 4s;
|
||||||
|
}
|
||||||
|
|
@ -7,14 +7,57 @@ export default {
|
||||||
theme: {
|
theme: {
|
||||||
extend: {
|
extend: {
|
||||||
colors: {
|
colors: {
|
||||||
background: "#09090b",
|
// Lumen · Night Foundry — values mirror tokens.css (kept literal so
|
||||||
surface: "#18181b",
|
// Tailwind alpha modifiers like bg-brass/10 compile)
|
||||||
primary: "#3b82f6",
|
paper: "oklch(13% 0.014 265 / <alpha-value>)",
|
||||||
accent: "#8b5cf6",
|
paper2: "oklch(16.5% 0.015 265 / <alpha-value>)",
|
||||||
|
paper3: "oklch(20% 0.016 265 / <alpha-value>)",
|
||||||
|
ink: "oklch(96% 0.006 262 / <alpha-value>)",
|
||||||
|
ink2: "oklch(86% 0.01 262 / <alpha-value>)",
|
||||||
|
muted: "oklch(64% 0.012 262 / <alpha-value>)",
|
||||||
|
brass: "oklch(76% 0.17 50 / <alpha-value>)",
|
||||||
|
brassink: "oklch(17% 0.03 50 / <alpha-value>)",
|
||||||
|
coral: "oklch(68% 0.16 18 / <alpha-value>)",
|
||||||
|
ok: "oklch(75% 0.11 150 / <alpha-value>)",
|
||||||
|
warn: "oklch(78% 0.14 75 / <alpha-value>)",
|
||||||
|
danger: "oklch(66% 0.18 25 / <alpha-value>)",
|
||||||
|
// legacy aliases so untouched files degrade gracefully
|
||||||
|
background: "oklch(13% 0.014 265 / <alpha-value>)",
|
||||||
|
surface: "oklch(16.5% 0.015 265 / <alpha-value>)",
|
||||||
|
primary: "oklch(76% 0.17 50 / <alpha-value>)",
|
||||||
|
accent: "oklch(68% 0.16 18 / <alpha-value>)",
|
||||||
|
},
|
||||||
|
fontFamily: {
|
||||||
|
display: "var(--font-display)",
|
||||||
|
body: "var(--font-body)",
|
||||||
|
sans: "var(--font-body)",
|
||||||
|
serif: "var(--font-display)",
|
||||||
|
mono: "var(--font-mono)",
|
||||||
|
},
|
||||||
|
borderColor: {
|
||||||
|
rule: "var(--color-rule)",
|
||||||
|
rule2: "var(--color-rule-2)",
|
||||||
|
},
|
||||||
|
borderRadius: {
|
||||||
|
card: "var(--radius-card)",
|
||||||
|
input: "var(--radius-input)",
|
||||||
|
},
|
||||||
|
fontSize: {
|
||||||
|
micro: ["10.5px", { letterSpacing: "0.10em" }],
|
||||||
|
},
|
||||||
|
transitionTimingFunction: {
|
||||||
|
out: "var(--ease-out)",
|
||||||
},
|
},
|
||||||
animation: {
|
animation: {
|
||||||
'pulse-slow': 'pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite',
|
'pulse-slow': 'pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite',
|
||||||
}
|
'fade': 'fadeIn 0.4s var(--ease-out)',
|
||||||
|
},
|
||||||
|
keyframes: {
|
||||||
|
fadeIn: {
|
||||||
|
from: { opacity: '0' },
|
||||||
|
to: { opacity: '1' },
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [],
|
plugins: [],
|
||||||
|
|
|
||||||
168
design.md
Normal file
168
design.md
Normal file
|
|
@ -0,0 +1,168 @@
|
||||||
|
# Design — OpenShorts
|
||||||
|
|
||||||
|
A locked design system for this app (dashboard + landing). Every page redesign
|
||||||
|
reads this file before emitting code. Do not regenerate per page — extend or
|
||||||
|
amend this file when the system needs to grow.
|
||||||
|
|
||||||
|
Theme: **Lumen · Night Foundry** (Hallmark catalog, atmospheric genre).
|
||||||
|
Register: premium AI-tool instrument (Modal / Anthropic / ElevenLabs school).
|
||||||
|
The product's own numbers — timecodes, aspect ratios, clip counts, costs —
|
||||||
|
are the decoration: they render as UPPERCASE mono readouts.
|
||||||
|
|
||||||
|
## Genre
|
||||||
|
|
||||||
|
atmospheric
|
||||||
|
|
||||||
|
## Macrostructure family
|
||||||
|
|
||||||
|
- Marketing pages (Landing): **Marquee Hero, Lumen-canonical** — lowercase
|
||||||
|
serif headline hero-left with one coral verb-landmark, hand-built CSS
|
||||||
|
apparatus hero-right, meter strip below the fold, then sections with mono
|
||||||
|
eyebrows. Nav: N9 edge-aligned minimal. Footer: Ft5 Statement.
|
||||||
|
- App pages (dashboard tabs, modals): **Workbench** — small functional
|
||||||
|
headings, hairline cards lit from within, mono readouts, zero enrichment.
|
||||||
|
Function carries the page.
|
||||||
|
- Content pages (Legal): **Long Document** — single column, 65ch measure,
|
||||||
|
inline headings, typographic links.
|
||||||
|
|
||||||
|
## Theme tokens (Night Foundry)
|
||||||
|
|
||||||
|
- `--color-paper` oklch(13% 0.014 265) — page canvas, late-night violet
|
||||||
|
- `--color-paper-2` oklch(16.5% 0.015 265) — elevated surface (cards, modals, sidebar)
|
||||||
|
- `--color-paper-3` oklch(20% 0.016 265) — hover surface / inset chips
|
||||||
|
- `--color-ink` oklch(96% 0.006 262) — headlines, near-white
|
||||||
|
- `--color-ink-2` oklch(86% 0.01 262) — body text
|
||||||
|
- `--color-muted` oklch(64% 0.012 262) — secondary text
|
||||||
|
- `--color-rule` oklch(96% 0.006 262 / 0.08) — hairline borders
|
||||||
|
- `--color-rule-2` oklch(96% 0.006 262 / 0.14) — stronger hairline
|
||||||
|
- `--rule-blueprint` oklch(96% 0.006 262 / 0.04) — blueprint grid lines
|
||||||
|
- `--color-accent` oklch(76% 0.17 50) — molten brass (THE accent)
|
||||||
|
- `--color-accent-ink` oklch(17% 0.03 50) — text on brass fills
|
||||||
|
- `--color-accent-2` oklch(68% 0.16 18) — coral chord (verb landmark ONLY + rare secondary)
|
||||||
|
- `--color-glow` oklch(80% 0.16 50 / 0.42) — apparatus halo
|
||||||
|
- `--color-paper-emit` oklch(76% 0.17 50 / 0.04) — inner-emission wash
|
||||||
|
- `--color-focus` oklch(76% 0.17 50) — focus rings
|
||||||
|
- `--color-ok` oklch(75% 0.11 150) — success states
|
||||||
|
- `--color-warn` oklch(78% 0.14 75) — warnings (keys missing, low quota)
|
||||||
|
- `--color-danger` oklch(66% 0.18 25) — errors, destructive
|
||||||
|
|
||||||
|
Tailwind names: `paper, paper2, paper3, ink, ink2, muted, brass, brassink,
|
||||||
|
coral, ok, warn, danger` (+ legacy aliases `background→paper`, `surface→paper2`,
|
||||||
|
`primary→brass`, `accent→coral` so untouched files degrade gracefully).
|
||||||
|
Borders: use `border-rule` / `border-rule2` utilities (defined in index.css).
|
||||||
|
|
||||||
|
## Typography
|
||||||
|
|
||||||
|
- Display: **Instrument Serif 400**, `font-display`, always roman (never italic),
|
||||||
|
**lowercase**, tracking -0.032em, line-height 1.02.
|
||||||
|
- Body: **Geist** 400/500/600, `font-body`.
|
||||||
|
- Mono: **JetBrains Mono** 400/500, `font-mono` — UPPERCASE labels only.
|
||||||
|
- Two-register rule: UI prose (headings, buttons, nav, empty states, helper
|
||||||
|
text) renders **lowercase**; mono labels (eyebrows, badges, readouts, stat
|
||||||
|
labels, keyboard hints) render **UPPERCASE** 10.5–11px tracking 0.10em at
|
||||||
|
~55% opacity. That contrast is the typographic signature.
|
||||||
|
- **NEVER lowercase user content**: video titles, captions, transcripts,
|
||||||
|
descriptions, emails, API keys, log output, filenames, prices in legal copy.
|
||||||
|
Apply `lowercase` class per-element on UI chrome only — no global
|
||||||
|
text-transform on body.
|
||||||
|
- Numerals: `font-variant-numeric: tabular-nums` wherever numbers appear
|
||||||
|
(`tabular-nums` utility). Big stats: Instrument Serif + tabular-nums.
|
||||||
|
- Type scale anchor: `--text-display: clamp(3rem, 6vw + 1rem, 6rem)` (landing
|
||||||
|
hero only). App headings stay small: text-xl/2xl max, serif lowercase.
|
||||||
|
|
||||||
|
## Spacing
|
||||||
|
|
||||||
|
4-point scale via Tailwind defaults (p-2/3/4/6/8/12/16). No arbitrary
|
||||||
|
`text-[9px]`-style values — minimum readable label is 10.5px (`text-micro`
|
||||||
|
utility). Radii: `--radius-card: 10px` (rounded-card), `--radius-input: 8px`
|
||||||
|
(rounded-input), pills `rounded-full` for CTAs and status chips only.
|
||||||
|
|
||||||
|
## Motion
|
||||||
|
|
||||||
|
- Easings: `--ease-out: cubic-bezier(0.16, 1, 0.3, 1)` only. Never `ease`.
|
||||||
|
- Durations: 220ms UI state, 600ms section reveals, 4s apparatus pulse.
|
||||||
|
- Reveal pattern: fade only (`animate-fade`), optional 12px translateY on
|
||||||
|
section entry. No slide-ins, no bounce, no scale-pops.
|
||||||
|
- Cards hover: `translateY(-4px)` + inner-glow brighten, 220ms.
|
||||||
|
- Reduced motion: everything collapses to instant final state.
|
||||||
|
- Focus ring: 2px brass, appears INSTANTLY (never animated).
|
||||||
|
|
||||||
|
## Microinteractions stance
|
||||||
|
|
||||||
|
- Silent success (inline check, quiet state change) — never celebratory.
|
||||||
|
- Buttons: `active:translate-y-px`, no scale tricks.
|
||||||
|
- Hover tooltips delay 800ms; focus tooltips 0ms.
|
||||||
|
- Loaders: `Loader2` lucide spin is fine, tinted `text-muted` or `text-brass`.
|
||||||
|
|
||||||
|
## CTA voice
|
||||||
|
|
||||||
|
- Primary: `.btn-primary` — brass fill, `text-brassink`, `rounded-full`,
|
||||||
|
lowercase label, font-medium. One per view section.
|
||||||
|
- Secondary: `.btn-ghost` — hairline `border-rule2`, ink text, rounded-full.
|
||||||
|
- Tertiary/utility: `.btn-quiet` — `bg-paper3` fill, no border.
|
||||||
|
- Destructive: `.btn-danger` — danger outline, fills on hover.
|
||||||
|
- Labels are verbs, lowercase: "start clipping", "generate", "publish",
|
||||||
|
"download". Never "Get Started!", never Title Case.
|
||||||
|
|
||||||
|
## Component recipes (shared — use these, don't reinvent)
|
||||||
|
|
||||||
|
- `.card` — hairline border + inner emission (radial brass 4–5%), rounded-card,
|
||||||
|
bg-paper2. Hover variant `.card-hover` lifts and brightens. Replaces ALL
|
||||||
|
glass-panel / bg-surface/50 / backdrop-blur cards.
|
||||||
|
- `.eyebrow` — mono UPPERCASE micro label. Section pattern: eyebrow stacked
|
||||||
|
ABOVE the heading, same column (`01 · TOOLS` then the serif heading). Never
|
||||||
|
tag-left/heading-right.
|
||||||
|
- `<Modal>` from `src/components/ui/Modal.jsx` — the ONLY modal shell
|
||||||
|
(overlay plain `bg-black/70`, NO backdrop-blur; panel bg-paper2 hairline).
|
||||||
|
- `<SegmentedControl>` from `src/components/ui/SegmentedControl.jsx` — all
|
||||||
|
option-button grids (position/size/animation pickers, platform toggles).
|
||||||
|
Active state = brass hairline + paper3 fill + ink text. Never bg-white
|
||||||
|
text-black, never per-feature colors.
|
||||||
|
- `<StepIndicator>` from `src/components/ui/StepIndicator.jsx` — the single
|
||||||
|
wizard stepper (ThumbnailStudio + SaaShortsTab share it). Mono ordinals.
|
||||||
|
- `.input-field` — inset bg-paper, hairline, focus brass ring (redefined in
|
||||||
|
index.css; existing class name kept).
|
||||||
|
- `.readout` — mono UPPERCASE value chip for machine data (timecodes, costs,
|
||||||
|
ratios, model names): `00:42 · 9:16 · $0.65`.
|
||||||
|
- Status: `.badge-ok` / `.badge-warn` / `.badge-danger` — tinted 10% fills,
|
||||||
|
mono uppercase.
|
||||||
|
|
||||||
|
## What pages MUST share
|
||||||
|
|
||||||
|
- Single accent: brass. Coral ONLY as the headline verb-landmark (landing) and
|
||||||
|
at most one small secondary highlight per view. NOTHING ELSE gets a hue.
|
||||||
|
- Zero gradients (text or background). Zero glassmorphism / backdrop-blur
|
||||||
|
panels. Zero per-feature identity colors (the old violet/emerald/amber/teal
|
||||||
|
per-tab coding is retired — tools are differentiated by mono eyebrow ordinals
|
||||||
|
`01 · CLIPS`, `02 · AI SHORTS`, not by hue).
|
||||||
|
- The two-register typography (lowercase prose / UPPERCASE mono labels).
|
||||||
|
- The CTA voice, radii, hairline card language.
|
||||||
|
- English copy everywhere (ScheduleWeekModal migrates from Spanish).
|
||||||
|
- Lucide icons at 16–18px, `text-muted` default, brass when active.
|
||||||
|
|
||||||
|
## What pages MAY differ on
|
||||||
|
|
||||||
|
- Landing may use enrichment: ONE hand-built CSS apparatus (filament chamber
|
||||||
|
reading as a 9:16 clip instrument) + blueprint grid + meter strip. App pages
|
||||||
|
get NONE of these (no grid bg, no apparatus, no meter) — except ProcessingAnimation,
|
||||||
|
which keeps its scanner HUD but re-tinted to brass/ink tokens.
|
||||||
|
- Legal is typography-only.
|
||||||
|
|
||||||
|
## Hard bans (Lumen)
|
||||||
|
|
||||||
|
No italics anywhere. No gradient text. No gradient buttons. No backdrop-blur.
|
||||||
|
No glowing orbs. No invented metrics (existing cited stats/prices are the
|
||||||
|
brief's real copy — keep them). No emoji as icons in chrome (existing emoji
|
||||||
|
option labels in SaaShorts pickers may stay as content). No rounded-2xl
|
||||||
|
soup — use rounded-card/rounded-input/rounded-full deliberately. No
|
||||||
|
`bg-[#121214]`-style hardcoded colors — tokens only. No Title Case UI copy.
|
||||||
|
|
||||||
|
## Functional contract (NEVER break)
|
||||||
|
|
||||||
|
Hash routing (`#app`, `#/pricing`, `#/account`, `#legal`, `#features`,
|
||||||
|
`#how-it-works`, `#pricing`, `#comparison`, `#faq` anchors), `billingEnabled` /
|
||||||
|
`isManaged` / `isSignedIn` gating, all handlers and props, localStorage keys
|
||||||
|
(`gemini_key`, `uploadPostKey_v3`, `elevenLabsKey_v1`, `falKey_v1`,
|
||||||
|
`uploadUserId`, `openshorts_session`, `openshorts_auth`,
|
||||||
|
`openshorts_skip_landing`), API calls and BYOK headers, QuotaError flows,
|
||||||
|
Remotion preview/render wiring. Redesign is classes + markup structure only.
|
||||||
Loading…
Reference in a new issue