← All edits
← All edits
Component · Overlays · 16:9
by CutshipVerified
A clean white living-room TV screen of records: a row of square album covers steps along one at a time, the selected cover swells and lifts on a soft shadow with its artist, title and year underneath, under a quiet bar with a profile, the weather and the time.
0 taken · 2 views
Included with Pro
Sign up free to unlock the spec, agent prompt and Make this.
Make it mine
Pro+Drop in your clip, photos and words and watch this asset play with them, styled with your brand kit. Then hand it to your agent for the full-quality render.
Make it mine is part of Pro+components/remotion/album-wall/component.tsx
import React, { useEffect, useState } from "react";
import {
AbsoluteFill,
Easing,
Img,
continueRender,
delayRender,
interpolate,
staticFile,
useCurrentFrame,
useVideoConfig,
} from "remotion";
import { loadFont as loadMontserrat } from "@remotion/google-fonts/Montserrat";
import { loadFont as loadInter } from "@remotion/google-fonts/Inter";
import { loadFont as loadDMSans } from "@remotion/google-fonts/DMSans";
import { loadFont as loadManrope } from "@remotion/google-fonts/Manrope";
import { getAvailableFonts } from "@remotion/google-fonts";
import type { AlbumWallProps } from "./schema";
const opts = { weights: ["400", "500", "600"] as ("400" | "500" | "600")[], subsets: ["latin", "latin-ext"] as ("latin" | "latin-ext")[] };
const FONTS = {
montserrat: loadMontserrat("normal", opts).fontFamily,
inter: loadInter("normal", opts).fontFamily,
"dm-sans": loadDMSans("normal", opts).fontFamily,
manrope: loadManrope("normal", opts).fontFamily,
} as const;
const resolve = (s: string) => (/^(https?:|data:|blob:|\/)/.test(s) ? s : staticFile(s));
const mod = (i: number, n: number) => ((i % n) + n) % n;
/** Muted tiles for albums without a cover. */
const TILE_COLORS = ["#2B2D42", "#C9B79C", "#E4572E", "#7D8C78", "#E9D8C4", "#3D5A80", "#B5838D", "#1F1F1F", "#F2CC8F", "#6D6875"];
const isLight = (hex: string) => {
const v = parseInt(hex.slice(1), 16);
return 0.299 * (v >> 16) + 0.587 * ((v >> 8) & 255) + 0.114 * (v & 255) > 160;
};
/** Loads a brand-kit Google Font by family name; returns it once ready. */
const useBrandFont = (family?: string) => {
const [ready, setReady] = useState<string | null>(null);
useEffect(() => {
if (!family) return setReady(null);
const entry = getAvailableFonts().find((f) => f.fontFamily.toLowerCase() === family.toLowerCase());
if (!entry) return;
const handle = delayRender(`Loading font ${family}`);
entry
.load()
.then((m) => {
const weights = Object.keys(m.getInfo().fonts.normal ?? {});
const keep = ["400", "500", "600"].filter((w) => weights.includes(w));
return m.loadFont("normal", { subsets: ["latin"], weights: keep.length ? keep : undefined }).waitUntilDone();
})
.then(() => setReady(entry.fontFamily))
.catch(() => setReady(null))
.finally(() => continueRender(handle));
}, [family]);
return ready;
};
/** Thin outline icons, drawn on a 24-unit grid. */
const WeatherIcon: React.FC<{ kind: AlbumWallProps["weatherIcon"]; size: number; color: string }> = ({ kind, size, color }) => {
if (kind === "none") return null;
const sun = (cx: number, cy: number, r: number) => (
<>
<circle cx={cx} cy={cy} r={r} />
{Array.from({ length: 8 }).map((_, i) => {
const a = (i * Math.PI) / 4;
return (
<line key={i} x1={cx + Math.cos(a) * (r + 2)} y1={cy + Math.sin(a) * (r + 2)} x2={cx + Math.cos(a) * (r + 3.6)} y2={cy + Math.sin(a) * (r + 3.6)} />
);
})}
</>
);
const cloud = "M7.5 19.5h10a3.6 3.6 0 0 0 .3-7.2 5.2 5.2 0 0 0-10-.9 3.1 3.1 0 0 0-.3 6.2z";
return (
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth={1.3} strokeLinecap="round" strokeLinejoin="round">
{kind === "sun" ? sun(12, 12, 4.2) : null}
{kind === "partly-cloudy" ? (
<>
{sun(9, 8.5, 3.2)}
<path d={cloud} transform="translate(1.5 0)" />
</>
) : null}
{kind === "cloud" ? <path d={cloud} transform="translate(-0.5 -2)" /> : null}
{kind === "rain" ? (
<>
<path d={cloud} transform="translate(-0.5 -4)" />
<path d="M9 18.5l-1 2.5M13 18.5l-1 2.5M17 18.5l-1 2.5" />
</>
) : null}
{kind === "moon" ? <path d="M19 14.5A7.5 7.5 0 0 1 9.5 5a7.5 7.5 0 1 0 9.5 9.5z" /> : null}
</svg>
);
};
const BellIcon: React.FC<{ size: number; color: string }> = ({ size, color }) => (
<svg width={size} height={size} viewBox="0 0 24 24" fill={color}>
<path d="M12 3a1.4 1.4 0 0 1 1.4 1.4v.5A6 6 0 0 1 18 10.7v3.8l1.6 2.3a.8.8 0 0 1-.7 1.2H5.1a.8.8 0 0 1-.7-1.2L6 14.5v-3.8a6 6 0 0 1 4.6-5.8v-.5A1.4 1.4 0 0 1 12 3zm-2.2 15.8h4.4a2.2 2.2 0 0 1-4.4 0z" />
</svg>
);
const LogoutIcon: React.FC<{ size: number; color: string }> = ({ size, color }) => (
<svg width={size} height={size} viewBox="0 0 24 24" fill="none" stroke={color} strokeWidth={1.6} strokeLinecap="round" strokeLinejoin="round">
<path d="M10 5H6.5A1.5 1.5 0 0 0 5 6.5v11A1.5 1.5 0 0 0 6.5 19H10" />
<path d="M14 8.5 17.5 12 14 15.5M17.5 12H9.5" />
</svg>
);
/**
* A living-room TV screen of records: a clean white UI with a profile, weather and clock along the
* top, and a row of square covers that steps one record at a time. The selected cover grows, lifts
* on a soft shadow and shows its artist, title and year underneath.
*/
export const AlbumWall: React.FC<AlbumWallProps> = ({
albums,
showHeader,
name,
avatar,
profileNote,
temperature,
weatherNote,
weatherIcon,
time,
date,
showBell,
coverSize,
focusScale,
gap,
cornerRadius,
focusX,
rowY,
showCaption,
showYear,
secondsPerAlbum,
moveSeconds,
seamlessLoop,
background,
glowColor,
textColor: baseTextColor,
mutedColor,
font,
brandKit,
}) => {
const frame = useCurrentFrame();
const { fps, width, height, durationInFrames } = useVideoConfig();
// Sizes are given at 1920×1080 and scale with the frame's area, so a 9:16 or 4:5 cut keeps the same feel.
const s = Math.sqrt((width * height) / (1920 * 1080));
const brandFont = useBrandFont(brandKit?.fonts[0]);
const fontFamily = brandFont ?? FONTS[font] ?? FONTS.montserrat;
const textColor = brandKit?.colors[0] ?? baseTextColor;
const n = Math.max(1, albums.length);
// Pace: one record per step. With seamlessLoop the step is nudged so the clip ends on whole laps.
const seconds = durationInFrames / fps;
let step = secondsPerAlbum;
if (seamlessLoop) {
const laps = Math.max(1, Math.round(seconds / (secondsPerAlbum * n)));
const looped = seconds / (laps * n);
if (Math.abs(looped / secondsPerAlbum - 1) <= 0.25) step = looped;
}
const stepFrames = step * fps;
const moveFrames = Math.min(moveSeconds * fps, stepFrames * 0.9);
const k = Math.floor(frame / stepFrames);
const local = frame - k * stepFrames;
// Each step holds on its record, then eases to the next in its last `moveSeconds`.
const a = interpolate(local, [stepFrames - moveFrames, stepFrames], [0, 1], {
extrapolateLeft: "clamp",
extrapolateRight: "clamp",
easing: Easing.bezier(0.65, 0, 0.35, 1),
});
const base = coverSize * s;
const big = base * focusScale;
const gapPx = gap * s;
const radius = cornerRadius * s;
const widthOf = (i: number) => base + (big - base) * Math.max(0, 1 - Math.abs(i - (k + a)));
// The selected spot stays put; covers k and k+1 trade size around it, so spacing stays even mid-move.
const anchor = focusX * width;
const centers = new Map<number, number>();
centers.set(k, anchor - a * (widthOf(k) / 2 + gapPx + widthOf(k + 1) / 2));
const left = Math.ceil(anchor / (base + gapPx)) + 2;
const right = Math.ceil((width - anchor) / (base + gapPx)) + 2;
for (let i = k - 1; i >= k - left; i--) centers.set(i, centers.get(i + 1)! - widthOf(i + 1) / 2 - gapPx - widthOf(i) / 2);
for (let i = k + 1; i <= k + right; i++) centers.set(i, centers.get(i - 1)! + widthOf(i - 1) / 2 + gapPx + widthOf(i) / 2);
const slots = [...centers.keys()].sort((x, y) => x - y);
const rowCenter = rowY * height;
const covers = [...new Set(albums.map((al) => al.cover).filter(Boolean))];
// Header metrics (at 1920×1080: 70 px avatar, 34 px name, 20 px notes).
const headerY = Math.max(0.085 * height, 92 * s);
const margin = 50 * s;
const big1 = 34 * s;
const small = 20 * s;
const caption = (album: (typeof albums)[number], opacity: number, dy: number) => (
<div
style={{
position: "absolute",
left: anchor - big,
width: big * 2,
top: rowCenter + big / 2 + 30 * s,
textAlign: "center",
opacity,
translate: `0px ${dy}px`,
}}
>
<div style={{ fontSize: 21 * s, fontWeight: 600, color: textColor, lineHeight: 1.35 }}>{album.artist}</div>
<div style={{ fontSize: 20 * s, fontWeight: 400, color: mutedColor, lineHeight: 1.35 }}>{album.title}</div>
{showYear && album.year ? (
<div style={{ fontSize: 18 * s, fontWeight: 400, color: mutedColor, opacity: 0.55, lineHeight: 1.5 }}>{album.year}</div>
) : null}
</div>
);
return (
<AbsoluteFill style={{ backgroundColor: background, fontFamily, overflow: "hidden" }}>
{glowColor !== "transparent" ? (
<AbsoluteFill
style={{ background: `radial-gradient(ellipse 55% 85% at 100% 35%, ${glowColor} 0%, ${glowColor}00 100%)` }}
/>
) : null}
{/* Load every cover up front so a step never waits on (or blanks for) an image. */}
<div style={{ position: "absolute", width: 1, height: 1, overflow: "hidden", opacity: 0 }}>
{covers.map((src) => (
<Img key={src} src={resolve(src)} style={{ width: base }} />
))}
</div>
{showHeader ? (
<>
<div style={{ position: "absolute", left: margin, top: headerY, translate: "0px -50%", display: "flex", alignItems: "center", gap: 44 * s }}>
<div
style={{
width: 70 * s,
height: 70 * s,
borderRadius: "50%",
overflow: "hidden",
backgroundColor: "#E6E6EA",
display: "flex",
alignItems: "center",
justifyContent: "center",
color: mutedColor,
fontSize: 30 * s,
fontWeight: 500,
flex: "none",
}}
>
{avatar ? (
<Img src={resolve(avatar)} style={{ width: "100%", height: "100%", objectFit: "cover" }} />
) : (
name.trim().charAt(0).toUpperCase()
)}
</div>
<div>
<div style={{ fontSize: big1, fontWeight: 500, color: textColor, lineHeight: 1.15 }}>{name}</div>
{profileNote ? (
<div style={{ display: "flex", alignItems: "center", gap: 8 * s, marginTop: 6 * s, fontSize: small, color: mutedColor, opacity: 0.7 }}>
<LogoutIcon size={small * 1.1} color={mutedColor} />
{profileNote}
</div>
) : null}
</div>
</div>
<div style={{ position: "absolute", right: margin + 18 * s, top: headerY, translate: "0px -50%", display: "flex", alignItems: "center", gap: 84 * s }}>
{temperature || weatherNote ? (
<div>
<div style={{ display: "flex", alignItems: "center", gap: 28 * s }}>
<WeatherIcon kind={weatherIcon} size={40 * s} color={mutedColor} />
<div style={{ fontSize: big1, fontWeight: 400, color: textColor, lineHeight: 1.15 }}>{temperature}</div>
</div>
<div style={{ fontSize: small, color: mutedColor, opacity: 0.7, marginTop: 6 * s }}>{weatherNote}</div>
</div>
) : null}
{time || date ? (
<div style={{ textAlign: "right" }}>
<div style={{ fontSize: big1, fontWeight: 400, color: textColor, lineHeight: 1.15 }}>{time}</div>
<div style={{ fontSize: small, color: mutedColor, opacity: 0.7, marginTop: 6 * s }}>{date}</div>
</div>
) : null}
{showBell ? (
<div style={{ marginLeft: 40 * s }}>
<BellIcon size={30 * s} color={mutedColor} />
</div>
) : null}
</div>
</>
) : null}
{slots.map((i) => {
const album = albums[mod(i, n)];
const tile = TILE_COLORS[mod(i, n) % TILE_COLORS.length];
const w = widthOf(i);
const lift = (w - base) / Math.max(1e-6, big - base); // 0 = resting, 1 = selected
const cx = centers.get(i)!;
if (cx + w / 2 < -base || cx - w / 2 > width + base) return null;
return (
<div
key={i}
style={{
position: "absolute",
left: cx - w / 2,
top: rowCenter - w / 2,
width: w,
height: w,
borderRadius: radius,
overflow: "hidden",
backgroundColor: tile,
boxShadow: `0px ${22 * s * lift}px ${48 * s * lift}px rgba(20, 20, 40, ${0.2 * lift})`,
zIndex: lift > 0 ? 2 : 1,
}}
>
{album.cover ? (
<Img src={resolve(album.cover)} style={{ width: "100%", height: "100%", objectFit: "cover", display: "block" }} />
) : (
<div
style={{
position: "absolute",
inset: 0,
padding: w * 0.09,
display: "flex",
flexDirection: "column",
justifyContent: "flex-end",
color: isLight(tile) ? "rgba(20,20,24,0.85)" : "rgba(255,255,255,0.92)",
fontSize: w * 0.075,
lineHeight: 1.2,
}}
>
<div style={{ fontWeight: 600 }}>{album.title}</div>
<div style={{ opacity: 0.75 }}>{album.artist}</div>
</div>
)}
</div>
);
})}
{showCaption ? (
<>
{caption(
albums[mod(k, n)],
interpolate(a, [0, 0.45], [1, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }),
interpolate(a, [0, 0.45], [0, -8 * s], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }),
)}
{a > 0
? caption(
albums[mod(k + 1, n)],
interpolate(a, [0.55, 1], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }),
interpolate(a, [0.55, 1], [10 * s, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" }),
)
: null}
</>
) : null}
</AbsoluteFill>
);
};
Remotion code you can paste anywhere, or install it: npx cutship add album-wall
MIT License: use it in any video, personal or commercial. License
More from Cutship
Creator page →