added spring
Browse files
Remotion-app/src/HelloWorld/ImageStream.jsx
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
import {Series, interpolate, useCurrentFrame} from 'remotion';
|
2 |
import React from 'react';
|
3 |
import {staticFile, useVideoConfig, Img} from 'remotion';
|
4 |
import {slide} from '@remotion/transitions/slide';
|
@@ -25,8 +25,13 @@ export default function ImageStream() {
|
|
25 |
>
|
26 |
{imageSequences.map((entry, index) => {
|
27 |
const durationInFrames = (entry.end - entry.start) * fps;
|
28 |
-
|
|
|
29 |
frame,
|
|
|
|
|
|
|
|
|
30 |
[
|
31 |
0,
|
32 |
durationInFrames / 4,
|
|
|
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';
|
|
|
25 |
>
|
26 |
{imageSequences.map((entry, index) => {
|
27 |
const durationInFrames = (entry.end - entry.start) * fps;
|
28 |
+
|
29 |
+
const driver = spring({
|
30 |
frame,
|
31 |
+
fps,
|
32 |
+
});
|
33 |
+
const zoom = interpolate(
|
34 |
+
driver,
|
35 |
[
|
36 |
0,
|
37 |
durationInFrames / 4,
|