-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathtransitions.html
163 lines (141 loc) · 5.13 KB
/
transitions.html
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>过渡效果 | www.waylau.com</title>
<meta name="description" content="过渡效果">
<meta name="author" content="Way Lau, www.waylau.com"/>
<meta name="viewport" content="width=device-width">
<link rel="shortcut icon" href="/favicon.ico">
<style>
.example {
width: 100px;
height: 100px;
background: red;
transition-property: width;
transition-duration: 1s;
transition-timing-function: linear;
transition-delay: 2s;
/* Safari */
-webkit-transition-property: width;
-webkit-transition-duration: 1s;
-webkit-transition-timing-function: linear;
-webkit-transition-delay: 2s;
}
.example:hover {
width: 200px;
}
#example {
position: relative;
width: 530px;
height: 530px;
margin: 0 auto 10px;
padding: 10px;
}
.childbox {
font-size: 12px;
position: relative;
width: 60px;
height: 60px;
margin-bottom: 10px;
background-color: #ccc;
}
.childbox p {
text-align: center;
padding-top: 10px;
}
#ease.childbox {
-webkit-transition: all 4s ease;
-moz-transition: all 4s ease;
-o-transition: all 4s ease;
transition: all 4s ease;
border: 1px solid #ff0000;
}
#ease_in.childbox {
-webkit-transition: all 4s ease-in;
-moz-transition: all 4s ease-in;
-o-transition: all 4s ease-in;
transition: all 4s ease-in;
border: 1px solid #00ffff;
}
#ease_out.childbox {
-webkit-transition: all 4s ease-out;
-moz-transition: all 4s ease-out;
-o-transition: all 4s ease-out;
transition: all 4s ease-out;
border: 1px solid #f5f5f5;
}
#ease_in_out.childbox {
-webkit-transition: all 4s ease-in-out;
-moz-transition: all 4s ease-in-out;
-o-transition: all 4s ease-in-out;
transition: all 4s ease-in-out;
border: 1px solid #f209f3;
}
#linear.childbox {
-webkit-transition: all 4s linear;
-moz-transition: all 4s linear;
-o-transition: all 4s linear;
transition: all 4s linear;
border: 1px solid #ddddff;
}
#custom.childbox {
-webkit-transition: all 4s cubic-bezier(1.000, 0.835, 0.000, 0.945);
-moz-transition: all 4s cubic-bezier(1.000, 0.835, 0.000, 0.945);
-o-transition: all 4s cubic-bezier(1.000, 0.835, 0.000, 0.945);
transition: all 4s cubic-bezier(1.000, 0.835, 0.000, 0.945);
border: 1px solid #cfdf44;
}
#negative.childbox {
-webkit-transition: all 4s cubic-bezier(1.000, -0.530, 0.405, 1.425);
-moz-transition: all 4s cubic-bezier(1.000, -0.530, 0.405, 1.425);
-o-transition: all 4s cubic-bezier(1.000, -0.530, 0.405, 1.425);
transition: all 4s cubic-bezier(1.000, -0.530, 0.405, 1.425);
border: 1px solid #000;
}
#steps-start.childbox {
-webkit-transition: all 4s steps(4, start);
-moz-transition: all 4s steps(4, start);
-o-transition: all 4s steps(4, start);
transition: all 4s steps(4, start);
border: 1px solid #ff0;
}
#steps-end.childbox {
-webkit-transition: all 4s steps(4, end);
-moz-transition: all 4s steps(4, end);
-o-transition: all 4s steps(4, end);
transition: all 4s steps(4, end);
border: 1px solid #0f0;
}
#example:hover .childbox, #example.hover_effect .childbox {
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
-webkit-transform: rotate(720deg);
-moz-transform: rotate(720deg);
-o-transform: rotate(720deg);
-ms-transform: rotate(720deg);
transform: rotate(720deg);
margin-left: 420px;
background-color: #fff;
}
</style>
</head>
<body>
<p>鼠标移动到 div 元素上,查看过渡效果。</p>
<p><b>注意:</b> 过渡效果需要等待两秒后才开始。</p>
<div class="example"></div>
<p>Hover on object to see it in action</p>
<div id="example">
<div id="ease" class="childbox"><p>CSS3</p></div>
<div id="ease_in" class="childbox"><p>CSS3</p></div>
<div id="ease_out" class="childbox"><p>CSS3</p></div>
<div id="ease_in_out" class="childbox"><p>CSS3</p></div>
<div id="linear" class="childbox"><p>CSS3</p></div>
<div id="custom" class="childbox"><p>CSS3</p></div>
<div id="negative" class="childbox"><p>CSS3</p></div>
<div id="steps-start" class="childbox"><p>CSS3</p></div>
<div id="steps-end" class="childbox"><p>CSS3</p></div>
</div>
</body>
</html>