Skip to content

Commit 1fcfd0d

Browse files
✨ Add animations to stats section
1 parent c739e83 commit 1fcfd0d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

resources/views/components/home/stats.blade.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
<section class="mx-auto w-full max-w-screen-lg px-10 pt-14 lg:px-5">
22
<div
3+
x-init="
4+
() => {
5+
if (reducedMotion) return
6+
const timeline = gsap
7+
.timeline({
8+
paused: true,
9+
})
10+
.fromTo(
11+
$refAll('pop-in'),
12+
{
13+
autoAlpha: 0,
14+
scale: 0.5,
15+
},
16+
{
17+
autoAlpha: 1,
18+
scale: 1,
19+
duration: 0.7,
20+
stagger: 0.1,
21+
ease: 'back.out(1.3)',
22+
},
23+
)
24+
motion.inView($el, (element) => {
25+
timeline.play()
26+
})
27+
}
28+
"
329
class="grid grid-cols-[repeat(auto-fill,minmax(18rem,1fr))] place-items-center gap-7 text-slate-700"
430
>
531
{{-- Discord --}}
632
<div
33+
x-ref="pop-in"
734
class="relative isolate z-0 w-full max-w-sm overflow-hidden rounded-2xl bg-gradient-to-t from-[#E2E2F7] to-[#EBECFF] p-7"
835
>
936
<div class="flex items-center gap-4">
@@ -72,6 +99,7 @@ class="size-3 rotate-45 transition duration-200 ease-in-out will-change-transfor
7299

73100
{{-- GitHub --}}
74101
<div
102+
x-ref="pop-in"
75103
class="relative isolate z-0 w-full max-w-sm overflow-hidden rounded-2xl bg-gradient-to-t from-[#FFEAD1] to-[#FFEFDD] p-7"
76104
>
77105
<div class="flex items-center gap-4">
@@ -161,6 +189,7 @@ class="size-4 transition duration-200 ease-in-out will-change-transform group-ho
161189

162190
{{-- Downloads --}}
163191
<div
192+
x-ref="pop-in"
164193
class="relative isolate z-0 w-full max-w-sm overflow-hidden rounded-2xl bg-gradient-to-t from-[#E5F1ED] to-[#ECF8F4] p-7"
165194
>
166195
<div class="flex items-center gap-4">

0 commit comments

Comments
 (0)