Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't delay animation to white text on listens page if starting at night #107

Open
zhammer opened this issue Jan 21, 2019 · 1 comment
Open
Labels
web client About the web client.

Comments

@zhammer
Copy link
Owner

zhammer commented Jan 21, 2019

Right now there's a 5 second delay in starting the glowing text animation for listens text at night. This is because we're waiting for the full page to transition to night, and once that transition is done we start glowing to white.

If the page loads directly to night, however, the text just stays gray for a while. It should start glowing immediately.

This will probably just involve checking if it's night && if it's the first render? not 100% sure best way to do this

animation: ${isDay ? '' : glowing} 5s linear 5s infinite;

@zhammer
Copy link
Owner Author

zhammer commented Jan 21, 2019

const isFirstRender = useFirstRender();
const animationDelay = useMemo(() => {
  if (isFirstRender && isDay) {
    return 0;
  }
  return 5;
}, [isDay]);

@zhammer zhammer added the web client About the web client. label Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
web client About the web client.
Projects
None yet
Development

No branches or pull requests

1 participant