Mbonea commited on
Commit
6a02642
1 Parent(s): ec7eef8
Remotion-app/src/HelloWorld/TextStream.jsx CHANGED
@@ -4,6 +4,8 @@ import * as Fonts from '@remotion/google-fonts';
4
  import transcriptData from './Assets/TextSequences.json';
5
  import Constants from './Assets/Constants.json';
6
  import {TransitionSeries} from '@remotion/transitions';
 
 
7
  const defaultText = {
8
  fontFamily: 'Luckiest Guy',
9
  fontSize: 120,
@@ -53,7 +55,7 @@ export const TextStream = () => {
53
  from={(entry.start + delta) * fps}
54
  durationInFrames={fps * (entry.end - entry.start + delta)}
55
  >
56
- <Letter style={subtitle}>{entry.text}</Letter>
57
  </TransitionSeries.Sequence>
58
  );
59
  })}
@@ -62,6 +64,21 @@ export const TextStream = () => {
62
  );
63
  };
64
 
65
- export function Letter({children, style}) {
66
- return <div style={style}>{children}</div>;
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  }
 
 
 
4
  import transcriptData from './Assets/TextSequences.json';
5
  import Constants from './Assets/Constants.json';
6
  import {TransitionSeries} from '@remotion/transitions';
7
+ import {GsapAnimation} from './Components/GsapAnimation';
8
+ import gsap from 'gsap';
9
  const defaultText = {
10
  fontFamily: 'Luckiest Guy',
11
  fontSize: 120,
 
55
  from={(entry.start + delta) * fps}
56
  durationInFrames={fps * (entry.end - entry.start + delta)}
57
  >
58
+ <Letter duration={(entry.end - entry.start + delta)} style={subtitle}>{entry.text}</Letter>
59
  </TransitionSeries.Sequence>
60
  );
61
  })}
 
64
  );
65
  };
66
 
67
+ export function Letter({children, style,duration}) {
68
+
69
+ const Textimeline =()=>{
70
+ let timeline=gsap.timeline()
71
+ timeline.fromTo('#letter',{yPercent:100},{yPercent:0,duration:duration/2, ease:"power2.inOut"})
72
+ return timeline
73
+ }
74
+
75
+ return <GsapAnimation Timeline={Textimeline} className='h-fit' style={style}>
76
+
77
+
78
+ <div id="letter">
79
+ {children}
80
+ </div>
81
+ </GsapAnimation>;
82
  }
83
+
84
+