-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: testimonials section Signed-off-by: sahadat-sk <[email protected]> * remove: markers of GSAP Signed-off-by: sahadat-sk <[email protected]> * fix: backround accroding to color scheme in author description Signed-off-by: sahadat-sk <[email protected]> * fix: scroll trigger when the section starts to show Signed-off-by: sahadat-sk <[email protected]> * fix: reduce the end of scroll trigger Signed-off-by: sahadat-sk <[email protected]> * refactor: background of testimonial section Signed-off-by: sahadat-sk <[email protected]> * add: package.json and package-lock.json Signed-off-by: sahadat-sk <[email protected]> * refactor: testimonials between different sections Signed-off-by: sahadat-sk <[email protected]> * refactor: text color according to keploy color scheme Signed-off-by: sahadat-sk <[email protected]> * fix: linting changes Signed-off-by: sahadat-sk <[email protected]> * refactor: container over company name and position with left to right animation Signed-off-by: sahadat-sk <[email protected]> * refactor: change container background to gradient Signed-off-by: sahadat-sk <[email protected]> --------- Signed-off-by: sahadat-sk <[email protected]>
- Loading branch information
1 parent
7dc29e8
commit e8fb028
Showing
3 changed files
with
114 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
"use client"; | ||
import Image from "next/image"; | ||
import { useRef } from "react"; | ||
import gsap from "gsap"; | ||
import { useGSAP } from "@gsap/react"; | ||
import { ScrollTrigger } from "gsap/all"; | ||
import _ScrollTrigger from "gsap/ScrollTrigger"; | ||
gsap.registerPlugin(useGSAP); | ||
gsap.registerPlugin(ScrollTrigger); | ||
|
||
const Testimonial = ({ | ||
content, | ||
author, | ||
company, | ||
image, | ||
}: { | ||
content: string; | ||
author: string; | ||
company: string; | ||
image: any; | ||
}) => { | ||
const container = useRef(null); | ||
useGSAP( | ||
() => { | ||
gsap.to(".quote-character", { | ||
scrollTrigger: { | ||
trigger: ".quote-container", | ||
scrub: 1, | ||
start: "top+=200 bottom", | ||
end: "bottom+=300 bottom", | ||
}, | ||
opacity: 1, | ||
stagger: 1, | ||
duration: 3, | ||
}); | ||
gsap.to(".gradient-container", { | ||
scrollTrigger: { | ||
trigger: ".gradient-container", | ||
scrub: 1, | ||
start: "bottom+=20 bottom", | ||
end: "bottom+=300 bottom", | ||
}, | ||
width: "100%", | ||
duration: 4, | ||
}); | ||
}, | ||
{ scope: container } | ||
); | ||
|
||
return ( | ||
<div ref={container} className="max-w-6xl px-4 mx-auto my-16"> | ||
<p className="text-lg md:text-2xl quote-container text-secondary-300"> | ||
<span className="quote-character opacity-[0.2]">"</span> | ||
{content.split("").map((character, index) => { | ||
if (character) { | ||
return ( | ||
<span key={index} className="quote-character opacity-[0.2]"> | ||
{character} | ||
</span> | ||
); | ||
} | ||
})} | ||
|
||
<span className="quote-character opacity-[0.2]">"</span> | ||
</p> | ||
<div className="relative flex items-center gap-4 px-4 py-4 mt-8 text-sm rounded-lg md:text-xl "> | ||
<Image src={image} alt="logo" className="w-auto h-4" /> | ||
<p className="font-bold text-accent-200"> | ||
{author} <span className="text-lg md:text-2xl">/</span> {company} | ||
</p> | ||
|
||
<div className="absolute top-0 bottom-0 left-0 w-0 rounded-md bg-gradient-to-r from-primary-200 -z-1 gradient-container"></div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export { Testimonial }; |
This file was deleted.
Oops, something went wrong.