@@ -39,17 +39,58 @@ import { FundButton } from '@coinbase/onchainkit/fund';
39
39
import Tweets from ' ../components/landing/Tweets' ;
40
40
import ComponentPreview from ' ../components/landing/ComponentPreview' ;
41
41
import LandingFooter from ' ../components/landing/LandingFooter' ;
42
+ import { animate } from ' motion' ;
43
+ import { useEffect , useRef } from ' react' ;
44
+ import { useScrollAnimation } from ' ../hooks/useScrollAnimation' ;
42
45
43
-
44
- <div className = " max-w-[1225px] mx-auto vp-doc relative px-[24px] mb-[26px] mt-0 md:px-0 md:mb-[64px] pb-24" >
45
- <div className = " mx-auto max-w-2xl" >
46
- <div className = " md:text-center flex flex-col gap-6 pt-[100px] pb-8" >
47
- <h1 className = " text-center text-5xl md:text-7xl font-medium no-underline text-zinc-950 dark:text-zinc-50 tracking-[-0.1rem]" >OnchainKit</h1 >
48
- <div className = " landing-page-hero text-center text-xl md:text-2xl text-zinc-950 dark:text-zinc-50" >
49
- Build onchain apps with ready-to-use React components and Typescript utilities.
46
+ <div
47
+ className = " max-w-[1225px] mx-auto vp-doc relative px-[24px] mb-[26px] mt-0 md:px-0 md:mb-[64px] pb-24"
48
+ ref = { useScrollAnimation ()}
49
+ >
50
+ <div className = " mx-auto max-w-2xl" ref = { useRef ()} >
51
+ <div className = " md:text-center flex flex-col pt-[100px] pb-8" >
52
+ <h1
53
+ className = " text-center text-5xl md:text-7xl font-medium no-underline text-zinc-950 dark:text-zinc-50 tracking-[-0.1rem]"
54
+ ref = { el => {
55
+ if (el ) {
56
+ animate (
57
+ el ,
58
+ { opacity: [0 , 1 ], y: [30 , 0 ] },
59
+ { duration: 0.6 , easing: ' ease-out' }
60
+ )
61
+ }
62
+ }}
63
+ >
64
+ OnchainKit
65
+ </h1 >
66
+ <div
67
+ className = " landing-page-hero text-center text-xl md:text-2xl text-zinc-950 dark:text-zinc-50"
68
+ ref = { el => {
69
+ if (el ) {
70
+ animate (
71
+ el ,
72
+ { opacity: [0 , 1 ], y: [30 , 0 ] },
73
+ { duration: 0.6 , easing: ' ease-out' , delay: 0.2 }
74
+ )
75
+ }
76
+ }}
77
+ >
78
+ Build onchain apps with ready-to-use React components and Typescript utilities.
50
79
</div >
51
80
</div >
52
- <div className = " flex flex-col items-center gap-6 w-full" >
81
+
82
+ <div
83
+ className = " flex flex-col items-center gap-6 w-full"
84
+ ref = { el => {
85
+ if (el ) {
86
+ animate (
87
+ el ,
88
+ { opacity: [0 , 1 ], y: [30 , 0 ] },
89
+ { duration: 0.6 , easing: ' ease-out' , delay: 0.4 }
90
+ )
91
+ }
92
+ }}
93
+ >
53
94
<div id = " home-install" className = " h-full w-10/12" >
54
95
55
96
:::code-group
@@ -71,22 +112,53 @@ bun add @coinbase/onchainkit
71
112
```
72
113
73
114
:::
74
- </div >
75
- <a href = " /getting-started" title = " Get started with OnchainKit" className = " alternate-button mx-auto md:mx-0 flex justify-center items-center bg-indigo-600 hover:bg-indigo-700 text-gray-50 dark:bg-indigo-400 dark:text-gray-950 dark:hover:bg-indigo-300 font-semibold leading-6 px-3 py-2 rounded-lg w-[140px]" >
115
+ </div >
116
+ <a
117
+ href = " /getting-started"
118
+ title = " Get started with OnchainKit"
119
+ className = " alternate-button mx-auto md:mx-0 flex justify-center items-center bg-indigo-600 hover:bg-indigo-700 text-gray-50 dark:bg-indigo-400 dark:text-gray-950 dark:hover:bg-indigo-300 font-semibold leading-6 px-3 py-2 rounded-lg w-[140px]"
120
+ ref = { el => {
121
+ if (el ) {
122
+ animate (
123
+ el ,
124
+ { opacity: [0 , 1 ], y: [30 , 0 ] },
125
+ { duration: 0.6 , easing: ' ease-out' , delay: 0.6 }
126
+ )
127
+
128
+ el .addEventListener (' mousedown' , () => {
129
+ animate (el , { scale: 0.98 }, { duration: 0.1 })
130
+ })
131
+ el .addEventListener (' mouseup' , () => {
132
+ animate (el , { scale: 1 }, { duration: 0.1 })
133
+ })
134
+ }
135
+ }}
136
+ >
76
137
Get started
77
138
</a >
78
139
</div >
79
140
</div >
80
141
</div >
81
142
82
143
<main className = " items-center flex flex-col vp-doc relative" >
83
- <div className = " live-demo-section pt-12" >
144
+ <div
145
+ className = " live-demo-section pt-12"
146
+ ref = { useScrollAnimation ()}
147
+ >
84
148
<ComponentPreview />
85
149
</div >
86
- <div className = " testimonials-section pt-12" >
150
+
151
+ <div
152
+ className = " testimonials-section pt-12"
153
+ ref = { useScrollAnimation ()}
154
+ >
87
155
<Tweets />
88
156
</div >
89
- <div className = " footer-section pt-12" >
157
+
158
+ <div
159
+ className = " footer-section pt-12"
160
+ ref = { useScrollAnimation ()}
161
+ >
90
162
<LandingFooter />
91
163
</div >
92
164
</main >
0 commit comments