Jump to content
Search Community

GSAP and React - Animated Navigation button and panel

ARNM test
Moderator Tag

Recommended Posts

Hello,

 

I'm just building out a little navigation for myself to see what I can do with my current experience in GSAP and React js.

 

I've got a button with two child span elements, their rotation value animates depending on useState, the click event handler also sets the state for the navigation panel which is initially hidden, then slides out from the right of viewport. It's kind of working how I want it to, except the onMouseLeave function (obviously) fires when the navigation button's state is rotated, so I need to address that. However, I'm starting to think that maybe I'm going about this the wrong way.

 

I was just wondering if someone could check over my code and point out any glaring issues or offer some advice :)

 

Here's a link to my code sandbox

 

https://codesandbox.io/s/nav-hxcoml?file=/src/Nav.js

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...