-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcarousel.css
59 lines (50 loc) · 1.06 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
/* CAROUSEL CSS */
.carousel {
width: 100%;
max-width: 800px;
max-height: 600px;
height: 40vh;
transform-style: preserve-3d;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
}
.cc-img {
object-fit: cover;
width: 100%;
}
.ccard {
position: absolute;
width: 75%;
height: 100%;
left: 0;
right: 0;
margin: auto;
transition: transform .4s ease;
cursor: pointer;
}
.cards {
position: relative;
width: 100%;
height: 100%;
margin-bottom: 20px;
}
#item-1:checked ~ .cards #card-3, #item-2:checked ~ .cards #card-1, #item-3:checked ~ .cards #card-2 {
transform: translatex(-40%) scale(.8);
opacity: .4;
z-index: 0;
}
#item-1:checked ~ .cards #card-2, #item-2:checked ~ .cards #card-3, #item-3:checked ~ .cards #card-1 {
transform: translatex(40%) scale(.8);
opacity: .4;
z-index: 0;
}
#item-1:checked ~ .cards #card-1, #item-2:checked ~ .cards #card-2, #item-3:checked ~ .cards #card-3 {
transform: translatex(0) scale(1);
opacity: 1;
z-index: 1;
}
input[type=radio] {
display: none;
}