Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: shader share cards for docs, blog and site pages
kapishdima1160fe5d2c76
diff --git a/app/(home)/blog/[slug]/page.tsx b/app/(home)/blog/[slug]/page.tsxindex f3cbd16c..bb61acdb 100644--- a/app/(home)/blog/[slug]/page.tsx+++ b/app/(home)/blog/[slug]/page.tsx@@ -35,7 +35,7 @@ export async function generateMetadata({const url = `/blog/${slug}`;const title = `${post.title} · Remocn`;- const shareImage = post.videoPoster ?? "/hero.png";+ const shareImage = post.videoPoster ?? `/og/blog/${slug}`;return {title: post.title,diff --git a/app/(home)/blog/page.tsx b/app/(home)/blog/page.tsxindex 3bd117e0..e9ab93a3 100644--- a/app/(home)/blog/page.tsx+++ b/app/(home)/blog/page.tsx@@ -1,11 +1,11 @@import type { Metadata } from "next";+import { SITE_PAGES, sitePageOgImage } from "@/config/site-pages";import { BlogHeader } from "./components/blog-header";import { FeaturedPost } from "./components/featured-post";import { PostIndex } from "./components/post-index";import { getBlogPosts } from "./lib/posts";-const DESCRIPTION =- "Making-of stories behind the videos we build with Remocn — the storyboard, the decisions that made each one work, and the prompt that rebuilds it.";+const DESCRIPTION = SITE_PAGES.blog.description;export const metadata: Metadata = {title: "Blog",@@ -21,15 +21,13 @@ export const metadata: Metadata = {title: "Blog · Remocn",description: DESCRIPTION,locale: "en_US",- images: [- { url: "/hero.png", width: 1200, height: 675, alt: "Blog · Remocn" },- ],+ images: [sitePageOgImage("blog")],},twitter: {card: "summary_large_image",title: "Blog · Remocn",description: DESCRIPTION,- images: ["/hero.png"],+ images: [sitePageOgImage("blog").url],},};diff --git a/app/(home)/changelog/page.tsx b/app/(home)/changelog/page.tsxindex 94d0f4d4..2581c82e 100644--- a/app/(home)/changelog/page.tsx+++ b/app/(home)/changelog/page.tsx@@ -1,6 +1,7 @@import type { Metadata } from "next";import type { ComponentProps } from "react";import { changelog } from "@/.source/server";+import { SITE_PAGES, sitePageOgImage } from "@/config/site-pages";import {changelogDateFormatter,changelogSlug,@@ -11,8 +12,7 @@ import { ChangelogEntry, EntryActionLink } from "./components/changelog-entry";import { ChangelogHeader } from "./components/changelog-header";import { ChangelogPreview } from "./components/changelog-preview";-const DESCRIPTION =- "Every release of Remocn — new components, transitions, shaders, icons, and improvements, newest first.";+const DESCRIPTION = SITE_PAGES.changelog.description;export const metadata: Metadata = {title: "Changelog",@@ -25,15 +25,13 @@ export const metadata: Metadata = {title: "Changelog · Remocn",description: DESCRIPTION,locale: "en_US",- images: [- { url: "/hero.png", width: 1200, height: 675, alt: "Changelog · Remocn" },- ],+ images: [sitePageOgImage("changelog")],},twitter: {card: "summary_large_image",title: "Changelog · Remocn",description: DESCRIPTION,- images: ["/hero.png"],+ images: [sitePageOgImage("changelog").url],},};diff --git a/app/(home)/changelog/video/page.tsx b/app/(home)/changelog/video/page.tsxindex c433a1d2..0d66fe29 100644--- a/app/(home)/changelog/video/page.tsx+++ b/app/(home)/changelog/video/page.tsx@@ -1,5 +1,6 @@import type { Metadata } from "next";import { changelog } from "@/.source/server";+import { sitePageOgImage } from "@/config/site-pages";import {changelogDateFormatter,changelogSlug,@@ -26,7 +27,7 @@ const entries = sortByDateDesc(changelog).flatMap((entry) =>: [],);-const shareImage = entries[0]?.videoPoster ?? "/hero.png";+const shareImage = entries[0]?.videoPoster ?? sitePageOgImage("changelog").url;export const metadata: Metadata = {title: "Changelog in video",diff --git a/app/(home)/inspired-by/page.tsx b/app/(home)/inspired-by/page.tsxindex cc076c76..138477bd 100644--- a/app/(home)/inspired-by/page.tsx+++ b/app/(home)/inspired-by/page.tsx@@ -1,11 +1,11 @@import type { Metadata } from "next";import { INSPIRED_BY } from "@/config/inspired-by";+import { SITE_PAGES, sitePageOgImage } from "@/config/site-pages";import { Credits } from "./credits";import saved from "./credits.json";import type { CreditsConfig } from "./credits-config";-const DESCRIPTION =- "The people on X whose work shaped Remocn: motion, design and code we learned from.";+const DESCRIPTION = SITE_PAGES["inspired-by"].description;const TITLE = "Inspired by · Remocn";@@ -20,13 +20,13 @@ export const metadata: Metadata = {title: TITLE,description: DESCRIPTION,locale: "en_US",- images: [{ url: "/hero.png", width: 1200, height: 675, alt: TITLE }],+ images: [sitePageOgImage("inspired-by")],},twitter: {card: "summary_large_image",title: TITLE,description: DESCRIPTION,- images: ["/hero.png"],+ images: [sitePageOgImage("inspired-by").url],},};diff --git a/app/(home)/legal/page.tsx b/app/(home)/legal/page.tsxindex bb40073a..19744596 100644--- a/app/(home)/legal/page.tsx+++ b/app/(home)/legal/page.tsx@@ -1,12 +1,12 @@import type { Metadata } from "next";+import { SITE_PAGES, sitePageOgImage } from "@/config/site-pages";import { LegalArticle } from "./components/legal-article";import { LegalContact } from "./components/legal-contact";import { LegalContentsBar } from "./components/legal-contents-bar";import { LegalHero } from "./components/legal-hero";import { LegalIndex } from "./components/legal-index";-const DESCRIPTION =- "How Remocn handles your data, and the terms that apply to the site, the free components, and paid products.";+const DESCRIPTION = SITE_PAGES.legal.description;export const metadata: Metadata = {title: "Privacy & Terms",@@ -19,20 +19,13 @@ export const metadata: Metadata = {title: "Privacy & Terms · Remocn",description: DESCRIPTION,locale: "en_US",- images: [- {- url: "/hero.png",- width: 1200,- height: 675,- alt: "Privacy & Terms · Remocn",- },- ],+ images: [sitePageOgImage("legal")],},twitter: {card: "summary_large_image",title: "Privacy & Terms · Remocn",description: DESCRIPTION,- images: ["/hero.png"],+ images: [sitePageOgImage("legal").url],},};diff --git a/app/(home)/sponsors/page.tsx b/app/(home)/sponsors/page.tsxindex e58f441b..1ba4c9b1 100644--- a/app/(home)/sponsors/page.tsx+++ b/app/(home)/sponsors/page.tsx@@ -1,11 +1,11 @@import type { Metadata } from "next";+import { SITE_PAGES, sitePageOgImage } from "@/config/site-pages";import { CreditsSection } from "./components/credits";import { SponsorsHero } from "./components/hero";import { TiersSection } from "./components/tiers";import { TrafficSection } from "./components/traffic";-const DESCRIPTION =- "Support Remocn and keep the components free and open source. Back the project monthly, from a name in the README to your logo on the landing page.";+const DESCRIPTION = SITE_PAGES.sponsors.description;export const metadata: Metadata = {title: "Sponsors",@@ -18,15 +18,13 @@ export const metadata: Metadata = {title: "Sponsors · Remocn",description: DESCRIPTION,locale: "en_US",- images: [- { url: "/hero.png", width: 1200, height: 675, alt: "Sponsors · Remocn" },- ],+ images: [sitePageOgImage("sponsors")],},twitter: {card: "summary_large_image",title: "Sponsors · Remocn",description: DESCRIPTION,- images: ["/hero.png"],+ images: [sitePageOgImage("sponsors").url],},};diff --git a/app/(home)/stars/page.tsx b/app/(home)/stars/page.tsxindex 4c9b6f2a..e69f08bb 100644--- a/app/(home)/stars/page.tsx+++ b/app/(home)/stars/page.tsx@@ -1,5 +1,6 @@import type { Metadata } from "next";import Link from "next/link";+import { SITE_PAGES, sitePageOgImage } from "@/config/site-pages";import { LandingButton } from "../components/landing/ui/landing-button";import {pageHeaderButton,@@ -10,8 +11,7 @@ const STARWALL_URL = "https://starwall.radiumcoders.com/";const AUTHOR_X_URL = "https://x.com/radiumcoders";const TITLE = "GitHub Stars Video Generator · Remocn";-const DESCRIPTION =- "Turn your repo's stars into a shareable animated video. Paste a GitHub repo and we animate every stargazer into a clip you can own.";+const DESCRIPTION = SITE_PAGES.stars.description;export const metadata: Metadata = {title: "GitHub Stars Video Generator",@@ -24,13 +24,13 @@ export const metadata: Metadata = {title: TITLE,description: DESCRIPTION,locale: "en_US",- images: [{ url: "/hero.png", width: 1200, height: 675, alt: TITLE }],+ images: [sitePageOgImage("stars")],},twitter: {card: "summary_large_image",title: TITLE,description: DESCRIPTION,- images: ["/hero.png"],+ images: [sitePageOgImage("stars").url],},};diff --git a/app/og/blog/[slug]/route.tsx b/app/og/blog/[slug]/route.tsxnew file mode 100644index 00000000..e285bde4--- /dev/null+++ b/app/og/blog/[slug]/route.tsx@@ -0,0 +1,32 @@+import { blog } from "@/.source/server";+import { blogSlug } from "@/lib/blog";+import { ogCard } from "@/lib/og-card";++const dateFormatter = new Intl.DateTimeFormat("en-US", {+ timeZone: "UTC",+ year: "numeric",+ month: "short",+ day: "numeric",+});++export const dynamic = "force-static";+export const dynamicParams = false;++export function generateStaticParams() {+ return blog.map((post) => ({ slug: blogSlug(post) }));+}++export async function GET(+ _req: Request,+ { params }: { params: Promise<{ slug: string }> },+) {+ const { slug } = await params;+ const post = blog.find((p) => blogSlug(p) === slug);+ if (!post) return new Response("Not found", { status: 404 });++ return ogCard({+ title: post.title,+ description: post.description,+ label: `Blog · ${dateFormatter.format(post.date)}`,+ });+}diff --git a/app/og/docs/[...slug]/route.tsx b/app/og/docs/[...slug]/route.tsxindex 1b1a55fe..aaad79a1 100644--- a/app/og/docs/[...slug]/route.tsx+++ b/app/og/docs/[...slug]/route.tsx@@ -1,22 +1,18 @@-import { readFileSync } from "node:fs";+import { existsSync, readFileSync } from "node:fs";import { join } from "node:path";-import { ImageResponse } from "takumi-js/response";+import { ogCard } from "@/lib/og-card";import { source } from "@/source";-const asset = (p: string) => join(process.cwd(), p);--const bgDataUri = `data:image/png;base64,${readFileSync(- asset("public/og/neuro-dark.png"),-).toString("base64")}`;--const markDataUri = `data:image/svg+xml;base64,${Buffer.from(- readFileSync(asset("public/logo-mark.svg"), "utf8").replace(- /currentColor/g,- "#ffffff",- ),-).toString("base64")}`;--const manrope700 = readFileSync(asset("app/og/fonts/manrope-700.woff2"));+// The label is the docs section the page sits in, named the way its sidebar+// group is (`content/docs/<section>/meta.json`).+function sectionTitle(section: string): string | undefined {+ const metaPath = join(process.cwd(), `content/docs/${section}/meta.json`);+ if (!existsSync(metaPath)) return undefined;+ const meta = JSON.parse(readFileSync(metaPath, "utf8")) as {+ title?: string;+ };+ return meta.title;+}export const dynamic = "force-static";@@ -33,63 +29,10 @@ export async function GET() {const { slug } = await params;const page = source.getPage(slug);- const title = page?.data.title ?? "Remocn";- return new ImageResponse(- <div- style={{- display: "flex",- flexDirection: "column",- justifyContent: "space-between",- width: "100%",- height: "100%",- padding: 72,- fontFamily: "Manrope",- position: "relative",- }}- >- {/** biome-ignore lint/performance/noImgElement: ImageResponse (satori) renders plain img only */}- <img- src={bgDataUri}- width={1200}- height={630}- alt=""- style={{ position: "absolute", top: 0, left: 0 }}- />- <div style={{ display: "flex", alignItems: "center", gap: 12 }}>- {/** biome-ignore lint/performance/noImgElement: ImageResponse (satori) renders plain img only */}- <img src={markDataUri} width={30} height={32} alt="" />- <span- style={{- color: "#ffffff",- fontSize: 30,- fontWeight: 700,- letterSpacing: -0.5,- }}- >- emocn- </span>- </div>- <div- style={{- display: "flex",- color: "#ffffff",- fontSize: 88,- fontWeight: 700,- letterSpacing: -2,- lineHeight: 1.05,- maxWidth: 960,- }}- >- {title}- </div>- </div>,- {- width: 1200,- height: 630,- fonts: [- { name: "Manrope", data: manrope700, weight: 700, style: "normal" },- ],- },- );+ return ogCard({+ title: page?.data.title ?? "Remocn",+ description: page?.data.description,+ label: slug.length > 1 ? sectionTitle(slug[0]) : undefined,+ });}diff --git a/app/og/fonts/geist-400.woff2 b/app/og/fonts/geist-400.woff2new file mode 100644index 00000000..82d2704fBinary files /dev/null and b/app/og/fonts/geist-400.woff2 differdiff --git a/app/og/fonts/geist-500.woff2 b/app/og/fonts/geist-500.woff2new file mode 100644index 00000000..b6e42599Binary files /dev/null and b/app/og/fonts/geist-500.woff2 differdiff --git a/app/og/fonts/manrope-600.woff2 b/app/og/fonts/manrope-600.woff2new file mode 100644index 00000000..7cc09a3bBinary files /dev/null and b/app/og/fonts/manrope-600.woff2 differdiff --git a/app/og/pages/[page]/route.tsx b/app/og/pages/[page]/route.tsxnew file mode 100644index 00000000..045b5877--- /dev/null+++ b/app/og/pages/[page]/route.tsx@@ -0,0 +1,18 @@+import { SITE_PAGES } from "@/config/site-pages";+import { ogCard } from "@/lib/og-card";++export const dynamic = "force-static";+export const dynamicParams = false;++export function generateStaticParams() {+ return Object.keys(SITE_PAGES).map((page) => ({ page }));+}++export async function GET(+ _req: Request,+ { params }: { params: Promise<{ page: string }> },+) {+ const { page } = await params;+ const entry = SITE_PAGES[page as keyof typeof SITE_PAGES];+ return ogCard({ title: entry.title, description: entry.description });+}diff --git a/config/site-pages.ts b/config/site-pages.tsnew file mode 100644index 00000000..a50fb4ed--- /dev/null+++ b/config/site-pages.ts@@ -0,0 +1,46 @@+/**+ * Standalone site pages that share one card from `/og/pages/<key>`. The page+ * reads its description from here too, so the card and the meta tags can't+ * drift apart.+ */+export const SITE_PAGES = {+ changelog: {+ title: "Changelog",+ description:+ "Every release of Remocn — new components, transitions, shaders, icons, and improvements, newest first.",+ },+ blog: {+ title: "Blog",+ description:+ "Making-of stories behind the videos we build with Remocn — the storyboard, the decisions that made each one work, and the prompt that rebuilds it.",+ },+ sponsors: {+ title: "Sponsors",+ description:+ "Support Remocn and keep the components free and open source. Back the project monthly, from a name in the README to your logo on the landing page.",+ },+ legal: {+ title: "Privacy & Terms",+ description:+ "How Remocn handles your data, and the terms that apply to the site, the free components, and paid products.",+ },+ stars: {+ title: "GitHub Stars Video Generator",+ description:+ "Turn your repo's stars into a shareable animated video. Paste a GitHub repo and we animate every stargazer into a clip you can own.",+ },+ "inspired-by": {+ title: "Inspired by",+ description:+ "The people on X whose work shaped Remocn: motion, design and code we learned from.",+ },+} as const;++export type SitePageKey = keyof typeof SITE_PAGES;++export const sitePageOgImage = (key: SitePageKey) => ({+ url: `/og/pages/${key}`,+ width: 1200,+ height: 630,+ alt: `${SITE_PAGES[key].title} · Remocn`,+});diff --git a/lib/og-card.tsx b/lib/og-card.tsxnew file mode 100644index 00000000..27c094e2--- /dev/null+++ b/lib/og-card.tsx@@ -0,0 +1,172 @@+import { readFileSync } from "node:fs";+import { join } from "node:path";+import { ImageResponse } from "takumi-js/response";++/**+ * The share card every page without its own poster uses (Paper "Remocn ·+ * Component Ideas" → OG images → C): the magenta shader as the surface, a+ * scrim under the copy, wordmark top-left, a label top-right, and the title+ * with its description at the bottom.+ */++const asset = (p: string) => join(process.cwd(), p);++const shaderDataUri = `data:image/png;base64,${readFileSync(+ asset("public/landing/shader-magenta.png"),+).toString("base64")}`;++const markDataUri = `data:image/svg+xml;base64,${Buffer.from(+ readFileSync(asset("public/logo-mark.svg"), "utf8").replace(+ /currentColor/g,+ "#ffffff",+ ),+).toString("base64")}`;++const geist400 = readFileSync(asset("app/og/fonts/geist-400.woff2"));+const geist500 = readFileSync(asset("app/og/fonts/geist-500.woff2"));+const manrope600 = readFileSync(asset("app/og/fonts/manrope-600.woff2"));++export const OG_SIZE = { width: 1200, height: 630 } as const;++// Long titles step the type down and leave the description fewer lines, so+// the copy block never climbs into the wordmark row.+const titleSize = (title: string) =>+ title.length <= 16 ? 96 : title.length <= 32 ? 80 : 60;++function clampDescription(text: string, max: number): string {+ if (text.length <= max) return text;+ const cut = text.slice(0, max);+ const words = cut.slice(0, cut.lastIndexOf(" "));+ return `${words.replace(/[\s,;:.—–-]+$/, "")}…`;+}++export function ogCard({+ title,+ description,+ label,+}: {+ title: string;+ description?: string;+ label?: string;+}) {+ return new ImageResponse(+ <div+ style={{+ display: "flex",+ flexDirection: "column",+ justifyContent: "space-between",+ width: "100%",+ height: "100%",+ padding: 64,+ position: "relative",+ backgroundColor: "#0e1012",+ color: "#ffffff",+ }}+ >+ {/** biome-ignore lint/performance/noImgElement: ImageResponse renders plain img only */}+ <img+ src={shaderDataUri}+ width={OG_SIZE.width}+ height={OG_SIZE.height}+ alt=""+ style={{+ position: "absolute",+ top: 0,+ left: 0,+ width: OG_SIZE.width,+ height: OG_SIZE.height,+ objectFit: "cover",+ }}+ />+ <div+ style={{+ position: "absolute",+ top: 0,+ left: 0,+ width: OG_SIZE.width,+ height: OG_SIZE.height,+ backgroundImage:+ "linear-gradient(20deg, rgba(14,16,18,0.88) 0%, rgba(14,16,18,0.55) 40%, rgba(14,16,18,0) 75%)",+ }}+ />+ <div+ style={{+ display: "flex",+ justifyContent: "space-between",+ alignItems: "center",+ }}+ >+ <div style={{ display: "flex", alignItems: "center", gap: 2 }}>+ {/** biome-ignore lint/performance/noImgElement: ImageResponse renders plain img only */}+ <img src={markDataUri} width={22} height={24} alt="" />+ <span+ style={{+ fontFamily: "Manrope",+ fontWeight: 600,+ fontSize: 26,+ lineHeight: "28px",+ letterSpacing: "-0.02em",+ }}+ >+ emocn+ </span>+ </div>+ {label ? (+ <span+ style={{+ fontFamily: "Geist",+ fontWeight: 400,+ fontSize: 20,+ lineHeight: "24px",+ letterSpacing: "-0.01em",+ color: "rgba(255,255,255,0.8)",+ }}+ >+ {label}+ </span>+ ) : null}+ </div>+ <div+ style={{+ display: "flex",+ flexDirection: "column",+ gap: 24,+ maxWidth: 880,+ fontFamily: "Geist",+ }}+ >+ <span+ style={{+ fontWeight: 500,+ fontSize: titleSize(title),+ lineHeight: 0.98,+ letterSpacing: "-0.05em",+ }}+ >+ {title}+ </span>+ {description ? (+ <span+ style={{+ fontWeight: 400,+ fontSize: 34,+ lineHeight: "42px",+ letterSpacing: "-0.025em",+ color: "rgba(255,255,255,0.72)",+ }}+ >+ {clampDescription(description, title.length > 32 ? 100 : 150)}+ </span>+ ) : null}+ </div>+ </div>,+ {+ ...OG_SIZE,+ fonts: [+ { name: "Geist", data: geist400, weight: 400, style: "normal" },+ { name: "Geist", data: geist500, weight: 500, style: "normal" },+ { name: "Manrope", data: manrope600, weight: 600, style: "normal" },+ ],+ },+ );+}diff --git a/public/og/neuro-dark.png b/public/og/neuro-dark.pngdeleted file mode 100644index f807ccd7..00000000Binary files a/public/og/neuro-dark.png and /dev/null differ