shoelace-style / animations

Your favorite animate.css effects available as ES modules for use with the Web Animations API.
MIT License
34 stars 4 forks source link

`transition-timing-function` should be `easing` #3

Closed rectalogic closed 4 months ago

rectalogic commented 4 months ago

CSS transition-timing-function is renamed easing in Web Animations API.

Note: There are a number of small differences between the terminology used in CSS Animations and the terminology used in Web Animations. For instance, Web Animations doesn't use the string "infinite", but instead uses the JavaScript keyword Infinity. And instead of timing-function we use easing. https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Using_the_Web_Animations_API

This does not appear to be renamed in the generated js, e.g. see bounce.js:

  {
    offset: 0.8,
    'transition-timing-function': 'cubic-bezier(0.215, 0.61, 0.355, 1)',
    transform: 'translate3d(0, 0, 0) scaleY(0.95)'
  },

https://cdn.jsdelivr.net/npm/@shoelace-style/animations@1.1.0/dist/attention_seekers/bounce.js

Ahh, it looks like the code is wrong, it's renaming animation-timing-function to easing, but not transition-timing-function: https://github.com/shoelace-style/animations/blob/f06ff2b5a2acd311351c594b483e38475f952c4e/src/animations.cjs#L35

rectalogic commented 4 months ago

Actually I think the bug is in animate.css https://github.com/animate-css/animate.css/issues/1797