drawer3d.styl
1.91 KB
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
58
59
60
61
62
63
64
65
66
67
68
/**
* 3D抽屉效果
*/
.minirefresh-theme-drawer3d
.minirefresh-downwrap
position: absolute;
top: 0;
left: 0;
height: 200px;
background: #000000;
/*
* 开启3D视角,经测试,就算不写,只要有translateZ,在iOS下默认也有这个效果
* http://www.w3cplus.com/css3/transform-basic-property.html
* */
transform-style: preserve-3d;
-webkit-transform-style: preserve-3d;
/**
* 隐藏不可见元素
*/
backface-visibility: hidden;
.downwrap-content
width: 100%;
margin-top: 20px;
text-align: center;
/**
* 由于父容器开启了preserve-3d 3D视角(iOS中只有有translateZ就相当于会默认开启),所以如果直接是drawer3d进行变换,会有一部分无法显示
* 需要中间来一个舞台,舞台占满宽高
*/
.state-3d
width: 100%;
height: 100%;
transform: translateZ(0);
-webkit-transform: translateZ(0);
perspective: 100px;
-webkit-perspective: 100px;
/*
* 视角和子元素的origin保持一致
*/
perspective-origin: center bottom;
-webkit-perspective-origin: center bottom;
.drawer3d
position: absolute;
left: 0;
bottom: 0;
width: 100%;
background: #FFFFFF;
text-align: center;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
-webkit-transform-origin: center bottom;
transform-origin: center bottom;
.drawer3d-mask
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: #D3D3D3;
/*
* 最终的透明度是计算生成的
*/
opacity: .4;