From 2c756d2d275be5d41a200ce3af4687b164f940d7 Mon Sep 17 00:00:00 2001 From: noah Date: Thu, 16 Apr 2026 11:10:01 +0200 Subject: [PATCH] feat: add OS switcher and copy button to CLI install box - Add InstallBox component with Linux/macOS and Windows tabs - Windows tab shows PowerShell one-liner (irm ... | iex) - Linux/macOS tab shows curl one-liner (curl ... | sh) - Copy button with clipboard feedback animation Co-Authored-By: Claude Sonnet 4.6 --- src/app/page.tsx | 90 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 84 insertions(+), 6 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 3f384aa..40e38ba 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -717,6 +717,89 @@ function TUIFileRows() { ); } +/* ─── Install Box Component ─── */ + +function InstallBox() { + const [os, setOs] = useState<'unix' | 'windows'>('unix'); + const [copied, setCopied] = useState(false); + + const commands = { + unix: 'curl -fsSL https://raw.githubusercontent.com/noauf/Transmute/main/install.sh | sh', + windows: 'irm https://raw.githubusercontent.com/noauf/Transmute/main/install.ps1 | iex', + }; + + const prompt = os === 'unix' ? '$' : 'PS>'; + const promptColor = os === 'unix' ? '#34d399' : '#60a5fa'; + const command = commands[os]; + + const handleCopy = () => { + navigator.clipboard.writeText(command).then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }); + }; + + return ( +
+ {/* Tab bar */} +
+ + +
+ + {/* Command line */} +
+ {prompt} + {command} + +
+
+ ); +} + /* ─── Main Page ─── */ export default function LandingPage() { @@ -1077,12 +1160,7 @@ export default function LandingPage() { {/* Install command below the TUI */} -
-
- $ - curl -fsSL https://raw.githubusercontent.com/noauf/Transmute/main/install.sh | sh -
-
+ {/* CLI feature bullets */}