@import './palette.scss';

/* 文字超长处理单行 */
@mixin single-line-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all;
}

/* 文字超长处理多行 */
@mixin more-lines-ellipsis($height, $line: 2) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  max-height: $height;
  -webkit-line-clamp: $line;
  overflow: hidden;
  word-break: break-all;
}

/* 正常按钮 */
@mixin primary-btn($fontsize: .36rem, $color: #212124, $width: 2.6rem, $height: .72rem, $line-height: .72rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  font-family: 'PEACE';
  text-align: center;
  background: url(https://image-1251917893.file.myqcloud.com/tip-project/pubg/pubg-match/horizon/btn-normal.png) no-repeat;
  position: relative;

  &::after {
    content: '';
    display: block;
    position: absolute;
    background: rgba(255, 255, 255, 0);
    pointer-events: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
  }

  &:active {
    &::after {
      content: '';
      display: block;
      position: absolute;
      background: rgba(255, 255, 255, .6);
      pointer-events: none;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
    }
  }
}

@mixin secondary-btn($fontsize: .36rem, $color: #fff, $width: 2.6rem, $height: .72rem, $line-height: .72rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  font-family: 'PEACE';
  letter-spacing: .04rem;
  text-align: center;
  background: url(https://image-1251917893.file.myqcloud.com/tip-project/pubg/pubg-match/horizon/btn-minor.png) no-repeat;
  background-size: 100% 100%;
  position: relative;

  &::after {
    content: '';
    display: block;
    position: absolute;
    background: rgba(255, 255, 255, 0);
    pointer-events: none;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
  }

  &:active {
    &::after {
      content: '';
      display: block;
      position: absolute;
      background: rgba(255, 255, 255, .6);
      pointer-events: none;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
    }
  }
}

//小号按钮
@mixin primary-btn-s($fontsize: .32rem, $color: #212124, $width: 2.6rem, $height: .6rem, $line-height: .6rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  font-family: 'PEACE';
  text-align: center;
  background: url(https://image-1251917893.file.myqcloud.com/tip-project/pubg/pubg-match/horizon/btn-normal-s.png) no-repeat;
  background-size: 100%;
}

@mixin secondary-btn-s($fontsize: .32rem, $color: #fff, $width: 2.6rem, $height: .6rem, $line-height: .6rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  font-family: 'PEACE';
  text-align: center;
  background: url(https://image-1251917893.file.myqcloud.com/tip-project/pubg/pubg-match/horizon/btn-minor-s.png) no-repeat;
  background-size: 100%;
}

//超小号按钮
@mixin primary-btn-xs($fontsize: .22rem, $color: #212124, $width: 1rem, $height: .5rem, $line-height: .5rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  font-family: 'PEACE';
  text-align: center;
  background: url(https://image-1251917893.file.myqcloud.com/tip-project/pubg/pubg-match/horizon/btn-normal-xs.png) no-repeat;
  background-size: 100%;
}

@mixin secondary-btn-xs($fontsize: .22rem, $color: #fff, $width: 1rem, $height: .5rem, $line-height: .5rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  font-family: 'PEACE';
  text-align: center;
  background: url(https://image-1251917893.file.myqcloud.com/tip-project/pubg/pubg-match/horizon/btn-minor-xs.png) no-repeat;
  background-size: 100%;
}

/* 次按钮-半透明 */
@mixin secondary-transparent-btn($fontsize: $font-xs, $color: $color-gray, $width: 1.7rem, $height: .56rem, $line-height: .52rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  letter-spacing: .04rem;
  text-align: center;
  background: url(https://image-1251917893.cos.ap-guangzhou.myqcloud.com/igame/match/gp/horz-match/btn-secondary-2.png) no-repeat;
  background-size: 100% 100%;
}

/* 不可点击按钮 */
@mixin disabled-btn($fontsize: $font-xs, $color: rgba($color-dark-4, .6), $width: 1.7rem, $height: .56rem, $line-height: .52rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  letter-spacing: .04rem;
  text-align: center;
  background: url(https://image-1251917893.file.myqcloud.com/igame/match/gp/horz-match/disabled-btn.png) no-repeat;
  background-size: 100% 100%;
}

/* 长按钮 */
@mixin long-btn($fontsize: $font-m, $color: $color-gray-2, $width: 3.56rem, $height: .66rem, $line-height: .66rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  letter-spacing: .04rem;
  text-align: center;
  background: url(https://image-1251917893.file.myqcloud.com/igame/match/gp/horz-match/long-btn.png) no-repeat;
  background-size: 100% 100%;
}

/* 长按钮-主按钮 */
@mixin long-btn-primary($fontsize: $font-m, $color: $color-btn, $width: 3.56rem, $height: .66rem, $line-height: .66rem) {
  font-size: $fontsize;
  color: $color;
  width: $width;
  height: $height;
  line-height: $line-height;
  letter-spacing: .04rem;
  text-align: center;
  background: url(https://image-1251917893.file.myqcloud.com/igame/match/gp/horz-match/btn-primary-long.png) no-repeat;
  background-size: 100% 100%;
}

/* 布局 */
@mixin flex-content($align: center, $justify: space-between, $direction: row) {
  display: flex;
  align-items: $align;
  justify-content: $justify;
  flex-direction: $direction;
}

@mixin inline-vertical-content($location: middle) {
  display: inline-block;
  vertical-align: $location;
}