diff --git a/src/components/Hero.astro b/src/components/Hero.astro index 2f9ff16..1ded09d 100644 --- a/src/components/Hero.astro +++ b/src/components/Hero.astro @@ -118,6 +118,13 @@ let activeTab = "macos-linux"; + const copyIconSvg = ``; + const checkIconSvg = ``; + + function setCopyIcon() { + heroCopyLabel.innerHTML = copyIconSvg; + } + function updateHero() { const channel = heroNextToggle.checked ? "next" : "stable"; const entry = commands[activeTab]; @@ -127,25 +134,27 @@ heroNextLabel.style.color = heroNextToggle.checked ? "var(--color-accent)" : ""; } + function selectTab(tabId: string) { + activeTab = tabId; + heroTabs.forEach((t) => { + t.setAttribute("aria-selected", String((t as HTMLElement).dataset.tab === activeTab)); + }); + updateHero(); + } + + // Auto-detect OS on load + if (/Win/.test(navigator.userAgent)) { + selectTab("windows"); + } + heroTabs.forEach((tab) => { tab.addEventListener("click", () => { - activeTab = (tab as HTMLElement).dataset.tab!; - heroTabs.forEach((t) => { - t.setAttribute("aria-selected", String((t as HTMLElement).dataset.tab === activeTab)); - }); - updateHero(); + selectTab((tab as HTMLElement).dataset.tab!); }); }); heroNextToggle.addEventListener("change", updateHero); - const copyIconSvg = ``; - const checkIconSvg = ``; - - function setCopyIcon() { - heroCopyLabel.innerHTML = copyIconSvg; - } - heroInstall.addEventListener("click", () => { const channel = heroNextToggle.checked ? "next" : "stable"; navigator.clipboard.writeText(commands[activeTab][channel]); diff --git a/src/components/InstallBlock.astro b/src/components/InstallBlock.astro deleted file mode 100644 index c4bb3cc..0000000 --- a/src/components/InstallBlock.astro +++ /dev/null @@ -1,222 +0,0 @@ ---- -const tabs = [ - { id: "unix", label: "macOS / Linux" }, - { id: "windows", label: "Windows" }, - { id: "npm", label: "npm" }, -]; ---- - -
-
-

- Get started -

-

- Install RemoteClaw in seconds. -

- - -
- { - tabs.map((tab) => ( - - )) - } -
- - -
- -
-
-
- $ - curl -fsSL remoteclaw.sh | sh -
- -
-

- Detects your OS, installs Node if needed, then installs - RemoteClaw globally. -

-
- - Install without root - -
-
- $ - curl -fsSL remoteclaw.sh | sh -s -- --local -
- -
-

- Installs to ~/.remoteclaw/bin — - no sudo required. -

-
-
- - - - - - -
- - -
- Then run: - remoteclaw - — - - getting started guide → - -
-
-
- -