mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
baseline style
This commit is contained in:
1 parent
37c16f54ef
commit
03109e63b5
7 files changed
+512
-177
No files matched your search
+49
-28
@@ -57,41 +57,51 @@ export default function Index() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-background">
|
||||
<div className="container mx-auto px-4 py-8">
|
||||
<div className="min-h-dvh bg-gradient-to-br from-primary/5 to-accent/5">
|
||||
<div className="container mx-auto px-4 py-6 md:py-8">
|
||||
<div className="max-w-4xl mx-auto">
|
||||
<div className="text-center mb-12">
|
||||
<h1 className="text-4xl font-bold mb-4">Shakespeare</h1>
|
||||
<p className="text-xl text-muted-foreground mb-2">
|
||||
<div className="text-center mb-8 md:mb-12">
|
||||
<div className="text-4xl md:text-6xl mb-4 md:mb-6">🎭</div>
|
||||
<h1 className="text-3xl md:text-4xl font-bold mb-3 md:mb-4 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
||||
Shakespeare
|
||||
</h1>
|
||||
<p className="text-lg md:text-xl text-muted-foreground mb-2">
|
||||
Build custom Nostr websites with AI assistance
|
||||
</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
<a href="https://soapbox.pub/mkstack" className="hover:underline">
|
||||
<a href="https://soapbox.pub/mkstack" className="hover:underline focus-ring text-primary">
|
||||
Vibed with MKStack
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="mb-12">
|
||||
<Card>
|
||||
<div className="mb-8 md:mb-12">
|
||||
<Card className="bg-gradient-to-br from-card to-card/50 border-primary/20 shadow-lg">
|
||||
<CardHeader>
|
||||
<CardTitle>Create a New Project</CardTitle>
|
||||
<CardDescription>
|
||||
Describe what kind of Nostr website you want to build
|
||||
</CardDescription>
|
||||
<div className="flex items-center gap-3 mb-2">
|
||||
<div className="p-2 bg-primary/10 rounded-lg">
|
||||
<Plus className="h-5 w-5 text-primary" />
|
||||
</div>
|
||||
<div>
|
||||
<CardTitle className="text-xl">Create a New Project</CardTitle>
|
||||
<CardDescription className="text-base">
|
||||
Describe what kind of Nostr website you want to build
|
||||
</CardDescription>
|
||||
</div>
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<Textarea
|
||||
placeholder="e.g., Create a farming equipment marketplace for local farmers to buy and sell tractors, tools, and supplies..."
|
||||
value={prompt}
|
||||
onChange={(e) => setPrompt(e.target.value)}
|
||||
className="min-h-[100px]"
|
||||
className="min-h-[120px] touch-action-manipulation overscroll-contain text-base leading-relaxed"
|
||||
disabled={isCreating}
|
||||
/>
|
||||
<Button
|
||||
onClick={handleCreateProject}
|
||||
disabled={!prompt.trim() || isCreating}
|
||||
className="w-full"
|
||||
className="w-full focus-ring bg-gradient-to-r from-primary to-primary/90 hover:from-primary/90 hover:to-primary/80 shadow-lg"
|
||||
size="lg"
|
||||
>
|
||||
{isCreating ? (
|
||||
@@ -111,13 +121,13 @@ export default function Index() {
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<h2 className="text-2xl font-semibold mb-6">Your Projects</h2>
|
||||
<h2 className="text-xl md:text-2xl font-semibold mb-4 md:mb-6">Your Projects</h2>
|
||||
|
||||
{isLoading ? (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{[...Array(6)].map((_, i) => (
|
||||
<Card key={i}>
|
||||
<CardContent className="p-6">
|
||||
<CardContent className="p-4 md:p-6">
|
||||
<Skeleton className="h-4 w-3/4 mb-2" />
|
||||
<Skeleton className="h-3 w-1/2" />
|
||||
</CardContent>
|
||||
@@ -125,26 +135,37 @@ export default function Index() {
|
||||
))}
|
||||
</div>
|
||||
) : projects.length === 0 ? (
|
||||
<div className="text-center py-12">
|
||||
<Folder className="mx-auto h-12 w-12 text-muted-foreground mb-4" />
|
||||
<p className="text-muted-foreground">No projects yet. Create your first project above!</p>
|
||||
</div>
|
||||
<Card className="bg-gradient-to-br from-muted/50 to-muted/20 border-dashed border-2 border-muted-foreground/20">
|
||||
<CardContent className="text-center py-8 md:py-12">
|
||||
<div className="flex items-center justify-center gap-2 mb-4">
|
||||
<Folder className="h-10 w-10 md:h-12 md:w-12 text-muted-foreground" />
|
||||
</div>
|
||||
<p className="text-muted-foreground text-sm md:text-base">No projects yet. Create your first project above!</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
) : (
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
{projects.map((project) => (
|
||||
<Card
|
||||
key={project.id}
|
||||
className="cursor-pointer hover:shadow-lg transition-shadow"
|
||||
className="cursor-pointer hover:shadow-xl hover:shadow-primary/10 transition-all duration-300 focus-ring bg-gradient-to-br from-card to-card/80 border-primary/10 hover:border-primary/20 hover:scale-[1.02]"
|
||||
onClick={() => handleProjectClick(project.id)}
|
||||
tabIndex={0}
|
||||
onKeyDown={(e) => {
|
||||
if (e.key === 'Enter' || e.key === ' ') {
|
||||
e.preventDefault();
|
||||
handleProjectClick(project.id);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<CardHeader>
|
||||
<CardTitle className="text-lg">{project.name}</CardTitle>
|
||||
<CardDescription>
|
||||
<CardHeader className="pb-2">
|
||||
<CardTitle className="text-base md:text-lg">{project.name}</CardTitle>
|
||||
<CardDescription className="text-sm">
|
||||
Created {project.createdAt.toLocaleDateString()}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
<CardContent className="pt-0">
|
||||
<p className="text-xs md:text-sm text-muted-foreground">
|
||||
Last modified {project.lastModified.toLocaleDateString()}
|
||||
</p>
|
||||
</CardContent>
|
||||
|
||||
@@ -5,17 +5,20 @@ import { useProjectsManager } from '@/hooks/useProjectsManager';
|
||||
import { ChatPane } from '@/components/Shakespeare/ChatPane';
|
||||
import { PreviewPane } from '@/components/Shakespeare/PreviewPane';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { ArrowLeft } from 'lucide-react';
|
||||
import { ArrowLeft, MessageSquare, Eye, Code } from 'lucide-react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { AISettingsDialog } from '@/components/ai/AISettingsDialog';
|
||||
import { useIsMobile } from '@/hooks/useIsMobile';
|
||||
|
||||
export function ProjectView() {
|
||||
const { projectId } = useParams<{ projectId: string }>();
|
||||
const [project, setProject] = useState<Project | null>(null);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [activeTab, setActiveTab] = useState<'preview' | 'code'>('preview');
|
||||
const [mobileView, setMobileView] = useState<'chat' | 'preview' | 'code'>('preview');
|
||||
const projectsManager = useProjectsManager();
|
||||
const navigate = useNavigate();
|
||||
const isMobile = useIsMobile();
|
||||
|
||||
const loadProject = useCallback(async () => {
|
||||
if (!projectId) return;
|
||||
@@ -56,9 +59,76 @@ export function ProjectView() {
|
||||
);
|
||||
}
|
||||
|
||||
if (isMobile) {
|
||||
return (
|
||||
<div className="h-dvh flex flex-col bg-background">
|
||||
<header className="border-b bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10 backdrop-blur supports-[backdrop-filter]:bg-gradient-to-r supports-[backdrop-filter]:from-primary/10 supports-[backdrop-filter]:via-accent/5 supports-[backdrop-filter]:to-primary/10 px-4 py-3 flex items-center justify-between">
|
||||
<div className="flex items-center space-x-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => navigate('/')}
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
</Button>
|
||||
<div className="min-w-0 flex-1">
|
||||
<h1 className="text-sm font-semibold truncate">{project.name}</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<AISettingsDialog />
|
||||
</header>
|
||||
|
||||
<div className="flex-1 overflow-hidden">
|
||||
{mobileView === 'chat' && (
|
||||
<ChatPane projectId={project.id} projectName={project.name} />
|
||||
)}
|
||||
{(mobileView === 'preview' || mobileView === 'code') && (
|
||||
<PreviewPane
|
||||
projectId={project.id}
|
||||
activeTab={mobileView}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="border-t bg-gradient-to-r from-primary/5 via-background to-accent/5 backdrop-blur">
|
||||
<div className="flex">
|
||||
<Button
|
||||
variant={mobileView === 'chat' ? 'default' : 'ghost'}
|
||||
size="sm"
|
||||
onClick={() => setMobileView('chat')}
|
||||
className="flex-1 rounded-none"
|
||||
>
|
||||
<MessageSquare className="h-4 w-4 mr-1" />
|
||||
Chat
|
||||
</Button>
|
||||
<Button
|
||||
variant={mobileView === 'preview' ? 'default' : 'ghost'}
|
||||
size="sm"
|
||||
onClick={() => setMobileView('preview')}
|
||||
className="flex-1 rounded-none"
|
||||
>
|
||||
<Eye className="h-4 w-4 mr-1" />
|
||||
Preview
|
||||
</Button>
|
||||
<Button
|
||||
variant={mobileView === 'code' ? 'default' : 'ghost'}
|
||||
size="sm"
|
||||
onClick={() => setMobileView('code')}
|
||||
className="flex-1 rounded-none"
|
||||
>
|
||||
<Code className="h-4 w-4 mr-1" />
|
||||
Code
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="h-screen flex flex-col bg-background">
|
||||
<header className="border-b px-4 py-3 flex items-center justify-between">
|
||||
<header className="border-b bg-gradient-to-r from-primary/10 via-accent/5 to-primary/10 backdrop-blur supports-[backdrop-filter]:bg-gradient-to-r supports-[backdrop-filter]:from-primary/10 supports-[backdrop-filter]:via-accent/5 supports-[backdrop-filter]:to-primary/10 px-4 py-3 flex items-center justify-between">
|
||||
<div className="flex items-center space-x-4">
|
||||
<Button
|
||||
variant="ghost"
|
||||
@@ -68,7 +138,7 @@ export function ProjectView() {
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
</Button>
|
||||
<div>
|
||||
<h1 className="text-lg font-semibold">{project.name}</h1>
|
||||
<h1 className="text-lg font-semibold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">{project.name}</h1>
|
||||
<p className="text-sm text-muted-foreground">{project.id}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user