Skip to content

Commit

Permalink
fix: gave the hypertext animation to start when in View (#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsarghyadas authored Dec 19, 2024
1 parent b084791 commit 6f9781c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions registry/default/magicui/hyper-text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default function HyperText({
observer.disconnect();
}
},
{ threshold: 0.1 },
{ threshold: 0.1, rootMargin: "-30% 0px -30% 0px" },
);

if (elementRef.current) {
Expand Down Expand Up @@ -123,7 +123,7 @@ export default function HyperText({
onMouseEnter={handleAnimationTrigger}
{...props}
>
<AnimatePresence mode="wait">
<AnimatePresence>
{displayText.map((letter, index) => (
<motion.span
key={index}
Expand Down

0 comments on commit 6f9781c

Please sign in to comment.