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

Responsive Design? #113

Open
endrehegyi opened this issue Feb 16, 2023 · 1 comment
Open

Responsive Design? #113

endrehegyi opened this issue Feb 16, 2023 · 1 comment

Comments

@endrehegyi
Copy link

Hi,

Just wondering, how would one handle animations if different animations are needed for mobile and desktop?

If it isn't included it would be nice if the animations could have responsive modifiers, like: md:fade md:left lg:fade-none

Thank you.

@mattaningram
Copy link
Member

There are two ways to do this in AnimXYZ currently.

If you are using the Vue or React packages, you can use the dynamic XYZ attribute. Check out the docs for them here: Vue and React. You would have to setup your own logic to detect viewport size and trigger different XYZ animations for each.

Another approach is to use the AnimXYZ CSS variables that drive every animation. Instead of using the xyz= attribute you can just set the desired XYZ variables (such as --xyz-translate-x: 20%) on the elements you are animating and use standard CSS media queries to modify them for different screen sizes. Check out the docs for variables here and let me know if you have any questions about how to use them!

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