float-btn.scss 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. @mixin notSelect {
  2. -moz-user-select: none; /*火狐*/
  3. -webkit-user-select: none; /*webkit浏览器*/
  4. -ms-user-select: none; /*IE10*/
  5. -khtml-user-select: none; /*早期浏览器*/
  6. user-select: none;
  7. }
  8. @mixin not-touch {
  9. -webkit-touch-callout: none;
  10. -webkit-user-select: none;
  11. -khtml-user-select: none;
  12. -moz-user-select: none;
  13. -ms-user-select: none;
  14. user-select: none;
  15. }
  16. .floatBtn {
  17. @include notSelect;
  18. @include not-touch();
  19. position: absolute;
  20. // z-index: 9999;
  21. overflow: visible;
  22. width: 160rpx;
  23. height: 76rpx;
  24. right: 0;
  25. // left: calc(100% - 196px);
  26. // top: calc(100% - 180px);
  27. color: #f5fef9;
  28. background: #239ad8;
  29. font-size: 28rpx;
  30. line-height: 76rpx;
  31. text-align: right;
  32. box-sizing: border-box;
  33. // padding: 10px;
  34. &.rightBtn {
  35. border-radius: 21rpx;
  36. }
  37. &.leftBtn {
  38. border-radius: 21rpx;
  39. }
  40. &.moveBtn {
  41. border-radius: 21rpx;
  42. }
  43. }
  44. @keyframes lightning-anim {
  45. 0% {
  46. opacity: 0;
  47. }
  48. 5% {
  49. opacity: 1;
  50. }
  51. 10% {
  52. opacity: 0;
  53. }
  54. 15% {
  55. opacity: 1;
  56. }
  57. 100% {
  58. opacity: 0;
  59. }
  60. }
  61. .lighting {
  62. position: absolute;
  63. top: 43%;
  64. left: 30rpx;
  65. font-size: 10rpx;
  66. transform: skewX(-10deg);
  67. animation: lightning-anim 2s linear infinite;
  68. }
  69. .lighting::before {
  70. content: "";
  71. position: absolute;
  72. margin-top: -20rpx;
  73. margin-left: -10rpx;
  74. border-top: 15rpx solid transparent;
  75. border-right: 10rpx solid #f7f5ff;
  76. border-bottom: 15rpx solid #f7f5ff;
  77. border-left: 10rpx solid transparent;
  78. }
  79. .lighting::after {
  80. content: "";
  81. position: absolute;
  82. margin-left: 6rpx;
  83. border-top: 15rpx solid #f7f5ff;
  84. border-right: 10rpx solid transparent;
  85. border-bottom: 15rpx solid transparent;
  86. border-left: 10rpx solid #f7f5ff;
  87. }