Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

✨ Landing hero: presentational poll demo with live dates (#2934)

Luke Vella8435137c9b7e
diff --git a/apps/landing/public/locales/en/home.json b/apps/landing/public/locales/en/home.json
index fa0cfc41d..739af5e5c 100644
--- a/apps/landing/public/locales/en/home.json
+++ b/apps/landing/public/locales/en/home.json
@@ -1,7 +1,6 @@
{
"createAPoll": "Create a meeting poll",
"createASchedulingPoll": "Create a scheduling poll",
- "createPageLikeThis": "Create a page like this in seconds!",
"doodleAlternative": "The best free Doodle alternative",
"doodleAlternativeDescription": "Rallly is the Doodle alternative that everyone is looking for. Thousands of users have already made the switch and are now enjoying professional ad-free meeting polls in an intuitive and easy-to-use interface. ",
"doodleAlternativeFinalCtaDescription": "Create your first poll in seconds and see why so many people left Doodle behind.",
@@ -20,6 +19,24 @@
"freeSchedulingPollTitle": "Find a date for your next event",
"goodfirmsQuote": "“Unique in its simplicity and requires minimum interaction time.”",
"headline": "Find the best time to meet",
+ "heroDemoClose": "Close",
+ "heroDemoCreatePoll": "Create your own poll",
+ "heroDemoDecline": "Decline",
+ "heroDemoDescription": "Please pick every time you could attend. We'll go with the one that works for everyone.",
+ "heroDemoEasyDescription": "That's all it takes to respond to a poll.",
+ "heroDemoIfNeedBe": "If need be",
+ "heroDemoLocation": "Riverside Community Center",
+ "heroDemoNo": "No",
+ "heroDemoOptionCount": "{count, plural, one {# option} other {# options}}",
+ "heroDemoOrganizer": "Organized by Sofia Almeida",
+ "heroDemoParticipants": "Participants",
+ "heroDemoResponseOptions": "Response options",
+ "heroDemoThatWasEasy": "That was easy!",
+ "heroDemoTitle": "Q3 Board Meeting",
+ "heroDemoTryIt": "Go ahead, try voting!",
+ "heroDemoVote": "Vote",
+ "heroDemoYes": "Yes",
+ "heroDemoYou": "You",
"hint": "It's free! No login required.",
"hubspotQuote": "“The simplest choice for availability polling for large groups.”",
"metaDescription": "Rallly is the fastest and easiest scheduling and collaboration tool. Create a meeting poll in seconds, no login required.",
diff --git a/apps/landing/public/static/images/hero-shot.png b/apps/landing/public/static/images/hero-shot.png
deleted file mode 100644
index d532b33e1..000000000
Binary files a/apps/landing/public/static/images/hero-shot.png and /dev/null differ
diff --git a/apps/landing/public/static/images/hero.png b/apps/landing/public/static/images/hero.png
deleted file mode 100644
index e3ecd5aab..000000000
Binary files a/apps/landing/public/static/images/hero.png and /dev/null differ
diff --git a/apps/landing/src/app/[locale]/(main)/(seo)/best-doodle-alternative/page.tsx b/apps/landing/src/app/[locale]/(main)/(seo)/best-doodle-alternative/page.tsx
index 9029974f7..2352dfe0a 100644
--- a/apps/landing/src/app/[locale]/(main)/(seo)/best-doodle-alternative/page.tsx
+++ b/apps/landing/src/app/[locale]/(main)/(seo)/best-doodle-alternative/page.tsx
@@ -6,6 +6,7 @@ import { Trans } from "react-i18next/TransWithoutContext";
import Bonus from "@/components/home/bonus";
import { FinalCta } from "@/components/home/final-cta";
import { MarketingHero } from "@/components/home/hero";
+import { HeroDemo } from "@/components/home/hero-demo/hero-demo";
import { BigTestimonial, Marketing, MentionedBy } from "@/components/marketing";
import { getTranslation } from "@/i18n/server";
@@ -18,6 +19,7 @@ export default async function Page(props: {
return (
<Marketing>
<MarketingHero
+ demo={<HeroDemo locale={locale} />}
title={t("doodleAlternative", {
ns: "home",
})}
diff --git a/apps/landing/src/app/[locale]/(main)/(seo)/free-scheduling-poll/page.tsx b/apps/landing/src/app/[locale]/(main)/(seo)/free-scheduling-poll/page.tsx
index 90f57e349..83c415016 100644
--- a/apps/landing/src/app/[locale]/(main)/(seo)/free-scheduling-poll/page.tsx
+++ b/apps/landing/src/app/[locale]/(main)/(seo)/free-scheduling-poll/page.tsx
@@ -6,6 +6,7 @@ import { Trans } from "react-i18next/TransWithoutContext";
import Bonus from "@/components/home/bonus";
import { FinalCta } from "@/components/home/final-cta";
import { MarketingHero } from "@/components/home/hero";
+import { HeroDemo } from "@/components/home/hero-demo/hero-demo";
import { BigTestimonial, Marketing, MentionedBy } from "@/components/marketing";
import { getTranslation } from "@/i18n/server";
@@ -18,6 +19,7 @@ export default async function Page(props: {
return (
<Marketing>
<MarketingHero
+ demo={<HeroDemo locale={locale} />}
title={t("freeSchedulingPollTitle", {
ns: "home",
})}
diff --git a/apps/landing/src/app/[locale]/(main)/(seo)/when2meet-alternative/page.tsx b/apps/landing/src/app/[locale]/(main)/(seo)/when2meet-alternative/page.tsx
index 9008567bc..1663a4efb 100644
--- a/apps/landing/src/app/[locale]/(main)/(seo)/when2meet-alternative/page.tsx
+++ b/apps/landing/src/app/[locale]/(main)/(seo)/when2meet-alternative/page.tsx
@@ -6,6 +6,7 @@ import { Trans } from "react-i18next/TransWithoutContext";
import Bonus from "@/components/home/bonus";
import { FinalCta } from "@/components/home/final-cta";
import { MarketingHero } from "@/components/home/hero";
+import { HeroDemo } from "@/components/home/hero-demo/hero-demo";
import { BigTestimonial, Marketing, MentionedBy } from "@/components/marketing";
import { getTranslation } from "@/i18n/server";
@@ -18,6 +19,7 @@ export default async function Page(props: {
return (
<Marketing>
<MarketingHero
+ demo={<HeroDemo locale={locale} />}
title={t("when2meetAlternative", {
ns: "home",
})}
diff --git a/apps/landing/src/app/[locale]/(main)/page.tsx b/apps/landing/src/app/[locale]/(main)/page.tsx
index 1d38eb05e..935e31534 100644
--- a/apps/landing/src/app/[locale]/(main)/page.tsx
+++ b/apps/landing/src/app/[locale]/(main)/page.tsx
@@ -5,6 +5,7 @@ import { cacheLife } from "next/cache";
import Bonus from "@/components/home/bonus";
import { FinalCta } from "@/components/home/final-cta";
import { MarketingHero } from "@/components/home/hero";
+import { HeroDemo } from "@/components/home/hero-demo/hero-demo";
import { BigTestimonial, Marketing, MentionedBy } from "@/components/marketing";
import { getTranslation } from "@/i18n/server";
@@ -17,6 +18,7 @@ export default async function Page(props: {
return (
<Marketing>
<MarketingHero
+ demo={<HeroDemo locale={locale} />}
title={t("headline", {
defaultValue: "Find the best time to meet",
ns: "home",
diff --git a/apps/landing/src/components/home/hero-demo/demo-data.ts b/apps/landing/src/components/home/hero-demo/demo-data.ts
new file mode 100644
index 000000000..6ade3cfd4
--- /dev/null
+++ b/apps/landing/src/components/home/hero-demo/demo-data.ts
@@ -0,0 +1,102 @@
+export type DemoVote = "yes" | "ifNeedBe" | "no";
+
+export type DemoOption = {
+ start: Date;
+ end: Date;
+};
+
+export type DemoDay = {
+ date: Date;
+ options: DemoOption[];
+};
+
+// Participant names are sample data and stay untranslated; votes are indexed
+// against the flattened option list (four Thursdays, two slots each).
+export const demoParticipants: { name: string; votes: DemoVote[] }[] = [
+ {
+ name: "Margaret Ellis",
+ votes: ["ifNeedBe", "yes", "no", "yes", "yes", "yes", "no", "yes"],
+ },
+ {
+ name: "Priya Patel",
+ votes: ["yes", "yes", "yes", "no", "yes", "yes", "no", "yes"],
+ },
+ {
+ name: "Tom Becker",
+ votes: ["yes", "yes", "yes", "yes", "yes", "no", "ifNeedBe", "yes"],
+ },
+ {
+ name: "Grace Okafor",
+ votes: ["no", "yes", "no", "yes", "yes", "no", "no", "yes"],
+ },
+];
+
+const HOUR_MS = 60 * 60 * 1000;
+const DAY_MS = 24 * HOUR_MS;
+const SLOT_HOURS = [12, 18];
+
+// The demo dates are floating wall times constructed in UTC and always
+// formatted with timeZone: "UTC", so the rendered clock times don't depend
+// on the server's time zone.
+export function getDemoDays(now: Date): DemoDay[] {
+ let day = new Date(now.getTime() + 7 * DAY_MS);
+ while (day.getUTCDay() !== 4) {
+ day = new Date(day.getTime() + DAY_MS);
+ }
+ return [0, 1, 2, 3].map((week) => {
+ const thursday = new Date(day.getTime() + week * 7 * DAY_MS);
+ const midnight = Date.UTC(
+ thursday.getUTCFullYear(),
+ thursday.getUTCMonth(),
+ thursday.getUTCDate(),
+ );
+ return {
+ date: new Date(midnight),
+ options: SLOT_HOURS.map((hour) => ({
+ start: new Date(midnight + hour * HOUR_MS),
+ end: new Date(midnight + (hour + 1) * HOUR_MS),
+ })),
+ };
+ });
+}
+
+export function getInitials(name: string) {
+ return name
+ .split(" ")
+ .map((part) => part[0])
+ .join("");
+}
+
+// The count badge in the app includes both yes and if-need-be votes.
+export function getScores(days: DemoDay[]) {
+ const optionCount = days.reduce((sum, day) => sum + day.options.length, 0);
+ return Array.from({ length: optionCount }, (_, index) =>
+ demoParticipants.reduce(
+ (score, participant) =>
+ participant.votes[index] === "no" ? score : score + 1,
+ 0,
+ ),
+ );
+}
+
+export function formatDemoParts(locale: string) {
+ const utc = { timeZone: "UTC" } as const;
+ return {
+ month: new Intl.DateTimeFormat(locale, { ...utc, month: "short" }),
+ year: new Intl.DateTimeFormat(locale, { ...utc, year: "numeric" }),
+ weekday: new Intl.DateTimeFormat(locale, { ...utc, weekday: "short" }),
+ dayOfMonth: new Intl.DateTimeFormat(locale, { ...utc, day: "numeric" }),
+ fullDay: new Intl.DateTimeFormat(locale, {
+ ...utc,
+ weekday: "short",
+ day: "numeric",
+ month: "short",
+ year: "numeric",
+ }),
+ time: new Intl.DateTimeFormat(locale, {
+ ...utc,
+ hour: "numeric",
+ minute: "2-digit",
+ }),
+ };
+}
diff --git a/apps/landing/src/components/home/hero-demo/demo-frame.tsx b/apps/landing/src/components/home/hero-demo/demo-frame.tsx
new file mode 100644
index 000000000..178083dfc
--- /dev/null
+++ b/apps/landing/src/components/home/hero-demo/demo-frame.tsx
@@ -0,0 +1,37 @@
+import { cn } from "@rallly/ui";
+
+// The shared device bezel: glass frame, identical corner treatment for the
+// desktop and phone shots, differing only in size.
+export const DemoFrame = ({
+ children,
+ className,
+}: {
+ children: React.ReactNode;
+ className?: string;
+}) => (
+ <div
+ className={cn(
+ "rounded-[2.2rem] border border-white/60 bg-white/60 p-1.5 shadow-sm backdrop-blur-xl",
+ className,
+ )}
+ >
+ {children}
+ </div>
+);
+
+export const DemoScreen = ({
+ children,
+ className,
+}: {
+ children: React.ReactNode;
+ className?: string;
+}) => (
+ <div
+ className={cn(
+ "overflow-hidden rounded-[1.8rem] border bg-white",
+ className,
+ )}
+ >
+ {children}
+ </div>
+);
diff --git a/apps/landing/src/components/home/hero-demo/desktop-demo.tsx b/apps/landing/src/components/home/hero-demo/desktop-demo.tsx
new file mode 100644
index 000000000..8bb0ee074
--- /dev/null
+++ b/apps/landing/src/components/home/hero-demo/desktop-demo.tsx
@@ -0,0 +1,238 @@
+import { cn } from "@rallly/ui";
+import type { TFunction } from "i18next";
+import {
+ ClockIcon,
+ MapPinIcon,
+ Maximize2Icon,
+ PlusIcon,
+ UserIcon,
+} from "lucide-react";
+import * as React from "react";
+import type { DemoDay } from "./demo-data";
+import { demoParticipants, formatDemoParts, getInitials } from "./demo-data";
+import { DemoFrame, DemoScreen } from "./demo-frame";
+import { VoteCount } from "./vote-count";
+import { VoteIcon } from "./vote-icon";
+
+export const DesktopDemo = ({
+ locale,
+ days,
+ scores,
+ t,
+}: {
+ locale: string;
+ days: DemoDay[];
+ scores: number[];
+ t: TFunction<"home">;
+}) => {
+ const format = formatDemoParts(locale);
+ const optionCount = scores.length;
+ const topScore = Math.max(...scores);
+
+ const monthGroups: { label: string; span: number }[] = [];
+ for (const day of days) {
+ const label = `${format.month.format(day.date).toUpperCase()} ${format.year.format(day.date)}`;
+ const last = monthGroups.at(-1);
+ if (last?.label === label) {
+ last.span += day.options.length;
+ } else {
+ monthGroups.push({ label, span: day.options.length });
+ }
+ }
+
+ return (
+ <DemoFrame className="rounded-2xl lg:rounded-[2.2rem]">
+ <DemoScreen className="rounded-xl bg-gray-100 p-4 sm:p-6 lg:rounded-[1.8rem]">
+ <div className="mx-auto w-fit space-y-3 text-left">
+ <div className="overflow-hidden rounded-xl border border-gray-200/60 bg-white">
+ <div className="h-1.5 bg-gradient-to-r from-indigo-500 to-violet-500" />
+ <div className="space-y-3 p-4 sm:p-5">
+ <div>
+ <h3 className="font-semibold text-gray-900 text-lg tracking-tight">
+ {t("heroDemoTitle", {
+ ns: "home",
+ defaultValue: "Q3 Board Meeting",
+ })}
+ </h3>
+ <p className="mt-1 text-gray-600 text-sm">
+ {t("heroDemoDescription", {
+ ns: "home",
+ defaultValue:
+ "Please pick every time you could attend. We'll go with the one that works for everyone.",
+ })}
+ </p>
+ </div>
+ <div className="space-y-1.5 text-gray-600 text-sm">
+ <div className="flex items-center gap-2">
+ <UserIcon className="size-4 text-gray-400" />
+ {t("heroDemoOrganizer", {
+ ns: "home",
+ defaultValue: "Organized by Sofia Almeida",
+ })}
+ </div>
+ <div className="flex items-center gap-2">
+ <MapPinIcon className="size-4 text-gray-400" />
+ {t("heroDemoLocation", {
+ ns: "home",
+ defaultValue: "Riverside Community Center",
+ })}
+ </div>
+ </div>
+ <div>
+ <div className="font-medium text-gray-900 text-sm">
+ {t("heroDemoResponseOptions", {
+ ns: "home",
+ defaultValue: "Response options",
+ })}
+ </div>
+ <div className="mt-1.5 flex items-center gap-4 text-gray-600 text-sm">
+ <span className="flex items-center gap-1.5">
+ <VoteIcon vote="yes" className="size-4" />
+ {t("heroDemoYes", {
+ ns: "home",
+ defaultValue: "Yes",
+ })}
+ </span>
+ <span className="flex items-center gap-1.5">
+ <VoteIcon vote="ifNeedBe" className="size-4" />
+ {t("heroDemoIfNeedBe", {
+ ns: "home",
+ defaultValue: "If need be",
+ })}
+ </span>
+ <span className="flex items-center gap-1.5">
+ <VoteIcon vote="no" className="size-4" />
+ {t("heroDemoNo", {
+ ns: "home",
+ defaultValue: "No",
+ })}
+ </span>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div className="overflow-hidden rounded-xl border border-gray-200/60 bg-white">
+ <div className="flex items-center justify-between px-4 py-3">
+ <div className="flex items-center gap-2">
+ <span className="font-semibold text-gray-900 text-sm">
+ {t("heroDemoParticipants", {
+ ns: "home",
+ defaultValue: "Participants",
+ })}
+ </span>
+ <span className="rounded-md border px-1.5 py-0.5 text-gray-500 text-xs">
+ {demoParticipants.length}
+ </span>
+ <span className="flex size-6 items-center justify-center rounded-md border text-gray-500">
+ <PlusIcon className="size-3.5" />
+ </span>
+ </div>
+ <div className="flex items-center gap-3 text-gray-500 text-sm">
+ <span>
+ {t("heroDemoOptionCount", {
+ ns: "home",
+ defaultValue:
+ "{count, plural, one {# option} other {# options}}",
+ count: optionCount,
+ })}
+ </span>
+ <Maximize2Icon className="size-4" />
+ </div>
+ </div>
+ <div className="grid grid-cols-[172px_repeat(8,84px)] border-gray-100 border-t text-center">
+ <div />
+ {monthGroups.map((group) => (
+ <div
+ key={group.label}
+ style={{ gridColumn: `span ${group.span}` }}
+ className="border-gray-100 border-l py-2 text-left"
+ >
+ <span className="pl-3 font-medium text-gray-700 text-xs tracking-wide">
+ {group.label}
+ </span>
+ </div>
+ ))}
+ <div />
+ {days.flatMap((day) =>
+ day.options.map((option, slotIndex) => (
+ <div
+ key={option.start.toISOString()}
+ className={cn(
+ "border-gray-100 border-t pt-2.5 text-gray-500 text-xs",
+ slotIndex === 0 && "border-l",
+ )}
+ >
+ {slotIndex === 0 && (
+ <>
+ {format.weekday.format(day.date)}
+ <div className="font-semibold text-base text-gray-900">
+ {format.dayOfMonth.format(day.date)}
+ </div>
+ </>
+ )}
+ </div>
+ )),
+ )}
+ <div />
+ {days.flatMap((day) =>
+ day.options.map((option, slotIndex) => {
+ const optionIndex =
+ days
+ .slice(0, days.indexOf(day))
+ .reduce((sum, d) => sum + d.options.length, 0) +
+ slotIndex;
+ const score = scores[optionIndex];
+ return (
+ <div
+ key={option.start.toISOString()}
+ className={cn(
+ "space-y-1 py-2.5 text-xs",
+ slotIndex === 0
+ ? "border-gray-100 border-l"
+ : "border-gray-50 border-l",
+ )}
+ >
+ <div className="text-gray-700">
+ {format.time.format(option.start)}
+ </div>
+ <div className="flex items-center justify-center gap-1 text-gray-500">
+ <ClockIcon className="size-3" />
+ 1h
+ </div>
+ <VoteCount count={score} highlight={score === topScore} />
+ </div>
+ );
+ }),
+ )}
+ {demoParticipants.map((participant) => (
+ <React.Fragment key={participant.name}>
+ <div className="flex items-center gap-2.5 border-gray-100 border-t px-3 py-3 text-left">
+ <span className="flex size-7 items-center justify-center rounded-full bg-gray-100 font-medium text-[10px] text-gray-600 uppercase">
+ {getInitials(participant.name)}
+ </span>
+ <span className="truncate text-gray-800 text-sm">
+ {participant.name}
+ </span>
+ </div>
+ {participant.votes.map((vote, index) => (
+ <div
+ key={`${participant.name}-${index}`}
+ className={cn(
+ "flex items-center justify-center border-gray-100 border-t",
+ index % 2 === 0
+ ? "border-l"
+ : "border-gray-50 border-l",
+ )}
+ >
+ <VoteIcon vote={vote} className="size-4" />
+ </div>
+ ))}
+ </React.Fragment>
+ ))}
+ </div>
+ </div>
+ </div>
+ </DemoScreen>
+ </DemoFrame>
+ );
+};
diff --git a/apps/landing/src/components/home/hero-demo/hero-demo.tsx b/apps/landing/src/components/home/hero-demo/hero-demo.tsx
new file mode 100644
index 000000000..a0dd675b7
--- /dev/null
+++ b/apps/landing/src/components/home/hero-demo/hero-demo.tsx
@@ -0,0 +1,49 @@
+import { getTranslation } from "@/i18n/server";
+import { formatDemoParts, getDemoDays, getScores } from "./demo-data";
+import { DesktopDemo } from "./desktop-demo";
+import { MobileDemo } from "./mobile-demo";
+import { TryItPrompt } from "./try-it-prompt";
+
+// A presentational replica of the poll screens, deliberately decoupled from
+// apps/web so the landing page can't be broken by app changes. Dates are
+// computed at render time and cached with the page (cacheLife on the pages
+// that use this), so they refresh with the page cache instead of going stale
+// like a screenshot.
+//
+// The desktop shot is decoration (aria-hidden, no interactive elements); the
+// phone is a working demo, so date and time strings are pre-formatted here on
+// the server and passed down as plain props — client-side Intl could disagree
+// with the server and cause hydration mismatches.
+export const HeroDemo = async ({ locale }: { locale: string }) => {
+ const { t } = await getTranslation<"home">(locale, "home");
+ const days = getDemoDays(new Date());
+ const scores = getScores(days);
+ const format = formatDemoParts(locale);
+
+ let optionIndex = -1;
+ const mobileDays = days.map((day) => ({
+ label: format.fullDay.format(day.date),
+ options: day.options.map((option) => {
+ optionIndex += 1;
+ return {
+ id: option.start.toISOString(),
+ time: format.time.formatRange(option.start, option.end),
+ score: scores[optionIndex],
+ };
+ }),
+ }));
+
+ return (
+ <div className="relative z-10 mb-12 lg:mx-auto lg:w-fit lg:max-w-full">
+ <div className="mr-[calc(50%-50vw)] overflow-hidden [mask-image:linear-gradient(to_left,transparent,black_6rem)] lg:mr-0 lg:overflow-visible lg:[mask-image:none]">
+ <div aria-hidden="true" className="w-max [zoom:0.65] lg:[zoom:1]">
+ <DesktopDemo locale={locale} days={days} scores={scores} t={t} />
+ </div>
+ </div>
+ <div className="hidden lg:absolute lg:-right-6 lg:-bottom-12 lg:block lg:w-[320px]">
+ <TryItPrompt />
+ <MobileDemo days={mobileDays} />
+ </div>
+ </div>
+ );
+};
diff --git a/apps/landing/src/components/home/hero-demo/mobile-demo.tsx b/apps/landing/src/components/home/hero-demo/mobile-demo.tsx
new file mode 100644
index 000000000..df905c08e
--- /dev/null
+++ b/apps/landing/src/components/home/hero-demo/mobile-demo.tsx
@@ -0,0 +1,243 @@
+"use client";
+import { posthog } from "@rallly/posthog/client";
+import { cn } from "@rallly/ui";
+import { CircleCheckIcon, UserIcon, XIcon } from "lucide-react";
+import * as m from "motion/react-m";
+import Link from "next/link";
+import * as React from "react";
+import { Trans } from "@/i18n/client/trans";
+import { useTranslation } from "@/i18n/client/use-translation";
+import { linkToApp } from "@/lib/linkToApp";
+import type { DemoVote } from "./demo-data";
+import { DemoFrame, DemoScreen } from "./demo-frame";
+import { VoteCount } from "./vote-count";
+import { VoteIcon } from "./vote-icon";
+
+export type MobileDemoDay = {
+ label: string;
+ options: { id: string; time: string; score: number }[];
+};
+
+const initialVotes: (DemoVote | undefined)[] = ["yes", "yes", "ifNeedBe"];
+
+const TriState = ({
+ label,
+ value,
+ onChange,
+}: {
+ label: string;
+ value?: DemoVote;
+ onChange: (vote: DemoVote) => void;
+}) => {
+ const { t } = useTranslation("home");
+ const voteLabels: Record<DemoVote, string> = {
+ yes: t("heroDemoYes", { defaultValue: "Yes" }),
+ ifNeedBe: t("heroDemoIfNeedBe", { defaultValue: "If need be" }),
+ no: t("heroDemoNo", { defaultValue: "No" }),
+ };
+ return (
+ <div className="flex h-8 w-24 shrink-0 items-center rounded-lg border border-gray-200/60 bg-gray-100 p-0.5">
+ {(["yes", "ifNeedBe", "no"] as const).map((vote) => {
+ const isSelected = vote === value;
+ return (
+ <label
+ key={vote}
+ className={cn(
+ "group flex h-full flex-1 cursor-pointer items-center justify-center rounded-md has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-indigo-500",
+ isSelected && "bg-white shadow-sm",
+ )}
+ >
+ <input
+ type="radio"
+ name={label}
+ checked={isSelected}
+ onChange={() => onChange(vote)}
+ aria-label={voteLabels[vote]}
+ className="sr-only"
+ />
+ <VoteIcon
+ vote={vote}
+ className={cn(
+ "size-3.5",
+ !isSelected &&
+ "text-gray-400 opacity-50 transition-opacity group-hover:opacity-100",
+ )}
+ />
+ </label>
+ );
+ })}
+ </div>
+ );
+};
+
+export const MobileDemo = ({ days }: { days: MobileDemoDay[] }) => {
+ const { t } = useTranslation("home");
+ const [submitted, setSubmitted] = React.useState(false);
+ const topScore = Math.max(
+ ...days.flatMap((day) => day.options.map((option) => option.score)),
+ );
+ const [votes, setVotes] = React.useState<
+ Record<string, DemoVote | undefined>
+ >(() => {
+ const entries: Record<string, DemoVote | undefined> = {};
+ days
+ .flatMap((day) => day.options)
+ .forEach((option, index) => {
+ entries[option.id] = initialVotes[index];
+ });
+ return entries;
+ });
+
+ return (
+ <DemoFrame className="rounded-[1.8rem]">
+ <DemoScreen className="relative flex h-[620px] flex-col rounded-[1.4rem] text-left">
+ <div className="flex items-center justify-between border-gray-100 border-b px-3 py-3">
+ <span className="flex items-center gap-2 font-medium text-gray-900 text-sm">
+ <span className="flex size-6 items-center justify-center rounded-full bg-gray-100">
+ <UserIcon className="size-3.5 text-gray-500" />
+ </span>
+ <Trans ns="home" i18nKey="heroDemoYou" defaults="You" />
+ </span>
+ </div>
+ <div className="min-h-0 flex-1 overflow-hidden">
+ {days.map((day) => (
+ <div key={day.label}>
+ <div className="border-gray-100 border-b bg-gray-50/60 px-3 py-2 font-semibold text-gray-900 text-xs">
+ {day.label}
+ </div>
+ {day.options.map((option) => (
+ <div
+ key={option.id}
+ className="flex items-center justify-between gap-2 border-gray-100 border-b px-3 py-3"
+ >
+ <div className="min-w-0 flex-1 text-gray-800 text-xs">
+ {option.time}
+ </div>
+ <VoteCount
+ count={option.score}
+ highlight={option.score === topScore}
+ className="mr-2 shrink-0"
+ />
+ <TriState
+ label={`${day.label} ${option.time}`}
+ value={votes[option.id]}
+ onChange={(vote) => {
+ setVotes((current) => ({
+ ...current,
+ [option.id]: vote,
+ }));
+ }}
+ />
+ </div>
+ ))}
+ </div>
+ ))}
+ </div>
+ <div className="absolute inset-x-0 bottom-0 flex items-center gap-2 bg-gradient-to-t from-55% from-white via-85% via-white/70 to-transparent p-3 pt-10">
+ <span
+ aria-hidden="true"
+ className="flex-1 rounded-xl border border-white/60 bg-white/70 py-2.5 text-center font-medium text-gray-800 text-sm shadow-sm backdrop-blur-md"
+ >
+ <Trans ns="home" i18nKey="heroDemoDecline" defaults="Decline" />
+ </span>
+ <button
+ type="button"
+ onClick={() => {
+ posthog?.capture("landing:hero_demo_continue_click");
+ setSubmitted(true);
+ }}
+ className="flex-[2] cursor-pointer rounded-xl bg-indigo-500/90 py-2.5 text-center font-medium text-sm text-white shadow-sm backdrop-blur-md hover:bg-indigo-500"
+ >
+ <Trans ns="home" i18nKey="heroDemoVote" defaults="Vote" />
+ </button>
+ </div>
+ {submitted && (
+ <div className="absolute inset-0 z-10 flex items-center justify-center bg-gray-900/20 p-4">
+ <m.div
+ initial={{ scale: 0.92, opacity: 0, y: 8 }}
+ animate={{ scale: 1, opacity: 1, y: 0 }}
+ transition={{ type: "spring", duration: 0.5, bounce: 0.35 }}
+ className="relative flex aspect-[4/3] w-full flex-col items-center justify-center rounded-2xl border border-white/60 bg-white/85 p-4 text-center shadow-lg backdrop-blur-xl"
+ >
+ <button
+ type="button"
+ aria-label={t("heroDemoClose", { defaultValue: "Close" })}
+ onClick={() => setSubmitted(false)}
+ className="absolute top-3 right-3 flex size-6 cursor-pointer items-center justify-center rounded-full text-gray-400 hover:bg-gray-100 hover:text-gray-600"
+ >
+ <XIcon className="size-4" />
+ </button>
+ <m.div
+ initial={{ scale: 0, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ transition={{
+ type: "spring",
+ duration: 0.6,
+ bounce: 0.45,
+ delay: 0.1,
+ }}
+ className="relative mb-3 inline-block"
+ >
+ <div className="absolute top-0 right-0 bottom-2 -left-1.5 origin-bottom -rotate-12 scale-95 rounded-xl bg-white opacity-75 shadow-xs ring-1 ring-gray-200 ring-inset" />
+ <div className="absolute top-0 -right-1.5 bottom-2 left-0 origin-bottom rotate-12 scale-95 rounded-xl bg-white opacity-75 shadow-xs ring-1 ring-gray-200 ring-inset" />
+ <div className="relative inline-flex rounded-xl bg-white p-2.5 shadow-xs ring-1 ring-gray-200 ring-inset">
+ <CircleCheckIcon className="size-5 text-green-500" />
+ </div>
+ </m.div>
+ <m.div
+ initial={{ opacity: 0, y: 6 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ type: "spring",
+ duration: 0.6,
+ bounce: 0.3,
+ delay: 0.2,
+ }}
+ >
+ <p className="font-semibold text-gray-900 text-sm">
+ <Trans
+ ns="home"
+ i18nKey="heroDemoThatWasEasy"
+ defaults="That was easy!"
+ />
+ </p>
+ <p className="mt-1.5 text-gray-500 text-xs">
+ <Trans
+ ns="home"
+ i18nKey="heroDemoEasyDescription"
+ defaults="That's all it takes to respond to a poll."
+ />
+ </p>
+ </m.div>
+ <m.div
+ initial={{ opacity: 0, y: 6 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ type: "spring",
+ duration: 0.6,
+ bounce: 0.3,
+ delay: 0.3,
+ }}
+ className="mt-4"
+ >
+ <Link
+ href={linkToApp("/new")}
+ onClick={() => {
+ posthog?.capture("landing:hero_demo_modal_cta_click");
+ }}
+ className="font-medium text-indigo-600 text-xs hover:underline"
+ >
+ <Trans
+ ns="home"
+ i18nKey="heroDemoCreatePoll"
+ defaults="Create your own poll"
+ />
+ </Link>
+ </m.div>
+ </m.div>
+ </div>
+ )}
+ </DemoScreen>
+ </DemoFrame>
+ );
+};
diff --git a/apps/landing/src/components/home/hero-demo/try-it-prompt.tsx b/apps/landing/src/components/home/hero-demo/try-it-prompt.tsx
new file mode 100644
index 000000000..1d1bd098c
--- /dev/null
+++ b/apps/landing/src/components/home/hero-demo/try-it-prompt.tsx
@@ -0,0 +1,36 @@
+import { cn } from "@rallly/ui";
+import { handwritten } from "@/fonts/handwritten";
+import { Trans } from "@/i18n/client/trans";
+
+const ScribbleArrow = ({ className }: { className?: string }) => (
+ <svg
+ viewBox="0 0 30 30"
+ fill="currentColor"
+ aria-hidden="true"
+ className={className}
+ >
+ <path
+ fillRule="evenodd"
+ d="M1.11 2.994h.001l.014-.002a17.546 17.546 0 011.383-.055c.902 0 2.175.06 3.643.3 2.944.48 6.612 1.674 9.67 4.498 1.464 1.35 2.55 3.281 3.339 5.492.787 2.204 1.259 4.626 1.535 6.894.27 2.224.35 4.275.36 5.788l-4.245-4.83a1 1 0 10-1.502 1.32l5.94 6.761a1 1 0 001.412.091l6.76-5.94a1 1 0 10-1.32-1.503l-5.045 4.433v-.262a53.57 53.57 0 00-.375-6.1c-.287-2.357-.783-4.935-1.637-7.325-.85-2.383-2.078-4.64-3.865-6.289-3.44-3.176-7.523-4.483-10.704-5.002A24.842 24.842 0 002.508.938a19.54 19.54 0 00-1.492.056 7.207 7.207 0 00-.089.008l-.025.003H.89v.001L1 2l-.11-.994a1 1 0 00.22 1.988"
+ clipRule="evenodd"
+ />
+ </svg>
+);
+
+export const TryItPrompt = () => (
+ <div
+ className={cn(
+ "pointer-events-none absolute -top-12 right-2 flex items-start gap-2 text-gray-600",
+ handwritten.className,
+ )}
+ >
+ <span className="-rotate-2 whitespace-nowrap text-sm">
+ <Trans
+ ns="home"
+ i18nKey="heroDemoTryIt"
+ defaults="Go ahead, try voting!"
+ />
+ </span>
+ <ScribbleArrow className="mt-3 size-6 text-gray-500" />
+ </div>
+);
diff --git a/apps/landing/src/components/home/hero-demo/vote-count.tsx b/apps/landing/src/components/home/hero-demo/vote-count.tsx
new file mode 100644
index 000000000..45bc7850b
--- /dev/null
+++ b/apps/landing/src/components/home/hero-demo/vote-count.tsx
@@ -0,0 +1,25 @@
+import { cn } from "@rallly/ui";
+import { UsersIcon } from "lucide-react";
+
+// Shared by the desktop and mobile demos: options with the highest count
+// render more prominently, like the score summary in the app.
+export const VoteCount = ({
+ count,
+ highlight,
+ className,
+}: {
+ count: number;
+ highlight?: boolean;
+ className?: string;
+}) => (
+ <div
+ className={cn(
+ "flex items-center justify-center gap-1 text-xs",
+ highlight ? "font-medium text-gray-700" : "text-gray-500",
+ className,
+ )}
+ >
+ <UsersIcon className="size-3.5" />
+ {count}
+ </div>
+);
diff --git a/apps/landing/src/components/home/hero-demo/vote-icon.tsx b/apps/landing/src/components/home/hero-demo/vote-icon.tsx
new file mode 100644
index 000000000..dd328176d
--- /dev/null
+++ b/apps/landing/src/components/home/hero-demo/vote-icon.tsx
@@ -0,0 +1,38 @@
+import { cn } from "@rallly/ui";
+import { CheckIcon, XIcon } from "lucide-react";
+import type { DemoVote } from "./demo-data";
+
+export const IfNeedBeIcon = ({ className }: { className?: string }) => (
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={3.5}
+ strokeLinecap="round"
+ aria-hidden="true"
+ className={className}
+ >
+ <path d="M20 13.5c-2.5-5-5-5-7-1s-4.5 4-7-1" />
+ </svg>
+);
+
+export const VoteIcon = ({
+ vote,
+ className,
+}: {
+ vote: DemoVote;
+ className?: string;
+}) => {
+ if (vote === "yes") {
+ return (
+ <CheckIcon
+ strokeWidth={3.5}
+ className={cn("text-green-500", className)}
+ />
+ );
+ }
+ if (vote === "ifNeedBe") {
+ return <IfNeedBeIcon className={cn("text-amber-400", className)} />;
+ }
+ return <XIcon strokeWidth={3.5} className={cn("text-gray-400", className)} />;
+};
diff --git a/apps/landing/src/components/home/hero.tsx b/apps/landing/src/components/home/hero.tsx
index 6c323a89c..5c421da0a 100644
--- a/apps/landing/src/components/home/hero.tsx
+++ b/apps/landing/src/components/home/hero.tsx
@@ -3,88 +3,26 @@ import { posthog } from "@rallly/posthog/client";
import { buttonVariants, cn } from "@rallly/ui";
import { Badge } from "@rallly/ui/badge";
import { ChevronRightIcon } from "lucide-react";
-import * as m from "motion/react-m";
-import Image from "next/image";
import Link from "next/link";
-import * as React from "react";
+import type * as React from "react";
import { handwritten } from "@/fonts/handwritten";
import { Trans } from "@/i18n/client/trans";
import { linkToApp } from "@/lib/linkToApp";
-const Screenshot = () => {
- const [isLoaded, setIsLoaded] = React.useState(false);
-
- return (
- <>
- <m.div
- transition={{
- delay: 0.5,
- type: "spring",
- duration: 1,
- bounce: 0.4,
- }}
- variants={{
- hidden: { opacity: 0, y: 0, z: 0 },
- visible: { opacity: 1, y: -10, z: 0 },
- }}
- initial="hidden"
- animate={isLoaded ? "visible" : "hidden"}
- style={{
- backfaceVisibility: "hidden",
- }}
- className="relative z-20 mx-auto w-fit max-w-full rounded-full border bg-gray-800 px-3 py-2 text-gray-50 text-sm subpixel-antialiased shadow-huge"
- >
- <Trans
- ns="home"
- i18nKey="createPageLikeThis"
- defaults="Create a page like this in seconds!"
- />
- <span className="absolute top-full left-1/2 z-10 h-8 w-px -translate-x-1/2 bg-gray-800" />
- <span className="absolute -bottom-12 left-1/2 z-10 inline-block size-3 origin-center -translate-x-1/2 rounded-full bg-gray-800 ring-1 ring-gray-800 ring-offset-2" />
- <span className="absolute -bottom-12 left-1/2 z-10 inline-block size-3 origin-center -translate-x-1/2 animate-ping rounded-full bg-gray-800 ring-1 ring-gray-800 ring-offset-2" />
- </m.div>
- <m.div
- transition={{
- type: "spring",
- duration: 1,
- bounce: 0.3,
- }}
- variants={{
- hidden: { opacity: 0, scale: 0.95, y: 5 },
- visible: { opacity: 1, scale: 1, y: 0 },
- }}
- initial="hidden"
- animate={isLoaded ? "visible" : "hidden"}
- className="mx-auto w-fit overflow-hidden rounded-md border shadow-huge"
- >
- <Image
- src="/static/images/hero-shot.png"
- alt="Screenshot of Rallly Poll"
- width={1440}
- height={1152}
- quality={100}
- preload
- onLoad={() => {
- setIsLoaded(true);
- }}
- />
- </m.div>
- </>
- );
-};
-
export const MarketingHero = ({
title,
description,
callToAction,
+ demo,
}: {
title: string;
description: string;
callToAction: React.ReactNode;
+ demo: React.ReactNode;
}) => {
return (
- <article className="max-w-full space-y-12 text-center">
- <header className="sm:p-8">
+ <article className="max-w-full space-y-16 text-center">
+ <header className="pt-6 sm:pt-28 sm:pb-8">
<div>
<Link
href="/blog/mobile-voting-redesign"
@@ -141,9 +79,7 @@ export const MarketingHero = ({
</p>
</div>
</header>
- <section>
- <Screenshot />
- </section>
+ <section>{demo}</section>
</article>
);
};
diff --git a/biome-plugins/no-raw-datetime-formatting.grit b/biome-plugins/no-raw-datetime-formatting.grit
index f53b38182..50f961fe9 100644
--- a/biome-plugins/no-raw-datetime-formatting.grit
+++ b/biome-plugins/no-raw-datetime-formatting.grit
@@ -3,12 +3,13 @@
// The allowlist below is the escape hatch: lib/datetime itself, zone
// detection (timezone-schema), zone abbreviations (timezone-utils), tests
// (which format independently of the app to act as an oracle, matching the
-// tests exemption in the biome.json overrides), and files still pending
-// migration. Shrink it as RAL-1247 proceeds.
-// packages/ui is exempt entirely: lib/datetime is an apps/web app-layer
-// concept, and a shared UI package cannot import it (wrong layering
-// direction). Shared primitives in packages/ui format dates only via a
-// caller-passed `locale` prop, which is a legitimate, narrower contract.
+// tests exemption in the biome.json overrides), repo scripts (tooling that
+// renders no user-facing UI), and files still pending migration. Shrink it
+// as RAL-1247 proceeds.
+// packages/ui and apps/landing are exempt entirely: lib/datetime is an
+// apps/web app-layer concept, and neither a shared UI package nor another
+// app can import it (wrong layering direction). Both format dates only via
+// a caller-passed `locale`, which is a legitimate, narrower contract.
language js
or {
@@ -24,7 +25,9 @@ or {
r".*/src/components/time-zone-picker/timezone-utils\.ts",
r".*/src/features/poll/components/manage-poll/use-csv-exporter\.ts",
r".*/tests/.*",
- r".*/packages/ui/.*"
+ r".*/scripts/.*",
+ r".*/packages/ui/.*",
+ r".*/apps/landing/.*"
},
register_diagnostic(span=$match, message="Do not format dates inline. Use the formatters in `@/lib/datetime` so locale, timezone, and hour-cycle preferences are applied consistently.")
}