LyricFragmentAssembly
文字のかけらが集まり、歌詞の形に整います。
import { AbsoluteFill, useVideoConfig } from 'remotion'
import { secondsToFrameRange } from 'framoo/core'
import { LyricsLayout, LyricFragmentAssembly } from 'framoo/lyrics'
export const LyricFragmentAssemblyPreview = () => {
const { fps } = useVideoConfig()
const lyricTiming = secondsToFrameRange(0.5, 5, fps)
const framesForSeconds = (seconds: number) =>
secondsToFrameRange(0, seconds, fps).durationInFrames
return (
<AbsoluteFill style={{ backgroundColor: '#17191f' }}>
{/* 背景画像など */}
<LyricsLayout>
<LyricFragmentAssembly
{...lyricTiming}
position={{ x: 0.5, y: 0.76 }}
anchor="center"
size="base"
motion={{
fragmentCount: 5,
settleDurationInFrames: framesForSeconds(22 / 30),
staggerInFrames: framesForSeconds(1 / 30),
spreadEm: 0.4,
seed: 11,
easing: 'ease-out',
}}
>
散らばった夢のかけらを
</LyricFragmentAssembly>
</LyricsLayout>
</AbsoluteFill>
)
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
children |
string |
— | 表示する歌詞。 |
from |
number |
0 |
表示を始めるフレーム。 |
durationInFrames |
number |
未指定(コンポジション終端まで) | タイムライン上で表示する長さ。フレーム単位。 |
name |
string |
LyricFragmentAssembly position |
Remotion Studioのタイムラインに表示するラベル。 |
position |
LyricPosition |
— | 配置位置。{ x, y }の各値は0から1の割合。 |
anchor |
LyricAnchor |
center |
positionに合わせる歌詞側の基準点。 |
safeArea |
LyricSafeAreaMode |
respect |
respectはセーフエリア基準、ignoreは画面全体基準。 |
size |
LyricTypographySize |
base |
文字サイズ。xs、sm、md、base、xl、2xl、4xl。 |
orientation |
LyricTextOrientation |
horizontal |
文字方向。horizontalまたはvertical。 |
rotationDegrees |
number |
0 |
歌詞全体の回転角度。角度を度単位で指定。 |
autoWrap |
boolean |
false |
自動折り返しを有効にする。明示的な改行は常に維持。 |
motion |
LyricFragmentAssemblyMotion |
{} |
このパターン固有のアニメーション設定。下表を参照。 |
motion の設定
| Prop | Type | Default | Description |
|---|---|---|---|
fragmentCount |
number |
5 |
各文字を組み立てる横方向の断片数。 |
settleDurationInFrames |
number |
20 |
各文字の断片が揃うまでの長さ。 |
staggerInFrames |
number |
1 |
隣り合う文字の開始間隔。 |
delayInFrames |
number |
0 |
最初の文字が始まるまでの待ち時間。 |
spreadEm |
number |
0.35 |
断片の初期位置が完成形から離れる最大距離。em単位。 |
seed |
number |
0 |
断片の初期位置を決める固定値。 |
easing |
linear | ease-in | ease-out | ease-in-out |
ease-out |
断片が揃う速度。 |