3d照片墙.html
3.52 KB
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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>css3_demo</title>
<style>
.container {
width: 100%;
}
.demo-perspective-photo {
position: absolute;
width: 100%;
height: 200px;
top: 15%;
background-color: #fff;
zoom: 2;
}
.demo-perspective-photo #stage {
width: 100%;
height: 200px;
-webkit-perspective: 800px;
-moz-perspective: 800px;
perspective: 800px;
-webkit-transition: top 0.5s;
-moz-transition: top 0.5s;
transition: top 0.5s;
position: relative;
}
.demo-perspective-photo #container {
position: absolute;
width: 64px;
height: 36px;
left: 50%;
top: 50%;
margin-left: -32px;
margin-top: -18px;
cursor: pointer;
-webkit-transition: -webkit-transform 1s;
-moz-transition: -moz-transform 1s;
transition: transform 1s;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
transform-style: preserve-3d;
-webkit-animation: photoRotate 18s ease-in-out infinite 2s;
animation: photoRotate 18s ease-in-out infinite 2s;
}
.demo-perspective-photo .piece {
width: 128px;
height:86px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
-webkit-transition: opacity 1s, -webkit-transform 1s;
-moz-transition: opacity 1s, -moz-transform 1s;
transition: opacity 1s, transform 1s;
position: absolute;
bottom: 0;
}
@-webkit-keyframes photoRotate {
0% {
-webkit-transform: rotateY(0deg);
transform: rotateY(0deg);
}
16.7% {
-webkit-transform: rotateY(60deg);
transform: rotateY(60deg);
}
33.3% {
-webkit-transform: rotateY(120deg);
transform: rotateY(120deg);
}
50% {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
66.7% {
-webkit-transform: rotateY(240deg);
transform: rotateY(240deg);
}
83.3% {
-webkit-transform: rotateY(300deg);
transform: rotateY(300deg);
}
100% {
-webkit-transform: rotateY(360deg);
transform: rotateY(360deg);
}
}
@keyframes photoRotate {
0% {
-webkit-transform: rotateY(0deg);
transform: rotateY(0deg);
}
16.7% {
-webkit-transform: rotateY(60deg);
transform: rotateY(60deg);
}
33.3% {
-webkit-transform: rotateY(120deg);
transform: rotateY(120deg);
}
50% {
-webkit-transform: rotateY(180deg);
transform: rotateY(180deg);
}
66.7% {
-webkit-transform: rotateY(240deg);
transform: rotateY(240deg);
}
83.3% {
-webkit-transform: rotateY(300deg);
transform: rotateY(300deg);
}
100% {
-webkit-transform: rotateY(360deg);
transform: rotateY(360deg);
}
}
</style>
</head>
<body>
<div class="container">
<!-- 3d照片墙 -->
<div class="demo-perspective-photo">
<div id="stage">
<div id="container">
<!-- 此处可上传自己的图片 -->
<img src="./a_src/img/1.jpg" class='piece' style="-webkit-transform: rotateY(0deg) translateZ(196px);">
<img src="./a_src/img/2.jpg" class='piece' style="-webkit-transform: rotateY(60deg) translateZ(196px);">
<img src="./a_src/img/3.jpg" class='piece' style="-webkit-transform: rotateY(120deg) translateZ(196px);">
<img src="./a_src/img/4.jpg" class='piece' style="-webkit-transform: rotateY(180deg) translateZ(196px);">
<img src="./a_src/img/5.jpg" class='piece' style="-webkit-transform: rotateY(240deg) translateZ(196px);">
<img src="./a_src/img/6.jpg" class='piece' style="-webkit-transform: rotateY(300deg) translateZ(196px);">
</div>
</div>
</div>
</div>
</html>