switchBlock.wxss 1 KB
/* components/switchBlock/switchBlock.wxss */
.switch-box {
    width: var(--fontSize236);
    height: var(--fontSize60);
    display: flex;
    border: var(--fontSize2) solid #347BFF;
    border-radius: var(--fontSize12);
    font-size: var(--fontSize28);
    color: #347BFF;
    margin-left: auto;
    position: relative;
  }
.text-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

  .switch-box .block {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    border-radius: var(--fontSize12);
    height: 100%;
    background: #347BFF;
    color: #fff;
    transition: all .25s;
  }
  
  .switch-box .block.right {
    left: 50%;
  }
  
  .switch-box .male,
  .switch-box .woman {
    width: 50%;
    height: 100%;
    position: absolute;
    top: 0;
    transition: all .25s;
  }
  
  .switch-box .male {
    left: 0;
  }
  
  .switch-box .woman {
    right: 0;
  }
  .switch-box .male.active,
  .switch-box .woman.active{
    color: #fff;
  }
  .disabled{
    opacity: .5;
  }