UI for Zipcoin Blue

fab.scss 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. @import "../../themes/ionic.globals";
  2. // Floating Action Buttons
  3. // --------------------------------------------------
  4. /// @prop - Width and height of the FAB button
  5. $fab-size: 56px !default;
  6. /// @prop - Width and height of the FAB button mini
  7. $fab-mini-size: 40px !default;
  8. /// @prop - Margin of the FAB Container
  9. $fab-content-margin: 10px !default;
  10. /// @prop - Margin of the FAB List
  11. $fab-list-margin: 10px !default;
  12. /// @prop - Background color of the button in a list
  13. $fab-list-button-background-color: #f4f4f4 !default;
  14. .fab {
  15. @include text-align(center);
  16. @include appearance(none);
  17. @include border-radius(50%);
  18. position: relative;
  19. z-index: 0;
  20. display: block;
  21. overflow: hidden;
  22. width: $fab-size;
  23. height: $fab-size;
  24. font-size: 14px;
  25. line-height: $fab-size;
  26. text-overflow: ellipsis;
  27. text-transform: none;
  28. white-space: nowrap;
  29. cursor: pointer;
  30. transition: background-color, opacity 100ms linear;
  31. background-clip: padding-box;
  32. font-kerning: none;
  33. user-select: none;
  34. contain: strict;
  35. }
  36. .fab ion-icon {
  37. flex: 1;
  38. font-size: 2.4rem;
  39. }
  40. // FAB mini
  41. // --------------------------------------------------
  42. .fab[mini] {
  43. @include margin(($fab-size - $fab-mini-size) / 2);
  44. width: $fab-mini-size;
  45. height: $fab-mini-size;
  46. line-height: $fab-mini-size;
  47. }
  48. .fab[mini] .fab-close-icon {
  49. line-height: $fab-mini-size;
  50. }
  51. // FAB container
  52. // --------------------------------------------------
  53. ion-fab {
  54. position: absolute;
  55. z-index: $z-index-fixed-content;
  56. &[center] {
  57. @include position(null, null, null, 50%);
  58. @include margin-horizontal(-$fab-size / 2, null);
  59. }
  60. &[middle] {
  61. @include margin(-$fab-size / 2, null, null, null);
  62. top: 50%;
  63. }
  64. &[top] {
  65. top: $fab-content-margin;
  66. }
  67. &[right] {
  68. // scss-lint:disable PropertySpelling
  69. @include multi-dir() {
  70. right: $fab-content-margin;
  71. }
  72. @include multi-dir() {
  73. right: calc(#{$fab-content-margin} + constant(safe-area-inset-right));
  74. right: calc(#{$fab-content-margin} + env(safe-area-inset-right));
  75. }
  76. }
  77. &[end] {
  78. @include position-horizontal(null, $fab-content-margin);
  79. @include safe-position-horizontal(null, $fab-content-margin);
  80. }
  81. &[bottom] {
  82. bottom: $fab-content-margin;
  83. }
  84. &[left] {
  85. // scss-lint:disable PropertySpelling
  86. @include multi-dir() {
  87. left: $fab-content-margin;
  88. }
  89. @include multi-dir() {
  90. left: calc(#{$fab-content-margin} + constant(safe-area-inset-left));
  91. left: calc(#{$fab-content-margin} + env(safe-area-inset-left));
  92. }
  93. }
  94. &[start] {
  95. @include position-horizontal($fab-content-margin, null);
  96. @include safe-position-horizontal($fab-content-margin, null);
  97. }
  98. &[top][edge] {
  99. top: -$fab-size / 2;
  100. }
  101. &[bottom][edge] {
  102. bottom: -$fab-size / 2;
  103. }
  104. }
  105. // FAB list (speed dial)
  106. // --------------------------------------------------
  107. ion-fab-list {
  108. @include margin($fab-size + $fab-list-margin, 0);
  109. position: absolute;
  110. top: 0;
  111. display: none;
  112. flex-direction: column;
  113. align-items: center;
  114. min-width: $fab-size;
  115. min-height: $fab-size;
  116. }
  117. .fab-in-list {
  118. @include margin(8px, 0);
  119. width: $fab-mini-size;
  120. height: $fab-mini-size;
  121. opacity: 0;
  122. visibility: hidden;
  123. transform: scale(0);
  124. }
  125. .fab-in-list.show {
  126. opacity: 1;
  127. visibility: visible;
  128. transform: scale(1);
  129. }
  130. ion-fab-list[side=left] .fab-in-list,
  131. ion-fab-list[side=right] .fab-in-list {
  132. @include margin(0, 8px);
  133. }
  134. ion-fab-list[side=top] {
  135. top: auto;
  136. bottom: 0;
  137. flex-direction: column-reverse;
  138. }
  139. ion-fab-list[side=left] {
  140. @include margin(0, $fab-size + $fab-list-margin);
  141. @include position-horizontal(null, 0);
  142. flex-direction: row-reverse;
  143. }
  144. ion-fab-list[side=right] {
  145. @include margin(0, $fab-size + $fab-list-margin);
  146. @include position(null, null, null, 0);
  147. flex-direction: row;
  148. }
  149. // FAB animation
  150. // --------------------------------------------------
  151. .fab-list-active {
  152. display: flex;
  153. }
  154. .fab-close-icon {
  155. @include position(0, 0, null, 0);
  156. position: absolute;
  157. line-height: $fab-size;
  158. opacity: 0;
  159. transform: scale(.4) rotateZ(-45deg);
  160. transition: all ease-in-out 300ms;
  161. transition-property: transform, opacity;
  162. }
  163. .fab .button-inner {
  164. transition: all ease-in-out 300ms;
  165. transition-property: transform, opacity;
  166. }
  167. .fab-close-active .fab-close-icon {
  168. opacity: 1;
  169. transform: scale(1) rotateZ(0deg);
  170. }
  171. .fab-close-active .button-inner {
  172. opacity: 0;
  173. transform: scale(.4) rotateZ(45deg);
  174. }