1- import { useEffect , useRef } from "react" ;
1+ import { useEffect , useRef , useState } from "react" ;
22import SiteHeader from "../components/SiteHeader" ;
33import posterUrl from "../assets/video-climb-blink-and-stare.webp" ;
44import videoUrl from "../assets/video-climb-blink-and-stare.mp4" ;
@@ -17,6 +17,36 @@ const ASTERISK_THRESHOLD = 0.50;
1717 * The video keeps scrubbing underneath. */
1818const UNPIN_THRESHOLD = 0.8 ;
1919
20+ const PILL =
21+ "inline-block px-4 py-1.5 rounded-md border border-[var(--color-caramel)]/30 text-[var(--color-caramel)] text-sm font-display font-medium hover:bg-[var(--color-caramel)]/10 hover:border-[var(--color-caramel)]/60 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-150" ;
22+
23+ const INSTALL_STEPS : Record < string , { pill : string ; title : string ; steps : string [ ] } > = {
24+ "darwin-aarch64" : {
25+ pill : "Mac Silicon" ,
26+ title : "Installing on Mac" ,
27+ steps : [
28+ "Double-click the downloaded .tar.gz to extract MouseTerm.app" ,
29+ "Drag MouseTerm.app to Applications" ,
30+ ] ,
31+ } ,
32+ "windows-x86_64" : {
33+ pill : "Windows x64" ,
34+ title : "Installing on Windows" ,
35+ steps : [
36+ "Double-click the downloaded ...-setup.exe" ,
37+ "If SmartScreen appears: More info \u2192 Run anyway" ,
38+ ] ,
39+ } ,
40+ "linux-x86_64" : {
41+ pill : "Linux x64" ,
42+ title : "Installing on Linux" ,
43+ steps : [
44+ "Make executable: chmod +x MouseTerm*.AppImage" ,
45+ "Run from terminal or double-click to launch" ,
46+ ] ,
47+ } ,
48+ } ;
49+
2050function Home ( ) {
2151 const videoRef = useRef < HTMLVideoElement > ( null ) ;
2252 const runwayRef = useRef < HTMLDivElement > ( null ) ;
@@ -28,6 +58,7 @@ function Home() {
2858 const footnoteRef = useRef < HTMLParagraphElement > ( null ) ;
2959 const headerRef = useRef < HTMLElement > ( null ) ;
3060 const headerBrandRef = useRef < HTMLAnchorElement > ( null ) ;
61+ const [ installGuide , setInstallGuide ] = useState < string | null > ( null ) ;
3162
3263 useEffect ( ( ) => {
3364 const video = videoRef . current ;
@@ -218,23 +249,48 @@ function Home() {
218249
219250 < a
220251 href = "/playground"
221- className = "inline-block px-8 py-3 rounded-md bg-[var(--color-caramel)] text-[var(--color-bg)] font-display font-semibold text-lg hover:brightness-110 transition-[filter] "
252+ className = "inline-block px-8 py-3 rounded-md bg-[var(--color-caramel)] text-[var(--color-bg)] font-display font-semibold text-lg hover:brightness-110 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-150 "
222253 >
223254 Try it in the Playground
224255 </ a >
225256
226- < div className = "mt-10 space-y-3 text-base leading-relaxed" >
227- < p >
228- Install for VSCode (and its forks) —{ " " }
229- < a href = "https://marketplace.visualstudio.com/items?itemName=diffplug.mouseterm" className = "text-[var(--color-caramel)] hover:underline" > Microsoft VSCode Marketplace</ a > { " / " }
230- < a href = "https://open-vsx.org/extension/diffplug/mouseterm" className = "text-[var(--color-caramel)] hover:underline" > OpenVSX</ a >
231- </ p >
232- < p >
233- Standalone apps —{ " " }
234- < a href = { standaloneLatest . platforms [ "windows-x86_64" ] . url } className = "text-[var(--color-caramel)] hover:underline" > Windows</ a > { " / " }
235- < a href = { standaloneLatest . platforms [ "darwin-aarch64" ] . url } className = "text-[var(--color-caramel)] hover:underline" > Mac</ a > { " / " }
236- < a href = { standaloneLatest . platforms [ "linux-x86_64" ] . url } className = "text-[var(--color-caramel)] hover:underline" > Linux</ a >
237- </ p >
257+ < div className = "mt-6 space-y-5" >
258+ < div >
259+ < p className = "text-xs uppercase tracking-widest opacity-40 mb-2" > VSCode extension</ p >
260+ < div className = "flex flex-wrap gap-2" >
261+ < a href = "https://marketplace.visualstudio.com/items?itemName=diffplug.mouseterm" className = { PILL } > VSCode Marketplace</ a >
262+ < a href = "https://open-vsx.org/extension/diffplug/mouseterm" className = { PILL } > OpenVSX</ a >
263+ </ div >
264+ </ div >
265+ < div >
266+ < p className = "text-xs uppercase tracking-widest opacity-40 mb-2" > Standalone app</ p >
267+ < div className = "flex flex-wrap gap-2" >
268+ { ( [ "darwin-aarch64" , "windows-x86_64" , "linux-x86_64" ] as const ) . map ( ( key ) => (
269+ < a
270+ key = { key }
271+ href = { standaloneLatest . platforms [ key ] . url }
272+ onClick = { ( ) => setInstallGuide ( key ) }
273+ className = { `${ PILL } ${ installGuide === key ? " bg-[var(--color-caramel)]/10 border-[var(--color-caramel)]/60" : "" } ` }
274+ >
275+ { INSTALL_STEPS [ key ] . pill }
276+ </ a >
277+ ) ) }
278+ < a href = "https://github.com/diffplug/mouseterm/issues/8" className = { PILL } > Other</ a >
279+ </ div >
280+ { installGuide && INSTALL_STEPS [ installGuide ] && (
281+ < div className = "mt-3 rounded-md border border-[var(--color-text)]/10 bg-[var(--color-text)]/5 px-4 py-3" >
282+ < p className = "text-xs uppercase tracking-widest text-[var(--color-caramel)] mb-2" > { INSTALL_STEPS [ installGuide ] . title } </ p >
283+ < ol className = "space-y-1 text-sm opacity-70" >
284+ { INSTALL_STEPS [ installGuide ] . steps . map ( ( step , i ) => (
285+ < li key = { i } className = "flex gap-2" >
286+ < span className = "text-[var(--color-caramel)] shrink-0" > { i + 1 } .</ span >
287+ < span > { step } </ span >
288+ </ li >
289+ ) ) }
290+ </ ol >
291+ </ div >
292+ ) }
293+ </ div >
238294 </ div >
239295 </ section >
240296
0 commit comments