HNHacker News
TopNewBestAskShowJobs

deniz-a

59 karma · joined November 24, 2020

HTML expert

Show HN is the only good thing about this site

I work for Big Sky Software and Commspace

https://denizaksimsek.com

submissionscomments
deniz-a··on _hyperscript: A jQuery and JavaScript Alternative
Thanks for commenting! I just did a pass over the vanilla JS examples addressing some of these issues.

Wrt. transitions:

> use CSS and a transition listener on the JS side

Now you need to have 3 files open in your editor simply to be able to say "this button fades away in half a second when clicked". The onclick is used to somewhat alleviate this (See "Locality of Behavior" [1]).

Separation of concerns is important, but different applications have different definitions of what constitutes a "concern". If one expects that the hiding animation will be changed by designers, one would likely use CSS as you suggested. The nice thing about `settle` in hyperscript (as opposed to just listening for a transitionend) is that you can switch from a transition to a keyframe animation and it will still work with no changes.

> add a transition end listener on the document

Wouldn't this also detect non-disappearing transitions (say, an element expanding or changing color)?

[1]: https://htmx.org/essays/locality-of-behaviour/

← PreviousPage 2 of 2