Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
💄 Frame landing hero demo in a browser window (#3448)
Luke Vella5db2724d8589
diff --git a/apps/landing/src/components/home/hero-demo/browser-chrome.tsx b/apps/landing/src/components/home/hero-demo/browser-chrome.tsxnew file mode 100644index 000000000..d3ee96c64--- /dev/null+++ b/apps/landing/src/components/home/hero-demo/browser-chrome.tsx@@ -0,0 +1,48 @@+import {+ ChevronLeftIcon,+ ChevronRightIcon,+ CopyIcon,+ PlusIcon,+ RotateCwIcon,+ ShareIcon,+ TextIcon,+} from "lucide-react";++const ToolbarPill = ({ children }: { children: React.ReactNode }) => (+ <div className="flex h-8 items-center gap-3 rounded-full border border-gray-200 px-3 text-gray-500">+ {children}+ </div>+);++// A decorative browser toolbar so the desktop shot reads as the invite page a+// participant opens from their link.+export const BrowserChrome = ({ url }: { url: string }) => (+ <div className="grid grid-cols-[1fr_minmax(0,28rem)_1fr] items-center gap-4 border-gray-200/80 border-b bg-white px-4 py-2.5">+ <div className="flex items-center gap-4">+ <div className="flex gap-2">+ <span className="size-3 rounded-full bg-[#ff5f57]" />+ <span className="size-3 rounded-full bg-[#febc2e]" />+ <span className="size-3 rounded-full bg-[#28c840]" />+ </div>+ <ToolbarPill>+ <ChevronLeftIcon className="size-4" />+ <span className="h-4 w-px bg-gray-200" />+ <ChevronRightIcon className="size-4 text-gray-300" />+ </ToolbarPill>+ </div>+ <div className="flex h-8 items-center gap-3 rounded-full border border-gray-200 px-3 text-gray-500">+ <TextIcon className="size-4" />+ <span className="min-w-0 flex-1 truncate text-center text-gray-700 text-sm">+ {url}+ </span>+ <RotateCwIcon className="size-3.5" />+ </div>+ <div className="flex justify-end">+ <ToolbarPill>+ <ShareIcon className="size-4" />+ <PlusIcon className="size-4" />+ <CopyIcon className="size-4" />+ </ToolbarPill>+ </div>+ </div>+);diff --git a/apps/landing/src/components/home/hero-demo/demo-frame.tsx b/apps/landing/src/components/home/hero-demo/demo-frame.tsxindex f562c1f53..38539308e 100644--- a/apps/landing/src/components/home/hero-demo/demo-frame.tsx+++ b/apps/landing/src/components/home/hero-demo/demo-frame.tsx@@ -1,9 +1,15 @@import { cn } from "@rallly/ui";-// The shared device bezel: glass frame, identical corner treatment for the-// desktop and phone shots, differing only in size. The screen radius is the-// frame radius minus the 1px border and 6px padding so the corners stay-// concentric.+// The window the desktop demo sits in: a light border and a soft, layered+// shadow.+export const DemoWindow = ({ children }: { children: React.ReactNode }) => (+ <div className="overflow-hidden rounded-2xl border border-gray-200/80 bg-white shadow-[0_1px_2px_rgb(0_0_0/0.04),0_8px_24px_-6px_rgb(0_0_0/0.06),0_24px_64px_-16px_rgb(0_0_0/0.10)]">+ {children}+ </div>+);++// The phone's glass bezel. The screen radius is the frame radius minus the 1px+// border and 6px padding so the corners stay concentric.export const DemoFrame = ({children,className,diff --git a/apps/landing/src/components/home/hero-demo/desktop-demo.tsx b/apps/landing/src/components/home/hero-demo/desktop-demo.tsxindex 064824fe9..d16c7dad7 100644--- a/apps/landing/src/components/home/hero-demo/desktop-demo.tsx+++ b/apps/landing/src/components/home/hero-demo/desktop-demo.tsx@@ -9,9 +9,10 @@ import {UserIcon,} from "lucide-react";import * as React from "react";+import { BrowserChrome } from "./browser-chrome";import type { DemoDay } from "./demo-data";import { formatDemoParts, getInitials } from "./demo-data";-import { DemoFrame, DemoScreen } from "./demo-frame";+import { DemoWindow } from "./demo-frame";import type { DemoPreset } from "./demo-presets";import { VoteCount } from "./vote-count";import { VoteIcon } from "./vote-icon";@@ -44,8 +45,9 @@ export const DesktopDemo = ({}return (- <DemoFrame>- <DemoScreen className="bg-gray-100 p-4 sm:p-6">+ <DemoWindow>+ <BrowserChrome url="app.rallly.co/invite/k3Xb9qLm" />+ <div className="bg-gray-100 p-4 sm:p-6">{/* Pinned to the grid width (235px + 8 × 84px) so a long descriptionwraps instead of stretching the card past the table. */}<div className="mx-auto w-[907px] space-y-3 text-left">@@ -222,7 +224,7 @@ export const DesktopDemo = ({</div></div></div>- </DemoScreen>- </DemoFrame>+ </div>+ </DemoWindow>);};diff --git a/apps/landing/src/components/home/hero-demo/hero-demo.tsx b/apps/landing/src/components/home/hero-demo/hero-demo.tsxindex adda8b002..384ddbfe8 100644--- a/apps/landing/src/components/home/hero-demo/hero-demo.tsx+++ b/apps/landing/src/components/home/hero-demo/hero-demo.tsx@@ -50,12 +50,13 @@ const CachedDemo = async ({const scores = getScores(days, demoPreset.participants);return (- <div className="relative z-10 select-none md:mx-auto md:max-w-full lg:-mx-6 lg:mb-12 lg:max-w-none">- <div className="mr-[calc(50%-50vw)] overflow-hidden [mask-image:linear-gradient(to_left,transparent,black_6rem)] md:mr-0 md:overflow-visible md:[mask-image:none]">- <div- aria-hidden="true"- className="w-max [zoom:0.65] lg:w-auto md:[zoom:0.75] lg:[zoom:1]"- >+ <div className="relative z-10 flex select-none justify-end lg:block">+ {/* Below lg the whole composition is laid out at a fixed desktop width+ and scaled down. It is right aligned to the container, so the+ browser window overflows the viewport on the left while the phone+ stays in view. */}+ <div className="relative mb-12 w-[1060px] shrink-0 [zoom:0.6] lg:w-auto md:[zoom:0.75] lg:[zoom:1]">+ <div aria-hidden="true"><DesktopDemolocale={locale}days={days}@@ -64,19 +65,18 @@ const CachedDemo = async ({t={t}/></div>- </div>- {/* The grid is centred in the frame, so the phone is anchored to the- frame's centre rather than its edge: its bezel starts 1px past the- sixth option column boundary at any lg viewport width, leaving the- previous column clear and hiding the next one's content. */}- <div className="hidden lg:absolute lg:-bottom-12 lg:left-[calc(50%+205px)] lg:block lg:w-[320px]">- <TryItPrompt- text={t("heroDemoTryIt", {- ns: "home",- defaultValue: "Go ahead, try voting!",- })}- />- <MobileDemo locale={locale} days={days} scores={scores} t={t} />+ {/* Inset from the window's right edge by a share of its width, so the+ gap between the two right edges scales with the layout and never+ closes. */}+ <div className="absolute right-[4%] -bottom-12 w-[320px]">+ <TryItPrompt+ text={t("heroDemoTryIt", {+ ns: "home",+ defaultValue: "Go ahead, try voting!",+ })}+ />+ <MobileDemo locale={locale} days={days} scores={scores} t={t} />+ </div></div></div>);