-
Notifications
You must be signed in to change notification settings - Fork 2
/
css3实现3D轮播.html
133 lines (124 loc) · 3.36 KB
/
css3实现3D轮播.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>3d轮播</title>
<style type="text/css">
@keyframes scroll {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(360deg);
}
}
body {
background: #f9f9f9;
}
.my-container {
width: 800px;
height: 500px;
margin: 20px auto;
/*border: 1px solid red;*/
}
.photo-wrap {
perspective: 800px;
width: 800px;
}
.container {
width: 800px;
height: 500px;
margin: 0 auto;
position: relative;
transform-style: preserve-3d;
transition: transform 1s;
animation: scroll 16s infinite;
}
.img {
width: 200px;
height: 118px;
line-height: 118px;
text-align: center;
position: absolute;
top: 160px;
left: 300px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.9) inset;
background: pink;
}
.img01 {
transform: rotateY(0deg) translateZ(300px);
}
.img02 {
transform: rotateY(40deg) translateZ(300px);
}
.img03 {
transform: rotateY(80deg) translateZ(300px);
}
.img04 {
transform: rotateY(120deg) translateZ(300px);
}
.img05 {
transform: rotateY(160deg) translateZ(300px);
}
.img06 {
transform: rotateY(200deg) translateZ(300px);
}
.img07 {
transform: rotateY(240deg) translateZ(300px);
}
.img08 {
transform: rotateY(280deg) translateZ(300px);
}
.img09 {
transform: rotateY(320deg) translateZ(300px);
}
.prev {
width: 30px;
height: 70px;
color: #6d8099;
float: left;
font-size: 22px;
background: #ddd;
line-height: 70px;
text-align: center;
position: relative;
bottom: -175px;
border-radius: 5px;
z-index: 100;
}
.next {
width: 30px;
height: 70px;
color: #6d8099;
float: right;
font-size: 22px;
background: #ddd;
line-height: 70px;
text-align: center;
position: relative;
bottom: -175px;
border-radius: 5px;
z-index: 100;
}
</style>
</head>
<body>
<div class="my-container">
<!-- <div class="prev"><</div> -->
<div class="photo-wrap"> <!-- 舞台 -->
<div class="container"> <!-- 容器 -->
<div class="img img01">1</div>
<div class="img img02">2</div>
<div class="img img03">3</div>
<div class="img img04">4</div>
<div class="img img05">5</div>
<div class="img img06">6</div>
<div class="img img07">7</div>
<div class="img img08">8</div>
<div class="img img09">9</div>
</div>
</div>
<!-- <div class="next">></div> -->
</div>
</body>
</html>