-
Notifications
You must be signed in to change notification settings - Fork 497
Expand file tree
/
Copy pathGsapText.jsx
More file actions
60 lines (53 loc) · 1.47 KB
/
GsapText.jsx
File metadata and controls
60 lines (53 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { useGSAP } from "@gsap/react";
import gsap from "gsap";
const GsapText = () => {
// TODO: Implement gsap text animation
useGSAP(() => {
gsap.to("#text", {
opacity: 1,
y: 0,
})
gsap.fromTo(".para", {
opacity:0,
y: 60,
}, {
opacity: 1,
y: 0,
delay: 0.5,
stagger: 0.4,
})
}, [])
return (
<main>
<h1 id="text" className="opacity-0 translate-y-10">
GsapText
</h1>
<p className="mt-5 text-gray-500 para">
We can use same method like <code>gsap.to()</code>,{" "}
<code>gsap.from()</code>, <code>gsap.fromTo()</code> and{" "}
<code>gsap.timeline()</code> to animate text.
</p>
<p className="mt-5 text-gray-500 para">
Using these methods we can achieve various text animations and effects
like fade in, fade out, slide in, slide out, and many more.
</p>
<p className="mt-5 text-gray-500 para">
For more advanced text animations and effects, you can explore the GSAP
TextPlugin or other third-party libraries that specialize in text
animations.
</p>
<p className="mt-5 text-gray-500 para">
Read more about the{" "}
<a
href="https://greensock.com/docs/v3/Plugins/TextPlugin"
target="_blank"
rel="noreferrer noopener nofollow"
>
TextPlugin
</a>{" "}
plugin.
</p>
</main>
);
};
export default GsapText;