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

Feature Request: add clip-path attribute key #93

Closed
sharanda opened this issue May 1, 2020 · 2 comments
Closed

Feature Request: add clip-path attribute key #93

sharanda opened this issue May 1, 2020 · 2 comments

Comments

@sharanda
Copy link

sharanda commented May 1, 2020

Clip-path attribute would allow to create nice 'crop' and opening effects;

The attribute has wide support across web-browsers: https://caniuse.com/#search=clip-path (might need to add -webkit- prefix for Safari)

Performs well in majority of web-browsers

In most cases clip-path might replace need to animate width/height attributes;

Please consider, cheers.

@alexfoxy
Copy link
Owner

alexfoxy commented May 8, 2020

Hey @sharanda

I've been working on a 2.0 update which allows you to specify a custom css animation. Check out the alpha here: https://github.com/alexfoxy/laxxx/tree/version-2

The code would look something like:

 lax.addElements(".my-element", {
        scrollY: {
          "clip-path": [
            [0, 100],
            [0, 100],
            {
              cssFn: (val) => {
                return `circle(${val}%)`
              }
            }
          ],
        }

@alexfoxy
Copy link
Owner

Hey @sharanda. Lax 2.0 is now available and you should be able to achieve a clip-path effect with the cssFn feature.

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