From 7f91dd7592179aadbc2b6a1bf88a330c4be90cf2 Mon Sep 17 00:00:00 2001 From: fgrreloaded Date: Tue, 25 Mar 2025 21:34:30 +0530 Subject: [PATCH] Implement scrolling testimonials component with improved layout and animation --- .../app/(home)/_components/Testimonials.tsx | 102 ++++++++++++------ apps/web/src/app/(home)/page.tsx | 5 +- 2 files changed, 71 insertions(+), 36 deletions(-) diff --git a/apps/web/src/app/(home)/_components/Testimonials.tsx b/apps/web/src/app/(home)/_components/Testimonials.tsx index 9435c16..6c38bad 100644 --- a/apps/web/src/app/(home)/_components/Testimonials.tsx +++ b/apps/web/src/app/(home)/_components/Testimonials.tsx @@ -1,3 +1,5 @@ +import { useRef } from "react"; + const testimonials = [ { name: "$ user@dev.sh", @@ -26,12 +28,20 @@ const testimonials = [ ]; const Testimonials = () => { + const scrollContainerRef = useRef(null); + + const duplicatedTestimonials = [ + ...testimonials, + ...testimonials, + ...testimonials, + ]; + return ( -
+
-
-
+
+

$ cat testimonials.log @@ -42,41 +52,53 @@ const Testimonials = () => {

-
- {testimonials.map((testimonial) => ( -
-
-
-
- {testimonial.avatar} +
+
+
+ {duplicatedTestimonials.map((testimonial) => ( +
+
+
+
+ {testimonial.avatar} +
+
+
+

+ {testimonial.name} +

+

+ + {testimonial.role} + + @ + + {testimonial.company} + +

-
-

- {testimonial.name} -

-

- - {testimonial.role} - - @ - - {testimonial.company} - -

-
+

+ {testimonial.content} +

-

- {testimonial.content} -

-
- ))} + ))} +
+ +
-
+
$ @@ -85,6 +107,20 @@ const Testimonials = () => {
+ +
); }; diff --git a/apps/web/src/app/(home)/page.tsx b/apps/web/src/app/(home)/page.tsx index 66a7972..87531dd 100644 --- a/apps/web/src/app/(home)/page.tsx +++ b/apps/web/src/app/(home)/page.tsx @@ -5,8 +5,7 @@ import CodeContainer from "./_components/CodeContainer"; import CustomizableSection from "./_components/CustomizableSection"; import NpmPackage from "./_components/NpmPackage"; import TechShowcase from "./_components/TechShowcase"; -// import TerminalDisplay from "./_components/Terminal"; -// import Testimonials from "./_components/Testimonials"; +import Testimonials from "./_components/Testimonials"; export default function HomePage() { return ( @@ -126,7 +125,7 @@ export default function HomePage() { - {/* */} + ); }