Skip to content

Commit 82ce02c

Browse files
✨ Add animations to v3 features section
1 parent c4d2c47 commit 82ce02c

File tree

1 file changed

+103
-7
lines changed

1 file changed

+103
-7
lines changed

resources/views/components/home/v3-features.blade.php

Lines changed: 103 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
11
<section class="mx-auto w-full max-w-screen-lg px-5 pt-32">
2-
<div class="isolate grid place-items-center">
2+
<div
3+
x-init="
4+
() => {
5+
if (reducedMotion) return
6+
const timeline = gsap
7+
.timeline({
8+
paused: true,
9+
})
10+
.fromTo(
11+
$el,
12+
{
13+
autoAlpha: 0,
14+
y: -20,
15+
},
16+
{
17+
autoAlpha: 1,
18+
y: 0,
19+
duration: 0.7,
20+
ease: 'power2.out',
21+
},
22+
)
23+
motion.inView(
24+
$el,
25+
(element) => {
26+
timeline.play()
27+
},
28+
{
29+
amount: 1,
30+
},
31+
)
32+
}
33+
"
34+
class="isolate grid place-items-center"
35+
>
336
<div class="grid self-center justify-self-center [grid-area:1/-1]">
437
<h2
538
class="self-center justify-self-center font-afacad text-6xl font-bold text-slate-800 [grid-area:1/-1]"
@@ -114,15 +147,78 @@ class="relative -z-50 w-[22rem] self-center justify-self-center [grid-area:1/-1]
114147
/>
115148
</div>
116149
<h3
150+
x-init="
151+
() => {
152+
if (reducedMotion) return
153+
const timeline = gsap
154+
.timeline({
155+
paused: true,
156+
})
157+
.fromTo(
158+
$el,
159+
{
160+
autoAlpha: 0,
161+
y: 20,
162+
},
163+
{
164+
autoAlpha: 1,
165+
y: 0,
166+
duration: 0.7,
167+
ease: 'power2.out',
168+
},
169+
)
170+
motion.inView(
171+
$el,
172+
(element) => {
173+
timeline.play()
174+
},
175+
{
176+
amount: 1,
177+
},
178+
)
179+
}
180+
"
117181
class="mx-auto max-w-3xl pt-3 text-center font-afacad text-2xl leading-normal text-gray-500"
118182
>
119183
Discover the enhancements and features in Filament V3, designed to
120184
elevate your development experience.
121185
</h3>
122186
<div
187+
x-init="
188+
() => {
189+
if (reducedMotion) return
190+
const timeline = gsap
191+
.timeline({
192+
paused: true,
193+
})
194+
.fromTo(
195+
$refAll('slide-in-left'),
196+
{
197+
autoAlpha: 0,
198+
x: -20,
199+
},
200+
{
201+
autoAlpha: 1,
202+
x: 0,
203+
duration: 0.7,
204+
stagger: 0.1,
205+
ease: 'power2.out',
206+
},
207+
)
208+
motion.inView(
209+
$el,
210+
(element) => {
211+
timeline.play()
212+
},
213+
{
214+
amount: 0.25,
215+
},
216+
)
217+
}
218+
"
123219
class="grid grid-cols-[repeat(auto-fill,minmax(20rem,1fr))] items-center gap-5 pt-10 *:flex *:items-center *:gap-5 *:rounded-2xl *:bg-white *:px-5 *:py-7 *:ring-1 *:ring-black/5"
124220
>
125-
<div>
221+
<div x-ref="slide-in-left">
126222
{{-- Icon --}}
127223
<svg
128224
xmlns="http://www.w3.org/2000/svg"
@@ -164,7 +260,7 @@ class="size-12 shrink-0"
164260
</p>
165261
</div>
166262
</div>
167-
<div>
263+
<div x-ref="slide-in-left">
168264
{{-- Icon --}}
169265
<svg
170266
xmlns="http://www.w3.org/2000/svg"
@@ -247,7 +343,7 @@ class="size-12 shrink-0"
247343
</p>
248344
</div>
249345
</div>
250-
<div>
346+
<div x-ref="slide-in-left">
251347
{{-- Icon --}}
252348
<svg
253349
xmlns="http://www.w3.org/2000/svg"
@@ -302,7 +398,7 @@ class="size-12 shrink-0"
302398
</p>
303399
</div>
304400
</div>
305-
<div>
401+
<div x-ref="slide-in-left">
306402
{{-- Icon --}}
307403
<svg
308404
xmlns="http://www.w3.org/2000/svg"
@@ -403,7 +499,7 @@ class="size-12 shrink-0"
403499
</p>
404500
</div>
405501
</div>
406-
<div>
502+
<div x-ref="slide-in-left">
407503
{{-- Icon --}}
408504
<svg
409505
xmlns="http://www.w3.org/2000/svg"
@@ -437,7 +533,7 @@ class="size-12 shrink-0"
437533
</p>
438534
</div>
439535
</div>
440-
<div>
536+
<div x-ref="slide-in-left">
441537
{{-- Icon --}}
442538
<svg
443539
xmlns="http://www.w3.org/2000/svg"

0 commit comments

Comments
 (0)