switchBlock.wxss
1008 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* components/switchBlock/switchBlock.wxss */
.switch-box {
width: 236rpx;
height: 60rpx;
display: flex;
border: 2rpx solid #3582EE;
border-radius: 12rpx;
font-size: 28rpx;
color: #3582EE;
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: 12rpx;
height: 100%;
background: #3582EE;
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;
}