-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcarousel.css
80 lines (72 loc) · 1.89 KB
/
carousel.css
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
/* body {
margin: 0;
background: lightgray;
text-align: center;
font-family: sans-serif;
color: #fefefe;
} */
.carcontainer {
position: relative;
width: 320px;
margin: 100px auto 0 auto;
perspective: 900px;
padding-bottom: 350px;
padding-top: 40px;
}
.carousel {
position: absolute;
width: 100%;
height: 100%;
transform-style: preserve-3d;
animation: rotate360 60s infinite forwards linear;
}
.carousel__face {
position: absolute;
width: 300px;
height: 187px;
top: 20px;
left: 10px;
right: 10px;
background-size: cover;
box-shadow:inset 0 0 0 2000px rgba(0, 0, 0, 0.042);
display: flex;
}
span {
margin: auto;
font-size: 2rem;
}
.carousel__face:nth-child(1) {
background-image: url("carousel/6.jpg");
transform: rotateY( 0deg) translateZ(430px); }
.carousel__face:nth-child(2) {
background-image: url("carousel/7.jpg");
transform: rotateY( 40deg) translateZ(430px); }
.carousel__face:nth-child(3) {
background-image: url("carousel/11.jpg");
transform: rotateY( 80deg) translateZ(430px); }
.carousel__face:nth-child(4) {
background-image: url("carousel/17.jpg");
transform: rotateY(120deg) translateZ(430px); }
.carousel__face:nth-child(5) {
background-image: url("carousel/16.jpg");
transform: rotateY(160deg) translateZ(430px); }
.carousel__face:nth-child(6) {
background-image: url("carousel/14.jpg");
transform: rotateY(200deg) translateZ(430px); }
.carousel__face:nth-child(7) {
background-image: url("carousel/12.jpg");
transform: rotateY(240deg) translateZ(430px); }
.carousel__face:nth-child(8) {
background-image: url("carousel/3.jpg");
transform: rotateY(280deg) translateZ(430px); }
.carousel__face:nth-child(9) {
background-image: url("carousel/4.jpg");
transform: rotateY(320deg) translateZ(430px); }
@keyframes rotate360 {
from {
transform: rotateY(0deg);
}
to {
transform: rotateY(-360deg);
}
}