News for hackers. Stuff that matters.
Re:Show HN: Build a JS-only interactive product walk-through... by nkozyra on Wednesday February 19, 2020 @06:28AM (#22364666)
No need to over complicate things by adding an unnecessary library?

I'm sympathetic to jQuery users and I think it's a phenomenal artifact in the history of the early web but unless you need to accommodate IE9 I don't know why you'd want to use it for a widget like this.

Re:Show HN: Build a JS-only interactive product walk-through... by rajangdavis on Wednesday February 19, 2020 @06:39AM (#22364713)
It's using some animation sugar from jQuery (source is in this blogpost: https://app.trevor.io/public/blog/demo).

It might be possible to port most stuff over to ES6 and use CSS animations; however, the code is concise and readable.

Re:Show HN: Build a JS-only interactive product walk-through... by nkozyra on Wednesday February 19, 2020 @06:43AM (#22364737)
I'm not arguing against jQuery in the abstract, but you can write concise readable vanilla js/css with animations.

I've used jQuery recently because I had to target older browsers, but if you don't it's almost always cleaner and lighter weight to use modern J's.

Re:Show HN: Build a JS-only interactive product walk-through... by rajangdavis on Wednesday February 19, 2020 @07:00AM (#22364790)
Honestly, my first thought was to port the code to ES6/CSS3 because I also share the belief that the code can be as concise if not moreso; however, I still think what the author did was a good solution.

I think the tradeoff is if you want to delegate everything (animations and DOM manipulation) to one language using a single library or split things up into two languages with no libraries. I prefer splitting things between JS and CSS, but I'm impressed with how clever, concise, and expressive using jQuery can be.

Re:Show HN: Build a JS-only interactive product walk-through... by tagspace on Wednesday February 19, 2020 @08:00AM (#22365041)
Yeah, true. Maybe we'll try and port this to CSS animations at some point.