forked from iamouyang21/css3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
roate-div.html
85 lines (84 loc) · 2.5 KB
/
roate-div.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>纯css实现照片墙效果</title>
<link href="reset.css" rel="stylesheet" type="text/css">
<style>
body {
padding-left: 500px;
padding-top: 250px;
}
.roate-wrap {
transform-style: preserve-3d;
position: relative;
width: 128px;
height: 96px;
animation: roate 18s linear 0ms infinite;
}
.roate-div{
width: 128px;
height: 96px;
position: absolute;
bottom: 0;
transition: all 1s;
opacity: 0.5;
}
.roate-div:nth-child(1) {
transform: rotateY(0deg) translateZ(195.8px);
background-color: #fc5c65;
}
.roate-div:nth-child(2) {
transform: rotateY(40deg) translateZ(195.8px);
background-color: #fd9644;
}
.roate-div:nth-child(3) {
transform: rotateY(80deg) translateZ(195.8px);
background-color: #fed330;
}
.roate-div:nth-child(4) {
transform: rotateY(120deg) translateZ(195.8px);
background-color: #26de81;
}
.roate-div:nth-child(5) {
transform: rotateY(160deg) translateZ(195.8px);
background-color: #2bcbba;
}
.roate-div:nth-child(6) {
transform: rotateY(200deg) translateZ(195.8px);
background-color: #eb3b5a;
}
.roate-div:nth-child(7) {
transform: rotateY(240deg) translateZ(195.8px);
background-color: #fa8231;
}
.roate-div:nth-child(8) {
transform: rotateY(280deg) translateZ(195.8px);
background-color: #f7b731;
}
.roate-div:nth-child(9) {
transform: rotateY(320deg) translateZ(195.8px);
background-color: #20bf6b;
}
@keyframes roate {
from {transform: rotateY(0deg)}
to {transform: rotateY(360deg)}
}
</style>
</head>
<body>
<div style="perspective: 800px">
<div class="roate-wrap">
<div class="roate-div"></div>
<div class="roate-div"></div>
<div class="roate-div"></div>
<div class="roate-div"></div>
<div class="roate-div"></div>
<div class="roate-div"></div>
<div class="roate-div"></div>
<div class="roate-div"></div>
<div class="roate-div"></div>
</div>
</div>
</body>
</html>