Skip to content

Commit

Permalink
fix: testimonial loading, animation and ui fixes (code100x#479) (code…
Browse files Browse the repository at this point in the history
…100x#480)

Co-authored-by: Vineet Agarwal <[email protected]>
  • Loading branch information
CyberSpyderX and VineeTagarwaL-code authored Oct 9, 2024
1 parent 06258fc commit e233092
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ html {
display: inline-block;
transform: rotate(-2deg);
}

.react-tweet-theme {
height: 100%;
}
Expand Down
8 changes: 7 additions & 1 deletion src/components/Testimonials.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const tweetIds = [
'1826968639049724010',
];

const finalTweetIds = [...tweetIds, ...tweetIds];

export default function Testimonials() {
return (
<div
Expand All @@ -24,7 +26,11 @@ export default function Testimonials() {
Real Success Stories from Job Seekers and Employers
</p>
</div>
<InfiniteMovingCards items={tweetIds} direction="right" speed="slow" />
<InfiniteMovingCards
items={finalTweetIds}
direction="right"
speed="slow"
/>
</div>
);
}
11 changes: 1 addition & 10 deletions src/components/ui/infinite-moving-cards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ export const InfiniteMovingCards = ({
const [start, setStart] = useState(false);
function addAnimation() {
if (containerRef.current && scrollerRef.current) {
const scrollerContent = Array.from(scrollerRef.current.children);

scrollerContent.forEach((item) => {
const duplicatedItem = item.cloneNode(true);
if (scrollerRef.current) {
scrollerRef.current.appendChild(duplicatedItem);
}
});

getDirection();
getSpeed();
setStart(true);
Expand Down Expand Up @@ -84,7 +75,7 @@ export const InfiniteMovingCards = ({
>
{items.map((id, index) => (
<li
className="w-[350px] min-h-fit h-[700px] max-w-full relative rounded-2xl flex-shrink-0 px-8 py-6 md:w-[450px]"
className="w-[350px] min-h-fit max-w-full relative rounded-2xl flex-shrink-0 px-8 py-6 md:w-[450px]"
// style={{
// background:
// 'linear-gradient(180deg, var(--slate-800), var(--slate-900)',
Expand Down

0 comments on commit e233092

Please sign in to comment.