cwadrupldijjit / ng2-parallax

A parallax plugin/directive for Angular 2. Learn more at:
http://cwadrupldijjit.com/ng2-parallax
MIT License
29 stars 18 forks source link

Looks aweful when applied to multiple elements created with *ngFor #14

Open Kamilius opened 6 years ago

Kamilius commented 6 years ago

It looks like directive applies background-position regardless element is in viewport, or not. This gives us an inconsistent look, and effect of multiple frames, stacked on each other (if background-repeat is default), or simply a white space (if background-repeat: no-repeat).

Is it possible to specify, that parallax should be applied taking element's offset from top into account? To not apply monstrous background-position of +200% etc?

cwadrupldijjit commented 5 years ago

I suppose this is possible, but I haven't really looked into doing auto-detection. The idea for this directive (at least, for the first iteration) was to keep it simple, and you do the rest. There are some complexities that I'd have to deal with and some opinions that I'd have to enforce on how you want the parallax effect to behave, and I'd suspect that wouldn't be quite as preferred for some.

But I'd be interested in your use-case. Do you have an example you could show me? That is, of course, if you're still interested. I know that I haven't been a great maintainer, and that is something that I want to be better about.

I will also be moving this issue to the new repo, because a similar concern may arise with the updates to Angular. To take a look at the current package, go here: cwdj-parallax