jsor / lity

Lightweight, accessible and responsive lightbox.
https://sorgalla.com/lity/
MIT License
1.15k stars 195 forks source link

Migrate to vanilla js #252

Open wpsumo opened 3 years ago

wpsumo commented 3 years ago

Move from jQuery dependencies to vanilla js: https://wpspeedmatters.com/jquery-performance/

wpsumo commented 3 years ago

@jsor Any plans to migrate to vanilla js? 👍

falko100 commented 3 years ago

@jsor +1 👍

naton commented 2 years ago

So, is anyone doing this? Should we just start? :)

(There is also the great https://youmightnotneedjquery.com/ btw)

wpsumo commented 2 years ago

@naton Don't think so go ahead and do it, I will be the first one to swap :)

naton commented 2 years ago

OK, here's a shot: https://github.com/naton/lity/tree/vanilla_js

~As stated in the README, it's not without bugs so any help squashing them would be awesome.~ I think I solved all of the problems after all.

naton commented 2 years ago

@wpsumo Did you get a chance to try it out yet? I'm confident enough to merge it into my master now, and then do a PR here, if that's of interest.

naton commented 2 years ago

Anyway, I opened up a PR for this. Let me know if it should be based on another branch than master or if there's anything else I should do.

wpsumo commented 2 years ago

@wpsumo Did you get a chance to try it out yet? I'm confident enough to merge it into my master now, and then do a PR here, if that's of interest.

@naton Sorry missed your comment, no I just saw it haven't had a chance to test it out yet. Let me test it next week and get back to you. I will test it within wordpress with data-lity-target on the img tag. I will let you know how it goes within wordpress and defer and delay loading of javascript/s.

<img src="https://cdn.example.com/image.jpg" data-lity-target="https://cdn.example.com/image.jpg" alt="alt text" >

n0ah01 commented 2 years ago

Just tested it with the code below, works perfectly, thanks a lot @naton ! <a href="https://youtube.com/watch?v=HFT7ATLQQx8" data-lity>Test Video</a>

ojvribeiro commented 1 year ago

@naton Since this project doesn't seem to be maintained anymore (last PR merged was Dec 22, 2020), can we all move to your fork?

wpsumo commented 1 year ago

@naton would make sense to do that based on @ojvribeiro comment above. Lets all move to your fork and continue using lity.

I've not tested it yet, sorry about that, it's about time to do it! I'll let you know :D

naton commented 1 year ago

Feel free to! I can't promise anything but since I use it myself I'll fix bugs as I find them.