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

Doesn't work with object already translated #9

Closed
worldoptimizer opened this issue Mar 19, 2019 · 12 comments
Closed

Doesn't work with object already translated #9

worldoptimizer opened this issue Mar 19, 2019 · 12 comments

Comments

@worldoptimizer
Copy link

I think this my just be a overhead on these elements and this library shouldn't care about them… on the other hand having elements already defining translation etc. respected would maybe broaden use cases.

@alexfoxy
Copy link
Owner

Yes this is true. Are you expecting to merge values or combine keys?

@alexfoxy
Copy link
Owner

@MaxZiebell did you have any further thoughts on this?

@alexfoxy alexfoxy reopened this Mar 22, 2019
@worldoptimizer
Copy link
Author

Lax could take the given offsets on init and add them to it's own animation. Not sure if that is viable without bloating.

@alexfoxy
Copy link
Owner

Yea makes sense, it would have to take the original css value e.g. "translateX(12pt) scale(1)" and then mix in its own values somehow. Do you have a specific example?

@worldoptimizer
Copy link
Author

worldoptimizer commented Mar 22, 2019

Yes but one I can't share at this point but it boils down to any element using positions with translation or other CSS values and it would be good practice to respect any preexisting values. Also has the nice side effect that you can do layouts and lax presets would work relative to the initial conditions. Like if you had a text rotated -90degrees … it would start a turn from there and not reset it to the lax setting.

@alexfoxy
Copy link
Owner

It seems a bit weird to be using translate to position stuff, it should be used for animations. I hear your point tho and I've had a look but need to change a bit of implementation to get it to work.

@worldoptimizer
Copy link
Author

In theory your right but the world is a messy place with many CSS hack like this one https://css-tricks.com/centering-percentage-widthheight-elements/ … This is just one example using translation to hack its way to a specific goal.

@alexfoxy
Copy link
Owner

alexfoxy commented Mar 22, 2019 via email

@worldoptimizer
Copy link
Author

worldoptimizer commented Mar 22, 2019

Don't beat yourself up over it. Unless your trying to build an all purpose tool we can live with it. One just needs to remember it when using lax. For my purpose I already worked around it. Consider size and complexly vs simplicity and lightweight of this against each other. Iax is also cool because it's small and fast. When nobody else runs against this it might just be fine the way it is!

@alexfoxy
Copy link
Owner

Of course. Just want the library to feel like it just works.. ;D

@alexfoxy
Copy link
Owner

I think I have worked out a way. Will be in next update.

@alexfoxy
Copy link
Owner

Fixed in 1.2.0 release

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

2 participants