easing..
Browse files
Remotion-app/src/HelloWorld/ImageStream.jsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
import {Series, interpolate, spring, useCurrentFrame} from 'remotion';
|
| 2 |
import React from 'react';
|
| 3 |
-
import {staticFile, useVideoConfig, Img} from 'remotion';
|
| 4 |
import {slide} from '@remotion/transitions/slide';
|
| 5 |
import imageSequences from './Assets/ImageSequences.json';
|
| 6 |
import {TransitionSeries, linearTiming} from '@remotion/transitions';
|
| 7 |
|
| 8 |
export default function ImageStream() {
|
| 9 |
-
const {
|
| 10 |
|
| 11 |
const frame = useCurrentFrame();
|
| 12 |
return (
|
|
@@ -24,13 +24,21 @@ export default function ImageStream() {
|
|
| 24 |
}}
|
| 25 |
>
|
| 26 |
{imageSequences.map((entry, index) => {
|
| 27 |
-
|
| 28 |
|
| 29 |
const zoom = interpolate(
|
| 30 |
frame,
|
| 31 |
-
[
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
);
|
| 35 |
|
| 36 |
return (
|
|
|
|
| 1 |
import {Series, interpolate, spring, useCurrentFrame} from 'remotion';
|
| 2 |
import React from 'react';
|
| 3 |
+
import {staticFile, useVideoConfig, Img, Easing} from 'remotion';
|
| 4 |
import {slide} from '@remotion/transitions/slide';
|
| 5 |
import imageSequences from './Assets/ImageSequences.json';
|
| 6 |
import {TransitionSeries, linearTiming} from '@remotion/transitions';
|
| 7 |
|
| 8 |
export default function ImageStream() {
|
| 9 |
+
const {fps} = useVideoConfig();
|
| 10 |
|
| 11 |
const frame = useCurrentFrame();
|
| 12 |
return (
|
|
|
|
| 24 |
}}
|
| 25 |
>
|
| 26 |
{imageSequences.map((entry, index) => {
|
| 27 |
+
const durationInFrames = (entry.end - entry.start) * fps;
|
| 28 |
|
| 29 |
const zoom = interpolate(
|
| 30 |
frame,
|
| 31 |
+
[
|
| 32 |
+
fps * entry.start,
|
| 33 |
+
fps * entry.start + 2 * (durationInFrames / 4),
|
| 34 |
+
fps * entry.end,
|
| 35 |
+
],
|
| 36 |
+
[1, 1.2, 1],
|
| 37 |
+
{
|
| 38 |
+
easing: Easing.bezier(0.8, 0.22, 0.96, 0.65),
|
| 39 |
+
extrapolateLeft: 'clamp',
|
| 40 |
+
extrapolateRight: 'clamp',
|
| 41 |
+
}
|
| 42 |
);
|
| 43 |
|
| 44 |
return (
|