Skip to content

Commit

Permalink
update: follower div
Browse files Browse the repository at this point in the history
  • Loading branch information
adnan-td committed Nov 23, 2023
1 parent 201738a commit c42e7ce
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-mouse-follower",
"version": "2.0.1",
"version": "2.0.3",
"description": "React mouse follower is a package based on react and framer motion. It provides components to add and customise cool mouse follower to your cursor",
"repository": {
"type": "git",
Expand Down
43 changes: 25 additions & 18 deletions src/component/follower_div.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,28 +71,35 @@ export function FollowerDiv({ pos, options }: { pos: MousePosition; options: Mou
}}
>
{options.text && !options.backgroundElement ? (
<AnimatePresence mode="wait">
<motion.p
animate={{ opacity: 1 }}
exit={{ opacity: 0.3 }}
transition={{ type: 'tween', duration: options.followSpeed ? 0.3 / options.followSpeed : 0.3, ease: 'circOut' }}
style={{
width: '85%',
textAlign: 'center',
lineHeight: options.textLineHeight,
letterSpacing: options.textLetterSpacing,
fontFamily: options.textFontFamily,
fontSize: options.textFontSize ? options.textFontSize : '12px',
color: options.textColor ? options.textColor : 'white',
}}
>
{options.text}
</motion.p>
</AnimatePresence>
<motion.p
initial={{ opacity: 0.7 }}
animate={{ opacity: 1 }}
transition={{ type: 'tween', duration: options.followSpeed ? 0.3 / options.followSpeed : 0.3, ease: 'circOut' }}
style={{
width: '85%',
textAlign: 'center',
lineHeight: options.textLineHeight,
letterSpacing: options.textLetterSpacing,
fontFamily: options.textFontFamily,
fontSize: options.textFontSize ? options.textFontSize : '12px',
color: options.textColor ? options.textColor : 'white',
}}
>
{options.text}
</motion.p>
) : null}
<AnimatePresence mode="wait">
{options.backgroundElement ? (
<motion.div
style={{
width: '100%',
height: '100%',
borderRadius: '9999px',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
overflow: 'hidden',
}}
animate={{ opacity: 1 }}
exit={{ opacity: 0.3 }}
transition={{ type: 'tween', duration: options.followSpeed ? 0.3 / options.followSpeed : 0.3, ease: 'circOut' }}
Expand Down

0 comments on commit c42e7ce

Please sign in to comment.