mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-03 07:57:22 +00:00
baseline style
This commit is contained in:
1 parent
37c16f54ef
commit
03109e63b5
7 files changed
+512
-177
No files matched your search
@@ -241,15 +241,15 @@ When creating new components or pages, follow the existing patterns in the codeb
|
||||
if (!isConfigured) {
|
||||
return (
|
||||
<div className="h-full flex flex-col">
|
||||
<div className="border-b px-4 py-3 flex justify-between items-center">
|
||||
<div className="border-b bg-gradient-to-r from-primary/5 to-accent/5 px-4 py-3 flex justify-between items-center">
|
||||
<div>
|
||||
<h2 className="font-semibold">AI Assistant</h2>
|
||||
<h2 className="font-semibold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">AI Assistant</h2>
|
||||
<p className="text-sm text-muted-foreground">Chat to build your project</p>
|
||||
</div>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="gap-2"
|
||||
className="gap-2 hover:bg-primary/10 hover:border-primary/20"
|
||||
onClick={() => {
|
||||
// This will be handled by the AISettingsDialog component
|
||||
const event = new CustomEvent('openAISettings');
|
||||
@@ -261,18 +261,18 @@ When creating new components or pages, follow the existing patterns in the codeb
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="flex-1 flex items-center justify-center">
|
||||
<div className="text-center space-y-4">
|
||||
<Bot className="h-12 w-12 mx-auto text-muted-foreground" />
|
||||
<div className="flex-1 flex items-center justify-center bg-gradient-to-br from-primary/5 to-accent/5">
|
||||
<div className="text-center space-y-4 max-w-md mx-auto p-6">
|
||||
<div className="text-4xl mb-4">🤖</div>
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold mb-2">AI Assistant Not Configured</h3>
|
||||
<h3 className="text-lg font-semibold mb-2 bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">AI Assistant Not Configured</h3>
|
||||
<p className="text-sm text-muted-foreground mb-4">
|
||||
Please configure your AI settings to start building with AI assistance.
|
||||
</p>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="gap-2"
|
||||
className="gap-2 hover:bg-primary/10 hover:border-primary/20"
|
||||
onClick={() => {
|
||||
const event = new CustomEvent('openAISettings');
|
||||
window.dispatchEvent(event);
|
||||
@@ -306,64 +306,66 @@ When creating new components or pages, follow the existing patterns in the codeb
|
||||
|
||||
return (
|
||||
<div className="h-full flex flex-col">
|
||||
<div className="border-b px-4 py-3 flex justify-between items-center">
|
||||
<div>
|
||||
<h2 className="font-semibold">AI Assistant</h2>
|
||||
<p className="text-sm text-muted-foreground">Chat to build your project</p>
|
||||
<div className="border-b bg-gradient-to-r from-primary/5 to-accent/5 px-4 py-3 flex justify-between items-center">
|
||||
<div className="min-w-0 flex-1">
|
||||
<h2 className="font-semibold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">AI Assistant</h2>
|
||||
<p className="text-sm text-muted-foreground hidden sm:block">Chat to build your project</p>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="gap-1 sm:gap-2 hover:bg-primary/10 hover:border-primary/20"
|
||||
onClick={runBuild}
|
||||
>
|
||||
<Play className="h-4 w-4" />
|
||||
<span className="hidden sm:inline">Build</span>
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="gap-1 sm:gap-2 hover:bg-accent/10 hover:border-accent/20"
|
||||
onClick={runDeploy}
|
||||
>
|
||||
<CloudUpload className="h-4 w-4" />
|
||||
<span className="hidden sm:inline">Deploy</span>
|
||||
</Button>
|
||||
</div>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="gap-2"
|
||||
onClick={runBuild}
|
||||
>
|
||||
<Play className="h-4 w-4" />
|
||||
Build
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
className="gap-2"
|
||||
onClick={runDeploy}
|
||||
>
|
||||
<CloudUpload className="h-4 w-4" />
|
||||
Deploy
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<ScrollArea className="flex-1 p-4" ref={scrollAreaRef}>
|
||||
<div className="space-y-4">
|
||||
<ScrollArea className="flex-1 p-3 sm:p-4" ref={scrollAreaRef}>
|
||||
<div className="space-y-3 sm:space-y-4">
|
||||
{messages.map((message, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className={cn(
|
||||
'flex gap-3',
|
||||
'flex gap-2 sm:gap-3',
|
||||
message.role === 'user' ? 'justify-end' : 'justify-start'
|
||||
)}
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
'flex gap-2 max-w-[80%]',
|
||||
'flex gap-2 max-w-[85%] sm:max-w-[80%]',
|
||||
message.role === 'user' ? 'flex-row-reverse' : 'flex-row'
|
||||
)}
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
'w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0',
|
||||
'w-7 h-7 sm:w-8 sm:h-8 rounded-full flex items-center justify-center flex-shrink-0',
|
||||
message.role === 'user'
|
||||
? 'bg-primary text-primary-foreground'
|
||||
: 'bg-muted'
|
||||
)}
|
||||
>
|
||||
{message.role === 'user' ? (
|
||||
<User className="h-4 w-4" />
|
||||
<User className="h-3 w-3 sm:h-4 sm:w-4" />
|
||||
) : (
|
||||
<Bot className="h-4 w-4" />
|
||||
<Bot className="h-3 w-3 sm:h-4 sm:w-4" />
|
||||
)}
|
||||
</div>
|
||||
<Card
|
||||
className={cn(
|
||||
'px-4 py-2',
|
||||
'px-3 py-2 sm:px-4',
|
||||
message.role === 'user'
|
||||
? 'bg-primary text-primary-foreground'
|
||||
: 'bg-muted'
|
||||
@@ -389,10 +391,10 @@ When creating new components or pages, follow the existing patterns in the codeb
|
||||
|
||||
{isLoading && (
|
||||
<div className="flex gap-2">
|
||||
<div className="w-8 h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0">
|
||||
<Bot className="h-4 w-4" />
|
||||
<div className="w-7 h-7 sm:w-8 sm:h-8 rounded-full bg-muted flex items-center justify-center flex-shrink-0">
|
||||
<Bot className="h-3 w-3 sm:h-4 sm:w-4" />
|
||||
</div>
|
||||
<Card className="px-4 py-2 bg-muted">
|
||||
<Card className="px-3 py-2 sm:px-4 bg-muted">
|
||||
<div className="flex space-x-1">
|
||||
<div className="h-2 w-2 bg-current rounded-full animate-bounce [animation-delay:-0.3s]"></div>
|
||||
<div className="h-2 w-2 bg-current rounded-full animate-bounce [animation-delay:-0.15s]"></div>
|
||||
@@ -404,20 +406,20 @@ When creating new components or pages, follow the existing patterns in the codeb
|
||||
</div>
|
||||
</ScrollArea>
|
||||
|
||||
<div className="border-t p-4">
|
||||
<div className="border-t p-3 sm:p-4">
|
||||
<div className="flex gap-2">
|
||||
<Textarea
|
||||
value={input}
|
||||
onChange={(e) => setInput(e.target.value)}
|
||||
onKeyDown={handleKeyDown}
|
||||
placeholder="Ask me to add features, edit files, or build your project..."
|
||||
className="min-h-[60px] resize-none"
|
||||
className="min-h-[60px] resize-none touch-action-manipulation overscroll-contain focus-ring"
|
||||
disabled={isLoading}
|
||||
/>
|
||||
<Button
|
||||
onClick={handleSend}
|
||||
disabled={!input.trim() || isLoading}
|
||||
className="self-end"
|
||||
className="self-end focus-ring"
|
||||
size="icon"
|
||||
>
|
||||
<Send className="h-4 w-4" />
|
||||
|
||||
@@ -66,27 +66,28 @@ export function FileEditor({ filePath, content, onSave, isLoading }: FileEditorP
|
||||
|
||||
return (
|
||||
<div className="h-full flex flex-col">
|
||||
<CardHeader className="border-b py-3">
|
||||
<CardHeader className="border-b py-2 sm:py-3">
|
||||
<div className="flex items-center justify-between">
|
||||
<CardTitle className="text-base">{filePath}</CardTitle>
|
||||
<div className="flex items-center space-x-2">
|
||||
<CardTitle className="text-sm sm:text-base truncate flex-1 mr-2">{filePath}</CardTitle>
|
||||
<div className="flex items-center space-x-1 sm:space-x-2">
|
||||
{hasChanges && (
|
||||
<span className="text-sm text-muted-foreground">Unsaved changes</span>
|
||||
<span className="text-xs sm:text-sm text-muted-foreground hidden sm:inline">Unsaved changes</span>
|
||||
)}
|
||||
<Button
|
||||
onClick={handleSave}
|
||||
disabled={!hasChanges || isSaving || isLoading}
|
||||
size="sm"
|
||||
className="focus-ring"
|
||||
>
|
||||
{isSaving ? (
|
||||
<>
|
||||
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
||||
Saving...
|
||||
<Loader2 className="mr-1 sm:mr-2 h-4 w-4 animate-spin" />
|
||||
<span className="hidden sm:inline">Saving...</span>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<Save className="mr-2 h-4 w-4" />
|
||||
Save
|
||||
<Save className="mr-1 sm:mr-2 h-4 w-4" />
|
||||
<span className="hidden sm:inline">Save</span>
|
||||
</>
|
||||
)}
|
||||
</Button>
|
||||
@@ -109,6 +110,7 @@ export function FileEditor({ filePath, content, onSave, isLoading }: FileEditorP
|
||||
className={cn(
|
||||
'w-full h-full resize-none border-0 rounded-none',
|
||||
'focus:outline-none focus:ring-0',
|
||||
'touch-action-manipulation overscroll-contain',
|
||||
getMonospaceFont()
|
||||
)}
|
||||
placeholder={`// Edit ${filePath}...`}
|
||||
|
||||
@@ -4,7 +4,8 @@ import { useFS } from '@/hooks/useFS';
|
||||
import { Tabs, TabsContent } from '@/components/ui/tabs';
|
||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { RefreshCw } from 'lucide-react';
|
||||
import { RefreshCw, FolderOpen, ArrowLeft } from 'lucide-react';
|
||||
import { useIsMobile } from '@/hooks/useIsMobile';
|
||||
|
||||
import { FileTree } from './FileTree';
|
||||
import { FileEditor } from './FileEditor';
|
||||
@@ -48,6 +49,8 @@ export function PreviewPane({ projectId, activeTab }: PreviewPaneProps) {
|
||||
const [selectedFile, setSelectedFile] = useState<string | null>(null);
|
||||
const [fileContent, setFileContent] = useState<string>('');
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [mobileCodeView, setMobileCodeView] = useState<'explorer' | 'editor'>('explorer');
|
||||
const isMobile = useIsMobile();
|
||||
const [hasBuiltProject, setHasBuiltProject] = useState(false);
|
||||
const iframeRef = useRef<HTMLIFrameElement>(null);
|
||||
const { fs } = useFS();
|
||||
@@ -262,6 +265,9 @@ export function PreviewPane({ projectId, activeTab }: PreviewPaneProps) {
|
||||
|
||||
const handleFileSelect = (filePath: string) => {
|
||||
setSelectedFile(filePath);
|
||||
if (isMobile) {
|
||||
setMobileCodeView('editor');
|
||||
}
|
||||
};
|
||||
|
||||
const handleFileSave = async (content: string) => {
|
||||
@@ -281,13 +287,13 @@ export function PreviewPane({ projectId, activeTab }: PreviewPaneProps) {
|
||||
<TabsContent value="preview" className="h-full mt-0">
|
||||
{hasBuiltProject ? (
|
||||
<div className="h-full w-full flex flex-col">
|
||||
<div className="flex items-center justify-between p-2 border-b bg-background">
|
||||
<span className="text-sm text-muted-foreground">Project Preview</span>
|
||||
<div className="flex items-center justify-between p-2 border-b bg-gradient-to-r from-primary/5 to-accent/5">
|
||||
<span className="text-sm font-medium bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">Project Preview</span>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={refreshIframe}
|
||||
className="h-8 w-8 p-0"
|
||||
className="h-8 w-8 p-0 hover:bg-primary/10"
|
||||
>
|
||||
<RefreshCw className="h-4 w-4" />
|
||||
</Button>
|
||||
@@ -327,39 +333,101 @@ export function PreviewPane({ projectId, activeTab }: PreviewPaneProps) {
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="code" className="h-full mt-0">
|
||||
<div className="h-full flex">
|
||||
<div className="w-1/3 border-r">
|
||||
<div className="p-4 border-b">
|
||||
<h3 className="font-semibold">File Explorer</h3>
|
||||
</div>
|
||||
<ScrollArea className="h-[calc(100%-60px)]">
|
||||
<FileTree
|
||||
projectId={projectId}
|
||||
onFileSelect={handleFileSelect}
|
||||
selectedFile={selectedFile}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
|
||||
<div className="flex-1">
|
||||
{selectedFile ? (
|
||||
<FileEditor
|
||||
filePath={selectedFile}
|
||||
content={fileContent}
|
||||
onSave={handleFileSave}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
) : (
|
||||
<div className="h-full flex items-center justify-center">
|
||||
<div className="text-center">
|
||||
<p className="text-muted-foreground">
|
||||
Select a file from the explorer to edit
|
||||
</p>
|
||||
{isMobile ? (
|
||||
<div className="h-full flex flex-col">
|
||||
{mobileCodeView === 'explorer' ? (
|
||||
<>
|
||||
<div className="p-3 border-b bg-gradient-to-r from-primary/5 to-accent/5">
|
||||
<h3 className="font-semibold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">File Explorer</h3>
|
||||
</div>
|
||||
</div>
|
||||
<ScrollArea className="flex-1">
|
||||
<FileTree
|
||||
projectId={projectId}
|
||||
onFileSelect={handleFileSelect}
|
||||
selectedFile={selectedFile}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<div className="p-3 border-b bg-gradient-to-r from-primary/5 to-accent/5 flex items-center gap-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => setMobileCodeView('explorer')}
|
||||
className="p-1"
|
||||
>
|
||||
<ArrowLeft className="h-4 w-4" />
|
||||
</Button>
|
||||
<h3 className="font-semibold flex-1 truncate bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">
|
||||
{selectedFile ? selectedFile.split('/').pop() : 'File Editor'}
|
||||
</h3>
|
||||
</div>
|
||||
<div className="flex-1">
|
||||
{selectedFile ? (
|
||||
<FileEditor
|
||||
filePath={selectedFile}
|
||||
content={fileContent}
|
||||
onSave={handleFileSave}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
) : (
|
||||
<div className="h-full flex items-center justify-center">
|
||||
<div className="text-center">
|
||||
<FolderOpen className="h-12 w-12 mx-auto text-muted-foreground mb-4" />
|
||||
<p className="text-muted-foreground">
|
||||
Select a file from the explorer to edit
|
||||
</p>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={() => setMobileCodeView('explorer')}
|
||||
className="mt-4"
|
||||
>
|
||||
Open File Explorer
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<div className="h-full flex">
|
||||
<div className="w-1/3 border-r">
|
||||
<div className="p-4 border-b bg-gradient-to-r from-primary/5 to-accent/5">
|
||||
<h3 className="font-semibold bg-gradient-to-r from-primary to-accent bg-clip-text text-transparent">File Explorer</h3>
|
||||
</div>
|
||||
<ScrollArea className="h-[calc(100%-60px)]">
|
||||
<FileTree
|
||||
projectId={projectId}
|
||||
onFileSelect={handleFileSelect}
|
||||
selectedFile={selectedFile}
|
||||
/>
|
||||
</ScrollArea>
|
||||
</div>
|
||||
|
||||
<div className="flex-1">
|
||||
{selectedFile ? (
|
||||
<FileEditor
|
||||
filePath={selectedFile}
|
||||
content={fileContent}
|
||||
onSave={handleFileSave}
|
||||
isLoading={isLoading}
|
||||
/>
|
||||
) : (
|
||||
<div className="h-full flex items-center justify-center">
|
||||
<div className="text-center">
|
||||
<p className="text-muted-foreground">
|
||||
Select a file from the explorer to edit
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
</div>
|
||||
|
||||
+222
-59
@@ -4,89 +4,107 @@
|
||||
|
||||
@layer base {
|
||||
:root {
|
||||
/* GitHub-inspired light theme with Shakespeare colors */
|
||||
--background: 0 0% 100%;
|
||||
--foreground: 222.2 84% 4.9%;
|
||||
--foreground: 220 9% 9%;
|
||||
|
||||
--card: 0 0% 100%;
|
||||
--card-foreground: 222.2 84% 4.9%;
|
||||
--card-foreground: 220 9% 9%;
|
||||
|
||||
--popover: 0 0% 100%;
|
||||
--popover-foreground: 222.2 84% 4.9%;
|
||||
--popover-foreground: 220 9% 9%;
|
||||
|
||||
--primary: 222.2 47.4% 11.2%;
|
||||
--primary-foreground: 210 40% 98%;
|
||||
/* Shakespeare purple as primary */
|
||||
--primary: 271 81% 56%;
|
||||
--primary-foreground: 0 0% 100%;
|
||||
|
||||
--secondary: 210 40% 96.1%;
|
||||
--secondary-foreground: 222.2 47.4% 11.2%;
|
||||
/* GitHub-style secondary */
|
||||
--secondary: 220 14% 96%;
|
||||
--secondary-foreground: 220 9% 9%;
|
||||
|
||||
--muted: 210 40% 96.1%;
|
||||
--muted-foreground: 215.4 16.3% 46.9%;
|
||||
--muted: 220 14% 96%;
|
||||
--muted-foreground: 220 9% 46%;
|
||||
|
||||
--accent: 210 40% 96.1%;
|
||||
--accent-foreground: 222.2 47.4% 11.2%;
|
||||
/* Shakespeare gold as accent */
|
||||
--accent: 45 93% 58%;
|
||||
--accent-foreground: 220 9% 9%;
|
||||
|
||||
--destructive: 0 84.2% 60.2%;
|
||||
--destructive-foreground: 210 40% 98%;
|
||||
--destructive: 0 84% 60%;
|
||||
--destructive-foreground: 0 0% 100%;
|
||||
|
||||
--border: 214.3 31.8% 91.4%;
|
||||
--input: 214.3 31.8% 91.4%;
|
||||
--ring: 222.2 84% 4.9%;
|
||||
/* GitHub-style borders */
|
||||
--border: 220 13% 91%;
|
||||
--input: 220 13% 91%;
|
||||
--ring: 271 81% 56%;
|
||||
|
||||
--radius: 0.5rem;
|
||||
--radius: 0.375rem;
|
||||
|
||||
--sidebar-background: 0 0% 98%;
|
||||
/* Sidebar colors - Enhanced purple theme */
|
||||
--sidebar-background: 271 81% 96%;
|
||||
--sidebar-foreground: 271 81% 15%;
|
||||
--sidebar-primary: 271 81% 56%;
|
||||
--sidebar-primary-foreground: 0 0% 100%;
|
||||
--sidebar-accent: 271 81% 92%;
|
||||
--sidebar-accent-foreground: 271 81% 15%;
|
||||
--sidebar-border: 271 81% 85%;
|
||||
--sidebar-ring: 271 81% 56%;
|
||||
|
||||
--sidebar-foreground: 240 5.3% 26.1%;
|
||||
|
||||
--sidebar-primary: 240 5.9% 10%;
|
||||
|
||||
--sidebar-primary-foreground: 0 0% 98%;
|
||||
|
||||
--sidebar-accent: 240 4.8% 95.9%;
|
||||
|
||||
--sidebar-accent-foreground: 240 5.9% 10%;
|
||||
|
||||
--sidebar-border: 220 13% 91%;
|
||||
|
||||
--sidebar-ring: 217.2 91.2% 59.8%;
|
||||
/* GitHub-style success and warning */
|
||||
--success: 142 76% 36%;
|
||||
--success-foreground: 0 0% 100%;
|
||||
--warning: 45 93% 58%;
|
||||
--warning-foreground: 220 9% 9%;
|
||||
}
|
||||
|
||||
.dark {
|
||||
--background: 222.2 84% 4.9%;
|
||||
--foreground: 210 40% 98%;
|
||||
/* GitHub-inspired dark theme with Shakespeare colors */
|
||||
--background: 220 13% 9%;
|
||||
--foreground: 220 14% 93%;
|
||||
|
||||
--card: 222.2 84% 4.9%;
|
||||
--card-foreground: 210 40% 98%;
|
||||
--card: 220 13% 11%;
|
||||
--card-foreground: 220 14% 93%;
|
||||
|
||||
--popover: 222.2 84% 4.9%;
|
||||
--popover-foreground: 210 40% 98%;
|
||||
--popover: 220 13% 11%;
|
||||
--popover-foreground: 220 14% 93%;
|
||||
|
||||
--primary: 210 40% 98%;
|
||||
--primary-foreground: 222.2 47.4% 11.2%;
|
||||
/* Shakespeare purple (lighter for dark mode) */
|
||||
--primary: 271 81% 65%;
|
||||
--primary-foreground: 220 13% 9%;
|
||||
|
||||
--secondary: 217.2 32.6% 17.5%;
|
||||
--secondary-foreground: 210 40% 98%;
|
||||
/* GitHub dark secondary */
|
||||
--secondary: 220 13% 15%;
|
||||
--secondary-foreground: 220 14% 93%;
|
||||
|
||||
--muted: 217.2 32.6% 17.5%;
|
||||
--muted-foreground: 215 20.2% 65.1%;
|
||||
--muted: 220 13% 15%;
|
||||
--muted-foreground: 220 9% 63%;
|
||||
|
||||
--accent: 217.2 32.6% 17.5%;
|
||||
--accent-foreground: 210 40% 98%;
|
||||
/* Shakespeare gold (adjusted for dark mode) */
|
||||
--accent: 45 93% 65%;
|
||||
--accent-foreground: 220 13% 9%;
|
||||
|
||||
--destructive: 0 62.8% 30.6%;
|
||||
--destructive-foreground: 210 40% 98%;
|
||||
--destructive: 0 84% 60%;
|
||||
--destructive-foreground: 0 0% 100%;
|
||||
|
||||
--border: 217.2 32.6% 17.5%;
|
||||
--input: 217.2 32.6% 17.5%;
|
||||
--ring: 212.7 26.8% 83.9%;
|
||||
--sidebar-background: 240 5.9% 10%;
|
||||
--sidebar-foreground: 240 4.8% 95.9%;
|
||||
--sidebar-primary: 224.3 76.3% 48%;
|
||||
--sidebar-primary-foreground: 0 0% 100%;
|
||||
--sidebar-accent: 240 3.7% 15.9%;
|
||||
--sidebar-accent-foreground: 240 4.8% 95.9%;
|
||||
--sidebar-border: 240 3.7% 15.9%;
|
||||
--sidebar-ring: 217.2 91.2% 59.8%;
|
||||
/* GitHub dark borders */
|
||||
--border: 220 13% 18%;
|
||||
--input: 220 13% 18%;
|
||||
--ring: 271 81% 65%;
|
||||
|
||||
/* Sidebar dark colors - Enhanced purple theme */
|
||||
--sidebar-background: 271 81% 8%;
|
||||
--sidebar-foreground: 271 81% 90%;
|
||||
--sidebar-primary: 271 81% 65%;
|
||||
--sidebar-primary-foreground: 271 81% 8%;
|
||||
--sidebar-accent: 271 81% 15%;
|
||||
--sidebar-accent-foreground: 271 81% 90%;
|
||||
--sidebar-border: 271 81% 20%;
|
||||
--sidebar-ring: 271 81% 65%;
|
||||
|
||||
/* Dark mode success and warning */
|
||||
--success: 142 76% 45%;
|
||||
--success-foreground: 0 0% 100%;
|
||||
--warning: 45 93% 65%;
|
||||
--warning-foreground: 220 13% 9%;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +114,151 @@
|
||||
}
|
||||
|
||||
body {
|
||||
@apply bg-background text-foreground;
|
||||
@apply bg-background text-foreground font-sans;
|
||||
font-feature-settings: "rlig" 1, "calt" 1;
|
||||
}
|
||||
|
||||
/* GitHub-style scrollbars */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: hsl(var(--border));
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: hsl(var(--muted-foreground) / 0.5);
|
||||
}
|
||||
|
||||
/* GitHub-style focus rings */
|
||||
.focus-ring {
|
||||
@apply focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2;
|
||||
}
|
||||
|
||||
/* Smooth transitions for theme switching */
|
||||
* {
|
||||
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
||||
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
||||
transition-duration: 150ms;
|
||||
}
|
||||
|
||||
/* Ensure hidden tab content doesn't take up space */
|
||||
[role="tabpanel"][hidden] {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Custom prose styling for chat messages */
|
||||
.prose {
|
||||
/* Override prose defaults to match chat styling */
|
||||
--tw-prose-body: hsl(var(--foreground));
|
||||
--tw-prose-headings: hsl(var(--foreground));
|
||||
--tw-prose-lead: hsl(var(--muted-foreground));
|
||||
--tw-prose-links: hsl(var(--primary));
|
||||
--tw-prose-bold: hsl(var(--foreground));
|
||||
--tw-prose-counters: hsl(var(--muted-foreground));
|
||||
--tw-prose-bullets: hsl(var(--muted-foreground));
|
||||
--tw-prose-hr: hsl(var(--border));
|
||||
--tw-prose-quotes: hsl(var(--foreground));
|
||||
--tw-prose-quote-borders: hsl(var(--border));
|
||||
--tw-prose-captions: hsl(var(--muted-foreground));
|
||||
--tw-prose-code: hsl(var(--foreground));
|
||||
--tw-prose-pre-code: hsl(var(--foreground));
|
||||
--tw-prose-pre-bg: hsl(var(--muted));
|
||||
--tw-prose-th-borders: hsl(var(--border));
|
||||
--tw-prose-td-borders: hsl(var(--border));
|
||||
}
|
||||
|
||||
.prose.dark\\:prose-invert {
|
||||
--tw-prose-body: hsl(var(--foreground));
|
||||
--tw-prose-headings: hsl(var(--foreground));
|
||||
--tw-prose-lead: hsl(var(--muted-foreground));
|
||||
--tw-prose-links: hsl(var(--primary));
|
||||
--tw-prose-bold: hsl(var(--foreground));
|
||||
--tw-prose-counters: hsl(var(--muted-foreground));
|
||||
--tw-prose-bullets: hsl(var(--muted-foreground));
|
||||
--tw-prose-hr: hsl(var(--border));
|
||||
--tw-prose-quotes: hsl(var(--foreground));
|
||||
--tw-prose-quote-borders: hsl(var(--border));
|
||||
--tw-prose-captions: hsl(var(--muted-foreground));
|
||||
--tw-prose-code: hsl(var(--foreground));
|
||||
--tw-prose-pre-code: hsl(var(--foreground));
|
||||
--tw-prose-pre-bg: hsl(var(--muted));
|
||||
--tw-prose-th-borders: hsl(var(--border));
|
||||
--tw-prose-td-borders: hsl(var(--border));
|
||||
}
|
||||
|
||||
/* Ensure proper spacing in chat messages */
|
||||
.prose p:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.prose p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/* Compact list styling for chat */
|
||||
.prose ul, .prose ol {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.prose li {
|
||||
margin-top: 0.25rem;
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
/* Compact heading spacing for chat */
|
||||
.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.prose h1:first-child, .prose h2:first-child, .prose h3:first-child,
|
||||
.prose h4:first-child, .prose h5:first-child, .prose h6:first-child {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
/* Mobile textarea scroll fix */
|
||||
.touch-action-manipulation {
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
.overscroll-contain {
|
||||
overscroll-behavior: contain;
|
||||
}
|
||||
|
||||
/* Dynamic viewport height support for mobile keyboards */
|
||||
.h-dvh {
|
||||
height: 100dvh;
|
||||
}
|
||||
|
||||
.min-h-dvh {
|
||||
min-height: 100dvh;
|
||||
}
|
||||
|
||||
.max-h-dvh {
|
||||
max-height: 100dvh;
|
||||
}
|
||||
|
||||
/* Fallback for browsers that don't support dvh */
|
||||
@supports not (height: 100dvh) {
|
||||
.h-dvh {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.min-h-dvh {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.max-h-dvh {
|
||||
max-height: 100vh;
|
||||
}
|
||||
}
|
||||
}
|
||||
+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>
|
||||
|
||||
+10
-1
@@ -1,5 +1,6 @@
|
||||
import type { Config } from "tailwindcss";
|
||||
import tailwindcssAnimate from "tailwindcss-animate";
|
||||
import typography from "@tailwindcss/typography";
|
||||
|
||||
export default {
|
||||
darkMode: ["class"],
|
||||
@@ -65,6 +66,14 @@ export default {
|
||||
'accent-foreground': 'hsl(var(--sidebar-accent-foreground))',
|
||||
border: 'hsl(var(--sidebar-border))',
|
||||
ring: 'hsl(var(--sidebar-ring))'
|
||||
},
|
||||
success: {
|
||||
DEFAULT: 'hsl(var(--success))',
|
||||
foreground: 'hsl(var(--success-foreground))'
|
||||
},
|
||||
warning: {
|
||||
DEFAULT: 'hsl(var(--warning))',
|
||||
foreground: 'hsl(var(--warning-foreground))'
|
||||
}
|
||||
},
|
||||
borderRadius: {
|
||||
@@ -96,5 +105,5 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
plugins: [tailwindcssAnimate],
|
||||
plugins: [tailwindcssAnimate, typography],
|
||||
} satisfies Config;
|
||||
Reference in new issue
Block a user