• capitainenemo 6 hours ago

    https://news.ycombinator.com/item?id=45736461 duplicate from 9 days ago, 41 comments

    • Y-bar 3 hours ago

      What I also would _love_ is a function based on velocity, or speed per logical pixel. So that a transition that happens over say 200px does not take the same time as the same transition happening over 450px.

          --myidea-tranistion-timing: 1px/5ms;
      
      The above would take one second (200pixels at 5ms per pixel) to transition a 200px distance, and would take 2.25 seconds to transition 450px because the velocity would be the same.
      • semolino 2 hours ago

        That would be awesome — I have found myself wishing for a similar CSS-only solution. In the meantime, I've resorted to measuring the translation distance in JS, and multiplying that by the average duration I want the element to spend in each pixel position (usually a few milliseconds).

      • bhollis 3 hours ago

        This is one of those "easy" things that should really be built into the CSS standard (as Josh points out in the article).

        • Sharlin 6 hours ago

          "piecewise" would probably have been a better name than "linear".