Share Posted November 29, 2022 Hey there This is one part demo and one part question. I've been lurking in the forum for some weeks to get help and hopefully this can help somebody else (and someone may even make this better, probably). I've been looking for a possibility to change my logo in the navbar depending on the color of the section it's on (because I have a transparent navbar). I didn't find a suitable solution so I created one on my own. If this is helpful to anyone with a similar problem, have fun! You could even go further and check for the lightness in a hsl value to cover all colors (or the w and b in hwb). However, here's my question. I have absolutely no idea if this is a performant or nice way to do it (I'm fairly new to JS and very new to GSAP). So if any of you pros out there see an immediate stupidity in my code, feel free to correct me 😄. See the Pen NWzBLGQ by tisign (@tisign) on CodePen 1 Link to comment Share on other sites More sharing options...
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
Already have an account? Sign in here.Sign In Now