refactor: update layout and styling for hero and home components
@@ -45,10 +45,8 @@ export default function HeroLayout() {
|
||||
</header>
|
||||
|
||||
{/* Main Content Area */}
|
||||
<main className="max-w-7xl mx-auto py-6 sm:px-6 lg:px-8 flex-grow">
|
||||
<div className="px-4 py-6 sm:px-0">
|
||||
<main className="flex-1 p-4 overflow-hidden">
|
||||
<Outlet />
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{/* Footer */}
|
||||
|
||||
@@ -39,28 +39,17 @@ export default function Home() {
|
||||
}, [jsonInput, query])
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-slate-50 p-6 font-sans text-slate-900">
|
||||
<div className="max-w-7xl mx-auto space-y-6">
|
||||
<header className="flex flex-col gap-2">
|
||||
<h1 className="text-2xl font-bold tracking-tight text-slate-800">
|
||||
TypeScript JSONPath Explorer
|
||||
</h1>
|
||||
<p className="text-slate-500 text-sm">
|
||||
Debug and visualises your JSONPath queries with real-time highlighting.
|
||||
</p>
|
||||
</header>
|
||||
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||
{/* 控制面板 */}
|
||||
<div className="flex flex-col gap-4">
|
||||
<div className="bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
|
||||
<div className="h-full flex gap-4">
|
||||
{/* 左侧输入面板 - 40% */}
|
||||
<div className="w-2/5 flex flex-col gap-4">
|
||||
<div className="bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden flex-1 flex flex-col">
|
||||
<div className="bg-slate-50 px-4 py-2 border-b border-slate-200">
|
||||
<span className="text-xs font-semibold uppercase tracking-wider text-slate-500">
|
||||
JSON Source
|
||||
</span>
|
||||
</div>
|
||||
<textarea
|
||||
className="w-full h-100 p-4 font-mono text-sm outline-none focus:ring-2 focus:ring-indigo-500/20 transition-all resize-none"
|
||||
className="flex-1 w-full p-4 font-mono text-sm outline-none focus:ring-2 focus:ring-indigo-500/20 transition-all resize-none"
|
||||
value={jsonInput}
|
||||
onChange={(e) => setJsonInput(e.target.value)}
|
||||
spellCheck={false}
|
||||
@@ -81,8 +70,8 @@ export default function Home() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* 可视化面板 */}
|
||||
<div className="bg-white rounded-xl shadow-sm border border-slate-200 flex flex-col overflow-hidden">
|
||||
{/* 右侧可视化面板 - 60% */}
|
||||
<div className="w-3/5 bg-white rounded-xl shadow-sm border border-slate-200 flex flex-col overflow-hidden">
|
||||
<div className="bg-slate-50 px-4 py-2 border-b border-slate-200 flex justify-between items-center">
|
||||
<span className="text-xs font-semibold uppercase tracking-wider text-slate-500">
|
||||
Visualised Result
|
||||
@@ -92,7 +81,7 @@ export default function Home() {
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="p-6 overflow-auto max-h-[580px] font-mono text-sm leading-relaxed">
|
||||
<div className="flex-1 p-6 overflow-auto font-mono text-sm leading-relaxed">
|
||||
{result.error ? (
|
||||
<div className="bg-red-50 text-red-600 p-4 rounded-lg border border-red-100 text-xs">
|
||||
<strong>Error:</strong> {result.error}
|
||||
@@ -107,7 +96,5 @@ export default function Home() {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||