New text and image styles
Browse files
Remotion-app/src/HelloWorld/ImageStream.jsx
CHANGED
|
@@ -7,12 +7,11 @@ import {
|
|
| 7 |
} from 'remotion';
|
| 8 |
import React from 'react';
|
| 9 |
import {staticFile, useVideoConfig, Img, Easing} from 'remotion';
|
| 10 |
-
import {slide} from '@remotion/transitions/slide';
|
| 11 |
import imageSequences from './Assets/ImageSequences.json';
|
| 12 |
import {TransitionSeries, linearTiming} from '@remotion/transitions';
|
| 13 |
|
| 14 |
export default function ImageStream() {
|
| 15 |
-
const {fps
|
| 16 |
|
| 17 |
const frame = useCurrentFrame();
|
| 18 |
return (
|
|
@@ -37,7 +36,7 @@ export default function ImageStream() {
|
|
| 37 |
frame,
|
| 38 |
[
|
| 39 |
fps * entry.start,
|
| 40 |
-
fps * entry.start +
|
| 41 |
fps * entry.end,
|
| 42 |
],
|
| 43 |
[1, 1.5, 1.3],
|
|
@@ -57,6 +56,7 @@ export default function ImageStream() {
|
|
| 57 |
<Img
|
| 58 |
style={{
|
| 59 |
transform: `scale(${zoom})`,
|
|
|
|
| 60 |
}}
|
| 61 |
src={staticFile(entry.name)}
|
| 62 |
/>
|
|
|
|
| 7 |
} from 'remotion';
|
| 8 |
import React from 'react';
|
| 9 |
import {staticFile, useVideoConfig, Img, Easing} from 'remotion';
|
|
|
|
| 10 |
import imageSequences from './Assets/ImageSequences.json';
|
| 11 |
import {TransitionSeries, linearTiming} from '@remotion/transitions';
|
| 12 |
|
| 13 |
export default function ImageStream() {
|
| 14 |
+
const {fps} = useVideoConfig();
|
| 15 |
|
| 16 |
const frame = useCurrentFrame();
|
| 17 |
return (
|
|
|
|
| 36 |
frame,
|
| 37 |
[
|
| 38 |
fps * entry.start,
|
| 39 |
+
fps * entry.start + durationInFrames / 2,
|
| 40 |
fps * entry.end,
|
| 41 |
],
|
| 42 |
[1, 1.5, 1.3],
|
|
|
|
| 56 |
<Img
|
| 57 |
style={{
|
| 58 |
transform: `scale(${zoom})`,
|
| 59 |
+
// transition: 'all 5s ease',
|
| 60 |
}}
|
| 61 |
src={staticFile(entry.name)}
|
| 62 |
/>
|
Remotion-app/src/HelloWorld/TextStream.jsx
CHANGED
|
@@ -5,23 +5,17 @@ import transcriptData from './Assets/TextSequences.json';
|
|
| 5 |
import {FONT_FAMILY} from './constants';
|
| 6 |
import {TransitionSeries} from '@remotion/transitions';
|
| 7 |
|
| 8 |
-
const codeStyle = (index) => {
|
| 9 |
-
return {
|
| 10 |
-
color: 'white',
|
| 11 |
-
position: 'absolute',
|
| 12 |
-
top: '50%',
|
| 13 |
-
zIndex: 50,
|
| 14 |
-
transform: 'translate(-50%, -50%)',
|
| 15 |
-
left: '50%',
|
| 16 |
-
};
|
| 17 |
-
};
|
| 18 |
-
|
| 19 |
const subtitle = {
|
| 20 |
fontFamily: FONT_FAMILY,
|
| 21 |
-
fontSize:
|
| 22 |
textAlign: 'center',
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
width: '100%',
|
| 26 |
};
|
| 27 |
|
|
@@ -42,11 +36,7 @@ export const TextStream = () => {
|
|
| 42 |
justifyContent: 'center',
|
| 43 |
alignItems: 'center',
|
| 44 |
position: 'relative',
|
| 45 |
-
|
| 46 |
-
fontSize: 120,
|
| 47 |
-
fontFamily: FONT_FAMILY,
|
| 48 |
-
fontWeight: 'bolder',
|
| 49 |
-
WebkitBackfaceVisibility: 'hidden',
|
| 50 |
}}
|
| 51 |
>
|
| 52 |
<TransitionSeries>
|
|
@@ -55,12 +45,10 @@ export const TextStream = () => {
|
|
| 55 |
<TransitionSeries.Sequence
|
| 56 |
style={subtitle}
|
| 57 |
key={index}
|
| 58 |
-
from={entry.start * fps}
|
| 59 |
-
durationInFrames={fps * (entry.end - entry.start)
|
| 60 |
>
|
| 61 |
-
<Letter style={subtitle}
|
| 62 |
-
{entry.text}
|
| 63 |
-
</Letter>
|
| 64 |
</TransitionSeries.Sequence>
|
| 65 |
);
|
| 66 |
})}
|
|
@@ -69,6 +57,6 @@ export const TextStream = () => {
|
|
| 69 |
);
|
| 70 |
};
|
| 71 |
|
| 72 |
-
export function Letter({children,
|
| 73 |
-
return
|
| 74 |
}
|
|
|
|
| 5 |
import {FONT_FAMILY} from './constants';
|
| 6 |
import {TransitionSeries} from '@remotion/transitions';
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
const subtitle = {
|
| 9 |
fontFamily: FONT_FAMILY,
|
| 10 |
+
fontSize: 150,
|
| 11 |
textAlign: 'center',
|
| 12 |
+
textShadow:
|
| 13 |
+
'-5px -5px 0 #00ff, 0 -5px 0 #00ff, 5px -5px 0 #00ff, 5px 0 0 #00ff, 5px 5px 0 #00ff, 0 5px 0 #00ff, -5px 5px 0 #00ff, -5px 0 0 #00ff',
|
| 14 |
+
position: 'fixed',
|
| 15 |
+
fontWeight: 'bolder',
|
| 16 |
+
color: 'white',
|
| 17 |
+
bottom: 200,
|
| 18 |
+
height: 'fit-content',
|
| 19 |
width: '100%',
|
| 20 |
};
|
| 21 |
|
|
|
|
| 36 |
justifyContent: 'center',
|
| 37 |
alignItems: 'center',
|
| 38 |
position: 'relative',
|
| 39 |
+
// backgroundColor: 'red',
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
}}
|
| 41 |
>
|
| 42 |
<TransitionSeries>
|
|
|
|
| 45 |
<TransitionSeries.Sequence
|
| 46 |
style={subtitle}
|
| 47 |
key={index}
|
| 48 |
+
from={(entry.start + 0.2) * fps}
|
| 49 |
+
durationInFrames={fps * (entry.end - entry.start)}
|
| 50 |
>
|
| 51 |
+
<Letter style={subtitle}>{entry.text}</Letter>
|
|
|
|
|
|
|
| 52 |
</TransitionSeries.Sequence>
|
| 53 |
);
|
| 54 |
})}
|
|
|
|
| 57 |
);
|
| 58 |
};
|
| 59 |
|
| 60 |
+
export function Letter({children, style}) {
|
| 61 |
+
return <div style={style}>{children}</div>;
|
| 62 |
}
|