| 1 | "use client"; |
| 2 | |
| 3 | import Image from "next/image"; |
| 4 | import { useCallback, useEffect, useRef, useState } from "react"; |
| 5 | |
| 6 | type Shot = { |
| 7 | src: string; |
| 8 | alt: string; |
| 9 | caption: string; |
| 10 | device: "phone" | "tablet" | "desktop"; |
| 11 | width: number; |
| 12 | height: number; |
| 13 | }; |
| 14 | |
| 15 | const slides: Shot[] = [ |
| 16 | { |
| 17 | src: "/screenshots/iphone-chat.png", |
| 18 | alt: "Siti AI chat running on iPhone", |
| 19 | caption: "Ask anything, on device", |
| 20 | device: "phone", |
| 21 | width: 1242, |
| 22 | height: 2688, |
| 23 | }, |
| 24 | { |
| 25 | src: "/screenshots/iphone-settings.png", |
| 26 | alt: "Siti AI on-device model settings on iPhone", |
| 27 | caption: "Pick your model", |
| 28 | device: "phone", |
| 29 | width: 1242, |
| 30 | height: 2688, |
| 31 | }, |
| 32 | { |
| 33 | src: "/screenshots/ipad-chat.png", |
| 34 | alt: "Siti AI chat running on iPad", |
| 35 | caption: "Roomy on iPad", |
| 36 | device: "tablet", |
| 37 | width: 2064, |
| 38 | height: 2752, |
| 39 | }, |
| 40 | { |
| 41 | src: "/screenshots/ipad-settings.png", |
| 42 | alt: "Siti AI on-device model settings on iPad", |
| 43 | caption: "Everything stays local", |
| 44 | device: "tablet", |
| 45 | width: 2064, |
| 46 | height: 2752, |
| 47 | }, |
| 48 | { |
| 49 | src: "/screenshots/windows-chat.png", |
| 50 | alt: "Siti AI chat running on Windows", |
| 51 | caption: "Now on Windows", |
| 52 | device: "desktop", |
| 53 | width: 1920, |
| 54 | height: 1080, |
| 55 | }, |
| 56 | { |
| 57 | src: "/screenshots/windows-private.png", |
| 58 | alt: "Siti AI private, on-device settings on Windows", |
| 59 | caption: "Private on your PC", |
| 60 | device: "desktop", |
| 61 | width: 1920, |
| 62 | height: 1080, |
| 63 | }, |
| 64 | { |
| 65 | src: "/screenshots/windows-draft.png", |
| 66 | alt: "Siti AI drafting and summarizing on Windows", |
| 67 | caption: "Draft and summarize", |
| 68 | device: "desktop", |
| 69 | width: 1920, |
| 70 | height: 1080, |
| 71 | }, |
| 72 | { |
| 73 | src: "/screenshots/windows-offline.png", |
| 74 | alt: "Siti AI working offline on Windows", |
| 75 | caption: "Works offline", |
| 76 | device: "desktop", |
| 77 | width: 1920, |
| 78 | height: 1080, |
| 79 | }, |
| 80 | { |
| 81 | src: "/screenshots/windows-model.png", |
| 82 | alt: "Siti AI on-device model picker on Windows", |
| 83 | caption: "Choose your model", |
| 84 | device: "desktop", |
| 85 | width: 1920, |
| 86 | height: 1080, |
| 87 | }, |
| 88 | ]; |
| 89 | |
| 90 | const AUTOPLAY_MS = 5000; |
| 91 | const SWIPE_THRESHOLD = 40; |
| 92 | |
| 93 | function Arrow({ dir }: { dir: "left" | "right" }) { |
| 94 | return ( |
| 95 | <svg |
| 96 | viewBox="0 0 24 24" |
| 97 | fill="none" |
| 98 | stroke="currentColor" |
| 99 | strokeWidth="2" |
| 100 | strokeLinecap="round" |
| 101 | strokeLinejoin="round" |
| 102 | className="h-5 w-5" |
| 103 | aria-hidden="true" |
| 104 | > |
| 105 | <path d={dir === "left" ? "M15 18l-6-6 6-6" : "M9 18l6-6-6-6"} /> |
| 106 | </svg> |
| 107 | ); |
| 108 | } |
| 109 | |
| 110 | export function AppScreenshots() { |
| 111 | const [index, setIndex] = useState(0); |
| 112 | const [paused, setPaused] = useState(false); |
| 113 | const touchStartX = useRef<number | null>(null); |
| 114 | |
| 115 | const count = slides.length; |
| 116 | const goTo = useCallback( |
| 117 | (next: number) => setIndex((next + count) % count), |
| 118 | [count] |
| 119 | ); |
| 120 | const prev = useCallback(() => goTo(index - 1), [goTo, index]); |
| 121 | const next = useCallback(() => goTo(index + 1), [goTo, index]); |
| 122 | |
| 123 | // The stage frame is sized per the active slide: portrait phone/tablet |
| 124 | // shots want a tall narrow box, landscape desktop shots want a wide |
| 125 | // short one, so both fill the frame without letterboxing or clipping. |
| 126 | const isDesktop = slides[index].device === "desktop"; |
| 127 | |
| 128 | // Auto-advance, paused on hover/focus and when the user prefers reduced motion. |
| 129 | useEffect(() => { |
| 130 | if (paused) return; |
| 131 | if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return; |
| 132 | const id = window.setInterval( |
| 133 | () => setIndex((i) => (i + 1) % count), |
| 134 | AUTOPLAY_MS |
| 135 | ); |
| 136 | return () => window.clearInterval(id); |
| 137 | }, [paused, count]); |
| 138 | |
| 139 | function onTouchStart(e: React.TouchEvent) { |
| 140 | touchStartX.current = e.touches[0].clientX; |
| 141 | } |
| 142 | function onTouchEnd(e: React.TouchEvent) { |
| 143 | if (touchStartX.current === null) return; |
| 144 | const delta = e.changedTouches[0].clientX - touchStartX.current; |
| 145 | if (delta > SWIPE_THRESHOLD) prev(); |
| 146 | else if (delta < -SWIPE_THRESHOLD) next(); |
| 147 | touchStartX.current = null; |
| 148 | } |
| 149 | |
| 150 | return ( |
| 151 | <section className="mx-auto max-w-5xl px-6 py-20"> |
| 152 | <div className="text-center"> |
| 153 | <p className="text-xs font-semibold uppercase tracking-[0.15em] text-brand"> |
| 154 | A look inside |
| 155 | </p> |
| 156 | <h2 className="mt-3 text-3xl font-semibold tracking-tight sm:text-4xl"> |
| 157 | Private by design, on every device. |
| 158 | </h2> |
| 159 | <p className="mx-auto mt-4 max-w-xl text-muted"> |
| 160 | The same assistant on iPhone, iPad, and Windows. Your model runs |
| 161 | locally and your chats never leave the device. |
| 162 | </p> |
| 163 | </div> |
| 164 | |
| 165 | <div |
| 166 | className="mt-12" |
| 167 | role="group" |
| 168 | aria-roledescription="carousel" |
| 169 | aria-label="App screenshots" |
| 170 | onMouseEnter={() => setPaused(true)} |
| 171 | onMouseLeave={() => setPaused(false)} |
| 172 | onFocus={() => setPaused(true)} |
| 173 | onBlur={() => setPaused(false)} |
| 174 | onKeyDown={(e) => { |
| 175 | if (e.key === "ArrowLeft") prev(); |
| 176 | if (e.key === "ArrowRight") next(); |
| 177 | }} |
| 178 | > |
| 179 | <div className="flex items-center justify-center gap-3 sm:gap-5"> |
| 180 | <button |
| 181 | type="button" |
| 182 | onClick={prev} |
| 183 | aria-label="Previous screenshot" |
| 184 | className="hidden shrink-0 rounded-full border border-border bg-surface p-3 text-muted shadow-sm transition-colors hover:text-ink sm:block" |
| 185 | > |
| 186 | <Arrow dir="left" /> |
| 187 | </button> |
| 188 | |
| 189 | {/* Stage: a fixed-height frame so slides of the same orientation |
| 190 | swap without the layout jumping. Widens and flattens for the |
| 191 | landscape Windows shots instead of letterboxing them. */} |
| 192 | <div |
| 193 | className={`relative w-full overflow-hidden transition-[max-width] duration-300 ${ |
| 194 | isDesktop |
| 195 | ? "h-[220px] max-w-2xl sm:h-[400px]" |
| 196 | : "h-[460px] max-w-md sm:h-[600px]" |
| 197 | }`} |
| 198 | onTouchStart={onTouchStart} |
| 199 | onTouchEnd={onTouchEnd} |
| 200 | > |
| 201 | <div |
| 202 | className="flex h-full transition-transform duration-500 ease-out" |
| 203 | style={{ transform: `translateX(-${index * 100}%)` }} |
| 204 | > |
| 205 | {slides.map((shot, i) => ( |
| 206 | <figure |
| 207 | key={shot.src} |
| 208 | className="flex h-full w-full shrink-0 flex-col items-center justify-center" |
| 209 | aria-roledescription="slide" |
| 210 | aria-label={`${i + 1} of ${count}`} |
| 211 | aria-hidden={i !== index} |
| 212 | > |
| 213 | <div |
| 214 | className="flex min-h-0 flex-1 items-center justify-center" |
| 215 | style={{ |
| 216 | maxWidth: |
| 217 | shot.device === "phone" |
| 218 | ? 260 |
| 219 | : shot.device === "tablet" |
| 220 | ? 420 |
| 221 | : 640, |
| 222 | }} |
| 223 | > |
| 224 | <Image |
| 225 | src={shot.src} |
| 226 | alt={shot.alt} |
| 227 | width={shot.width} |
| 228 | height={shot.height} |
| 229 | priority={i === 0} |
| 230 | sizes="(max-width: 640px) 90vw, 420px" |
| 231 | className="h-full w-auto rounded-card border border-border bg-surface object-contain shadow-sm" |
| 232 | /> |
| 233 | </div> |
| 234 | <figcaption className="mt-4 text-center text-sm text-muted"> |
| 235 | {shot.caption} |
| 236 | </figcaption> |
| 237 | </figure> |
| 238 | ))} |
| 239 | </div> |
| 240 | </div> |
| 241 | |
| 242 | <button |
| 243 | type="button" |
| 244 | onClick={next} |
| 245 | aria-label="Next screenshot" |
| 246 | className="hidden shrink-0 rounded-full border border-border bg-surface p-3 text-muted shadow-sm transition-colors hover:text-ink sm:block" |
| 247 | > |
| 248 | <Arrow dir="right" /> |
| 249 | </button> |
| 250 | </div> |
| 251 | |
| 252 | {/* Dots */} |
| 253 | <div className="mt-6 flex items-center justify-center gap-2.5"> |
| 254 | {slides.map((shot, i) => ( |
| 255 | <button |
| 256 | key={shot.src} |
| 257 | type="button" |
| 258 | onClick={() => goTo(i)} |
| 259 | aria-label={`Go to ${shot.caption}`} |
| 260 | aria-current={i === index} |
| 261 | className={`h-2 rounded-full transition-all ${ |
| 262 | i === index ? "w-6 bg-brand" : "w-2 bg-border hover:bg-muted" |
| 263 | }`} |
| 264 | /> |
| 265 | ))} |
| 266 | </div> |
| 267 | </div> |
| 268 | </section> |
| 269 | ); |
| 270 | } |