feat(dashboard): make the app usable on a phone

The dashboard was a desktop layout that merely survived a narrow viewport.
The changes below are interface only; no backend behaviour, request shape or
data changes.

Navigation. Below md the 80px icon rail is gone. It cost a fifth of a 360px
screen to show seven unlabelled glyphs. In its place: a bottom tab bar with
the four everyday destinations plus "more", and a drawer behind the header's
menu button carrying the full list. All three surfaces read one `navItems`
array, so they cannot drift. The tab bar is a flex sibling of the scrolling
pane rather than a fixed overlay, so no pane needs compensating padding and
nothing hides behind it. The header gains the section name the rail used to
carry, so a phone still knows where it is.

Shell. h-dvh where supported (100vh hides its own bottom bar behind mobile
browser chrome), body overflow-x hidden, and safe-area padding for the iOS
home indicator via viewport-fit=cover.

Touch and legibility. Inputs render at 16px below sm so iOS stops zooming on
focus and never zooming back; the shared button pills get a 44px floor on
coarse pointers; the 10.5px mono labels come up to 11.5px on phones.

Density. The clip-generator hero no longer fills the fold on its own. The log
terminal starts collapsed on phones. Result cards cap the 9:16 preview so the
title, captions and actions stay on the same screen as the clip. Modals become
bottom sheets below sm — a centred dialog with 4px side margins was wasting the
only width there was. Banners, the results toolbar and the social nudge stack
instead of crushing.

Also fixes three <div>-inside-<p> blocks in Settings that the browser was
silently tearing apart.
This commit is contained in:
juancarlos.cavero 2026-08-24 01:34:46 +02:00
parent 06984906e2
commit 3709d64085
14 changed files with 461 additions and 180 deletions

View file

@ -4,7 +4,11 @@
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<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" /> <!-- viewport-fit=cover so the bottom tab bar can pad itself past the iOS home
indicator with env(safe-area-inset-bottom); without it that inset reads 0. -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<meta name="theme-color" content="#0b0d12" />
<meta name="color-scheme" content="dark" />
<!-- Fonts: Lumen system (Instrument Serif display · Geist body · JetBrains Mono labels) --> <!-- 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.googleapis.com" />

View file

@ -1,5 +1,5 @@
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import { Upload, Sparkles, Youtube, Instagram, Share2, ChevronDown, Check, Activity, LayoutDashboard, Settings, Plus, History, X, Terminal, Shield, LayoutGrid, Image, Globe, RotateCcw, Calendar, AlertTriangle, KeyRound, Bot, Users, Smartphone, ExternalLink, Copy, CheckCircle2, Mail, Loader2, Download } from 'lucide-react'; import { Upload, Sparkles, Youtube, Instagram, Share2, ChevronDown, Check, Activity, LayoutDashboard, Settings, Plus, History, X, Terminal, Shield, LayoutGrid, Image, Globe, RotateCcw, Calendar, AlertTriangle, KeyRound, Bot, Users, Smartphone, ExternalLink, Copy, CheckCircle2, Mail, Loader2, Download, Menu } from 'lucide-react';
import KeyInput from './components/KeyInput'; import KeyInput from './components/KeyInput';
import MediaInput from './components/MediaInput'; import MediaInput from './components/MediaInput';
import ResultCard from './components/ResultCard'; import ResultCard from './components/ResultCard';
@ -108,16 +108,19 @@ const UserProfileSelector = ({ profiles, selectedUserId, onSelect, onConnect })
<div className="relative z-50"> <div className="relative z-50">
<button <button
onClick={() => setIsOpen(!isOpen)} onClick={() => setIsOpen(!isOpen)}
className="flex items-center justify-between bg-paper2 border border-rule2 rounded-input px-3 py-2 text-sm text-ink2 hover:bg-paper3 transition-colors min-w-[180px]" aria-label="social profile"
/* Phone: avatar + chevron only. A 180px pill next to the menu button,
the section title and the minutes meter overflowed a 360px header. */
className="flex items-center justify-between gap-1 bg-paper2 border border-rule2 rounded-input px-2 sm:px-3 py-2 text-sm text-ink2 hover:bg-paper3 transition-colors sm:min-w-[180px]"
> >
<span className="flex items-center gap-2"> <span className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-paper3 border border-rule flex items-center justify-center font-mono text-micro text-brass"> <div className="w-5 h-5 rounded-full bg-paper3 border border-rule flex items-center justify-center font-mono text-micro text-brass shrink-0">
{autoId ? "S" : (selectedProfile?.username?.substring(0, 1).toUpperCase() || "U")} {autoId ? "S" : (selectedProfile?.username?.substring(0, 1).toUpperCase() || "U")}
</div> </div>
{autoId ? ( {autoId ? (
<ProfileNetworkIcons profile={selectedProfile} size={13} /> <span className="hidden sm:flex"><ProfileNetworkIcons profile={selectedProfile} size={13} /></span>
) : ( ) : (
<span className="font-medium text-ink truncate max-w-[100px]">{selectedProfile?.username || "Select User"}</span> <span className="hidden sm:block font-medium text-ink truncate max-w-[100px]">{selectedProfile?.username || "Select User"}</span>
)} )}
</span> </span>
<ChevronDown size={14} className={`text-muted transition-transform ${isOpen ? 'rotate-180' : ''}`} /> <ChevronDown size={14} className={`text-muted transition-transform ${isOpen ? 'rotate-180' : ''}`} />
@ -245,9 +248,15 @@ function App() {
// Pre-flight quality gate: { info: {max_height, min_height, cookies_invalid}, data } // Pre-flight quality gate: { info: {max_height, min_height, cookies_invalid}, data }
const [qualityGate, setQualityGate] = useState(null); const [qualityGate, setQualityGate] = useState(null);
const [logs, setLogs] = useState([]); const [logs, setLogs] = useState([]);
const [logsVisible, setLogsVisible] = useState(true); // Collapsed on phones: the log tail is the least useful thing on a 360px
// screen and it was pushing the actual clips a full scroll down.
const [logsVisible, setLogsVisible] = useState(() => {
try { return window.innerWidth >= 768; } catch { return true; }
});
const [processingMedia, setProcessingMedia] = useState(null); const [processingMedia, setProcessingMedia] = useState(null);
const [activeTab, setActiveTab] = useState('dashboard'); // dashboard, settings const [activeTab, setActiveTab] = useState('dashboard'); // dashboard, settings
// Mobile only: the full nav lives in a drawer behind the header's menu button.
const [navOpen, setNavOpen] = useState(false);
// Reopened-project state (paid mode): per-clip {index, server_file, active_layers} // Reopened-project state (paid mode): per-clip {index, server_file, active_layers}
// restored from the backend so ResultCards resume editing where they left off. // restored from the backend so ResultCards resume editing where they left off.
const [projectState, setProjectState] = useState(null); const [projectState, setProjectState] = useState(null);
@ -854,98 +863,236 @@ function App() {
// --- UI Components --- // --- UI Components ---
const Sidebar = () => { // One nav definition drives all three surfaces: the desktop rail, the mobile
const navItems = [ // drawer, and the bottom tab bar. `short` is the tab-bar label — the full one
{ id: 'dashboard', ord: '01', icon: LayoutDashboard, label: 'Clip Generator' }, // wraps to two lines in a 5-up bar on a 360px phone.
{ id: 'saasshorts', ord: '02', icon: Sparkles, label: 'AI Shorts', byok: true }, const navItems = [
{ id: 'ai-agent', ord: '03', icon: Bot, label: 'AI Agent', byok: true }, { id: 'dashboard', ord: '01', icon: LayoutDashboard, label: 'Clip Generator', short: 'clips', primary: true },
{ id: 'ugc-gallery', ord: '04', icon: LayoutGrid, label: 'UGC Gallery' }, { id: 'saasshorts', ord: '02', icon: Sparkles, label: 'AI Shorts', short: 'ai shorts', byok: true, primary: true },
{ id: 'thumbnails', ord: '05', icon: Image, label: 'YouTube Studio' }, { id: 'ai-agent', ord: '03', icon: Bot, label: 'AI Agent', short: 'agent', byok: true },
...(billingEnabled && isSignedIn ? [{ id: 'history', ord: '06', icon: History, label: 'History' }] : []), { id: 'ugc-gallery', ord: '04', icon: LayoutGrid, label: 'UGC Gallery', short: 'gallery', primary: true },
{ id: 'settings', ord: '07', icon: Settings, label: 'Settings' }, { id: 'thumbnails', ord: '05', icon: Image, label: 'YouTube Studio', short: 'studio', primary: true },
]; ...(billingEnabled && isSignedIn ? [{ id: 'history', ord: '06', icon: History, label: 'History', short: 'history' }] : []),
{ id: 'settings', ord: '07', icon: Settings, label: 'Settings', short: 'settings' },
];
const activeNav = navItems.find((n) => n.id === activeTab);
return ( // Escape closes the mobile drawer. The shell itself is overflow-hidden, so
<div className="w-20 lg:w-64 bg-paper2 border-r border-rule flex flex-col h-full shrink-0 transition-all duration-300"> // there is no body scroll to lock behind it.
<a href="#landing" className="p-6 flex items-center gap-3" title="go to landing page"> useEffect(() => {
<div className="w-8 h-8 bg-paper3 rounded-input flex items-center justify-center shrink-0 overflow-hidden border border-rule"> if (!navOpen) return;
<img src="/logo-openshorts.png" alt="Logo" className="w-full h-full object-cover" /> const onKey = (e) => { if (e.key === 'Escape') setNavOpen(false); };
</div> document.addEventListener('keydown', onKey);
<span className="font-display lowercase text-lg text-ink hidden lg:block">openshorts</span> return () => document.removeEventListener('keydown', onKey);
}, [navOpen]);
const goToTab = (id) => { setActiveTab(id); setNavOpen(false); };
// Shared footer links (landing, repo, pricing, contact) — same list in the
// desktop rail and the mobile drawer, so they can never drift apart.
const NavFooterLinks = ({ collapsed = false }) => (
<>
<a
href="#landing"
className="flex items-center gap-2 px-3 py-2 text-xs lowercase text-muted hover:text-ink2 transition-colors"
>
<Globe size={14} className="shrink-0" />
<span className={collapsed ? 'hidden lg:block truncate' : 'truncate'}>landing page</span>
</a>
<a
href="https://github.com/mutonby/openshorts"
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-2 px-3 py-2 text-xs lowercase text-muted hover:text-ink2 transition-colors"
>
<svg height="14" viewBox="0 0 16 16" version="1.1" width="14" aria-hidden="true" fill="currentColor" className="shrink-0"><path fillRule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<span className={collapsed ? 'hidden lg:block truncate' : 'truncate'}>open source</span>
</a>
{billingEnabled && (
<a
href="#/pricing"
className="flex items-center gap-2 px-3 py-2 text-xs lowercase text-muted hover:text-ink2 transition-colors"
>
<Sparkles size={14} className="shrink-0" />
<span className={collapsed ? 'hidden lg:block truncate' : 'truncate'}>plans &amp; pricing</span>
</a> </a>
)}
<a
href="mailto:info@openshorts.app"
className="flex items-center gap-2 px-3 py-2 text-xs lowercase text-muted hover:text-ink2 transition-colors"
>
<Mail size={14} className="shrink-0" />
<span className={collapsed ? 'hidden lg:block truncate' : 'truncate'}>info@openshorts.app</span>
</a>
</>
);
<nav className="flex-1 px-4 py-4 space-y-1"> // Desktop rail: icon-only from md, labelled from lg. Below md it is gone
// entirely — an unlabelled 80px rail ate a fifth of a phone screen.
const Sidebar = () => (
<div className="hidden md:flex w-20 lg:w-64 bg-paper2 border-r border-rule flex-col h-full shrink-0 transition-all duration-300">
<a href="#landing" className="p-6 flex items-center gap-3" title="go to landing page">
<div className="w-8 h-8 bg-paper3 rounded-input flex items-center justify-center shrink-0 overflow-hidden border border-rule">
<img src="/logo-openshorts.png" alt="Logo" className="w-full h-full object-cover" />
</div>
<span className="font-display lowercase text-lg text-ink hidden lg:block">openshorts</span>
</a>
<nav className="flex-1 px-4 py-4 space-y-1">
{navItems.map((item) => {
const NavIcon = item.icon;
const isActive = activeTab === item.id;
return (
<button
key={item.id}
onClick={() => setActiveTab(item.id)}
title={item.label}
className={`relative w-full flex items-center gap-3 px-3 py-2.5 rounded-input transition-colors ${isActive ? 'bg-paper3 text-ink' : 'text-muted hover:text-ink2 hover:bg-paper3/50'}`}
>
{isActive && (
<span className="absolute left-0 top-1.5 bottom-1.5 w-0.5 bg-brass rounded-full" aria-hidden="true" />
)}
<NavIcon size={18} className={`shrink-0 ${isActive ? 'text-brass' : ''}`} />
<span className="text-sm lowercase hidden lg:block flex-1 text-left truncate">{item.label}</span>
{item.byok && <span className="readout hidden lg:block">BYOK</span>}
<span className="readout hidden lg:block">{item.ord}</span>
</button>
);
})}
</nav>
<div className="p-4 border-t border-rule space-y-1">
<NavFooterLinks collapsed />
</div>
</div>
);
// Mobile drawer: the complete nav, reachable from the header's menu button.
const MobileNavDrawer = () => (
<div
className="md:hidden fixed inset-0 z-[90] flex"
role="dialog"
aria-modal="true"
aria-label="Navigation"
>
<div
className="absolute inset-0 bg-black/60 animate-fade"
onClick={() => setNavOpen(false)}
aria-hidden="true"
/>
<div className="relative w-[17rem] max-w-[82vw] h-full bg-paper2 border-r border-rule flex flex-col animate-slide-in-left">
<div className="flex items-center justify-between px-5 h-14 border-b border-rule shrink-0">
<a href="#landing" className="flex items-center gap-2.5" onClick={() => setNavOpen(false)}>
<div className="w-7 h-7 bg-paper3 rounded-input overflow-hidden border border-rule shrink-0">
<img src="/logo-openshorts.png" alt="" className="w-full h-full object-cover" />
</div>
<span className="font-display lowercase text-lg text-ink">openshorts</span>
</a>
<button
onClick={() => setNavOpen(false)}
aria-label="close navigation"
className="p-2 -mr-2 text-muted hover:text-ink transition-colors"
>
<X size={18} />
</button>
</div>
<nav className="flex-1 overflow-y-auto custom-scrollbar px-3 py-3 space-y-1">
{navItems.map((item) => { {navItems.map((item) => {
const NavIcon = item.icon; const NavIcon = item.icon;
const isActive = activeTab === item.id; const isActive = activeTab === item.id;
return ( return (
<button <button
key={item.id} key={item.id}
onClick={() => setActiveTab(item.id)} onClick={() => goToTab(item.id)}
className={`relative w-full flex items-center gap-3 px-3 py-2.5 rounded-input transition-colors ${isActive ? 'bg-paper3 text-ink' : 'text-muted hover:text-ink2 hover:bg-paper3/50'}`} aria-current={isActive ? 'page' : undefined}
className={`relative w-full flex items-center gap-3 px-3 py-3 rounded-input transition-colors ${isActive ? 'bg-paper3 text-ink' : 'text-muted active:bg-paper3/60'}`}
> >
{isActive && ( {isActive && (
<span className="absolute left-0 top-1.5 bottom-1.5 w-0.5 bg-brass rounded-full" aria-hidden="true" /> <span className="absolute left-0 top-2 bottom-2 w-0.5 bg-brass rounded-full" aria-hidden="true" />
)} )}
<NavIcon size={18} className={`shrink-0 ${isActive ? 'text-brass' : ''}`} /> <NavIcon size={18} className={`shrink-0 ${isActive ? 'text-brass' : ''}`} />
<span className="text-sm lowercase hidden lg:block flex-1 text-left truncate">{item.label}</span> <span className="text-[0.95rem] lowercase flex-1 text-left truncate">{item.label}</span>
{item.byok && <span className="readout hidden lg:block">BYOK</span>} {item.byok && <span className="readout shrink-0">BYOK</span>}
<span className="readout hidden lg:block">{item.ord}</span>
</button> </button>
); );
})} })}
</nav> </nav>
<div className="p-4 border-t border-rule space-y-1"> <div className="px-3 py-3 border-t border-rule space-y-0.5 safe-bottom shrink-0">
<a <NavFooterLinks />
href="#landing"
className="flex items-center gap-2 px-3 py-1.5 text-xs lowercase text-muted hover:text-ink2 transition-colors"
>
<Globe size={14} className="shrink-0" />
<span className="hidden lg:block truncate">landing page</span>
</a>
<a
href="https://github.com/mutonby/openshorts"
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-2 px-3 py-1.5 text-xs lowercase text-muted hover:text-ink2 transition-colors"
>
<svg height="14" viewBox="0 0 16 16" version="1.1" width="14" aria-hidden="true" fill="currentColor" className="shrink-0"><path fillRule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<span className="hidden lg:block truncate">open source</span>
</a>
{billingEnabled && (
<a
href="#/pricing"
className="flex items-center gap-2 px-3 py-1.5 text-xs lowercase text-muted hover:text-ink2 transition-colors"
>
<Sparkles size={14} className="shrink-0" />
<span className="hidden lg:block truncate">plans &amp; pricing</span>
</a>
)}
<a
href="mailto:info@openshorts.app"
className="flex items-center gap-2 px-3 py-1.5 text-xs lowercase text-muted hover:text-ink2 transition-colors"
>
<Mail size={14} className="shrink-0" />
<span className="hidden lg:block truncate">info@openshorts.app</span>
</a>
</div> </div>
</div> </div>
</div>
);
// Bottom tab bar: the four everyday destinations plus "more" for the rest.
// It is a flex sibling of the scrolling pane rather than `fixed`, so nothing
// ever hides behind it and no pane needs compensating padding.
const MobileTabBar = () => {
const tabs = navItems.filter((n) => n.primary);
const moreActive = !tabs.some((t) => t.id === activeTab);
return (
<nav className="md:hidden shrink-0 border-t border-rule bg-paper2/95 backdrop-blur-sm safe-bottom">
<div className="flex items-stretch">
{tabs.map((item) => {
const NavIcon = item.icon;
const isActive = activeTab === item.id;
return (
<button
key={item.id}
onClick={() => goToTab(item.id)}
aria-current={isActive ? 'page' : undefined}
className={`flex-1 min-w-0 flex flex-col items-center justify-center gap-1 py-2 min-h-[56px] transition-colors ${isActive ? 'text-ink' : 'text-muted active:text-ink2'}`}
>
<NavIcon size={19} className={isActive ? 'text-brass' : ''} />
<span className="text-[10.5px] lowercase leading-none truncate max-w-full px-0.5">{item.short}</span>
</button>
);
})}
<button
onClick={() => setNavOpen(true)}
aria-label="more sections"
aria-expanded={navOpen}
className={`flex-1 min-w-0 flex flex-col items-center justify-center gap-1 py-2 min-h-[56px] transition-colors ${moreActive ? 'text-ink' : 'text-muted active:text-ink2'}`}
>
<Menu size={19} className={moreActive ? 'text-brass' : ''} />
<span className="text-[10.5px] lowercase leading-none">more</span>
</button>
</div>
</nav>
); );
}; };
return ( return (
<div className="flex h-screen bg-paper overflow-hidden"> /* h-dvh where supported: on mobile Safari/Chrome `100vh` is the tallest the
viewport ever gets, so a h-screen shell hides its own bottom bar behind
the browser chrome until the user scrolls. */
<div className="flex h-screen supports-[height:100dvh]:h-[100dvh] bg-paper overflow-hidden">
<Sidebar /> <Sidebar />
{navOpen && <MobileNavDrawer />}
<main className="flex-1 flex flex-col h-full overflow-hidden relative"> <main className="flex-1 min-w-0 flex flex-col h-full overflow-hidden relative">
{/* Top Header */} {/* Top Header */}
<header className="h-14 border-b border-rule bg-paper flex items-center justify-between px-6 shrink-0 z-10"> <header className="h-14 border-b border-rule bg-paper flex items-center justify-between gap-2 px-3 sm:px-6 shrink-0 z-10">
<div className="flex items-center gap-4"> <div className="flex items-center gap-2 sm:gap-4 min-w-0">
{/* Mobile: the drawer handle, and the section name the icon rail
used to carry. Without it a phone has no "where am I". */}
<button
onClick={() => setNavOpen(true)}
aria-label="open navigation"
className="md:hidden -ml-1 p-2 rounded-input text-muted active:bg-paper3 transition-colors shrink-0"
>
<Menu size={20} />
</button>
<span className="md:hidden font-display lowercase text-base text-ink truncate">
{activeNav?.label || 'openshorts'}
</span>
{status !== 'idle' && ( {status !== 'idle' && (
<button <button
onClick={handleReset} onClick={handleReset}
className="btn-quiet px-3 py-1.5 text-xs" className="btn-quiet px-3 py-1.5 text-xs shrink-0"
aria-label="New Project"
> >
<Plus size={14} /> <Plus size={14} />
<span className="hidden sm:inline">New Project</span> <span className="hidden sm:inline">New Project</span>
@ -953,7 +1100,7 @@ function App() {
)} )}
</div> </div>
<div className="flex items-center gap-4"> <div className="flex items-center gap-2 sm:gap-4 shrink-0">
{userProfiles.length > 0 && ( {userProfiles.length > 0 && (
<UserProfileSelector <UserProfileSelector
profiles={userProfiles} profiles={userProfiles}
@ -986,21 +1133,23 @@ function App() {
)} )}
{billingEnabled && isSignedIn && <ProfileMenu />} {billingEnabled && isSignedIn && <ProfileMenu />}
{/* Hidden below sm: the standing banner underneath already says the
same thing, and two warnings in a 360px header is just noise. */}
{keysMissing && ( {keysMissing && (
<button <button
onClick={() => (billingEnabled && !isSignedIn ? setShowLogin(true) : setActiveTab('settings'))} onClick={() => (billingEnabled && !isSignedIn ? setShowLogin(true) : setActiveTab('settings'))}
className="badge-warn hover:brightness-125 transition-all" className="badge-warn hover:brightness-125 transition-all hidden sm:inline-flex"
title="Configure API keys or choose a plan" title="Configure API keys or choose a plan"
> >
<AlertTriangle size={12} /> <AlertTriangle size={12} />
<span className="hidden sm:inline"> <span className="hidden md:inline">
{!apiKey && !uploadPostKey {!apiKey && !uploadPostKey
? 'Gemini & Upload-Post keys missing' ? 'Gemini & Upload-Post keys missing'
: !apiKey : !apiKey
? 'Gemini API Key Missing' ? 'Gemini API Key Missing'
: 'Upload-Post API Key Missing'} : 'Upload-Post API Key Missing'}
</span> </span>
<span className="sm:hidden">keys missing</span> <span className="md:hidden">keys missing</span>
</button> </button>
)} )}
</div> </div>
@ -1008,10 +1157,10 @@ function App() {
{/* Persistent Missing Keys Banner — visible on every screen */} {/* Persistent Missing Keys Banner — visible on every screen */}
{keysMissing && activeTab !== 'settings' && ( {keysMissing && activeTab !== 'settings' && (
<div className="mx-4 sm:mx-6 mt-3 px-4 py-3 bg-paper2 border border-rule rounded-card flex flex-wrap items-center justify-between gap-3 sm:gap-4 shrink-0 animate-fade"> <div className="mx-3 sm:mx-6 mt-3 px-3.5 sm:px-4 py-3 bg-paper2 border border-rule rounded-card flex flex-wrap items-center justify-between gap-2.5 sm:gap-4 shrink-0 animate-fade">
<div className="flex items-center gap-3 text-sm text-ink2"> <div className="flex items-start sm:items-center gap-2.5 sm:gap-3 text-sm text-ink2 min-w-0 flex-1">
<KeyRound size={16} className="shrink-0 text-warn" /> <KeyRound size={16} className="shrink-0 text-warn mt-0.5 sm:mt-0" />
<div> <div className="min-w-0">
<span className="font-medium text-ink">Required API keys missing.</span>{' '} <span className="font-medium text-ink">Required API keys missing.</span>{' '}
<span className="text-muted"> <span className="text-muted">
{!apiKey && !uploadPostKey {!apiKey && !uploadPostKey
@ -1024,7 +1173,7 @@ function App() {
</div> </div>
<button <button
onClick={() => setActiveTab('settings')} onClick={() => setActiveTab('settings')}
className="btn-quiet px-3 py-1.5 text-xs shrink-0" className="btn-quiet px-3 py-1.5 text-xs shrink-0 w-full sm:w-auto"
> >
Go to Settings Go to Settings
</button> </button>
@ -1033,14 +1182,18 @@ function App() {
{/* Session Recovery Banner */} {/* Session Recovery Banner */}
{sessionRecovered && ( {sessionRecovered && (
<div className="mx-6 mt-2 px-4 py-3 bg-paper2 border border-rule rounded-card flex items-center justify-between animate-fade shrink-0"> <div className="mx-3 sm:mx-6 mt-2 px-3.5 sm:px-4 py-3 bg-paper2 border border-rule rounded-card flex items-start justify-between gap-3 animate-fade shrink-0">
<div className="flex items-center gap-2 text-sm text-ink2"> <div className="flex items-start sm:items-center gap-2 text-sm text-ink2 flex-wrap min-w-0">
<RotateCcw size={16} className="text-brass" /> <RotateCcw size={16} className="text-brass shrink-0 mt-0.5 sm:mt-0" />
<span className="font-medium">Session recovered</span> <span className="font-medium">Session recovered</span>
<span className="text-muted text-xs">Your previous work has been restored.</span> <span className="text-muted text-xs">Your previous work has been restored.</span>
</div> </div>
<button onClick={() => setSessionRecovered(false)} className="text-muted hover:text-ink transition-colors"> <button
<X size={14} /> onClick={() => setSessionRecovered(false)}
aria-label="dismiss"
className="text-muted hover:text-ink transition-colors shrink-0 -m-1 p-1"
>
<X size={16} />
</button> </button>
</div> </div>
)} )}
@ -1141,7 +1294,7 @@ function App() {
Connect Connect
</button> </button>
</div> </div>
<p className="text-xs text-muted leading-relaxed"> <div className="text-xs text-muted leading-relaxed">
Connect your Upload-Post account to enable one-click publishing. Connect your Upload-Post account to enable one-click publishing.
<div className="mt-3 grid grid-cols-1 sm:grid-cols-3 gap-2"> <div className="mt-3 grid grid-cols-1 sm:grid-cols-3 gap-2">
<a href="https://app.upload-post.com/login" target="_blank" rel="noopener noreferrer" className="p-2 border border-rule rounded-input hover:bg-paper3 transition-colors flex flex-col gap-1"> <a href="https://app.upload-post.com/login" target="_blank" rel="noopener noreferrer" className="p-2 border border-rule rounded-input hover:bg-paper3 transition-colors flex flex-col gap-1">
@ -1161,7 +1314,7 @@ function App() {
<span className="text-muted"> <span className="text-muted">
Keys are only stored in your browser. They are sent to the backend only to process your request, never stored server-side. Keys are only stored in your browser. They are sent to the backend only to process your request, never stored server-side.
</span> </span>
</p> </div>
</div> </div>
</div> </div>
@ -1205,7 +1358,7 @@ function App() {
{elevenLabsSaved ? <><Check size={12} /> saved</> : 'Save'} {elevenLabsSaved ? <><Check size={12} /> saved</> : 'Save'}
</button> </button>
</div> </div>
<p className="text-xs text-muted leading-relaxed"> <div className="text-xs text-muted leading-relaxed">
Get your API key from ElevenLabs to enable video translation. Get your API key from ElevenLabs to enable video translation.
<div className="mt-3 grid grid-cols-1 sm:grid-cols-2 gap-2"> <div className="mt-3 grid grid-cols-1 sm:grid-cols-2 gap-2">
<a href="https://elevenlabs.io/sign-up" target="_blank" rel="noopener noreferrer" className="p-2 border border-rule rounded-input hover:bg-paper3 transition-colors flex flex-col gap-1"> <a href="https://elevenlabs.io/sign-up" target="_blank" rel="noopener noreferrer" className="p-2 border border-rule rounded-input hover:bg-paper3 transition-colors flex flex-col gap-1">
@ -1221,7 +1374,7 @@ function App() {
<span className="text-muted"> <span className="text-muted">
Keys are only stored in your browser. They are sent to the backend only to process your request, never stored server-side. Keys are only stored in your browser. They are sent to the backend only to process your request, never stored server-side.
</span> </span>
</p> </div>
</div> </div>
</div> </div>
@ -1263,7 +1416,7 @@ function App() {
{falSaved ? <><Check size={12} /> saved</> : 'Save'} {falSaved ? <><Check size={12} /> saved</> : 'Save'}
</button> </button>
</div> </div>
<p className="text-xs text-muted leading-relaxed"> <div className="text-xs text-muted leading-relaxed">
Get your API key from fal.ai to enable AI actor video generation. Get your API key from fal.ai to enable AI actor video generation.
<div className="mt-3 grid grid-cols-1 sm:grid-cols-2 gap-2"> <div className="mt-3 grid grid-cols-1 sm:grid-cols-2 gap-2">
<a href="https://fal.ai/dashboard/keys" target="_blank" rel="noopener noreferrer" className="p-2 border border-rule rounded-input hover:bg-paper3 transition-colors flex flex-col gap-1"> <a href="https://fal.ai/dashboard/keys" target="_blank" rel="noopener noreferrer" className="p-2 border border-rule rounded-input hover:bg-paper3 transition-colors flex flex-col gap-1">
@ -1279,7 +1432,7 @@ function App() {
<span className="text-muted"> <span className="text-muted">
Keys are only stored in your browser. Sent to backend only to process requests. Keys are only stored in your browser. Sent to backend only to process requests.
</span> </span>
</p> </div>
</div> </div>
</div> </div>
</div> </div>
@ -1409,7 +1562,7 @@ function App() {
{/* View: UGC Gallery */} {/* View: UGC Gallery */}
{activeTab === 'ugc-gallery' && ( {activeTab === 'ugc-gallery' && (
<div className="h-full overflow-y-auto custom-scrollbar animate-fade"> <div className="h-full overflow-y-auto custom-scrollbar animate-fade">
<div className="max-w-6xl mx-auto p-6 md:p-8"> <div className="max-w-6xl mx-auto p-4 sm:p-6 md:p-8">
<UGCGallery /> <UGCGallery />
</div> </div>
</div> </div>
@ -1418,7 +1571,7 @@ function App() {
{/* View: History */} {/* View: History */}
{activeTab === 'history' && ( {activeTab === 'history' && (
<div className="h-full overflow-y-auto custom-scrollbar animate-fade"> <div className="h-full overflow-y-auto custom-scrollbar animate-fade">
<div className="max-w-6xl mx-auto p-6 md:p-8"> <div className="max-w-6xl mx-auto p-4 sm:p-6 md:p-8">
<HistoryTab onReopenProject={restoreProject} /> <HistoryTab onReopenProject={restoreProject} />
</div> </div>
</div> </div>
@ -1447,21 +1600,24 @@ function App() {
{/* View: Dashboard (Idle) */} {/* View: Dashboard (Idle) */}
{activeTab === 'dashboard' && status === 'idle' && ( {activeTab === 'dashboard' && status === 'idle' && (
<div className="h-full overflow-y-auto custom-scrollbar animate-fade"> <div className="h-full overflow-y-auto custom-scrollbar animate-fade">
<div className="min-h-full flex flex-col items-center justify-center px-4 py-6 sm:p-6"> <div className="min-h-full flex flex-col items-center justify-center px-4 py-5 sm:p-6">
<div className="max-w-xl w-full text-center space-y-8"> {/* On a phone the hero used to fill the fold on its own and push
<div className="space-y-4"> the uploader — the whole point of the screen — below it. The
<p className="eyebrow">01 · CLIP GENERATOR</p> eyebrow, the display size and the gaps all shrink first. */}
<h1 className="font-display lowercase text-4xl md:text-5xl text-ink"> <div className="max-w-xl w-full text-center space-y-5 sm:space-y-8">
<div className="space-y-2.5 sm:space-y-4">
<p className="eyebrow hidden sm:block">01 · CLIP GENERATOR</p>
<h1 className="font-display lowercase text-3xl sm:text-4xl md:text-5xl text-ink">
Create Viral Shorts Create Viral Shorts
</h1> </h1>
<p className="text-muted text-lg"> <p className="text-muted text-[15px] sm:text-lg leading-snug sm:leading-normal max-w-sm sm:max-w-none mx-auto">
Drop your long-form video below to instantly generate viral clips with AI. Drop your long-form video below to instantly generate viral clips with AI.
</p> </p>
</div> </div>
<MediaInput onProcess={handleProcess} isProcessing={status === 'processing'} /> <MediaInput onProcess={handleProcess} isProcessing={status === 'processing'} />
<div className="flex flex-wrap items-center justify-center gap-4 sm:gap-8 text-muted text-sm"> <div className="flex flex-wrap items-center justify-center gap-4 sm:gap-8 text-muted text-xs sm:text-sm">
<span className="flex items-center gap-2"><Youtube size={16} /> YouTube</span> <span className="flex items-center gap-2"><Youtube size={16} /> YouTube</span>
<span className="flex items-center gap-2"><Instagram size={16} /> Instagram</span> <span className="flex items-center gap-2"><Instagram size={16} /> Instagram</span>
<span className="flex items-center gap-2"><TikTokIcon size={16} /> TikTok</span> <span className="flex items-center gap-2"><TikTokIcon size={16} /> TikTok</span>
@ -1473,11 +1629,11 @@ function App() {
{/* View: Processing / Results (Split View) */} {/* View: Processing / Results (Split View) */}
{activeTab === 'dashboard' && (status === 'processing' || status === 'complete' || status === 'error') && ( {activeTab === 'dashboard' && (status === 'processing' || status === 'complete' || status === 'error') && (
<div className="h-full flex flex-col md:flex-row gap-4 p-4 overflow-y-auto md:overflow-y-hidden custom-scrollbar animate-fade"> <div className="h-full flex flex-col md:flex-row gap-3 md:gap-4 p-3 md:p-4 overflow-y-auto md:overflow-y-hidden custom-scrollbar animate-fade">
{/* Left Panel: Preview & Status */} {/* Left Panel: Preview & Status */}
<div className={`${status === 'complete' ? 'w-full md:w-[30%] lg:w-[25%]' : 'w-full md:w-[55%] lg:w-[60%]'} md:h-full flex flex-col shrink-0 md:shrink card p-4 sm:p-6 overflow-y-auto custom-scrollbar transition-all duration-700 ease-in-out`}> <div className={`${status === 'complete' ? 'w-full md:w-[30%] lg:w-[25%]' : 'w-full md:w-[55%] lg:w-[60%]'} md:h-full flex flex-col shrink-0 md:shrink card p-3.5 sm:p-6 md:overflow-y-auto custom-scrollbar transition-all duration-700 ease-in-out`}>
<div className="mb-6 flex items-center justify-between"> <div className="mb-4 sm:mb-6 flex items-center justify-between gap-2">
<h2 className="text-sm font-medium text-ink lowercase flex items-center gap-2"> <h2 className="text-sm font-medium text-ink lowercase flex items-center gap-2">
<Activity className={`text-brass ${status === 'processing' ? 'animate-pulse' : ''}`} size={18} /> <Activity className={`text-brass ${status === 'processing' ? 'animate-pulse' : ''}`} size={18} />
Live Analysis Live Analysis
@ -1510,21 +1666,29 @@ function App() {
)} )}
{/* Logs Terminal */} {/* Logs Terminal */}
<div className={`bg-paper rounded-card border border-rule overflow-hidden flex flex-col transition-all duration-500 ${status === 'complete' ? 'h-32 min-h-0 opacity-50 hover:opacity-100' : 'flex-1 min-h-[200px]'}`}> <div className={`bg-paper rounded-card border border-rule overflow-hidden flex flex-col transition-all duration-500 ${status === 'complete' ? `min-h-0 opacity-50 hover:opacity-100 ${logsVisible ? 'h-32' : 'h-auto'}` : `flex-1 ${logsVisible ? 'min-h-[160px] sm:min-h-[200px]' : 'min-h-0 flex-none'}`}`}>
<div className="px-4 py-2 border-b border-rule flex items-center justify-between bg-paper2 shrink-0"> <button
type="button"
onClick={() => setLogsVisible(!logsVisible)}
aria-expanded={logsVisible}
className="w-full px-3.5 sm:px-4 py-2.5 border-b border-rule flex items-center justify-between gap-2 bg-paper2 shrink-0 text-left"
>
<span className="readout flex items-center gap-2"> <span className="readout flex items-center gap-2">
<Terminal size={12} /> System Logs <Terminal size={12} /> System Logs
</span> </span>
<button onClick={() => setLogsVisible(!logsVisible)} className="text-muted hover:text-ink transition-colors"> <span className="flex items-center gap-2 text-muted">
{logsVisible ? <ChevronDown size={14} /> : <ChevronDown size={14} className="rotate-180" />} {!logsVisible && logs.length > 0 && (
</button> <span className="readout normal-case">{logs.length}</span>
</div> )}
<ChevronDown size={16} className={logsVisible ? '' : 'rotate-180'} />
</span>
</button>
{logsVisible && ( {logsVisible && (
<div className="flex-1 p-4 overflow-y-auto font-mono text-xs space-y-1.5 custom-scrollbar text-muted"> <div className="flex-1 p-3.5 sm:p-4 overflow-y-auto font-mono text-[11px] sm:text-xs space-y-1.5 custom-scrollbar text-muted break-words">
{logs.map((log, i) => ( {logs.map((log, i) => (
<div key={i} className={`flex gap-2 ${log.toLowerCase().includes('error') ? 'text-danger' : 'text-muted'}`}> <div key={i} className={`flex gap-2 ${log.toLowerCase().includes('error') ? 'text-danger' : 'text-muted'}`}>
<span className="text-muted opacity-50 shrink-0">{new Date().toLocaleTimeString()}</span> <span className="text-muted opacity-50 shrink-0 hidden sm:inline">{new Date().toLocaleTimeString()}</span>
<span>{log}</span> <span className="min-w-0 break-words">{log}</span>
</div> </div>
))} ))}
{status === 'processing' && ( {status === 'processing' && (
@ -1536,21 +1700,26 @@ function App() {
</div> </div>
{/* Right Panel: Results Grid */} {/* Right Panel: Results Grid */}
<div className={`${status === 'complete' ? 'w-full md:w-[70%] lg:w-[75%]' : 'w-full md:w-[45%] lg:w-[40%]'} md:h-full flex flex-col shrink-0 md:shrink card p-4 sm:p-6 transition-all duration-700 ease-in-out`}> <div className={`${status === 'complete' ? 'w-full md:w-[70%] lg:w-[75%]' : 'w-full md:w-[45%] lg:w-[40%]'} md:h-full flex flex-col shrink-0 md:shrink card p-3.5 sm:p-6 transition-all duration-700 ease-in-out`}>
<h2 className="font-display lowercase text-xl text-ink mb-6 flex flex-wrap items-center gap-2 shrink-0"> {/* Title + counters on one row, the two actions on their own row
Generated Shorts below. Wrapping them all together dropped a lone half-width
{results?.clips?.length > 0 && ( "schedule week" pill under the title on a phone. */}
<span className="readout bg-paper3 px-2.5 py-1 rounded-full ml-auto"> <div className="mb-4 sm:mb-6 shrink-0 space-y-3">
{results.clips.length} Clips <h2 className="font-display lowercase text-lg sm:text-xl text-ink flex flex-wrap items-center gap-2">
</span> <span className="mr-auto">Generated Shorts</span>
)} {results?.clips?.length > 0 && (
{results?.cost_analysis && !isManaged && ( <span className="readout bg-paper3 px-2.5 py-1 rounded-full">
<span className="readout bg-paper3 px-2.5 py-1 rounded-full ml-2" title={`Input: ${results.cost_analysis.input_tokens} | Output: ${results.cost_analysis.output_tokens}`}> {results.clips.length} Clips
GEMINI · ${results.cost_analysis.total_cost.toFixed(5)} </span>
</span> )}
)} {results?.cost_analysis && !isManaged && (
<span className="readout bg-paper3 px-2.5 py-1 rounded-full" title={`Input: ${results.cost_analysis.input_tokens} | Output: ${results.cost_analysis.output_tokens}`}>
GEMINI · ${results.cost_analysis.total_cost.toFixed(5)}
</span>
)}
</h2>
{results?.clips?.length > 0 && status === 'complete' && ( {results?.clips?.length > 0 && status === 'complete' && (
<div className="flex items-center gap-2 ml-auto"> <div className="flex flex-col sm:flex-row sm:justify-end items-stretch sm:items-center gap-2">
<button <button
onClick={handleDownloadAll} onClick={handleDownloadAll}
disabled={downloadingAll} disabled={downloadingAll}
@ -1572,7 +1741,7 @@ function App() {
)} )}
</div> </div>
)} )}
</h2> </div>
{status === 'complete' && results?.clips?.length > 0 && ( {status === 'complete' && results?.clips?.length > 0 && (
<div className="mb-2 space-y-2"> <div className="mb-2 space-y-2">
@ -1592,14 +1761,29 @@ function App() {
publishing them is one connect away. Hidden once any publishing them is one connect away. Hidden once any
network is linked or the user dismisses it. */} network is linked or the user dismisses it. */}
{showSocialNudge && ( {showSocialNudge && (
<div className="w-full flex items-center gap-3 px-3 py-2.5 rounded-input bg-paper3 border border-rule text-sm"> <div className="w-full flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3 px-3 py-2.5 rounded-input bg-paper3 border border-rule text-sm">
<div className="flex-1 min-w-0"> <div className="flex items-start gap-3 flex-1 min-w-0">
<span className="text-ink">Publish these clips straight from here.</span>{' '} <div className="min-w-0 leading-relaxed">
<span className="text-muted">Connect your YouTube, TikTok or Instagram once — after that every clip is one click from posted.</span> <span className="text-ink">Publish these clips straight from here.</span>{' '}
<span className="text-muted">Connect your YouTube, TikTok or Instagram once — after that every clip is one click from posted.</span>
</div>
{/* On a phone the dismiss X rides the copy, so the CTA
below can run the full width of the card. */}
<button
onClick={() => {
track('SocialNudgeDismissed');
setSocialNudgeDismissed(true);
try { localStorage.setItem('os_social_nudge_dismissed', '1'); } catch (_) { /* ignore */ }
}}
aria-label="dismiss"
className="sm:hidden shrink-0 -m-1 p-1 text-muted hover:text-ink"
>
<X size={16} />
</button>
</div> </div>
<button <button
onClick={() => { track('SocialNudgeConnect'); handleConnectSocials(); }} onClick={() => { track('SocialNudgeConnect'); handleConnectSocials(); }}
className="btn-quiet shrink-0 text-xs py-1.5 px-3 lowercase" className="btn-quiet shrink-0 text-xs py-1.5 px-3 lowercase w-full sm:w-auto"
> >
connect socials → connect socials →
</button> </button>
@ -1610,7 +1794,7 @@ function App() {
try { localStorage.setItem('os_social_nudge_dismissed', '1'); } catch (_) { /* ignore */ } try { localStorage.setItem('os_social_nudge_dismissed', '1'); } catch (_) { /* ignore */ }
}} }}
aria-label="dismiss" aria-label="dismiss"
className="shrink-0 p-1 text-muted hover:text-ink" className="hidden sm:block shrink-0 p-1 text-muted hover:text-ink"
> >
<X size={14} /> <X size={14} />
</button> </button>
@ -1676,6 +1860,10 @@ function App() {
</div> </div>
{/* Phone navigation. A flex sibling of the scrolling pane, not a fixed
overlay, so content is never trapped behind it. */}
<MobileTabBar />
</main> </main>
{/* Missing API Key Modal */} {/* Missing API Key Modal */}

View file

@ -6,10 +6,10 @@ 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="card mx-6 mt-3 px-4 py-3 flex items-center justify-between gap-4 shrink-0 animate-fade"> <div className="card mx-3 sm:mx-6 mt-3 px-3.5 sm:px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-3 sm:gap-4 shrink-0 animate-fade">
<div className="flex items-center gap-3 text-sm"> <div className="flex items-start sm:items-center gap-2.5 sm:gap-3 text-sm min-w-0">
<KeyRound size={16} className="shrink-0 text-warn" /> <KeyRound size={16} className="shrink-0 text-warn mt-0.5 sm:mt-0" />
<div className="text-ink2 lowercase"> <div className="text-ink2 lowercase leading-relaxed min-w-0">
<span className="font-medium text-ink">Advanced tool.</span>{' '} <span className="font-medium text-ink">Advanced tool.</span>{' '}
{needsPlan {needsPlan
? <>Sign in with <span className="font-medium text-ink">Google</span> to unlock free. This tool also uses your own <span className="font-medium text-ink normal-case">fal.ai + ElevenLabs</span> keys (you pay those providers).</> ? <>Sign in with <span className="font-medium text-ink">Google</span> to unlock free. This tool also uses your own <span className="font-medium text-ink normal-case">fal.ai + ElevenLabs</span> keys (you pay those providers).</>
@ -18,7 +18,7 @@ export default function AdvancedBanner({ needsPlan, onKeys }) {
</div> </div>
<button <button
onClick={needsPlan ? () => { window.location.hash = '#/pricing'; } : onKeys} onClick={needsPlan ? () => { window.location.hash = '#/pricing'; } : onKeys}
className="btn-quiet shrink-0 text-xs px-3 py-1.5" className="btn-quiet shrink-0 text-xs px-3 py-1.5 w-full sm:w-auto"
> >
{needsPlan ? <>See plans <ArrowRight size={14} /></> : 'Add keys'} {needsPlan ? <>See plans <ArrowRight size={14} /></> : 'Add keys'}
</button> </button>

View file

@ -1092,11 +1092,16 @@ export default function ClipEditor({ jobId, clipIndex, clipTitle, onClose, onRer
<div className="px-4 sm:px-6 pt-4 pb-3 border-b border-rule flex items-start justify-between gap-4 shrink-0"> <div className="px-4 sm:px-6 pt-4 pb-3 border-b border-rule flex items-start justify-between gap-4 shrink-0">
<div className="min-w-0"> <div className="min-w-0">
<p className="eyebrow mb-1">EDITOR · CLIP {clipIndex + 1}</p> <p className="eyebrow mb-1">EDITOR · CLIP {clipIndex + 1}</p>
<h2 className="font-display lowercase text-2xl text-ink truncate">edit clip</h2> <h2 className="font-display lowercase text-xl sm:text-2xl text-ink truncate">edit clip</h2>
{clipTitle && <p className="text-xs text-muted truncate mt-0.5">{clipTitle}</p>} {clipTitle && <p className="text-xs text-muted truncate mt-0.5">{clipTitle}</p>}
{/* Phone: the readouts move under the title — as a third
column they squeezed the title to two characters. */}
<p className="readout sm:hidden mt-1 truncate">
{fmt(total)} · {needsSourcePath ? 'FULL RE-FRAME' : 'FAST RECUT'}
</p>
</div> </div>
<div className="flex items-center gap-3 shrink-0"> <div className="flex items-center gap-2 sm:gap-3 shrink-0">
<div className="text-right"> <div className="text-right hidden sm:block">
<p className="readout">DURATION · {fmt(total)}</p> <p className="readout">DURATION · {fmt(total)}</p>
<p className="readout mt-1"> <p className="readout mt-1">
{needsSourcePath ? 'PATH · FULL RE-FRAME' : 'PATH · FAST RECUT'} {needsSourcePath ? 'PATH · FULL RE-FRAME' : 'PATH · FAST RECUT'}
@ -1109,15 +1114,16 @@ export default function ClipEditor({ jobId, clipIndex, clipTitle, onClose, onRer
title={showSource title={showSource
? 'put the source monitor away and edit the clip on its own' ? 'put the source monitor away and edit the clip on its own'
: 'bring back the source monitor, its transcript and in/out marking'} : 'bring back the source monitor, its transcript and in/out marking'}
className="btn-quiet text-xs py-1.5 px-3 flex items-center gap-1.5 lowercase" aria-label={showSource ? 'hide source' : 'show source'}
className="btn-quiet text-xs py-1.5 px-2.5 sm:px-3 flex items-center gap-1.5 lowercase"
> >
{showSource ? <PanelLeftClose size={14} /> : <PanelLeft size={14} />} {showSource ? <PanelLeftClose size={14} /> : <PanelLeft size={14} />}
{showSource ? 'hide source' : 'show source'} <span className="hidden sm:inline">{showSource ? 'hide source' : 'show source'}</span>
</button> </button>
)} )}
{confirmClose ? ( {confirmClose ? (
<div className="flex items-center gap-2"> <div className="flex flex-wrap items-center justify-end gap-2">
<span className="text-xs text-warn lowercase">discard changes?</span> <span className="text-xs text-warn lowercase hidden sm:inline">discard changes?</span>
<button className="btn-danger text-xs py-1.5 px-3" onClick={onClose}>discard</button> <button className="btn-danger text-xs py-1.5 px-3" onClick={onClose}>discard</button>
<button className="btn-ghost text-xs py-1.5 px-3" onClick={() => setConfirmClose(false)}>keep editing</button> <button className="btn-ghost text-xs py-1.5 px-3" onClick={() => setConfirmClose(false)}>keep editing</button>
</div> </div>

View file

@ -228,7 +228,7 @@ export default function MediaInput({ onProcess, isProcessing }) {
}} }}
/> />
<span className="block font-mono text-sm leading-none">{f.label}</span> <span className="block font-mono text-sm leading-none">{f.label}</span>
<span className="block text-[10px] leading-tight text-center text-muted">{f.hint}</span> <span className="block text-[11px] sm:text-[10px] leading-tight text-center text-muted">{f.hint}</span>
</button> </button>
); );
})} })}
@ -249,7 +249,9 @@ export default function MediaInput({ onProcess, isProcessing }) {
)} )}
</button> </button>
{showAdvanced && ( {showAdvanced && (
<div className="mt-3 grid grid-cols-3 gap-2 animate-fade"> /* Stacked on a phone: three number fields side by side leaves
~100px each, which crushes both label and value. */
<div className="mt-3 grid grid-cols-1 sm:grid-cols-3 gap-3 sm:gap-2 animate-fade">
<div> <div>
<p className="eyebrow mb-1.5">clips to aim for</p> <p className="eyebrow mb-1.5">clips to aim for</p>
<input <input
@ -280,17 +282,17 @@ export default function MediaInput({ onProcess, isProcessing }) {
className="input-field" className="input-field"
/> />
</div> </div>
<p className="col-span-3 text-[11px] leading-relaxed text-muted"> <p className="col-span-1 sm:col-span-3 text-[11px] leading-relaxed text-muted">
Targets, not guarantees: the AI returns fewer clips when the Targets, not guarantees: the AI returns fewer clips when the
material doesn't hold them. Leave blank to let it decide. material doesn't hold them. Leave blank to let it decide.
</p> </p>
<div className="col-span-3 flex items-center justify-between gap-3 pt-1 border-t border-rule"> <div className="col-span-1 sm:col-span-3 flex flex-wrap items-center justify-between gap-3 pt-3 sm:pt-1 border-t border-rule">
<label className="flex items-center gap-2 text-xs text-ink2 cursor-pointer select-none"> <label className="flex items-center gap-2 text-xs text-ink2 cursor-pointer select-none">
<input <input
type="checkbox" type="checkbox"
checked={autoHook} checked={autoHook}
onChange={(e) => setAutoHook(e.target.checked)} onChange={(e) => setAutoHook(e.target.checked)}
className="accent-[var(--color-accent)] cursor-pointer" className="w-4 h-4 shrink-0 accent-[var(--color-accent)] cursor-pointer"
/> />
auto hook titles on clips auto hook titles on clips
</label> </label>
@ -313,12 +315,12 @@ export default function MediaInput({ onProcess, isProcessing }) {
)} )}
</div> </div>
<label className="flex items-start gap-2 mt-5 text-xs text-muted cursor-pointer select-none"> <label className="flex items-start gap-2.5 mt-5 text-left text-[13px] sm:text-xs leading-relaxed 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-[var(--color-accent)] cursor-pointer" className="mt-0.5 w-4 h-4 shrink-0 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="/terms" target="_blank" rel="noopener noreferrer" className="text-ink2 underline underline-offset-2 hover:text-brass transition-colors" onClick={(e) => e.stopPropagation()}>Terms</a> and <a href="/privacy" target="_blank" rel="noopener noreferrer" className="text-ink2 underline underline-offset-2 hover:text-brass transition-colors" onClick={(e) => e.stopPropagation()}>Privacy Policy</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="/terms" target="_blank" rel="noopener noreferrer" className="text-ink2 underline underline-offset-2 hover:text-brass transition-colors" onClick={(e) => e.stopPropagation()}>Terms</a> and <a href="/privacy" target="_blank" rel="noopener noreferrer" className="text-ink2 underline underline-offset-2 hover:text-brass transition-colors" onClick={(e) => e.stopPropagation()}>Privacy Policy</a>.

View file

@ -137,8 +137,10 @@ export default function ReframeEditor({ jobId, clipIndex, clipTitle, onClose, on
}; };
return ( return (
<div className="fixed inset-0 z-50 bg-black/80 flex items-center justify-center p-4"> /* Bottom sheet on a phone, centred dialog from sm — same shape as the
<div className="card w-full max-w-3xl max-h-[90vh] flex flex-col"> shared Modal so the app has one overlay idiom, not two. */
<div className="fixed inset-0 z-50 bg-black/80 flex items-end sm:items-center justify-center p-0 sm:p-4">
<div className="card w-full max-w-3xl max-h-[92vh] sm:max-h-[90vh] flex flex-col rounded-b-none sm:rounded-card animate-sheet-up sm:animate-none">
<div className="flex items-center justify-between p-4 border-b border-rule"> <div className="flex items-center justify-between p-4 border-b border-rule">
<div className="flex items-center gap-2.5 min-w-0"> <div className="flex items-center gap-2.5 min-w-0">
<Crosshair size={18} className="text-brass shrink-0" /> <Crosshair size={18} className="text-brass shrink-0" />
@ -152,7 +154,7 @@ export default function ReframeEditor({ jobId, clipIndex, clipTitle, onClose, on
</button> </button>
</div> </div>
<div className="flex-1 overflow-y-auto p-4 space-y-5"> <div className="flex-1 overflow-y-auto overscroll-contain custom-scrollbar p-4 space-y-5">
<p className="text-xs text-muted leading-relaxed"> <p className="text-xs text-muted leading-relaxed">
Play a scene to hear who is talking, then drag the rectangle over Play a scene to hear who is talking, then drag the rectangle over
the person you want. Each scene is one camera. Scenes you leave the person you want. Each scene is one camera. Scenes you leave
@ -191,13 +193,13 @@ export default function ReframeEditor({ jobId, clipIndex, clipTitle, onClose, on
))} ))}
</div> </div>
<div className="flex items-center justify-between gap-3 p-4 border-t border-rule"> <div className="flex flex-col sm:flex-row sm:items-center justify-between gap-3 p-4 border-t border-rule">
<span className="text-xs text-muted"> <span className="text-xs text-muted">
{adjusted === 0 {adjusted === 0
? 'nothing adjusted yet' ? 'nothing adjusted yet'
: `${adjusted} scene${adjusted > 1 ? 's' : ''} reframed by hand`} : `${adjusted} scene${adjusted > 1 ? 's' : ''} reframed by hand`}
</span> </span>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2 [&>button]:flex-1 sm:[&>button]:flex-none">
<button onClick={onClose} className="btn-quiet py-2 px-4 text-sm">cancel</button> <button onClick={onClose} className="btn-quiet py-2 px-4 text-sm">cancel</button>
<button <button
onClick={handleSave} onClick={handleSave}
@ -209,6 +211,7 @@ export default function ReframeEditor({ jobId, clipIndex, clipTitle, onClose, on
</button> </button>
</div> </div>
</div> </div>
<div className="sm:hidden safe-bottom" />
</div> </div>
</div> </div>
); );

View file

@ -11,7 +11,7 @@ import WatermarkModal, { watermarkNoticeDismissed } from './WatermarkModal';
import { useAuth } from '../contexts/AuthContext'; import { useAuth } from '../contexts/AuthContext';
import { renderInBrowser } from '../lib/renderInBrowser'; import { renderInBrowser } from '../lib/renderInBrowser';
const QUIET_BTN = 'group flex flex-col items-center justify-center gap-1 py-2 px-1 rounded-input border border-rule hover:bg-paper3 text-[11px] lowercase text-ink2 whitespace-nowrap transition-colors disabled:opacity-45 disabled:cursor-not-allowed'; const QUIET_BTN = 'group flex flex-col items-center justify-center gap-1 py-2.5 sm:py-2 px-1 rounded-input border border-rule hover:bg-paper3 text-[11px] lowercase text-ink2 whitespace-nowrap transition-colors disabled:opacity-45 disabled:cursor-not-allowed';
const PLATFORM_OPTIONS = [ const PLATFORM_OPTIONS = [
{ value: 'tiktok', label: 'tiktok', icon: <Video size={16} /> }, { value: 'tiktok', label: 'tiktok', icon: <Video size={16} /> },
@ -726,7 +726,11 @@ export default function ResultCard({ clip, index, jobId, durable, uploadPostKey,
return ( return (
<div className="card overflow-hidden flex flex-col md:flex-row group hover:border-rule2 transition-colors animate-fade md:min-h-[420px]" 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 md:min-h-[420px]" style={{ animationDelay: `${index * 0.1}s` }}>
{/* Left: Video Preview — 9:16 column matching the fixed card height */} {/* Left: Video Preview — 9:16 column matching the fixed card height */}
<div className="w-full md:w-[236px] bg-black relative shrink-0 aspect-[9/16] md:aspect-auto group/video"> {/* A full-width 9:16 preview on a phone is ~640px tall on its own,
which pushed the title, captions and every action off-screen.
Capping the height and centring keeps the whole card scannable
without letterboxing the clip. */}
<div className="w-full max-w-[calc(64vh*0.5625)] md:max-w-none mx-auto md:mx-0 md:w-[236px] bg-black relative shrink-0 aspect-[9/16] md:aspect-auto group/video">
<video <video
ref={videoRef} ref={videoRef}
src={playbackUrl} src={playbackUrl}
@ -899,7 +903,7 @@ export default function ResultCard({ clip, index, jobId, durable, uploadPostKey,
<button <button
onClick={() => setShowModal(true)} onClick={() => setShowModal(true)}
className="btn-primary flex-col gap-1 py-2 px-1 text-[11px] rounded-input whitespace-nowrap" className="btn-primary flex-col gap-1 py-2.5 sm:py-2 px-1 text-[11px] leading-none rounded-input whitespace-nowrap"
> >
<Share2 size={16} className="shrink-0" /> post <Share2 size={16} className="shrink-0" /> post
</button> </button>

View file

@ -434,7 +434,7 @@ export default function ThumbnailStudio({ geminiApiKey, uploadPostKey, uploadUse
}; };
return ( return (
<div className="h-full overflow-y-auto p-6 md:p-8 animate-fade"> <div className="h-full overflow-y-auto custom-scrollbar p-4 sm: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-end justify-between mb-2"> <div className="flex items-end justify-between mb-2">

View file

@ -6,10 +6,10 @@ import { Sparkles, ArrowRight } from 'lucide-react';
// only fires for signed-out or magic-link-only accounts. // only fires for signed-out or magic-link-only accounts.
export default function TrialGate({ toolName = 'this' }) { export default function TrialGate({ toolName = 'this' }) {
return ( return (
<div className="card mx-6 mt-3 px-4 py-3 flex items-center justify-between gap-4 shrink-0 animate-fade"> <div className="card mx-3 sm:mx-6 mt-3 px-3.5 sm:px-4 py-3 flex flex-col sm:flex-row sm:items-center justify-between gap-3 sm:gap-4 shrink-0 animate-fade">
<div className="flex items-center gap-3 text-sm"> <div className="flex items-start sm:items-center gap-2.5 sm:gap-3 text-sm min-w-0">
<Sparkles size={16} className="shrink-0 text-brass" /> <Sparkles size={16} className="shrink-0 text-brass mt-0.5 sm:mt-0" />
<div className="text-ink2 lowercase"> <div className="text-ink2 lowercase leading-relaxed min-w-0">
<span className="font-medium text-ink">Preview mode.</span>{' '} <span className="font-medium text-ink">Preview mode.</span>{' '}
Sign in with <span className="font-medium text-ink">Google</span> to use {toolName} free — Sign in with <span className="font-medium text-ink">Google</span> to use {toolName} free —
20 min/month, no credit card. <span className="text-muted">Or run it free by self-hosting.</span> 20 min/month, no credit card. <span className="text-muted">Or run it free by self-hosting.</span>
@ -17,7 +17,7 @@ export default function TrialGate({ toolName = 'this' }) {
</div> </div>
<button <button
onClick={() => { window.location.hash = '#/pricing'; }} onClick={() => { window.location.hash = '#/pricing'; }}
className="btn-primary shrink-0 text-xs px-4 py-2" className="btn-primary shrink-0 text-xs px-4 py-2 w-full sm:w-auto"
> >
Start free <ArrowRight size={14} /> Start free <ArrowRight size={14} />
</button> </button>

View file

@ -59,7 +59,7 @@ export default function UGCGallery() {
</div> </div>
{/* Tabs */} {/* Tabs */}
<div className="max-w-xs"> <div className="max-w-xs w-full">
<SegmentedControl <SegmentedControl
size="sm" size="sm"
value={tab} value={tab}
@ -79,7 +79,7 @@ export default function UGCGallery() {
<p className="text-sm text-muted lowercase">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-2 sm:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-3">
{videos.map((video) => ( {videos.map((video) => (
<VideoCard key={video.video_id} video={video} copied={copied} onCopy={handleCopy} /> <VideoCard key={video.video_id} video={video} copied={copied} onCopy={handleCopy} />
))} ))}
@ -95,7 +95,7 @@ export default function UGCGallery() {
<p className="text-sm text-muted lowercase">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 gap-3"> <div className="grid grid-cols-2 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} />
))} ))}

View file

@ -24,36 +24,47 @@ export default function Modal({ isOpen, onClose, title, eyebrow, size = 'md', ch
if (!isOpen) return null; if (!isOpen) return null;
return ( return (
/* Phone: a bottom sheet — anchored to the thumb, edge to edge, and free to
run taller than a centred dialog whose 4px side margins wasted the only
width there was. From sm up it is the centred dialog it always was. */
<div <div
className="fixed inset-0 z-[100] flex items-center justify-center bg-black/70 p-4 animate-fade" className="fixed inset-0 z-[100] flex items-end sm:items-center justify-center bg-black/70 p-0 sm:p-4 animate-fade"
onMouseDown={(e) => { if (e.target === e.currentTarget && onClose) onClose(); }} onMouseDown={(e) => { if (e.target === e.currentTarget && onClose) onClose(); }}
role="dialog" role="dialog"
aria-modal="true" aria-modal="true"
> >
<div className={`card relative w-full ${SIZES[size] || SIZES.md} max-h-[90vh] flex flex-col`}> <div
className={`card relative w-full ${SIZES[size] || SIZES.md} max-h-[92vh] sm:max-h-[90vh] flex flex-col
rounded-b-none sm:rounded-card animate-sheet-up sm:animate-none`}
>
{/* Grab handle: the affordance that says "this sheet closes downward". */}
<div className="sm:hidden pt-2.5 pb-1 flex justify-center shrink-0" aria-hidden="true">
<span className="w-9 h-1 rounded-full bg-[color:var(--color-rule-2)]" />
</div>
{!hideClose && onClose && ( {!hideClose && onClose && (
<button <button
onClick={onClose} onClick={onClose}
aria-label="close" 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" className="absolute top-3 right-3 sm:top-4 sm:right-4 z-10 p-2 rounded-full text-muted hover:text-ink hover:bg-paper3 transition-colors"
> >
<X size={16} /> <X size={18} />
</button> </button>
)} )}
{(title || eyebrow) && ( {(title || eyebrow) && (
<div className="px-4 sm:px-6 pt-6 pb-4 border-b border-rule shrink-0"> <div className="px-4 sm:px-6 pt-3 sm:pt-6 pb-4 border-b border-rule shrink-0">
{eyebrow && <p className="eyebrow mb-1.5">{eyebrow}</p>} {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>} {title && <h2 className="font-display lowercase text-xl sm:text-2xl text-ink leading-tight break-words pr-10">{title}</h2>}
</div> </div>
)} )}
<div className="px-4 sm:px-6 py-5 overflow-y-auto custom-scrollbar grow"> <div className="px-4 sm:px-6 py-5 overflow-y-auto overscroll-contain custom-scrollbar grow">
{children} {children}
</div> </div>
{footer && ( {footer && (
<div className="px-4 sm:px-6 py-4 border-t border-rule shrink-0"> <div className="px-4 sm:px-6 py-4 border-t border-rule shrink-0 safe-bottom">
{footer} {footer}
</div> </div>
)} )}
{!footer && <div className="sm:hidden safe-bottom" />}
</div> </div>
</div> </div>
); );

View file

@ -6,10 +6,34 @@
@tailwind utilities; @tailwind utilities;
@layer base { @layer base {
html {
/* momentum scrolling inside the app's panes, and no rubber-band on the shell */
-webkit-text-size-adjust: 100%;
}
body { body {
@apply bg-paper text-ink2 antialiased; @apply bg-paper text-ink2 antialiased;
font-family: var(--font-body); font-family: var(--font-body);
font-variant-numeric: tabular-nums; font-variant-numeric: tabular-nums;
/* A single stray wide child (a log line, a long URL) used to make the whole
app pan sideways on a phone. Panes that really are wide scroll on their own. */
overflow-x: hidden;
}
/* Touch: iOS zooms the page whenever a focused field renders below 16px, and
it never zooms back out. Lift every text control to 16px on small screens —
Tailwind's text-sm/xs on inputs is what triggers it. */
@media (max-width: 639px) {
input:not([type='checkbox']):not([type='radio']):not([type='range']),
select,
textarea {
font-size: 16px;
}
}
/* Kill the 300ms tap flash on Android/iOS — it reads as lag on every button. */
button, a, [role='button'] {
-webkit-tap-highlight-color: transparent;
} }
::selection { ::selection {
@ -142,6 +166,34 @@
@media (max-width: 379px) { @media (max-width: 379px) {
.btn-primary, .btn-ghost { padding-left: 1rem; padding-right: 1rem; } .btn-primary, .btn-ghost { padding-left: 1rem; padding-right: 1rem; }
} }
/* Touch: 44px is the Apple/WCAG hit-target floor. The quiet/danger pills sit
at ~34px from their padding alone, which is a miss on a phone. Only the
shared pills are lifted — blanket-sizing every <button> would stretch the
icon rows inside the clip cards. */
@media (pointer: coarse) {
.btn-primary, .btn-ghost, .btn-quiet, .btn-danger { min-height: 44px; }
}
/* App shell helpers ------------------------------------------------------ */
/* Pads past the iOS home indicator (needs viewport-fit=cover in index.html).
A spacer rather than `padding-bottom`: Tailwind's utilities layer is emitted
after components, so a `py-4` on the same element would win outright and
silently drop the inset. This adds to whatever padding is already there. */
.safe-bottom::after {
content: '';
display: block;
width: 100%;
height: env(safe-area-inset-bottom, 0px);
}
/* Phone type: the muted grey reads fine at desktop distance but loses too
much on a small bright screen, and 10.5px mono labels turn to texture. */
@media (max-width: 639px) {
.readout { font-size: 11.5px; letter-spacing: 0.06em; }
.eyebrow { font-size: 11.5px; letter-spacing: 0.08em; opacity: 0.7; }
}
} }
/* Custom Scrollbar */ /* Custom Scrollbar */

View file

@ -13,12 +13,12 @@ import LoginModal from './components/LoginModal'
function PageShell({ title, children }) { function PageShell({ title, children }) {
return ( return (
<div className="min-h-screen bg-paper text-ink2"> <div className="min-h-screen bg-paper text-ink2">
<header className="h-16 border-b border-rule bg-paper flex items-center justify-between px-6"> <header className="h-14 sm:h-16 border-b border-rule bg-paper flex items-center justify-between gap-3 px-4 sm:px-6 sticky top-0 z-20">
<a href="#app" className="font-display lowercase text-lg text-ink">OpenShorts</a> <a href="#app" className="font-display lowercase text-lg text-ink truncate">OpenShorts</a>
<a href="#app" className="text-sm lowercase text-muted hover:text-ink transition-colors">← Back to app</a> <a href="#app" className="text-sm lowercase text-muted hover:text-ink transition-colors shrink-0">← <span className="hidden sm:inline">Back to app</span><span className="sm:hidden">back</span></a>
</header> </header>
<main className="p-8"> <main className="p-4 sm:p-6 md:p-8 pb-[max(2rem,env(safe-area-inset-bottom))]">
{title && <h1 className="font-display lowercase text-3xl text-ink text-center mb-10">{title}</h1>} {title && <h1 className="font-display lowercase text-2xl sm:text-3xl text-ink text-center mb-6 sm:mb-10">{title}</h1>}
{children} {children}
</main> </main>
</div> </div>

View file

@ -51,12 +51,23 @@ export default {
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)', 'fade': 'fadeIn 0.4s var(--ease-out)',
// mobile shell: the nav drawer flies in from the edge, sheets rise
'slide-in-left': 'slideInLeft 0.24s var(--ease-out)',
'sheet-up': 'sheetUp 0.26s var(--ease-out)',
}, },
keyframes: { keyframes: {
fadeIn: { fadeIn: {
from: { opacity: '0' }, from: { opacity: '0' },
to: { opacity: '1' }, to: { opacity: '1' },
}, },
slideInLeft: {
from: { transform: 'translateX(-100%)' },
to: { transform: 'translateX(0)' },
},
sheetUp: {
from: { transform: 'translateY(12px)', opacity: '0' },
to: { transform: 'translateY(0)', opacity: '1' },
},
}, },
}, },
}, },