uni-fab.wxss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. /**
  2. * 这里是uni-app内置的常用样式变量
  3. *
  4. * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
  5. * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
  6. *
  7. */
  8. /**
  9. * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
  10. *
  11. * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
  12. */
  13. /* 颜色变量 */
  14. /* 行为相关颜色 */
  15. /* 文字基本颜色 */
  16. /* 背景颜色 */
  17. /* 边框颜色 */
  18. /* 尺寸变量 */
  19. /* 文字尺寸 */
  20. /* 图片尺寸 */
  21. /* Border Radius */
  22. /* 水平间距 */
  23. /* 垂直间距 */
  24. /* 透明度 */
  25. /* 文章场景相关 */
  26. .horizontal-margin {
  27. margin-right: 20rpx;
  28. }
  29. .vertical-margin {
  30. margin-bottom: 20rpx;
  31. }
  32. .uni-fab {
  33. position: fixed;
  34. display: flex;
  35. justify-content: center;
  36. align-items: center;
  37. z-index: 12;
  38. border-radius: 45px;
  39. }
  40. .uni-fab--active {
  41. opacity: 1;
  42. }
  43. .uni-fab--leftBottom {
  44. left: 15px;
  45. bottom: 30px;
  46. }
  47. .uni-fab--leftTop {
  48. left: 15px;
  49. top: 30px;
  50. }
  51. .uni-fab--rightBottom {
  52. right: 24rpx;
  53. bottom: calc(100rpx + env(safe-area-inset-bottom));
  54. }
  55. .uni-fab--rightTop {
  56. right: 15px;
  57. top: 30px;
  58. }
  59. .uni-fab__circle {
  60. position: fixed;
  61. display: flex;
  62. justify-content: center;
  63. align-items: center;
  64. width: 64rpx;
  65. height: 64rpx;
  66. background-color: #3c3e49;
  67. border-radius: 50%;
  68. z-index: 13;
  69. }
  70. .uni-fab__circle--leftBottom {
  71. left: 15px;
  72. bottom: 30px;
  73. }
  74. .uni-fab__circle--leftTop {
  75. left: 15px;
  76. top: 30px;
  77. }
  78. .uni-fab__circle--rightBottom {
  79. right: 40rpx;
  80. bottom: calc(120rpx + env(safe-area-inset-bottom));
  81. }
  82. .uni-fab__circle--rightTop {
  83. right: 15px;
  84. top: 30px;
  85. }
  86. .uni-fab__circle--left {
  87. left: 0;
  88. }
  89. .uni-fab__circle--right {
  90. right: 0;
  91. }
  92. .uni-fab__circle--top {
  93. top: 0;
  94. }
  95. .uni-fab__circle--bottom {
  96. bottom: 0;
  97. }
  98. .uni-fab__plus {
  99. font-weight: bold;
  100. }
  101. .fab-circle-icon {
  102. transform: rotate(0deg);
  103. transition: transform 0.3s;
  104. font-weight: 200;
  105. }
  106. .uni-fab__plus--active {
  107. transform: rotate(135deg);
  108. }
  109. .uni-fab__content {
  110. box-sizing: border-box;
  111. display: flex;
  112. flex-direction: row;
  113. border-radius: 55px;
  114. overflow: hidden;
  115. transition-property: width, height;
  116. transition-duration: 0.2s;
  117. width: 64rpx;
  118. border-color: #dddddd;
  119. border-width: 1rpx;
  120. border-style: solid;
  121. }
  122. .uni-fab__content--other-platform {
  123. border-width: 0px;
  124. }
  125. .uni-fab__content--left {
  126. justify-content: flex-start;
  127. }
  128. .uni-fab__content--right {
  129. justify-content: flex-end;
  130. }
  131. .uni-fab__content--flexDirection {
  132. flex-direction: column;
  133. justify-content: flex-end;
  134. }
  135. .uni-fab__content--flexDirectionStart {
  136. flex-direction: column;
  137. justify-content: flex-start;
  138. }
  139. .uni-fab__content--flexDirectionEnd {
  140. flex-direction: column;
  141. justify-content: flex-end;
  142. }
  143. .uni-fab__item {
  144. display: flex;
  145. flex-direction: column;
  146. justify-content: center;
  147. align-items: center;
  148. width: 100rpx;
  149. opacity: 0;
  150. transition: opacity 0.2s;
  151. }
  152. .uni-fab__item--active {
  153. opacity: 1;
  154. }
  155. .uni-fab__item-image {
  156. width: 52rpx;
  157. height: 52rpx;
  158. }
  159. .uni-fab__item-text {
  160. color: #ffffff;
  161. display: table;
  162. font-size: 24rpx;
  163. margin-top: 4px;
  164. }
  165. .uni-fab__item--first {
  166. width: 100rpx;
  167. height: 100rpx;
  168. margin-bottom: 0 !important;
  169. }