Skip to content

Conversation

@JS-GitRepo
Copy link
Owner

Fixed bug where link hover animations reset everytime the background hue reversed. Previously, it used onRest to reset, with spring parameters AND duration. Read docs further at react-spring.dev and realized I was using props
/ config parameters in a strange combination

…hue reversed. Previously, it used onRest to reset, with spring parameters AND duration. Read docs further at react-spring.dev and realized I was using props / config parameters in a strange combination
@JS-GitRepo JS-GitRepo merged commit 4add1eb into main Sep 26, 2022
@JS-GitRepo
Copy link
Owner Author

NEW SPRING:

const hueRotation = useSpring({
    loop: { reverse: true },
    delay: 1000,
    reset: true,
    to: {
      filter: "hue-rotate(130deg) saturate(80%) sepia(30%)",
    },
    from: {
      filter: "hue-rotate(0deg) saturate(100%) sepia(0%)",
    },
    cancel: bgAnimOff,
    config: { duration: hueDuration },
  });

OLD SPRING:

  const hueRotation = useSpring({
    to: {
      filter: "hue-rotate(130deg) saturate(80%) sepia(30%)",
    },
    from: {
      filter: "hue-rotate(0deg) saturate(100%) sepia(0%)",
    },
    reset: false,
    cancel: bgAnimOff,
    reverse: hueFlip,
    delay: 1000,
    config: { duration: hueDuration, tension: 280, friction: 60 },
    onRest: () => setHueFlip(!hueFlip),
  });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants