Page sections / Calls to action

Polaroid-Flanked Closing CTA

A massive centered headline with two tilted polaroid photos flanking it, a muted subline, a wide dark rounded 'Get started for free' button, an 'or talk to sales' link, and a row of three rating blocks (large score, orange stars, source name).

Rebuilt from cal.com/pricing in the Warm Paper Calendar style.

npx shadcn@latest add https://justyoink.it/r/warm-paper-calendar/blocks/centered-polaroid-closing-cta.json

Looks exactly like cal.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Images2 in this component. Swap any for a library image or one of your own.All images in this style →

Choose an image

Image

Loading…

Usage

Props: headline, subline, ctaLabel/ctaHref, salesLabel/salesHref, leftImage/rightImage (polaroid photo URLs, shown on lg+), and ratings (score, source, stars). Renders standalone with defaults.

components/centered-polaroid-closing-cta.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
type Rating = { score: string; source: string; stars: number };

type Props = {
  headline?: string;
  subline?: string;
  ctaLabel?: string;
  ctaHref?: string;
  salesLabel?: string;
  salesHref?: string;
  leftImage?: string;
  rightImage?: string;
  ratings?: Rating[];
};

function Star({ fill }: { fill: number }) {
  const id = `s${Math.random().toString(36).slice(2, 8)}`;
  return (
    <svg width="14" height="14" viewBox="0 0 24 24" aria-hidden="true">
      <defs>
        <linearGradient id={id}>
          <stop offset={`${fill * 100}%`} stopColor="#f59e0b" />
          <stop offset={`${fill * 100}%`} stopColor="#e5e5e5" />
        </linearGradient>
      </defs>
      <path fill={`url(#${id})`} d="M12 2l3 6.9 7.5.7-5.7 5 1.7 7.4L12 18l-6.5 4 1.7-7.4-5.7-5 7.5-.7z" />
    </svg>
  );
}

function Polaroid({ src, alt, className }: { src: string; alt: string; className: string }) {
  return (
    <div className={`absolute hidden lg:block w-[230px] bg-paper p-2 pb-9 shadow-soft ${className}`}>
      <img src={src} alt={alt} width={209} height={160} loading="lazy" className="h-[160px] w-full object-cover sepia-[0.25] saturate-75" />
    </div>
  );
}

export default function PolaroidFlankedClosingCta({
  headline = "Planning made simple for every team.",
  subline = "Free to start, no card needed, no limits on bookings. Link your calendar, share a page, and let guests pick a time that suits you both.",
  ctaLabel = "Start planning for free",
  ctaHref = "#",
  salesLabel = "or contact our team",
  salesHref = "#",
  leftImage = "https://yoink-app.fly.dev/stock/interior-2.jpg",
  rightImage = "https://yoink-app.fly.dev/stock/landscape-1.jpg",
  ratings = [
    { score: "4.5", source: "Reviewly", stars: 4.5 },
    { score: "4.8", source: "Launchboard", stars: 5 },
    { score: "4.5", source: "Northwind", stars: 4.5 },
  ],
}: Props) {
  return (
    <section className="relative overflow-hidden bg-canvas px-6 py-24 md:py-32">
      <Polaroid src={leftImage} alt="Sunlit interior with wooden tables" className="left-[4%] top-[48%] -rotate-[4deg]" />
      <Polaroid src={rightImage} alt="Pine forest above a calm sea" className="right-[4%] top-[48%] rotate-[3deg]" />
      <div className="relative mx-auto flex max-w-3xl flex-col items-center text-center">
        <Reveal from="up">
          <h2 className="font-display text-5xl font-bold leading-[0.95] tracking-[-0.05em] text-ink-deep md:text-7xl lg:text-[88px]">{headline}</h2>
        </Reveal>
        <p className="mt-8 max-w-xl text-lg leading-relaxed text-muted">{subline}</p>
        <a href={ctaHref} className="mt-10 inline-flex h-[72px] items-center justify-center rounded-xl bg-ink px-10 font-display text-2xl font-semibold tracking-tight text-canvas transition-opacity duration-300 hover:opacity-85 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ink sm:min-w-[338px]">{ctaLabel}</a>
        <a href={salesHref} className="mt-5 text-sm font-medium text-ink-deep hover:underline focus-visible:outline focus-visible:outline-2">{salesLabel}</a>
        <ul className="mt-14 flex flex-wrap items-center justify-center gap-x-10 gap-y-6">
          {ratings.map((r) => (
            <li key={r.source} className="flex items-center gap-3">
              <span className="font-display text-4xl font-semibold tracking-tight text-ink-deep">{r.score}</span>
              <span className="flex flex-col items-start gap-1">
                <span className="flex gap-0.5" aria-label={`${r.stars} out of 5 stars`}>
                  {[0, 1, 2, 3, 4].map((i) => (
                    <Star key={i} fill={Math.max(0, Math.min(1, r.stars - i))} />
                  ))}
                </span>
                <span className="text-caption text-muted">{r.source}</span>
              </span>
            </li>
          ))}
        </ul>
      </div>
    </section>
  );
}

// ---- Yoink motion (inlined, no dependencies): Reveal ----

const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)";

const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;

function ykReducedMotion(): boolean {
  return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
}

// "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance.
// Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed,
// and there is a box to watch), and a safety net reveals anything on screen that is still hidden.
type YkRevealState = "idle" | "hidden" | "shown";

function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState {
  const [state, setState] = useState<YkRevealState>("idle");
  useYkLayoutEffect(() => {
    const el = ref.current;
    if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return;
    // watch the element's own box, or its children when it has none (display: contents)
    const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]);
    const onScreen = (t: Element) => {
      const r = t.getBoundingClientRect();
      return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth;
    };
    if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible
    let shown = false;
    const show = (v: boolean) => {
      if (v !== shown) (shown = v), setState(v ? "shown" : "hidden");
    };
    setState("hidden");
    const inView = new Set<Element>();
    const io = new IntersectionObserver((entries) => {
      for (const e of entries) {
        if (e.isIntersecting) inView.add(e.target);
        else inView.delete(e.target);
      }
      if (inView.size) {
        show(true);
        if (once) io.disconnect();
      } else if (!once) show(false);
    });
    const watched = new Set<Element>();
    const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t)));
    watch();
    // safety net: styles that land after mount (display: contents) get watched too, and nothing
    // stays hidden for more than a moment while it is actually on screen
    const start = Date.now();
    const net = setInterval(() => {
      if (shown) return once && clearInterval(net);
      watch();
      if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true);
    }, 600);
    return () => {
      io.disconnect();
      clearInterval(net);
    };
  }, [once]);
  return state;
}

type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none";

/** Fades content in as it scrolls into view. */
function Reveal({
  children,
  from = "up",
  delay = 0,
  duration = 700,
  distance = 24,
  once = true,
  as = "div",
  className,
  style,
}: {
  children?: ReactNode;
  from?: YkRevealFrom;
  delay?: number;
  duration?: number;
  distance?: number;
  once?: boolean;
  as?: ElementType;
  className?: string;
  style?: CSSProperties;
}) {
  const Tag = as;
  const ref = useRef<HTMLElement>(null);
  const state = useYkReveal(ref, once);
  const hidden = state === "hidden";
  const offset = {
    up: `translate3d(0, ${distance}px, 0)`,
    down: `translate3d(0, ${-distance}px, 0)`,
    left: `translate3d(${-distance}px, 0, 0)`,
    right: `translate3d(${distance}px, 0, 0)`,
    scale: "scale(0.94)",
    blur: `translate3d(0, ${distance / 2}px, 0)`,
    none: "none",
  }[from];
  const t = `${duration}ms ${YK_EASE} ${delay}ms`;
  return (
    <Tag
      ref={ref}
      className={className}
      style={{
        ...style,
        ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }),
        ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }),
      }}
    >
      {children}
    </Tag>
  );
}

Quality checks

Automated, in a real browser · 5d ago
—

More from Warm Paper Calendar

The whole style →

Floating Pill Navigation Bar

Headers & nav bars

Hub-and-Spoke Integration Diagram

Animated graphics

Customer Story Accordion

Accordions

Inline-Chip Headline Hero

Heroes

Frosted Desktop Booking Mockup

Media & mockups

Monochrome Logo Grid

Logo clouds