天波h5前端应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 satır
2.6KB

  1. $designWidth: 750;
  2. $blue: #2599ff;
  3. $next: #8bc6fa;
  4. $red: #ff8c8c;
  5. $background: #f2f4f5;
  6. // 灰色线条
  7. $lineGray: #F5F5F5;
  8. $border_color: #d1d1d1;
  9. /* 绑定时选择人物关系图片head.png */
  10. $spriteWidthHead: 180;
  11. $spriteHeightHead: 330;
  12. $iconWidthHead: 80;
  13. $iconHeightHead: 80;
  14. /* 雪碧图 */
  15. $spriteWidth: 400;
  16. $spriteHeight: 400;
  17. /* tabbar */
  18. $tabbarH: 60px;
  19. /* navbar */
  20. $navbarH: 46px;
  21. /* @function px2rem($px) {
  22. @return $px*320/$designWidth/20+rem;
  23. } */
  24. @-webkit-keyframes rotation {
  25. from {
  26. -webkit-transform: rotate(0deg);
  27. }
  28. to {
  29. -webkit-transform: rotate(360deg);
  30. }
  31. }
  32. @mixin colorAndFont($color, $fontSize) {
  33. color: $color;
  34. font-size: ($fontSize)px;
  35. }
  36. @mixin center {
  37. display: flex;
  38. justify-content: center;
  39. align-items: center;
  40. }
  41. @mixin boxShadow($color...) {
  42. @if $color {
  43. box-shadow: 0 0 10px $color;
  44. } @else {
  45. box-shadow: 0 0 10px rgba(185, 185, 185, .9);
  46. }
  47. }
  48. @mixin avatarShadow {
  49. box-shadow: 0 0 1px 1px rgba(185, 185, 185, 0.4);
  50. }
  51. @mixin avatarActiveShadow {
  52. box-shadow: 0 0 5px 1px rgba(185, 185, 185, 0.4);
  53. }
  54. @mixin avatarOnlineShadow {
  55. box-shadow: 0 0 1px 1px rgba(95, 204, 14, 0.4);
  56. }
  57. @mixin avatarActiveOnlineShadow {
  58. box-shadow: 0 0 5px 1px rgba(95, 204, 14, 0.4);
  59. }
  60. @mixin border {
  61. position: absolute;
  62. box-sizing: border-box;
  63. content: ' ';
  64. pointer-events: none;
  65. top: -50%;
  66. right: -50%;
  67. bottom: -50%;
  68. left: -50% !important;
  69. border-bottom: 1px solid $border_color;
  70. -webkit-transform: scale(.5);
  71. transform: scale(.5);
  72. }
  73. // 雪碧图位置的处理
  74. @mixin bgPosition(
  75. $spriteWidth,
  76. $spriteHeight,
  77. $iconWidth,
  78. $iconHeight,
  79. $iconX,
  80. $iconY
  81. ) {
  82. background-position: (
  83. ($iconX / ($spriteWidth - $iconWidth)) * 100% ($iconY / ($spriteHeight - $iconHeight)) * 100%
  84. );
  85. }
  86. // 雪碧图
  87. @mixin icon_position($iconWidth, $iconHeight, $iconX, $iconY) {
  88. @include bgPosition(
  89. $spriteWidth,
  90. $spriteHeight,
  91. $iconWidth,
  92. $iconHeight,
  93. $iconX,
  94. $iconY
  95. );
  96. }
  97. // 雪碧图路径
  98. @mixin icon($spriteUrl, $iconW, $iconH, $containerW, $containerH) {
  99. background: transparent url($spriteUrl) no-repeat;
  100. background-size: (400 * $iconW / $containerW)px (400 * $iconH / $containerH)px;
  101. }
  102. // 绑定时选择人物关系图片head.png
  103. @mixin head_position($iconX, $iconY) {
  104. @include bgPosition(
  105. $spriteWidthHead,
  106. $spriteHeightHead,
  107. $iconWidthHead,
  108. $iconHeightHead,
  109. $iconX,
  110. $iconY
  111. );
  112. }