Creating a custom hook for dual animation state