Итак, задача весьма тривиальна. Нужно просто сделать так, чтобы кнопки right-cases-arrow и left-cases-arrow двигали слайдер в право и в лево соответственно. Просто я не могу понять css логику. И если что, код не мой, я его просто адаптировал, поэтому радиобаттоны снизу работают а вот кнопки не смог настроить. Помогите пожалуйста
HTML5 |
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
|
<section class="cases-screen">
<div class="container">
<div class="minicontainer2">
<h1 class="cases-main-text">КЕЙСЫ</h1>
<img class="left-cases-arrow" src="imgs/arrow.png">
<div class="c">
<h2 class="cases-before-text">ДО НАС</h2>
<input type="radio" name="a" id="cr-1" checked>
<label for="cr-1" style="--hue: 32"></label>
<div class="ci" style="--z: 4">
<h2 class="ch" style="--h: 32; --s: 80%; --l: 90%">?</h2>
<img class="img1" src="imgs/avitoDO.png" >
<img class="img2" src="imgs/avitoPosle.png" >
</div>
<input type="radio" name="a" id="cr-2">
<label for="cr-2" style="--hue: 82"></label>
<div class="ci" style="--z: 3">
<h2 class="ch" style="--h: 82; --s: 80%; --l: 90%">?</h2>
<img class="img1" src="imgs/avitoDO.png" >
<img class="img2" src="imgs/avitoPosle.png" >
</div>
<input type="radio" name="a" id="cr-3">
<label for="cr-3" style="--hue: 40"></label>
<div class="ci" style="--z: 2">
<h2 class="ch" style="--h: 40; --s: 100%; --l: 89%">?</h2>
<img class="img1" src="imgs/avitoDO.png" >
<img class="img2" src="imgs/avitoPosle.png" > </div>
<input type="radio" name="a" id="cr-4">
<label for="cr-4" style="--hue: 210"></label>
<div class="ci" style="--z: 1">
<h2 class="ch" style="--h: 210; --s: 70%; --l: 90%">?</h2>
<img class="img1" src="imgs/avitoDO.png" >
<img class="img2" src="imgs/avitoPosle.png" > </div>
<h2 class="cases-after-text">ПОСЛЕ НАС</h2>
</div>
</div>
<img class="right-cases-arrow" src="imgs/arrow.png">
</section>
</main>
<!-- MAIN -->
</div> |
|
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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
| .c {
margin-top: 130px;
width: 1500px;
height: 800px;
border-radius: 12px;
padding: 20px;
padding-bottom: 40px;
display: flex;
align-items: flex-end;
justify-content: center;
position: relative;
overflow: hidden;
background: hsla(0, 0%, 90%, 0);
box-sizing: border-box;
}
.ci {
position: absolute;
top: 0;
left: 100px;
width: inherit;
height: inherit;
transform-origin: left 50%;
background: inherit;
z-index: var(--z);
transition: 0.7s ease-out; /*скорость перехода*/
}
.ci img {
-moz-user-select: none;
user-select: none;
width: 900px;
}
.img1 {
margin-top: -5px;
margin-left: -5px;
}
.img2 {
margin-top: -150px;
margin-left: 380px;
}
.ch {
position: absolute;
top: 20%;
right: 20%;
transform: translateY(-50%);
font-size: 2rem;
text-shadow: 0 2px 10px hsla(var(--h) var(--s) 10% / .3);
}
input {
position: absolute;
left: 0;
top: 0;
opacity: 0;
z-index: -10;
}
label {
margin-bottom: -30px;
width: 10%;
height: 10px;
margin-right: 4px;
border-radius: 20px;
background: hsla(0, 0%, 79%, 0.575);
cursor: pointer;
position: relative;
z-index: 10;
}
label:last-child {
margin-right: 0;
}
input:checked+label {
background-color: rgba(137, 43, 226, 0.712);
}
input:not(:checked)+label+.ci {
transform: translateX(-100%);
opacity: 0;
}
input:checked+label+.ci~.ci {
transform: translateX(100%);
}
input:not(:checked)+label+.ci {
transition: 0;
}
/*/////////////////////////////ОСТАЛЬНОЕ///////////////////////////////////*/
.minicontainer2 {
display: flex;
flex-wrap: wrap;
justify-content: center;
position: relative;
align-items: center;
}
.cases-main-text {
position: absolute;
top: 0;
right: 160px;
font-size: 184px;
color: #7826df;
}
.cases-before-text {
transform: rotate(270deg);
font-size: 30px;
top: 190px;
left: 0;
position: absolute;
color: #7826df;
}
.cases-after-text {
transform: rotate(270deg);
font-size: 30px;
right: 0;
bottom: 190px;
position: absolute;
color: #7826df;
}
.left-cases-arrow {
left: 10;
top: 50%;
transform: rotate(180deg);
cursor: pointer;
}
.right-cases-arrow {
right: 5%;
top: 44.5%;
position: absolute;
cursor: pointer;
z-index: 15;
} |
|