Orbit Carousel
A strip of photo tiles builds under a bold title, curls into a ring that orbits it, collapses into a stack and the hero tile zooms to full frame.
Install using CLI
npx shadcn@latest add https://www.sycamore.to/r/orbit-carousel.jsonDownload assets (fonts and images)
node sycamore-assets.mjs orbit-carouselUsage
import { OrbitCarousel } from "./sycamore/orbit-carousel/OrbitCarousel";
<Composition
id="OrbitCarousel"
component={OrbitCarousel}
durationInFrames={306}
fps={30}
width={1920}
height={1080}
/>Install manually
Copy the source code into src/sycamore/orbit-carousel/
// Orbit Carousel: a strip of photo tiles builds up under a bold title, curls
// into a ring that orbits the title, collapses into a stack, and the hero tile
// zooms to full screen. Built section by section (see SECTIONS below).
//
// Every tile is one absolutely positioned element whose position is computed
// from the frame, so later sections (strip -> ring -> stack) can morph the same
// elements instead of swapping layers.
import React from "react";
import {
AbsoluteFill,
cancelRender,
continueRender,
delayRender,
Easing,
Img,
interpolate,
interpolateColors,
spring,
staticFile,
useCurrentFrame,
useVideoConfig,
} from "remotion";
// Fonts are served from public/ (not Google Fonts) so renders never depend on
// fonts.gstatic.com. Inter Bold for the title, Geist Mono for the HUD.
const SANS = "OrbitInter";
const MONO = "OrbitGeistMono";
const loadLocalFont = (family: string, file: string, weight: string) => {
if (typeof FontFace === "undefined") return;
const handle = delayRender(`font ${family}`);
const font = new FontFace(family, `url(${staticFile(`orbit-carousel/fonts/${file}`)}) format("woff2")`, { weight });
font
.load()
.then(() => {
document.fonts.add(font);
continueRender(handle);
})
.catch((err) => cancelRender(err));
};
loadLocalFont(SANS, "inter-700.woff2", "700");
loadLocalFont(MONO, "geist-mono-400.woff2", "400");
export const ORBIT_FPS = 30;
export const ORBIT_WIDTH = 1920;
export const ORBIT_HEIGHT = 1080;
// Section boundaries (frames). All five sections are built.
export const SECTIONS = {
build: { from: 0, to: 60 }, // 1. strip builds + title reveals
ring: { from: 60, to: 86 }, // 2. strip curls into a ring, title shrinks into it
orbit: { from: 86, to: 216 }, // 3. ring orbits; two whips, each with a background change
collapse: { from: 216, to: 235 }, // 4. ring pulls into a stack, hero on top, HUD closes in
hero: { from: 228, to: 276 }, // 5. hero grows to full frame (over the HUD), then holds
} as const;
export const ORBIT_FRAMES = 306;
const BG = "#70737e";
const BG_MAUVE = "#9b7d9e";
const BG_DARK = "#3d3740";
// Section 3: the background changes at each whip of the orbit.
const BG_STEPS = [
{ from: 132, to: 146, color: BG_MAUVE },
{ from: 186, to: 201, color: BG_DARK },
{ from: 229, to: 242, color: BG }, // section 4: back to grey as the ring collapses
];
// Orbit whips: extra clockwise turn (degrees) on top of the steady ORBIT_SPEED,
// fitted to the reference. The first winds up slowly, peaks around f137 and has
// a long tail; the second is short and sharp.
const WHIPS = [
{ from: 110, to: 178, turn: 122, ease: Easing.bezier(0.72, 0, 0, 1) },
{ from: 180, to: 197, turn: 48, ease: Easing.bezier(0.52, 0, 0.62, 1) },
{ from: 220, to: 242, turn: 55, ease: Easing.bezier(0.6, 0, 0.4, 1) }, // section 4: spins up while collapsing
];
// Section 4: how far (px) the HUD labels slide in from the top/bottom edges, so they
// end up hugging the stack. Keyframes traced from the reference.
const HUD_INSET_FRAMES = [212, 222, 226, 230, 234, 238, 242];
const HUD_INSET_VALUES = [0, 24, 43, 77, 141, 210, 240];
// Sections 4-5: the hero's size (px) as it grows out of the stack to full frame.
// Traced from the reference every 2 frames: it squares up first, then widens to
// 16:9 and fills the frame at f276, then holds still to the end (no push-in).
const HERO_FRAMES = [228, 232, 236, 238, 240, 242, 244, 246, 248, 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, 272, 274, 276];
const HERO_W = [172, 198, 266, 293, 366, 495, 702, 939, 1134, 1290, 1413, 1518, 1599, 1662, 1722, 1770, 1806, 1842, 1866, 1887, 1902, 1914, 1920];
const HERO_H = [207, 224, 285, 304, 365, 495, 582, 702, 792, 864, 912, 954, 984, 1008, 1032, 1050, 1062, 1074, 1080, 1080, 1080, 1080, 1080];
const INK = "#ececec";
// Stock photos (Unsplash), public/orbit-carousel/. The first is the hero tile.
const TILES = [1, 2, 4, 5, 6, 7, 8, 9, 10, 11].map((n) => staticFile(`orbit-carousel/${n}.jpg`));
// Strip geometry.
const TILE = 90;
const GAP = 13;
const TILE_FIRST = 5; // frame the first tile pops in
const TILE_EVERY = 2; // frames between tiles
// Ring geometry (section 2). Tiles grow into portrait cards on a circle around
// the title; the circle is turning clockwise while it closes, and keeps turning.
const RING_R = 275;
const RING_W = 172;
const RING_H = 207;
const RING_PITCH = (2 * Math.PI * RING_R) / 10; // arc length between tile centres
const ORBIT_SPEED = 0.62; // degrees per frame once the ring is closed
const RING_SPIN = 29; // degrees turned during the curl itself
const TITLE_RING_SCALE = 0.4;
// Title geometry.
const FONT_SIZE = 126;
const LINE = 108; // line pitch
const TEXT_GAP = 24; // between the title block and the strip
// Frames at which each title line starts to reveal.
const T = { motion: 13, template: 20, s01: 22, social: 28 } as const;
const ease = Easing.bezier(0.22, 1, 0.36, 1);
const clamp = { extrapolateLeft: "clamp", extrapolateRight: "clamp" } as const;
/** 0..1 progress of a line/tile entering, starting at `start`. */
const useEnter = (start: number, dur = 6) => {
const frame = useCurrentFrame();
return interpolate(frame, [start, start + dur], [0, 1], { ...clamp, easing: ease });
};
// ---------------------------------------------------------------- HUD
const HudLabel: React.FC<{ children: React.ReactNode; style?: React.CSSProperties }> = ({ children, style }) => (
<div
style={{
position: "absolute",
fontFamily: MONO,
fontSize: 17,
letterSpacing: 1.5,
color: INK,
textTransform: "uppercase",
whiteSpace: "nowrap",
...style,
}}
>
{children}
</div>
);
/** Corner labels that slide in to the centre while the bottom rule shrinks away. */
const Hud: React.FC<{ tilesShown: number; inset: number }> = ({ tilesShown, inset }) => {
const frame = useCurrentFrame();
const { width } = useVideoConfig();
// 0 = labels at the corners, 1 = gathered in the middle.
const gather = interpolate(frame, [0, 14], [0, 1], { ...clamp, easing: Easing.bezier(0.65, 0, 0.35, 1) });
const margin = 30;
const pair = (leftW: number, rightW: number, gap: number) => {
const total = leftW + gap + rightW;
const left = interpolate(gather, [0, 1], [margin, (width - total) / 2]);
const right = interpolate(gather, [0, 1], [width - margin - rightW, (width + total) / 2 - rightW]);
return { left, right };
};
// Approximate label widths at 17px mono (≈ 11.7px per char incl. tracking).
const cw = 11.7;
const top = pair(11 * cw, 8 * cw, 16);
const bottom = pair(12 * cw, 9 * cw, 34);
const ruleL = bottom.left + 12 * cw + 18;
const ruleR = bottom.right - 18;
const counterIn = interpolate(frame, [5, 7], [0, 1], clamp);
const count = String(tilesShown).padStart(2, "0");
return (
<>
<HudLabel style={{ top: 52 + inset, left: top.left }}>website.com</HudLabel>
<HudLabel style={{ top: 52 + inset, left: top.right }}>template</HudLabel>
<HudLabel style={{ bottom: 52 + inset, left: bottom.left }}>social media</HudLabel>
{ruleR > ruleL + 1 && (
<div
style={{
position: "absolute",
bottom: 61,
left: ruleL,
width: ruleR - ruleL,
height: 1.5,
background: INK,
opacity: 0.55,
}}
/>
)}
<HudLabel style={{ bottom: 52 + inset, left: bottom.right, opacity: counterIn }}>{count} frames</HudLabel>
</>
);
};
// ---------------------------------------------------------------- title
/** One title line, revealed by sliding up out of a mask. */
const TitleLine: React.FC<{ text: string; y: number; start: number; scale: number }> = ({ text, y, start, scale }) => {
const p = useEnter(start);
if (p <= 0) return null;
return (
<div
style={{
position: "absolute",
left: 0,
right: 0,
top: y - LINE / 2,
height: LINE,
overflow: "hidden",
display: "flex",
justifyContent: "center",
transform: `scale(${scale})`,
}}
>
<div
style={{
fontFamily: SANS,
fontWeight: 700,
fontSize: FONT_SIZE,
lineHeight: `${LINE}px`,
letterSpacing: -4,
color: INK,
transform: `translateY(${(1 - p) * 70}%)`,
}}
>
{text}
</div>
</div>
);
};
// ---------------------------------------------------------------- main
export const OrbitCarousel: React.FC = () => {
const frame = useCurrentFrame();
const { fps, width, height } = useVideoConfig();
const cx = width / 2;
const cy = height / 2;
// How many tiles are in, and each tile's pop.
const tileStart = (i: number) => TILE_FIRST + i * TILE_EVERY;
const tilesShown = TILES.filter((_, i) => frame >= tileStart(i)).length;
// The strip recentres as it grows: its width follows a smoothed tile count.
const grown = TILES.reduce(
(acc, _, i) => acc + spring({ frame: frame - tileStart(i), fps, config: { damping: 200, mass: 0.5 } }),
0,
);
// ---- section 2: curl. p = 0 flat strip, 1 closed ring.
const p = interpolate(frame, [SECTIONS.ring.from, SECTIONS.ring.to], [0, 1], {
...clamp,
easing: Easing.bezier(0.65, 0, 0.3, 1),
});
const tileW = interpolate(p, [0, 1], [TILE, RING_W]);
const tileH = interpolate(p, [0, 1], [TILE, RING_H]);
const pitch = interpolate(p, [0, 1], [TILE + GAP, RING_PITCH]);
// Clockwise spin: eases in with the curl, then a constant orbit (hermite so
// the speed is continuous at the hand-off).
const spinT = interpolate(frame, [SECTIONS.ring.from, SECTIONS.ring.to], [0, 1], clamp);
const spinLen = SECTIONS.ring.to - SECTIONS.ring.from;
const spin =
RING_SPIN * (3 * spinT ** 2 - 2 * spinT ** 3) +
ORBIT_SPEED * spinLen * (spinT ** 3 - spinT ** 2) +
Math.max(0, frame - SECTIONS.ring.to) * ORBIT_SPEED +
WHIPS.reduce((acc, w) => acc + w.turn * interpolate(frame, [w.from, w.to], [0, 1], { ...clamp, easing: w.ease }), 0);
// ---- section 3: background steps grey -> mauve -> dark with the whips.
const bg = BG_STEPS.reduce(
(color, step) =>
interpolateColors(frame, [step.from, step.to], [color, step.color], {
easing: Easing.bezier(0.35, 0, 0.2, 1),
}),
BG,
);
// ---- section 4: collapse. 1 = full ring, 0 = every tile stacked on the centre.
const gather = interpolate(frame, [SECTIONS.collapse.from, SECTIONS.collapse.to], [1, 0], {
...clamp,
easing: Easing.in(Easing.quad),
});
const hudInset = interpolate(frame, HUD_INSET_FRAMES, HUD_INSET_VALUES, clamp);
/** Centre of tile i: on an arc whose curvature grows with p (bottom of the arc
* is the strip's middle), then the whole shape rotated about the screen centre. */
const tileCentre = (i: number) => {
// Section 1 strip (recentring while it grows).
const stripW = Math.max(grown, 0.0001) * (TILE + GAP) - GAP;
const flatX = -stripW / 2 + i * (TILE + GAP) + TILE / 2;
if (p <= 0) return { x: cx + flatX, y: cy };
const s = (i - (TILES.length - 1) / 2) * pitch; // arc length from the middle
const r = (TILES.length * pitch) / (2 * Math.PI * p); // radius, infinite at p = 0
const bottom = RING_R * p; // arc bottom sinks so the closed ring centres on screen
const th = s / r;
let x = r * Math.sin(th);
let y = bottom - r * (1 - Math.cos(th));
// Section 4: the closed ring pulls in on its centre (accelerating).
x *= gather;
y *= gather;
const a = (spin * Math.PI) / 180;
return { x: cx + x * Math.cos(a) - y * Math.sin(a), y: cy + x * Math.sin(a) + y * Math.cos(a) };
};
// ---- title: lines stack above/below the strip, then close the strip's gap and
// shrink into the ring's middle.
// The title trails the curl by a few frames.
const tp = interpolate(frame, [SECTIONS.ring.from + 4, SECTIONS.ring.to + 2], [0, 1], {
...clamp,
easing: Easing.bezier(0.6, 0, 0.3, 1),
});
// Section 4: the title shrinks away under the collapsing tiles.
const titleOut = interpolate(frame, [222, 233], [1, 0], { ...clamp, easing: Easing.bezier(0.45, 0, 0.55, 1) });
const titleScale = interpolate(tp, [0, 1], [1, TITLE_RING_SCALE]) * titleOut;
const nearOff = TILE / 2 + TEXT_GAP + LINE / 2; // line next to the strip
const near = interpolate(tp, [0, 1], [nearOff, LINE / 2]) * titleScale;
const far = (nearOff + LINE) * (1 - tp) + 1.5 * LINE * tp;
// MOTION sits right above the strip until TEMPLATE arrives and pushes it up.
const motionOff = interpolate(useEnter(T.template, 8), [0, 1], [nearOff, far]);
return (
<AbsoluteFill style={{ background: bg, overflow: "hidden" }}>
<Hud tilesShown={tilesShown} inset={hudInset} />
<TitleLine text="MOTION" y={cy - (tp > 0 ? far * titleScale : motionOff)} start={T.motion} scale={titleScale} />
<TitleLine text="TEMPLATE" y={cy - near} start={T.template} scale={titleScale} />
<TitleLine text="S—01" y={cy + near} start={T.s01} scale={titleScale} />
<TitleLine text="SOCIAL" y={cy + far * titleScale} start={T.social} scale={titleScale} />
{TILES.map((src, i) => {
const pop = spring({ frame: frame - tileStart(i), fps, config: { damping: 14, mass: 0.4, stiffness: 180 } });
if (frame < tileStart(i)) return null;
const c = tileCentre(i);
const hero = i === 0 && frame >= SECTIONS.hero.from;
const w = hero ? interpolate(frame, HERO_FRAMES, HERO_W, clamp) : tileW;
const h = hero ? interpolate(frame, HERO_FRAMES, HERO_H, clamp) : tileH;
return (
<div
key={src}
style={{
position: "absolute",
left: c.x - w / 2,
top: c.y - h / 2,
width: w,
height: h,
transform: `scale(${interpolate(pop, [0, 1], [0.4, 1])})`,
opacity: interpolate(pop, [0, 0.3], [0, 1], clamp),
overflow: "hidden",
// The hero (tile 0) rides on top once the ring starts to collapse.
zIndex: i === 0 && frame >= SECTIONS.collapse.from ? 1 : undefined,
}}
>
<Img src={src} style={{ width: "100%", height: "100%", objectFit: "cover" }} />
</div>
);
})}
</AbsoluteFill>
);
};Download assets (fonts and images)
curl -O https://www.sycamore.to/sycamore-assets.mjsnode sycamore-assets.mjs orbit-carousel
Sycamore