remotion-transitions 是做什麼的?
使用外掛在 Remotion 中建立自訂場景轉場,包含動畫數學、時間模式與即用範例。
功能特色
- 動畫數學:內建常用緩動函數(如 ease-in、ease-out、彈性緩動等)。
- 時間模式:支援延遲、持續時間與時間軸微調。
- 即用範例:提供多種現成轉場,如淡入淡出、滑動、縮放與自訂形狀。
- 外掛架構:可輕鬆擴充,無需修改核心 Remotion 設定。
安裝
使用 npm 或 yarn 安裝:
npm install delphinereverse794/remotion-transitions
# 或
yarn add delphinereverse794/remotion-transitions
基本使用
以下範例展示如何在 Remotion 元件中套用轉場:
import { useTransition, FadeTransition } from 'delphinereverse794/remotion-transitions';
export const MyScene: React.FC = () => {
const transition = useTransition({
duration: 30,
easing: 'easeInOut',
type: 'fade',
});
return (
<div style={{ opacity: transition }}>
<h1>Hello, Remotion!</h1>
</div>
);
};
進階配置
您可以自訂時間模式與動畫參數:
import { CustomTransition } from 'delphinereverse794/remotion-transitions';
const slideTransition = CustomTransition({
duration: 45,
delay: 10,
direction: 'left',
easing: 'bounce',
});
支援平台
- Remotion 3.0 及以上版本
- 任何支援 React 的現代瀏覽器
授權條款
請參閱專案中的 LICENSE 檔案。