_keyframes.scss 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. //
  2. // Copyright 2017 Google Inc.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. @use "@material/animation/variables" as animation-variables;
  23. @use "@material/theme/mixins";
  24. @use "./variables";
  25. @mixin container-keyframes_(
  26. $from-stroke-color,
  27. $to-stroke-color,
  28. $from-fill-color,
  29. $to-fill-color,
  30. $uid) {
  31. @keyframes mdc-checkbox-fade-in-background-#{$uid} {
  32. 0% {
  33. @include mixins.prop(border-color, $from-stroke-color);
  34. @include mixins.prop(background-color, $from-fill-color);
  35. }
  36. 50% {
  37. @include mixins.prop(border-color, $to-stroke-color);
  38. @include mixins.prop(background-color, $to-fill-color);
  39. }
  40. }
  41. @keyframes mdc-checkbox-fade-out-background-#{$uid} {
  42. 0%,
  43. 80% {
  44. @include mixins.prop(border-color, $to-stroke-color);
  45. @include mixins.prop(background-color, $to-fill-color);
  46. }
  47. 100% {
  48. @include mixins.prop(border-color, $from-stroke-color);
  49. @include mixins.prop(background-color, $from-fill-color);
  50. }
  51. }
  52. }
  53. @mixin mark-keyframes_ {
  54. @keyframes mdc-checkbox-unchecked-checked-checkmark-path {
  55. 0%,
  56. 50% {
  57. stroke-dashoffset: variables.$mark-path-length_;
  58. }
  59. 50% {
  60. animation-timing-function: animation-variables.$deceleration-curve-timing-function;
  61. }
  62. 100% {
  63. stroke-dashoffset: 0;
  64. }
  65. }
  66. @keyframes mdc-checkbox-unchecked-indeterminate-mixedmark {
  67. 0%,
  68. 68.2% {
  69. transform: scaleX(0);
  70. }
  71. 68.2% {
  72. animation-timing-function: cubic-bezier(0, 0, 0, 1);
  73. }
  74. 100% {
  75. transform: scaleX(1);
  76. }
  77. }
  78. @keyframes mdc-checkbox-checked-unchecked-checkmark-path {
  79. from {
  80. animation-timing-function: animation-variables.$acceleration-curve-timing-function;
  81. opacity: 1;
  82. stroke-dashoffset: 0;
  83. }
  84. to {
  85. opacity: 0;
  86. stroke-dashoffset: variables.$mark-path-length_ * -1;
  87. }
  88. }
  89. @keyframes mdc-checkbox-checked-indeterminate-checkmark {
  90. from {
  91. animation-timing-function: animation-variables.$deceleration-curve-timing-function;
  92. transform: rotate(0deg);
  93. opacity: 1;
  94. }
  95. to {
  96. transform: rotate(45deg);
  97. opacity: 0;
  98. }
  99. }
  100. @keyframes mdc-checkbox-indeterminate-checked-checkmark {
  101. from {
  102. animation-timing-function: variables.$indeterminate-checked-easing-function_;
  103. transform: rotate(45deg);
  104. opacity: 0;
  105. }
  106. to {
  107. transform: rotate(360deg);
  108. opacity: 1;
  109. }
  110. }
  111. @keyframes mdc-checkbox-checked-indeterminate-mixedmark {
  112. from {
  113. animation-timing-function: mdc-animation-deceleration-curve-timing-function;
  114. transform: rotate(-45deg);
  115. opacity: 0;
  116. }
  117. to {
  118. transform: rotate(0deg);
  119. opacity: 1;
  120. }
  121. }
  122. @keyframes mdc-checkbox-indeterminate-checked-mixedmark {
  123. from {
  124. animation-timing-function: variables.$indeterminate-checked-easing-function_;
  125. transform: rotate(0deg);
  126. opacity: 1;
  127. }
  128. to {
  129. transform: rotate(315deg);
  130. opacity: 0;
  131. }
  132. }
  133. @keyframes mdc-checkbox-indeterminate-unchecked-mixedmark {
  134. 0% {
  135. animation-timing-function: linear;
  136. transform: scaleX(1);
  137. opacity: 1;
  138. }
  139. 32.8%,
  140. 100% {
  141. transform: scaleX(0);
  142. opacity: 0;
  143. }
  144. }
  145. }