Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: added generative og image
kapishdima55aab44f7575
diff --git a/app/docs/[[...slug]]/page.tsx b/app/docs/[[...slug]]/page.tsxindex 216a21b4..f6574daf 100644--- a/app/docs/[[...slug]]/page.tsx+++ b/app/docs/[[...slug]]/page.tsx@@ -50,8 +50,24 @@ export async function generateMetadata(props: {const page = source.getPage(params.slug);if (!page) notFound();const data = page.data;+ const slug = params.slug ?? [];+ if (slug.length === 0) {+ return { title: data.title, description: data.description };+ }+ const ogUrl = `/og/docs/${slug.join("/")}`;return {title: data.title,description: data.description,+ openGraph: {+ title: data.title,+ description: data.description,+ images: [{ url: ogUrl, width: 1200, height: 630 }],+ },+ twitter: {+ card: "summary_large_image",+ title: data.title,+ description: data.description,+ images: [ogUrl],+ },};}diff --git a/app/og/docs/[...slug]/route.tsx b/app/og/docs/[...slug]/route.tsxnew file mode 100644index 00000000..da6ddbe0--- /dev/null+++ b/app/og/docs/[...slug]/route.tsx@@ -0,0 +1,93 @@+import { readFileSync } from "node:fs";+import { join } from "node:path";+import { ImageResponse } from "takumi-js/response";+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"));++export const dynamic = "force-static";++export function generateStaticParams() {+ return source+ .getPages()+ .map((page) => ({ slug: page.slugs }))+ .filter((p) => p.slug.length > 0);+}++export async function GET(+ _req: Request,+ { params }: { params: Promise<{ slug: string[] }> },+) {+ 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",+ }}+ >+ <img+ src={bgDataUri}+ width={1200}+ height={630}+ alt=""+ style={{ position: "absolute", top: 0, left: 0 }}+ />+ <div style={{ display: "flex", alignItems: "center", gap: 12 }}>+ <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" },+ ],+ },+ );+}diff --git a/app/og/fonts/manrope-700.woff2 b/app/og/fonts/manrope-700.woff2new file mode 100644index 00000000..84f7af54Binary files /dev/null and b/app/og/fonts/manrope-700.woff2 differdiff --git a/bun.lock b/bun.lockindex 7bfc48a7..a9eb4bed 100644--- a/bun.lock+++ b/bun.lock@@ -6,6 +6,7 @@"name": "remocn","dependencies": {"@base-ui/react": "^1.3.0",+ "@fontsource/manrope": "^5.2.8","@openpanel/nextjs": "^1.0.13","@openpanel/sdk": "^1.3.1","@paper-design/shaders-react": "0.0.76",@@ -40,6 +41,7 @@"server-only": "^0.0.1","sonner": "^2.0.7","tailwind-merge": "^3.5.0",+ "takumi-js": "^2.3.0","tw-animate-css": "^1.4.0","vaul": "^1.1.2","zod": "^4.3.6",@@ -214,6 +216,8 @@"@floating-ui/utils": ["@floating-ui/[email protected]", "", {}, "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg=="],+ "@fontsource/manrope": ["@fontsource/[email protected]", "", {}, "sha512-gJHJmcuUk7qWcNCfcAri/DJQtXtBYqi9yKratr4jXhSo0I3xUtNNKI+igQIcw5c+m95g0vounk8ZnX/kb8o0TA=="],+"@formatjs/fast-memoize": ["@formatjs/[email protected]", "", {}, "sha512-CbNbf+tlJn1baRnPkNePnBqTLxGliG6DDgNa/UtV66abwIjwsliPMOt0172tzxABYzSuxZBZfcp//qI8AvBWPg=="],"@formatjs/intl-localematcher": ["@formatjs/[email protected]", "", { "dependencies": { "@formatjs/fast-memoize": "3.1.1" } }, "sha512-q05KMYGJLyqFNFtIb8NhWLF5X3aK/k0wYt7dnRFuy6aLQL+vUwQ1cg5cO4qawEiINybeCPXAWlprY2mSBjSXAQ=="],@@ -556,6 +560,28 @@"@tailwindcss/postcss": ["@tailwindcss/[email protected]", "", { "dependencies": { "@alloc/quick-lru": "^5.2.0", "@tailwindcss/node": "4.2.2", "@tailwindcss/oxide": "4.2.2", "postcss": "^8.5.6", "tailwindcss": "4.2.2" } }, "sha512-n4goKQbW8RVXIbNKRB/45LzyUqN451deQK0nzIeauVEqjlI49slUlgKYJM2QyUzap/PcpnS7kzSUmPb1sCRvYQ=="],+ "@takumi-rs/core": ["@takumi-rs/[email protected]", "", { "dependencies": { "@takumi-rs/helpers": "2.3.0" }, "optionalDependencies": { "@takumi-rs/core-darwin-arm64": "2.3.0", "@takumi-rs/core-darwin-x64": "2.3.0", "@takumi-rs/core-linux-arm64-gnu": "2.3.0", "@takumi-rs/core-linux-arm64-musl": "2.3.0", "@takumi-rs/core-linux-x64-gnu": "2.3.0", "@takumi-rs/core-linux-x64-musl": "2.3.0", "@takumi-rs/core-win32-arm64-msvc": "2.3.0", "@takumi-rs/core-win32-x64-msvc": "2.3.0" }, "peerDependencies": { "csstype": "*" }, "optionalPeers": ["csstype"] }, "sha512-thOAMYzS2v7kbXHdBH5NItKM7qwusG2lR8ed8g26TpnkZBr5kLMLZnZnarTjF6A3YQ58Vzxw0d8aUrgrk5oK3Q=="],++ "@takumi-rs/core-darwin-arm64": ["@takumi-rs/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-6V+TDWmsiox4gGEYoazHQYkGU+vadvFdhBMBJ0tXlFx2GuW2tWgc6ShStZYksUTvVWK3MmoQL5/u/HAZE8RdVA=="],++ "@takumi-rs/core-darwin-x64": ["@takumi-rs/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-BkuI4GTOXIC1nRhm9N3t4QshOLSFqs/l64e61Wnu9aJp1VbifnaFcKyLVe7Dw2iIywbqazGkdKAhbqo8ol909A=="],++ "@takumi-rs/core-linux-arm64-gnu": ["@takumi-rs/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-VXyXcjExj8h4TJNXJOWY57hO6TCaJteAJe3Q1JxmP4HqjoHGpkt5A8PmL5zj4F0dlIpaPsO+AfhuWVQw9WrmwA=="],++ "@takumi-rs/core-linux-arm64-musl": ["@takumi-rs/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-aH/Puouk5ZVFud2vl4qDQMKdvGbnK75SxtrciWZLcYreUVX0A6Du+UC6qlehgFa0gBPCwEbQC0Bf5Rfo+cXWpg=="],++ "@takumi-rs/core-linux-x64-gnu": ["@takumi-rs/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-nZ0M+1KFvBLdNcdBM1jazwLhKp0kj8W6BwHJs3RKW+CbON8RXaBLQqvjIAOs6Gyw+/v1S2gkCs7aJGI3TZ/uxA=="],++ "@takumi-rs/core-linux-x64-musl": ["@takumi-rs/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-Afu9h+v51zFixvG3It4OgzDjjiLB4kPv0r+iJDwoRKSwP5tMju8HS10Qig+idWLSkWIe2jOIAV+wud2o9A8kPg=="],++ "@takumi-rs/core-win32-arm64-msvc": ["@takumi-rs/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-2b1GwWYIwM/i23eTmSZnzEj1tz3g3URZjk+a6tO5qif8dEhx17ufn6MnXa2doGjXcrx3EIsgAYIRvtmKCrGUKg=="],++ "@takumi-rs/core-win32-x64-msvc": ["@takumi-rs/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-kh0y7fLzqNV3rlPUp3XKThykySrohS98neiPWm+D71Yot3USXkYqPCFKHpDdZoan6ZyQyoldcf2jbN3+KLmp+w=="],++ "@takumi-rs/helpers": ["@takumi-rs/[email protected]", "", { "peerDependencies": { "preact": "^10.0.0", "react": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["preact", "react"] }, "sha512-2y/fFESu2c3JVZyk/uL+imEgPInqArWPDGbZrbyqcEKwnRmFKYMHFNkFWZhyjIfHc8us/4+NgPkydPxzz6Fwiw=="],++ "@takumi-rs/wasm": ["@takumi-rs/[email protected]", "", { "dependencies": { "@takumi-rs/helpers": "2.3.0" }, "peerDependencies": { "csstype": "*" }, "optionalPeers": ["csstype"] }, "sha512-BGYyWHRDMUR3/pzc5ZlwDSVcLu8rZHU6w/94XQOBtGq/vQE6bB92PJbcGmup+f/uiIHUp6plNYntl/nge0elpQ=="],+"@ts-morph/common": ["@ts-morph/[email protected]", "", { "dependencies": { "fast-glob": "^3.3.3", "minimatch": "^10.0.1", "path-browserify": "^1.0.1" } }, "sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ=="],"@tybys/wasm-util": ["@tybys/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg=="],@@ -1512,6 +1538,8 @@"tailwindcss": ["[email protected]", "", {}, "sha512-KWBIxs1Xb6NoLdMVqhbhgwZf2PGBpPEiwOqgI4pFIYbNTfBXiKYyWoTsXgBQ9WFg/OlhnvHaY+AEpW7wSmFo2Q=="],+ "takumi-js": ["[email protected]", "", { "dependencies": { "@takumi-rs/core": "2.3.0", "@takumi-rs/helpers": "2.3.0", "@takumi-rs/wasm": "2.3.0" } }, "sha512-5JJ1j/pJxqg/7YWKVPLDxrMGFgYy/kM3K3cEC4OLJPVMan3YxeUBle6O3Tz77RSmNxKr902+FNwQ3oB/sAlEmg=="],+"tapable": ["[email protected]", "", {}, "sha512-1MOpMXuhGzGL5TTCZFItxCc0AARf1EZFQkGqMm7ERKj8+Hgr5oLvJOVFcC+lRmR8hCe2S3jC4T5D7Vg/d7/fhA=="],"terser": ["[email protected]", "", { "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.15.0", "commander": "^2.20.0", "source-map-support": "~0.5.20" }, "bin": { "terser": "bin/terser" } }, "sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q=="],diff --git a/next.config.ts b/next.config.tsindex c8ba9c1b..96bd3894 100644--- a/next.config.ts+++ b/next.config.ts@@ -14,6 +14,7 @@ const nextConfig: NextConfig = {"@remotion/renderer","@remotion/bundler","esbuild",+ "@takumi-rs/core",],turbopack: {root: __dirname,diff --git a/package.json b/package.jsonindex 54b38fb4..4234e1d4 100644--- a/package.json+++ b/package.json@@ -19,6 +19,7 @@},"dependencies": {"@base-ui/react": "^1.3.0",+ "@fontsource/manrope": "^5.2.8","@openpanel/nextjs": "^1.0.13","@openpanel/sdk": "^1.3.1","@paper-design/shaders-react": "0.0.76",@@ -53,6 +54,7 @@"server-only": "^0.0.1","sonner": "^2.0.7","tailwind-merge": "^3.5.0",+ "takumi-js": "^2.3.0","tw-animate-css": "^1.4.0","vaul": "^1.1.2","zod": "^4.3.6"diff --git a/public/og/neuro-dark.png b/public/og/neuro-dark.pngnew file mode 100644index 00000000..f807ccd7Binary files /dev/null and b/public/og/neuro-dark.png differ