-
Notifications
You must be signed in to change notification settings - Fork 498
Expand file tree
/
Copy pathGsapFrom.jsx
More file actions
53 lines (46 loc) · 1.38 KB
/
GsapFrom.jsx
File metadata and controls
53 lines (46 loc) · 1.38 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
import { useGSAP } from "@gsap/react";
import gsap from "gsap";
const GsapFrom = () => {
// TODO: Implement the gsap.from() method
useGSAP(() => {
gsap.from("#green-box", {
x: 350,
repeat: -1,
yoyo: true,
rotation: 180,
duration: 2,
ease: "power1.inOut",
});
}, []);
return (
<main>
<h1>GsapFrom</h1>
<p className="mt-5 text-gray-500">
The <code>gsap.from()</code> method is used to animate elements from a
new state to their current state.
</p>
<p className="mt-5 text-gray-500">
The <code>gsap.from()</code> method is similar to the{" "}
<code>gsap.to()</code> method, but the difference is that the{" "}
<code>gsap.from()</code> method animates elements from a new state to
their current state, while the <code>gsap.to()</code> method animates
elements from their current state to a new state.
</p>
<p className="mt-5 text-gray-500">
Read more about the{" "}
<a
href="https://greensock.com/docs/v3/GSAP/gsap.from()"
target="_blank"
rel="noreferrer noopener nofollow"
>
gsap.from()
</a>{" "}
method.
</p>
<div className="mt-20">
<div id="green-box" className="w-20 h-20 bg-green-500 rounded-lg" />
</div>
</main>
);
};
export default GsapFrom;