-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.css
135 lines (129 loc) · 2.76 KB
/
demo.css
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
*{
padding: 0;
margin: 0;
list-style: none;
}
.wrapper{
width: 700px;
margin: 0 auto;
border: 1px solid #000;
}
.wrapper ul{
width: 100%;
display: flex;
justify-content: center;
flex-wrap: wrap;
}
.wrapper ul li{
width: 200px;
height: 200px;
margin: 10px;
perspective: 300px;
}
.wrapper .picBox{
width: 100%;
height: 100%;
position: relative;
transform-style: preserve-3d;
transform-origin: 50% 50% -100px;
animation: 0.3s ease-out forwards;
}
.wrapper .picBox .show,
.wrapper .picBox .hide{
width: 100%;
height: 100%;
opacity: 0.7;
}
.wrapper .picBox .show img{
width: 100%;
height: 100%;
}
.wrapper .picBox .hide{
position: absolute;
left: 0;
top: 0;
background: #000;
color: #fff;
text-align: center;
line-height: 200px;
transform:translate3d(0,0,-1px);
}
.wrapper .picBox .show{
transform:translate3d(0,0,1px);
}
.wrapper .in-top .picBox{
animation-name: in-top;
}
.wrapper .out-top .picBox{
animation-name: out-top;
}
.wrapper .in-bottom .picBox{
animation-name: in-bottom;
}
.wrapper .out-bottom .picBox{
animation-name: out-bottom;
}
.wrapper .in-left .picBox{
animation-name: in-left;
}
.wrapper .out-left .picBox{
animation-name: out-left;
}
.wrapper .in-right .picBox{
animation-name: in-right;
}
.wrapper .out-right .picBox{
animation-name: out-right;
}
@keyframes in-top{
0%{ transform:rotate3d(0,0,0,0) }
100%{ transform:rotate3d(1,0,0,-90deg) }
}
@keyframes out-top{
0%{ transform:rotate3d(1,0,0,-90deg) }
100%{ transform:rotate3d(0,0,0,0) }
}
@keyframes in-bottom{
0%{ transform:rotate3d(0,0,0,0) }
100%{ transform:rotate3d(1,0,0,90deg) }
}
@keyframes out-bottom{
0%{ transform:rotate3d(1,0,0,90deg) }
100%{ transform:rotate3d(0,0,0,0) }
}
@keyframes in-left{
0%{ transform:rotate3d(0,0,0,0) }
100%{ transform:rotate3d(0,1,0,90deg) }
}
@keyframes out-left{
0%{ transform:rotate3d(0,1,0,90deg) }
100%{ transform:rotate3d(0,0,0,0) }
}
@keyframes in-right{
0%{ transform:rotate3d(0,0,0,0) }
100%{ transform:rotate3d(0,1,0,-90deg) }
}
@keyframes out-right{
0%{ transform:rotate3d(0,1,0,-90deg) }
100%{ transform:rotate3d(0,0,0,0) }
}
.wrapper .in-top .picBox .hide,
.wrapper .out-top .picBox .hide{
transform-origin: bottom;
transform: translate3d(0,-100%,0) rotate3d(1,0,0,90deg);
}
.wrapper .out-bottom .picBox .hide,
.wrapper .in-bottom .picBox .hide{
transform-origin: top;
transform: translate3d(0,100%,0) rotate3d(1,0,0,-90deg);
}
.wrapper .out-left .picBox .hide,
.wrapper .in-left .picBox .hide{
transform-origin: right;
transform: translate3d(-100%,0,0) rotate3d(0,1,0,-90deg);
}
.wrapper .out-right .picBox .hide,
.wrapper .in-right .picBox .hide{
transform-origin: left;
transform: translate3d(100%,0,0) rotate3d(0,1,0,90deg);
}