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

Disable easing in and out #963

Open
kaligrafy opened this issue Sep 23, 2024 · 3 comments
Open

Disable easing in and out #963

kaligrafy opened this issue Sep 23, 2024 · 3 comments

Comments

@kaligrafy
Copy link

kaligrafy commented Sep 23, 2024

I search in all the documentation and I don't see how to completely disable easing in and out. Here are my settings:

const loopLength = 1000;
const animationSpeed = 100;
const [currentTime, setCurrentTime] = useState<number>(0);

useEffect(() => {
        const animation = animate({
            from: 0,
            to: loopLength,
            duration: loopLength,
            repeat: Infinity,
            onUpdate: setCurrentTime,
        });
        return () => animation.stop();
}, [loopLength, animationSpeed]);

How can I just get an animated arrow path, with a constant speed and no acceleration and deceleration between each loop?

Here is the current result, which includes an unwanted acceleration and deceleration:
https://github.com/user-attachments/assets/31365ef9-19f1-4365-b647-f6fa85794d05

Thanks!

@stokesman
Copy link
Contributor

@kaligrafy
Copy link
Author

Works perfectly, thanks! I thought linear was just easing too, but in a linear fashion. Maybe replace this value by "none" or "no" would be more appropriate?

@karlbot
Copy link

karlbot commented Sep 28, 2024

Works perfectly, thanks! I thought linear was just easing too, but in a linear fashion. Maybe replace this value by "none" or "no" would be more appropriate?

maybe confusing, but "linear" is the way that kind of interpolation is typically described

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

No branches or pull requests

3 participants