-
Notifications
You must be signed in to change notification settings - Fork 0
/
Css--animation.html
76 lines (76 loc) · 1.68 KB
/
Css--animation.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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Css--animation</title>
</head>
<style>
div{display: inline-block;margin: 0 auto;padding: 10px;}
/* 旋转 */
.rotating_x:hover{
animation: rotating_x 2s infinite;
}
@keyframes rotating_x{
0%{
transform: rotateX(0deg)
}
50%{
transform: rotateX(360deg)
}
100%{
transform: rotateX(0deg)
}
}
.rotating_y:hover{
animation: rotating_y 2s infinite;
}
@keyframes rotating_y{
0%{
transform: rotateY(0deg)
}
50%{
transform: rotateY(360deg)
}
100%{
transform: rotateY(0deg)
}
}
.rotating_z:hover{
animation: rotating_z 2s infinite;
}
@keyframes rotating_z{
0%{
transform: rotateZ(0deg)
}
50%{
transform: rotateZ(360deg)
}
100%{
transform: rotateZ(0deg)
}
}
.scale:hover{
animation: scale 2s ease-in-out infinite;
}
@keyframes scale{
0%{
transform: scale(1)
}
50%{
transform: scale(1.5)
}
100%{
transform: scale(1)
}
}
</style>
<body>
<div class='rotating_x'>X旋转动画</div>
<div class='rotating_y'>Y旋转动画</div>
<div class='rotating_z'>Z旋转动画</div>
<div class='scale'>缩放</div>
</body>
</html>