右上角滑入字卡
姓名與頭銜字卡從右側水平滑入,左側搭配垂直強調線,文字靠右對齊,適合右上角人物標示場景。
文字動態商務橫式
提示詞(可直接修改內容)
import { AbsoluteFill, interpolate, spring, useCurrentFrame, useVideoConfig } from "remotion";
import React from "react";
export const CardTopRight: React.FC = () => {
const frame = useCurrentFrame();
const { fps } = useVideoConfig();
const slideProgress = spring({ frame, fps, config: { damping: 22, stiffness: 140 } });
const textProgress = spring({ frame: frame - 10, fps, config: { damping: 25, stiffness: 110 } });
const x = interpolate(slideProgress, [0, 1], [600, 0]);
const textOpacity = interpolate(textProgress, [0, 0.4], [0, 1], { extrapolateRight: "clamp" });
return (
<AbsoluteFill
style={{
background: "linear-gradient(135deg, #052e16 0%, #0f172a 100%)",
justifyContent: "flex-start",
alignItems: "flex-end",
paddingTop: 60,
paddingRight: 0,
}}
>
<div
style={{
transform: `translateX(${x}px)`,
display: "flex",
alignItems: "stretch",
height: 90,
}}
>
<div style={{ width: 4, background: "#4ade80", flexShrink: 0 }} />
<div
style={{
background: "#052e16",
paddingRight: 24,
paddingLeft: 24,
display: "flex",
flexDirection: "column",
justifyContent: "center",
opacity: textOpacity,
}}
>
<div
style={{
fontSize: 38,
fontWeight: 700,
color: "#ffffff",
fontFamily: "sans-serif",
textAlign: "right",
}}
>
Alex Johnson
</div>
<div
style={{
fontSize: 20,
color: "#bbf7d0",
fontFamily: "sans-serif",
marginTop: 2,
textAlign: "right",
}}
>
Lead Engineer
</div>
</div>
</div>
</AbsoluteFill>
);
};登入後查看完整程式碼