Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

fix: code theme

dev_wandrya5f461d4ff4f
diff --git a/app/(home)/components/.omc/state/agent-replay-2096ec79-a746-48fe-a12d-180366827aaf.jsonl b/app/(home)/components/.omc/state/agent-replay-2096ec79-a746-48fe-a12d-180366827aaf.jsonl
new file mode 100644
index 00000000..aa00a70b
--- /dev/null
+++ b/app/(home)/components/.omc/state/agent-replay-2096ec79-a746-48fe-a12d-180366827aaf.jsonl
@@ -0,0 +1,3 @@
+{"t":0,"agent":"a388220","agent_type":"unknown","event":"agent_stop","success":true}
+{"t":0,"agent":"system","event":"keyword_detected","keyword":"ralph"}
+{"t":0,"agent":"system","event":"mode_change","mode_from":"none","mode_to":"ralph"}
diff --git a/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/pre-tool-advisory-throttle.json b/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/pre-tool-advisory-throttle.json
new file mode 100644
index 00000000..884a2600
--- /dev/null
+++ b/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/pre-tool-advisory-throttle.json
@@ -0,0 +1,14 @@
+{
+ "version": 1,
+ "entries": {
+ "1bb6914bc42b891c26d46c8ae2fd4f44071f59862e89dc550f4c82877b700216": {
+ "last_emitted_at_ms": 1780592388172,
+ "message": "The boulder never stops. Continue until all tasks complete."
+ },
+ "79a93d4a2f8f50b95f852280616242fee1855dc99a3c75211917f55e72e95fae": {
+ "last_emitted_at_ms": 1780592253036,
+ "message": "Use parallel execution for independent tasks. Use run_in_background for long operations (npm install, builds, tests)."
+ }
+ },
+ "updated_at": "2026-06-04T16:59:48.172Z"
+}
\ No newline at end of file
diff --git a/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/ralph-state.json b/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/ralph-state.json
new file mode 100644
index 00000000..12517695
--- /dev/null
+++ b/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/ralph-state.json
@@ -0,0 +1,13 @@
+{
+ "active": true,
+ "iteration": 2,
+ "max_iterations": 100,
+ "started_at": "2026-06-04T16:55:09.366Z",
+ "prompt": "/oh-my-claudecode:ralph давай сделаем в TypewriterCodeBlock приоритет на next-theme, если в пропсах передана theme - используем ее. И убери в featuredstrep theme добавь ее в InteractiveCode",
+ "session_id": "2096ec79-a746-48fe-a12d-180366827aaf",
+ "project_path": "/Users/dev_wandry/projects/opensource/remocn/app/(home)/components",
+ "linked_ultrawork": true,
+ "awaiting_confirmation": true,
+ "awaiting_confirmation_set_at": "2026-06-04T16:55:09.366Z",
+ "last_checked_at": "2026-06-04T17:00:09.330Z"
+}
\ No newline at end of file
diff --git a/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/subagent-tracking-state.json b/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/subagent-tracking-state.json
new file mode 100644
index 00000000..ee7973ee
--- /dev/null
+++ b/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/subagent-tracking-state.json
@@ -0,0 +1,7 @@
+{
+ "agents": [],
+ "total_spawned": 0,
+ "total_completed": 0,
+ "total_failed": 0,
+ "last_updated": "2026-06-04T16:51:31.588Z"
+}
\ No newline at end of file
diff --git a/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/ultrawork-state.json b/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/ultrawork-state.json
new file mode 100644
index 00000000..a1d4f54c
--- /dev/null
+++ b/app/(home)/components/.omc/state/sessions/2096ec79-a746-48fe-a12d-180366827aaf/ultrawork-state.json
@@ -0,0 +1,11 @@
+{
+ "active": true,
+ "started_at": "2026-06-04T16:55:09.379Z",
+ "original_prompt": "/oh-my-claudecode:ralph давай сделаем в TypewriterCodeBlock приоритет на next-theme, если в пропсах передана theme - используем ее. И убери в featuredstrep theme добавь ее в InteractiveCode",
+ "session_id": "2096ec79-a746-48fe-a12d-180366827aaf",
+ "project_path": "/Users/dev_wandry/projects/opensource/remocn/app/(home)/components",
+ "reinforcement_count": 0,
+ "awaiting_confirmation": true,
+ "awaiting_confirmation_set_at": "2026-06-04T16:55:09.379Z",
+ "last_checked_at": "2026-06-04T16:55:09.379Z"
+}
\ No newline at end of file
diff --git a/app/(home)/components/sections/get-started.tsx b/app/(home)/components/sections/get-started.tsx
index 38b5c7bc..c8e3f10e 100644
--- a/app/(home)/components/sections/get-started.tsx
+++ b/app/(home)/components/sections/get-started.tsx
@@ -5,11 +5,7 @@ import { LAVENDER, MINT, PEACH, SECTION } from "@/config/landing";
import { convertNpmCommand } from "@/lib/convert-npm-command";
import { FadeUp } from "../fade-up";
import { SectionHeading } from "../section-heading";
-import {
- SYNTAX_LIGHT,
- Token,
- TypewriterCodeBlock,
-} from "../typewriter-code-block";
+import { Tok, TypewriterCodeBlock } from "../typewriter-code-block";
type Step = {
n: number;
@@ -125,13 +121,12 @@ function FeaturedStep({ step, delay }: { step: Step; delay: number }) {
/>
<TypewriterCodeBlock
- theme="light"
header={false}
- text={<Token color={SYNTAX_LIGHT.string}>"Hello, world"</Token>}
- fontSize={<Token color={SYNTAX_LIGHT.number}>72</Token>}
- color={<Token color={SYNTAX_LIGHT.string}>"#171717"</Token>}
- fontWeight={<Token color={SYNTAX_LIGHT.number}>700</Token>}
- cursor={<Token color={SYNTAX_LIGHT.boolean}>true</Token>}
+ text={<Tok kind="string">"Hello, world"</Tok>}
+ fontSize={<Tok kind="number">72</Tok>}
+ color={<Tok kind="string">"#171717"</Tok>}
+ fontWeight={<Tok kind="number">700</Tok>}
+ cursor={<Tok kind="boolean">true</Tok>}
/>
<div className="flex flex-wrap items-center gap-2 pt-1">
diff --git a/app/(home)/components/sections/interactive-code.tsx b/app/(home)/components/sections/interactive-code.tsx
index 7d130c29..d2b42b25 100644
--- a/app/(home)/components/sections/interactive-code.tsx
+++ b/app/(home)/components/sections/interactive-code.tsx
@@ -313,6 +313,7 @@ export function InteractiveCode() {
<div className="mt-12 grid items-stretch gap-6 sm:mt-16 lg:grid-cols-2">
{/* Interactive code editor — the JSX values are the controls. */}
<TypewriterCodeBlock
+ theme="dark"
text={
<EditableString value={text} onChange={set(setText, "text")} />
}
diff --git a/app/(home)/components/typewriter-code-block.tsx b/app/(home)/components/typewriter-code-block.tsx
index 671503c5..6a9ac3ac 100644
--- a/app/(home)/components/typewriter-code-block.tsx
+++ b/app/(home)/components/typewriter-code-block.tsx
@@ -1,5 +1,14 @@
+"use client";
+
import { ChevronDown } from "lucide-react";
-import type { ReactNode } from "react";
+import { useTheme } from "next-themes";
+import {
+ createContext,
+ type ReactNode,
+ useContext,
+ useEffect,
+ useState,
+} from "react";
import { cn } from "@/lib/utils";
export type CodeTheme = "light" | "dark";
@@ -47,8 +56,7 @@ export const SYNTAX: Record<CodeTheme, SyntaxPalette> = {
light: SYNTAX_LIGHT,
};
-// Chrome (surface, title bar, traffic lights, chip) per theme. Fixed colours —
-// driven only by the `theme` prop, never by the site's next-theme.
+// Chrome (surface, title bar, traffic lights, chip) per theme.
const CHROME: Record<
CodeTheme,
{ container: string; titleBar: string; dot: string; chip: string }
@@ -67,6 +75,8 @@ const CHROME: Record<
},
};
+const PaletteContext = createContext<SyntaxPalette>(SYNTAX_DARK);
+
export function Token({
color,
children,
@@ -78,12 +88,30 @@ export function Token({
}
/**
- * The `Typewriter` editor card: title bar + syntax-highlighted source. The
- * `theme` prop ("light" | "dark") fully controls the surface and the syntax
- * palette and is independent of the site theme. The five JSX prop values are
- * slots, so callers decide whether each one is a static {@link Token} or an
- * interactive control; `palette` is exposed so callers can colour their slots
- * to match the active theme.
+ * Token coloured by the active {@link TypewriterCodeBlock} theme. Use this for
+ * slot values when the block follows the site theme (no explicit `theme` prop),
+ * so the colours track light/dark automatically.
+ */
+export function Tok({
+ kind,
+ children,
+}: {
+ kind: keyof SyntaxPalette;
+ children: ReactNode;
+}) {
+ const palette = useContext(PaletteContext);
+ return <span style={{ color: palette[kind] }}>{children}</span>;
+}
+
+/**
+ * The `Typewriter` editor card: title bar + syntax-highlighted source.
+ *
+ * Theme resolution: an explicit `theme` prop always wins; otherwise the block
+ * follows the site's next-theme (`resolvedTheme`), falling back to dark before
+ * mount to avoid hydration mismatch. The active palette is exposed to slots via
+ * context — colour them with {@link Tok} to track the theme, or {@link Token}
+ * for a fixed colour. The five JSX prop values are slots, so callers decide
+ * whether each is static or an interactive control.
*/
export function TypewriterCodeBlock({
text,
@@ -93,7 +121,7 @@ export function TypewriterCodeBlock({
cursor,
footer,
label = "Typewriter",
- theme = "dark",
+ theme,
header = true,
className,
}: {
@@ -105,100 +133,111 @@ export function TypewriterCodeBlock({
footer?: ReactNode;
label?: string;
theme?: CodeTheme;
- className?: string;
header?: boolean;
+ className?: string;
}) {
- const chrome = CHROME[theme];
- const palette = SYNTAX[theme];
+ const { resolvedTheme } = useTheme();
+ const [mounted, setMounted] = useState(false);
+
+ // Theme is only known on the client; before mount fall back to dark so SSR
+ // and the first client render agree.
+ useEffect(() => setMounted(true), []);
+
+ const active: CodeTheme =
+ theme ?? (mounted && resolvedTheme === "light" ? "light" : "dark");
+ const chrome = CHROME[active];
+ const palette = SYNTAX[active];
return (
- <div
- className={cn(
- "relative overflow-hidden rounded-2xl ring-1 sm:rounded-3xl",
- chrome.container,
- className,
- )}
- >
- {/* Title bar */}
- {header && (
- <div
- className={cn(
- "relative flex items-center justify-between border-b px-5 py-4",
- chrome.titleBar,
- )}
- >
- <div className="flex items-center gap-2">
- <span className={cn("size-3 rounded-full", chrome.dot)} />
- <span className={cn("size-3 rounded-full", chrome.dot)} />
- <span className={cn("size-3 rounded-full", chrome.dot)} />
- </div>
- <span
+ <PaletteContext.Provider value={palette}>
+ <div
+ className={cn(
+ "relative overflow-hidden rounded-2xl ring-1 sm:rounded-3xl",
+ chrome.container,
+ className,
+ )}
+ >
+ {/* Title bar */}
+ {header && (
+ <div
className={cn(
- "inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium ring-1",
- chrome.chip,
+ "relative flex items-center justify-between border-b px-5 py-4",
+ chrome.titleBar,
)}
>
- {label}
- <ChevronDown className="size-3.5" />
- </span>
- </div>
- )}
-
- {/* Code */}
- <pre className="relative overflow-x-auto px-6 py-6 font-mono text-[13px] leading-[1.95] whitespace-pre [scrollbar-width:none] sm:text-sm [&::-webkit-scrollbar]:hidden">
- <code>
- <Token color={palette.keyword}>import</Token>
- <Token color={palette.plain}>{" { "}</Token>
- <Token color={palette.type}>Typewriter</Token>
- <Token color={palette.plain}>{" } "}</Token>
- <Token color={palette.keyword}>from</Token>{" "}
- <Token color={palette.string}>"@/components/remocn/typewriter"</Token>
- <Token color={palette.punctuation}>;</Token>
- {"\n\n"}
- <Token color={palette.keyword}>export function</Token>{" "}
- <Token color={palette.fn}>Hero</Token>
- <Token color={palette.punctuation}>{"() {"}</Token>
- {"\n "}
- <Token color={palette.keyword}>return</Token>{" "}
- <Token color={palette.punctuation}>(</Token>
- {"\n "}
- <Token color={palette.punctuation}>{"<"}</Token>
- <Token color={palette.type}>Typewriter</Token>
- {"\n "}
- <Token color={palette.prop}>text</Token>
- <Token color={palette.punctuation}>=</Token>
- {text}
- {"\n "}
- <Token color={palette.prop}>fontSize</Token>
- <Token color={palette.punctuation}>={"{"}</Token>
- {fontSize}
- <Token color={palette.punctuation}>{"}"}</Token>
- {"\n "}
- <Token color={palette.prop}>color</Token>
- <Token color={palette.punctuation}>=</Token>
- {color}
- {"\n "}
- <Token color={palette.prop}>fontWeight</Token>
- <Token color={palette.punctuation}>={"{"}</Token>
- {fontWeight}
- <Token color={palette.punctuation}>{"}"}</Token>
- {"\n "}
- <Token color={palette.prop}>cursor</Token>
- <Token color={palette.punctuation}>={"{"}</Token>
- {cursor}
- <Token color={palette.punctuation}>{"}"}</Token>
- {"\n "}
- <Token color={palette.punctuation}>{"/>"}</Token>
- {"\n "}
- <Token color={palette.punctuation}>)</Token>
- {"\n"}
- <Token color={palette.punctuation}>{"}"}</Token>
- </code>
- </pre>
-
- {footer ? (
- <div className="relative flex justify-end px-6 pb-5">{footer}</div>
- ) : null}
- </div>
+ <div className="flex items-center gap-2">
+ <span className={cn("size-3 rounded-full", chrome.dot)} />
+ <span className={cn("size-3 rounded-full", chrome.dot)} />
+ <span className={cn("size-3 rounded-full", chrome.dot)} />
+ </div>
+ <span
+ className={cn(
+ "inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium ring-1",
+ chrome.chip,
+ )}
+ >
+ {label}
+ <ChevronDown className="size-3.5" />
+ </span>
+ </div>
+ )}
+
+ {/* Code */}
+ <pre className="relative overflow-x-auto px-6 py-6 font-mono text-[13px] leading-[1.95] whitespace-pre [scrollbar-width:none] sm:text-sm [&::-webkit-scrollbar]:hidden">
+ <code>
+ <Token color={palette.keyword}>import</Token>
+ <Token color={palette.plain}>{" { "}</Token>
+ <Token color={palette.type}>Typewriter</Token>
+ <Token color={palette.plain}>{" } "}</Token>
+ <Token color={palette.keyword}>from</Token>{" "}
+ <Token color={palette.string}>"@/components/remocn/typewriter"</Token>
+ <Token color={palette.punctuation}>;</Token>
+ {"\n\n"}
+ <Token color={palette.keyword}>export function</Token>{" "}
+ <Token color={palette.fn}>Hero</Token>
+ <Token color={palette.punctuation}>{"() {"}</Token>
+ {"\n "}
+ <Token color={palette.keyword}>return</Token>{" "}
+ <Token color={palette.punctuation}>(</Token>
+ {"\n "}
+ <Token color={palette.punctuation}>{"<"}</Token>
+ <Token color={palette.type}>Typewriter</Token>
+ {"\n "}
+ <Token color={palette.prop}>text</Token>
+ <Token color={palette.punctuation}>=</Token>
+ {text}
+ {"\n "}
+ <Token color={palette.prop}>fontSize</Token>
+ <Token color={palette.punctuation}>={"{"}</Token>
+ {fontSize}
+ <Token color={palette.punctuation}>{"}"}</Token>
+ {"\n "}
+ <Token color={palette.prop}>color</Token>
+ <Token color={palette.punctuation}>=</Token>
+ {color}
+ {"\n "}
+ <Token color={palette.prop}>fontWeight</Token>
+ <Token color={palette.punctuation}>={"{"}</Token>
+ {fontWeight}
+ <Token color={palette.punctuation}>{"}"}</Token>
+ {"\n "}
+ <Token color={palette.prop}>cursor</Token>
+ <Token color={palette.punctuation}>={"{"}</Token>
+ {cursor}
+ <Token color={palette.punctuation}>{"}"}</Token>
+ {"\n "}
+ <Token color={palette.punctuation}>{"/>"}</Token>
+ {"\n "}
+ <Token color={palette.punctuation}>)</Token>
+ {"\n"}
+ <Token color={palette.punctuation}>{"}"}</Token>
+ </code>
+ </pre>
+
+ {footer ? (
+ <div className="relative flex justify-end px-6 pb-5">{footer}</div>
+ ) : null}
+ </div>
+ </PaletteContext.Provider>
);
}