Coder Social home page Coder Social logo

jQuery dependency about tilt.js HOT 14 CLOSED

gijsroge avatar gijsroge commented on May 18, 2024 8
jQuery dependency

from tilt.js.

Comments (14)

micku7zu avatar micku7zu commented on May 18, 2024 6

Hi Guys, I hope @gijsroge won't be upset. I initially wanted to make a fork and improve the actual jQuery code (mostly to cache things) and then make a pull request, but then I saw that many of you wanted a vanilla version, without any dependencies so I started a new project which is a shameless copy of @gijsroge work but without jQuery.

Here you can find the vanilla version: https://micku7zu.github.io/vanillaTilt.js/index.html

@gijsroge I don't need any credits about the vanilla version, if you want to include it in your project and maintain it, I will be happy to delete my own project and help / write code on your project, just contact me πŸ˜„

from tilt.js.

joshwcomeau avatar joshwcomeau commented on May 18, 2024 6

@gijsroge I think you might be surprised at how far vanilla JS has come :) comparing the two versions, the jQuery one is not any more maintainable.

For comparison: Tilt.js and vanillaTilt.js

(full code is available here: https://github.com/micku7zu/vanillaTilt.js)

If you're comfortable in jQuery, it's totally understandable that you wouldn't feel the need to change the codebase. That said, I think it behooves you to take another look at ditching jQuery, in this and your work in general; IMO it's becoming a pointless abstraction as browser compatibility and browser APIs improve, and you don't want to be bundling a big library if you don't have to.

from tilt.js.

gijsroge avatar gijsroge commented on May 18, 2024 4

@micku7zu Thanks for the amazing effort! Looks really solid.

I'm not fond of including this in my library as it would only increase the time to maintain/write tests etc.
I do think you should start your own repo, and i'll happily link that one in my readme :)

Also if you start your own repo, leave a reply here for future visitors that are looking for a vanilla version :)

Thanks again!

from tilt.js.

garygreen avatar garygreen commented on May 18, 2024 4

@gijsroge shame you won't accept a PR to remove jquery as a dependency. jQuery is increasingly becoming more obsolete with libraries like vue.js, react, etc and browser's becoming more and more similar without their nuances, it's almost pointless including it - in fact, my website doesn't use jquery at all and so tilt.js just isn't worth it, if I have to include jQuery as well.

There's really only a win win for removing jQuery as dependency imo, but of course it's your call. πŸ˜„

from tilt.js.

lucasbento avatar lucasbento commented on May 18, 2024 3

I was wondering the same, really liked your job here, @gijsroge, wanted to use it with React but without jQuery.

from tilt.js.

micku7zu avatar micku7zu commented on May 18, 2024 1

@gijsroge Thanks. I appreciate what kind of person you are πŸ‘ Keep up the good work man!

Ok, so now that we know the directions of both projects, I will have to do some more work on my own repository, because it was all just a messy copy & paste.

I will credit you and your project everywhere I can in my repository, because people should know that a jQuery version is present and it was the original idea of the effect πŸ˜„

I will contact you after the repository will be polished and if you want, you can include somewhere in the Readme.

I will try to keep the API/options/features very similar with yours :)

Good job again,
Have a nice day all!

from tilt.js.

gijsroge avatar gijsroge commented on May 18, 2024 1

@marcobiedermann Its your lucky day cause @micku7zu has already wrote a vanilla js version -> https://github.com/micku7zu/vanillaTilt.js

from tilt.js.

gijsroge avatar gijsroge commented on May 18, 2024

I'm not sure, I wouldn't count on it. I'll update this issue if I change my mind.

Oh and thanks for the compliment! πŸ˜„

from tilt.js.

larrybotha avatar larrybotha commented on May 18, 2024

There's nothing major in here that couldn't be nicely abstracted using vanilla JS to eliminate the jQuery dep :)

Pretty much need the following, and jQuery can be eliminated:

  • helper for applying css props
  • helper for checking for data attributes
  • helper for getting event co-ordinates
  • a few custom events to trigger

Would love to get on this, but can't dedicate any time at the moment :/

Would also be beneficial to convert this to a UMD module.

Anyways, great job, awesome effect :)

from tilt.js.

lucasbento avatar lucasbento commented on May 18, 2024

Loved the work, @micku7zu!

I think it would be great if you included it on the README, @gijsroge.

Great job, guys! πŸ˜„

from tilt.js.

gijsroge avatar gijsroge commented on May 18, 2024

@joshwcomeau Yes I know, i did some work in vanilla JS, but I felt like doing something with jQuery as people are more familliar with it. But i agree this could easily be done in vanilla JS. But I don't want to change the whole codebase in this repo after 2 days :)

from tilt.js.

garygreen avatar garygreen commented on May 18, 2024

Also, you could still use jquery to write tests, if you like.

from tilt.js.

marcobiedermann avatar marcobiedermann commented on May 18, 2024

@gijsroge
Any updates on this one?
I would also like to use tile.js without jQuery.
Translating your code to vanilla JS should not be too hard with modern JavaScript.
I suggest adding a jQuery wrapper in a separate file so still support both options.
If you like, I can help you out and provide a PR.

from tilt.js.

marcobiedermann avatar marcobiedermann commented on May 18, 2024

@gijsroge
I've already seen this comment (#1 (comment)). But I don't think it makes any sense to create a separate repo for this.
Makes maintaining and implementing features / bugfixes way harder and will always be out of sync.
My question was if you / your project is interested in moving over to a vanilla approach :)

from tilt.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.