_animated.less 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // animating icons
  2. // --------------------------
  3. .@{fa-css-prefix}-beat {
  4. animation-name: ~'@{fa-css-prefix}-beat';
  5. animation-delay: ~'var(--@{fa-css-prefix}-animation-delay, 0)';
  6. animation-direction: ~'var(--@{fa-css-prefix}-animation-direction, normal)';
  7. animation-duration: ~'var(--@{fa-css-prefix}-animation-duration, 1s)';
  8. animation-iteration-count: ~'var(--@{fa-css-prefix}-animation-iteration-count, infinite)';
  9. animation-timing-function: ~'var(--@{fa-css-prefix}-animation-timing, ease-in-out)';
  10. }
  11. .@{fa-css-prefix}-bounce {
  12. animation-name: ~'@{fa-css-prefix}-beat';
  13. animation-delay: ~'var(--@{fa-css-prefix}-animation-delay, 0)';
  14. animation-direction: ~'var(--@{fa-css-prefix}-animation-direction, normal)';
  15. animation-duration: ~'var(--@{fa-css-prefix}-animation-duration, 1s)';
  16. animation-iteration-count: ~'var(--@{fa-css-prefix}-animation-iteration-count, infinite)';
  17. animation-timing-function: ~'var(--@{fa-css-prefix}-animation-timing, cubic-bezier(0.280, 0.840, 0.420, 1))';
  18. }
  19. .@{fa-css-prefix}-fade {
  20. animation-name: ~'@{fa-css-prefix}-fade';
  21. animation-delay: ~'var(--@{fa-css-prefix}-animation-delay, 0)';
  22. animation-direction: ~'var(--@{fa-css-prefix}-animation-direction, normal)';
  23. animation-duration: ~'var(--@{fa-css-prefix}-animation-duration, 1s)';
  24. animation-iteration-count: ~'var(--@{fa-css-prefix}-animation-iteration-count, infinite)';
  25. animation-timing-function: ~'var(--@{fa-css-prefix}-animation-timing, cubic-bezier(.4,0,.6,1))';
  26. }
  27. .@{fa-css-prefix}-beat-fade {
  28. animation-name: ~'@{fa-css-prefix}-beat-fade';
  29. animation-delay: ~'var(--@{fa-css-prefix}-animation-delay, 0)';
  30. animation-direction: ~'var(--@{fa-css-prefix}-animation-direction, normal)';
  31. animation-duration: ~'var(--@{fa-css-prefix}-animation-duration, 1s)';
  32. animation-iteration-count: ~'var(--@{fa-css-prefix}-animation-iteration-count, infinite)';
  33. animation-timing-function: ~'var(--@{fa-css-prefix}-animation-timing, cubic-bezier(.4,0,.6,1))';
  34. }
  35. .@{fa-css-prefix}-flip {
  36. animation-name: ~'@{fa-css-prefix}-flip';
  37. animation-delay: ~'var(--@{fa-css-prefix}-animation-delay, 0)';
  38. animation-direction: ~'var(--@{fa-css-prefix}-animation-direction, normal)';
  39. animation-duration: ~'var(--@{fa-css-prefix}-animation-duration, 1s)';
  40. animation-iteration-count: ~'var(--@{fa-css-prefix}-animation-iteration-count, infinite)';
  41. animation-timing-function: ~'var(--@{fa-css-prefix}-animation-timing, ease-in-out)';
  42. }
  43. .@{fa-css-prefix}-shake {
  44. animation-name: ~'@{fa-css-prefix}-shake';
  45. animation-delay: ~'var(--@{fa-css-prefix}-animation-delay, 0)';
  46. animation-direction: ~'var(--@{fa-css-prefix}-animation-direction, normal)';
  47. animation-duration: ~'var(--@{fa-css-prefix}-animation-duration, 1s)';
  48. animation-iteration-count: ~'var(--@{fa-css-prefix}-animation-iteration-count, infinite)';
  49. animation-timing-function: ~'var(--@{fa-css-prefix}-animation-timing, ease-in-out)';
  50. }
  51. .@{fa-css-prefix}-spin {
  52. animation-name: ~'@{fa-css-prefix}-spin';
  53. animation-delay: ~'var(--@{fa-css-prefix}-animation-delay, 0)';
  54. animation-direction: ~'var(--@{fa-css-prefix}-animation-direction, normal)';
  55. animation-duration: ~'var(--@{fa-css-prefix}-animation-duration, 2s)';
  56. animation-iteration-count: ~'var(--@{fa-css-prefix}-animation-iteration-count, infinite)';
  57. animation-timing-function: ~'var(--@{fa-css-prefix}-animation-timing, linear)';
  58. }
  59. .@{fa-css-prefix}-spin-reverse {
  60. --@{fa-css-prefix}-animation-direction: reverse;
  61. }
  62. // if agent or operating system prefers reduced motion, disable animations
  63. // see: https://www.smashingmagazine.com/2020/09/design-reduced-motion-sensitivities/
  64. // see: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
  65. @media (prefers-reduced-motion: reduce) {
  66. .@{fa-css-prefix}-beat,
  67. .@{fa-css-prefix}-bounce,
  68. .@{fa-css-prefix}-fade,
  69. .@{fa-css-prefix}-beat-fade,
  70. .@{fa-css-prefix}-flip,
  71. .@{fa-css-prefix}-pulse,
  72. .@{fa-css-prefix}-shake,
  73. .@{fa-css-prefix}-spin,
  74. .@{fa-css-prefix}-spin-pulse {
  75. animation-delay: -1ms;
  76. animation-duration: 1ms;
  77. animation-iteration-count: 1;
  78. transition-delay: 0s;
  79. transition-duration: 0s;
  80. }
  81. }
  82. @keyframes ~'@{fa-css-prefix}-beat' {
  83. 0%, 90% { transform: scale(1); }
  84. 45% { transform: ~'scale(var(--@{fa-css-prefix}-beat-scale, 1.25))'; }
  85. }
  86. @keyframes ~'@{fa-css-prefix}-bounce' {
  87. 0% { transform: scale(1,1) translateY(0); }
  88. 10% { transform: ~'scale(var(--#{$fa-css-prefix}-bounce-start-scale-x, 1.1),var(--#{$fa-css-prefix}-bounce-start-scale-y, 0.9))' translateY(0); }
  89. 30% { transform: ~'scale(var(--#{$fa-css-prefix}-bounce-jump-scale-x, 0.9),var(--#{$fa-css-prefix}-bounce-jump-scale-y, 1.1))' ~'translateY(var(--#{$fa-css-prefix}-bounce-height, -0.5em))'; }
  90. 50% { transform: ~'scale(var(--#{$fa-css-prefix}-bounce-land-scale-x, 1.05),var(--#{$fa-css-prefix}-bounce-land-scale-y, 0.95))' translateY(0); }
  91. 57% { transform: ~'scale(1,1) translateY(var(--#{$fa-css-prefix}-bounce-rebound, -0.125em))'; }
  92. 64% { transform: scale(1,1) translateY(0); }
  93. 100% { transform: scale(1,1) translateY(0); }
  94. }
  95. @keyframes ~'@{fa-css-prefix}-fade' {
  96. 50% { opacity: ~'var(--@{fa-css-prefix}-fade-opacity, 0.4)'; }
  97. }
  98. @keyframes ~'@{fa-css-prefix}-beat-fade' {
  99. 0%, 100% {
  100. opacity: ~'var(--@{fa-css-prefix}-beat-fade-opacity, 0.4)';
  101. transform: scale(1);
  102. }
  103. 50% {
  104. opacity: 1;
  105. transform: ~'scale(var(--@{fa-css-prefix}-beat-fade-scale, 1.125))';
  106. }
  107. }
  108. @keyframes ~'@{fa-css-prefix}-flip' {
  109. 50% {
  110. transform: ~'rotate3d(var(--@{fa-css-prefix}-flip-x, 0), var(--@{fa-css-prefix}-flip-y, 1), var(--@{fa-css-prefix}-flip-z, 0), var(--@{fa-css-prefix}-flip-angle, -180deg))';
  111. }
  112. }
  113. @keyframes ~'@{fa-css-prefix}-shake' {
  114. 0% { transform: rotate(-15deg); }
  115. 4% { transform: rotate(15deg); }
  116. 8%, 24% { transform: rotate(-18deg); }
  117. 12%, 28% { transform: rotate(18deg); }
  118. 16% { transform: rotate(-22deg); }
  119. 20% { transform: rotate(22deg); }
  120. 32% { transform: rotate(-12deg); }
  121. 36% { transform: rotate(12deg); }
  122. 40%, 100% { transform: rotate(0deg); }
  123. }
  124. @keyframes ~'@{fa-css-prefix}-spin' {
  125. 0% { transform: rotate(0deg); }
  126. 100% { transform: rotate(360deg); }
  127. }