CalendarPickerJS icon indicating copy to clipboard operation
CalendarPickerJS copied to clipboard

Restored animations

Open jarmo opened this issue 3 years ago • 4 comments

Restore previously removed animations when changing months

jarmo avatar Mar 27 '22 11:03 jarmo

Things to consider:

  • Should animations be toggle-able?
  • What about users that prefer reduced motion

MathiasWP avatar Jun 20 '22 11:06 MathiasWP

I actually commented here under the commit, which removed animations: https://github.com/MathiasWP/CalendarPickerJS/commit/5d078439583f9e1a579661cb463dbdeeed731332#comments

Did you get some user feedback and that's why you removed these in the first place?

jarmo avatar Jun 20 '22 12:06 jarmo

I'd say that animations make things look better and a lot is animated in websphere. Just by adding configurability to this library doesn't change anything in global space.

However, when animations need to be disabled then it is easy to do it via the following CSS:

#calendar-grid.swoosh-up,
#calendar-grid.swoosh-up-reverse,
#calendar-grid.swoosh-down,
#calendar-grid.swoosh-down-reverse {
    animation: none !important;
}

No need to add any extra complexity to this library's codebase to turn animations off.

jarmo avatar Jun 20 '22 12:06 jarmo

@MathiasWP Just found out about this CSS feature called prefers-reduced-motion: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion

Implemented your requested change - user can now toggle animation via global system setting. I also tested it in Firefox as is mentioned in the documentation above.

jarmo avatar Jun 21 '22 13:06 jarmo