Comments (14)
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.
@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.
@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.
@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.
I was wondering the same, really liked your job here, @gijsroge, wanted to use it with React but without jQuery.
from tilt.js.
@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.
@marcobiedermann Its your lucky day cause @micku7zu has already wrote a vanilla js version -> https://github.com/micku7zu/vanillaTilt.js
from tilt.js.
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.
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.
Loved the work, @micku7zu!
I think it would be great if you included it on the README, @gijsroge.
Great job, guys! π
from tilt.js.
@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.
Also, you could still use jquery to write tests, if you like.
from tilt.js.
@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.
@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)
- why paralax effect not work HOT 1
- Scrolling fast problem HOT 2
- Add effect to element from mouse over page HOT 4
- Lag in chrome based browsers for duration of the value of the speed option HOT 4
- transform: translateZ(20px) only activates when hover HOT 3
- Outzooming cause issue
- Targeting consecutive nested elements for parallax effect HOT 1
- Disable on Mobile HOT 1
- Uncaught TypeError: Cannot read property 'x' of undefined HOT 20
- Does tilt work with images HOT 1
- Mouse events wrong on documentation
- Accessibility concerns?
- Glare on images/svgs?
- test
- SVG Inner Elements
- transform: translateZ(20px); is apply before hover HOT 2
- What does maxTilt option do?
- Add just a little tilt
- Tilt effect isn't working on mobile HOT 1
- I donβt see a tilt on mobile
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tilt.js.