material icon indicating copy to clipboard operation
material copied to clipboard

Add support for light animation mode that will disable heavy animations

Open robertmesserle opened this issue 11 years ago • 27 comments

Some of the animations in the Material design spec are pretty heavy, and may not make sense for all users or all devices. We may want to look into adding a light mode for these scenarios that either replaces heavy animations with lighter versions, or disables them altogether.

robertmesserle avatar Dec 05 '14 21:12 robertmesserle

Possible options: auto, lite, off

ThomasBurleson avatar Feb 05 '15 13:02 ThomasBurleson

This would be a great addition :)

barryvdh avatar Jul 22 '15 11:07 barryvdh

+1

BTW, is there a way to hack it to disable animations?

jbraccini avatar Jul 22 '15 15:07 jbraccini

You could put md-no-ink on a lot of items ;)

barryvdh avatar Jul 22 '15 15:07 barryvdh

@naomiblack You closed this, but added a milestone? Is it still planned? If so, why not keep it open?

barryvdh avatar Aug 15 '15 12:08 barryvdh

Yes, we would love to have this as well. Is it still planned?

Codier avatar Nov 12 '15 22:11 Codier

+1

nitin7dc avatar Feb 01 '16 18:02 nitin7dc

Are there any other ways to disable animations (for slower computers)? What about adding support for disabling heavy effects? Thanks!

nicolae-olariu avatar Mar 01 '16 14:03 nicolae-olariu

+1

stefan-leye avatar Mar 03 '16 09:03 stefan-leye

@nicolae-olariu I'm facing the problem on my app as well. I disable them myself by css:

.md-ripple-container, .md-ripple-placed {
    transition: none;
}
.md-open-menu-container.md-active {
    opacity: 1;
    transition: none;
    transition-duration: 0ms;
    /* transition: all .4s cubic-bezier(.25,.8,.25,1); */
    /* transition-duration: 200ms; */
}

md-dialog.md-transition-in {
    opacity: 1;
    transition: none;
    -webkit-transform: none;
    transform: none;
}

/*Disable transition for fading in menu items dialog.*/
.md-open-menu-container.md-active > md-menu-content > * {
    opacity: 1;
    transition: none;
    transition-duration: 0ms;
    transition-delay: 0ms;
}
.md-button
{
    transition: none;
    transition-duration: 0ms;
    transition-delay: 0ms;
}
md-dialog._md-transition-in {
    transition: none;
    transition-duration: 0ms;
    transition-delay: 0ms;
}

md-input-container label{
    transition: none!important;
    transition-duration: 0ms!important;
    transition-delay: 0ms!important;
}


md-slider ._md-thumb-container, ._md-focus-ring, ._md-track-fill, ._md-thumb{
    transition: none!important;
    transition-duration: 0ms!important;
    transition-delay: 0ms!important;
}

md-select-menu
{
    transition: none!important;
    transition-duration: 0ms!important;
    transition-delay: 0ms!important;
}
md-select-menu md-content
{
    transition: none!important;
    transition-duration: 0ms!important;
    transition-delay: 0ms!important;
}

Also I've disabled the ripple effect in the body-tag which affects all child elements (gladly):

<body md-no-ink>...</body>

Don't change the transform events cause they will destroy everything... Just disable the transition.

Short update: If this CSS-Sheet doesn't disable the animations you need to disable Chrome has a beautiful animation helper now: image

Greetings Graphefruit

graphefruit avatar Mar 23 '16 12:03 graphefruit

@graphefruit I shall give it a try! Thanks!

nicolae-olariu avatar Mar 23 '16 12:03 nicolae-olariu

@graphefruit I gave both of those a try but didn't notice any significant performance impact to IE11 with AM 1.0.5.

Splaktar avatar May 10 '16 05:05 Splaktar

@Splaktar try use 1.1.0-RC4. I tested it on 1.0.8 and the performance betwen 1.0 and 1.1 is realy different, so give it a try.

Also have a look then on #8329 for the newest CSS.

graphefruit avatar May 10 '16 05:05 graphefruit

<body md-no-ink> ... </body> it will disable for all the browsers?

ashishpatel02 avatar Jul 20 '16 09:07 ashishpatel02

@ashishpatel02 It will disable on all browers yes. I'm using safari, ie and chrome, and no ripple effects here.

graphefruit avatar Jul 20 '16 09:07 graphefruit

Is there anything which can only work for i.e?

ashishpatel02 avatar Jul 20 '16 09:07 ashishpatel02

Not tested - Add the md-no-ink on browser start, if its IE?

  • If you render the index.html from c#/php/python there shouldn't be any problem.
  • If you're directly rendering with a static index.html and javascript try to check if the browser is IE and add the md-no-ink attribute to the body

graphefruit avatar Jul 20 '16 09:07 graphefruit

Cool, Many Thanks :) :) :+1: :100:

ashishpatel02 avatar Jul 20 '16 09:07 ashishpatel02

I have added it like below but still facing the same issue. can you please help me for this? image

ashishpatel02 avatar Jul 26 '16 10:07 ashishpatel02

I think the problem is, that the md-no-ink is added after the angular rendering.

-> Try to add the md-no-ink static on body - is it working then? If its working you need to add the md-no-ink before angular. (you can bootstrap your application self instead https://docs.angularjs.org/guide/bootstrap)

Which angular material version are you using? Try the latest one

graphefruit avatar Jul 26 '16 11:07 graphefruit