Join the discussion

Write your take first — we'll ask for email only when you're ready to publish.

  • Hacker News
  • CSS is so stupid, this stuff was so easy with Flash. Just look at this mess.
  • once u mess with it enough u will realize that u need physics math that relies on a function that uses the previous state to interpolate between different states. u can use great libraries such as https://motion.dev/ for this
  • Why do we need, essentially checkboxes, to have a whole simulation? How many people would even notice the switches have a transition at all?

    I was fascinated with building websites ~25 years ago, but looking back, we were doing just printing press on screens -- e.g. the obsession with text-align:justify, and some people not satisfied with that, made punctuation marks stick out. All that "rubber" <div>s insanity... and now this: every little flip switch needs a whole animation process. Who will care if they have no transitions whatsoever?

  • There are people like him. And then there are people like me, looking for the option in my window manager not to draw the content when a window is moved.
  • Counterpoint:

    A smoothly animated switch is calming to our vegetative nervous system resulting in reduced systemic bodily inflammation, thereby facilitating healing from almost any health condition imaginable.

    Bit like a wholesome, warm asparagus soup before bed.

  • I really wanted to change the easing curves. They are interactive, but not modifiable. If you're reading this @joshwcomeau - i would play with the curves if you made them modifiable lol
  • There is a modifiable curve after many fixed-shape examples. It's not easy to come up with something that feels realistic though!
  • a revisit of the <blink> tag :-P

    The article is nice. The website is very nicely done. It's interesting in a 'because you can' sort of way.

    But I shudder when I imagine a web where all page elements move with bouncyness.

    edit: which is not to say you should never use it of course. Even the <blink> had some uses.

  • Nice website. I got the newsletter popup, but it was cute, not annoying like they usually are.
  • I wish CSS had two related things

    - A function similar to linear() that supports control points so we can make multi-point Bezier paths.

    - calc() support as an easing function so you could combine sin(), etc., and do oscillation with damping.

    - A spring() function that remembers the current velocity for when parameters change.

  • I'm not a web guy. Why would you want that in CSS when you have Javascript?
  • Since the goal is to create an illusion of real physics, I wonder when they'll just cut to the chase and start using actual physics engines.

    Reason I mention it is neither this nor bezier curves deal with the target changing mid-animation very well. CSS just starts over from the current position, which breaks the illusion. A physics engine would maintain the illusion, and could be simpler to specify:

        transition: physics(system=gravity, force=10, bounce=on, dampening=3)
        transition: physics(system=spring, force=5, bounce=off, dampening=5)
  • Both paragraphs are addressed in the article.
  • The article mentions spring animations, which is essentially a basic physics simulation. They’re very commonly used in higher level JavaScript animation frameworks, but not supported in native CSS.
  • I've encountered a strange bug (using Chrome for Android). When I have this CSS demo page open and scroll about halfway down, the volume of my background audio (e.g., a Twitch App stream) drops by about 50%. Closing the tab immediately restores the audio to its normal volume. I can reproduce this issue consistently. Does anyone have any idea what might be causing this behavior?

    Edit: it seems it's caused by autoplay of Easing Wizard's video.

  • Btw: the design of the webpage with all the animations and beautifully crafted info-boxes is top-notch.
  • His stuff is so incredibly high quality. Really stands out in an AI slop filled internet
  • Agreed. And wow, try to turn dark/light theme on and off (hint: speakers on).
  • "Marge, I'm pulling an all-nighter for my little girl. Put on a pot of coffee! Drink it, and start making burgers"

    I love articles like this one, that inspire me to want to get coding as if it was the most exciting thing to do in the world.

    I did subscribe to the newsletter, I bookmarked the page, and I am going back right now to see what else there is to learn from the website. Some of it is in the details, if you subscribe, then you get a sound played. For the last two decades or so, playing sounds without asking the user has been strictly forbidden, but here the rules are known and broken, which I like, as it means I can experiment with this myself and stop being so boring.

  • That gives me a quite literal flashback.

    Back in the Macromedia Flash 5 days (25 years ago!), Robert Penner popularized the easing concept. I can't imagine the void we had before that. I clearly remember me starring at the formulas in ActionScript 1.0 (see [1]) without any chance of understanding them - but usage was clear, easy and fun!

    Those formulas basically generated the required tweening numbers mathematical (comparable to the Bezier approach mentioned in the article). That's a much different concept to the linear interpolation described in the linked blog article where you pass in a static list of numbers. The more complex your curve the more numbers you need. That's when the author links to the external tool "Linear() Easing Generator" by Jake Archibald and Adam Argyle. It was a fresh and nice reading even though animations are less a topic for me then it was back with Flash.

    Here an example of an easing function from the linked source file. The tween executing function would pass in time (t) and other parameters I can't name to calculate the resulting value continuously.

      Math.easeInOutBack = function (t, b, c, d, s) {
          if (s == undefined) s = 1.70158; 
          if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
          return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
      };
    
    If you want to dig deeper, visit roberpenner's easing overview [2] with some resources. Surprisingly all of those links are still working.

    [1] https://robertpenner.com/easing/penner_easing_as1.txt [2] https://robertpenner.com/easing/