Skip to content

Commit 787c9c8

Browse files
committed
Swiper Update
1 parent 3063d07 commit 787c9c8

File tree

1 file changed

+21
-20
lines changed

1 file changed

+21
-20
lines changed

screenshots.html

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@
2222
<style>
2323
html,
2424
body {
25+
font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
26+
font-size: 14px;
27+
margin: 0;
28+
padding: 0;
2529
position: relative;
2630
height: 100%;
31+
background: #111;
32+
color: #111;
2733
}
2834
body {
2935
background: #343432;
@@ -35,36 +41,25 @@
3541
}
3642
.swiper {
3743
width: 100%;
38-
height: 100%;
44+
height: 300px;
45+
margin-left: auto;
46+
margin-right: auto;
3947
}
4048
.swiper-slide {
4149
text-align: center;
4250
font-size: 18px;
43-
background: #343432;
4451
display: flex;
4552
justify-content: center;
4653
align-items: center;
54+
background-size: cover;
55+
background: #343432 center;
4756
}
4857
.swiper-slide img {
4958
display: block;
5059
max-width: 100%;
5160
max-height: 100%;
5261
object-fit: cover;
5362
}
54-
body {
55-
background: #111;
56-
color: #111;
57-
}
58-
.swiper {
59-
width: 100%;
60-
height: 300px;
61-
margin-left: auto;
62-
margin-right: auto;
63-
}
64-
.swiper-slide {
65-
background-size: cover;
66-
background-position: center;
67-
}
6863
.mySwiper2 {
6964
height: 80%;
7065
width: 100%;
@@ -149,18 +144,24 @@
149144
</div>
150145

151146
<script src="https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js"></script>
147+
152148
<script>
153149
var swiper = new Swiper(".mySwiper", {
154-
spaceBetween: 10,
155-
slidesPerView: 5,
156150
freeMode: true,
151+
grabCursor: true,
152+
loop: true,
153+
mousewheel: true,
154+
slidesPerView: 5,
155+
spaceBetween: 10,
157156
watchSlidesProgress: true,
158157
});
159158
var swiper2 = new Swiper(".mySwiper2", {
160-
spaceBetween: 10,
161-
mousewheel: true,
162159
grabCursor: true,
160+
effect: 'fade',
163161
loop: true,
162+
mousewheel: true,
163+
spaceBetween: 10,
164+
zoom: true,
164165
keyboard: {
165166
enabled: true,
166167
},

0 commit comments

Comments
 (0)