File tree Expand file tree Collapse file tree 6 files changed +76
-21
lines changed Expand file tree Collapse file tree 6 files changed +76
-21
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
25
25
- Header.js component
26
26
- reCAPTCHA
27
27
- useIntersect Hook, Reveal container for scrolling using intersection API
28
+ - A new swipable feature on CardColumns.js
28
29
29
30
### Fixed
30
31
@@ -37,3 +38,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
37
38
- installed yarn
38
39
- normalized buttons' and links' styling
39
40
- updated ` package.json ` commands for macOs
41
+
42
+
Original file line number Diff line number Diff line change
1
+ import { Swiper , SwiperSlide } from 'swiper/react' ;
2
+ import { Pagination , Navigation } from 'swiper' ;
3
+ import 'swiper/css' ;
4
+ import "swiper/css/pagination" ;
5
+ import "swiper/css/navigation" ;
6
+
1
7
import Card from './Card' ;
2
8
import Container from './Container' ;
3
9
import styles from '../styles/CardsColumns.module.scss' ;
@@ -11,22 +17,42 @@ export default function CardsColumns({
11
17
linkText,
12
18
} ) {
13
19
return (
14
- < Container >
15
- < div className = { styles . inner__content } >
16
- { titles . map ( ( title , index ) => {
17
- return (
18
- < Card
19
- title = { title }
20
- image = { images [ index ] }
21
- altTag = { altTags [ index ] }
22
- content = { content [ index ] }
23
- link = { links [ index ] }
24
- linkText = { linkText [ index ] }
25
- key = { index }
26
- />
27
- ) ;
28
- } ) }
29
- </ div >
30
- </ Container >
20
+ < Container >
21
+ < Swiper className = { styles . swiper }
22
+ mousewheel = { true }
23
+ grabCursor = { true }
24
+ modules = { [ Pagination ] }
25
+ pagination
26
+ centerInsufficientSlides = { true }
27
+ slidesPerView = { 1.09 }
28
+ breakpoints = { {
29
+ 769 : {
30
+ slidesPerView : 2 ,
31
+ spaceBetween : 50 ,
32
+ } ,
33
+ 1334 : {
34
+ slidesPerView : 3 ,
35
+ spaceBetween : 50 ,
36
+ }
37
+ } }
38
+ >
39
+ { titles . map ( ( title , index ) =>
40
+ < SwiperSlide key = { index } className = { styles . swiperSlide } >
41
+ < div className = { styles . inner__content } >
42
+ < Card
43
+ title = { title }
44
+ image = { images [ index ] }
45
+ altTag = { altTags [ index ] }
46
+ content = { content [ index ] }
47
+ link = { links [ index ] }
48
+ linkText = { linkText [ index ] }
49
+ key = { index }
50
+ />
51
+ </ div >
52
+ </ SwiperSlide >
53
+ ) }
54
+
55
+ </ Swiper >
56
+ </ Container >
31
57
) ;
32
58
}
Original file line number Diff line number Diff line change 17
17
"react-dom" : " 17.0.1" ,
18
18
"react-google-recaptcha" : " ^2.1.0" ,
19
19
"react-mailchimp-subscribe" : " ^2.1.3" ,
20
- "sass" : " ^1.35.1"
20
+ "sass" : " ^1.35.1" ,
21
+ "swiper" : " ^8.2.2"
21
22
}
22
23
}
Original file line number Diff line number Diff line change 7
7
border-radius : 1.5rem ;
8
8
box-shadow : $box-shadow ;
9
9
min-width : 32% ;
10
+ height : 37rem ;
10
11
11
12
@include desktop {
12
- flex-basis : 32 % ;
13
+
13
14
margin : 1.5rem 1.5rem 0 1.5rem ;
14
15
15
16
& :first-child ,
Original file line number Diff line number Diff line change 3
3
4
4
.inner__content {
5
5
margin : 0 auto ;
6
- padding-bottom : 12 rem ;
6
+ padding-bottom : 4 rem ;
7
7
justify-content : center ;
8
8
9
9
@include desktop-breakpoint-plus {
10
10
display : flex ;
11
11
}
12
12
13
13
@include desktop-breakpoint-minus {
14
- padding-bottom : 5 rem ;
14
+ padding-bottom : 1 rem ;
15
15
}
16
16
}
17
+
18
+ .swiper {
19
+ margin-bottom : 6rem ;
20
+ }
Original file line number Diff line number Diff line change @@ -114,6 +114,13 @@ debug@^2.1.3:
114
114
dependencies :
115
115
ms "2.0.0"
116
116
117
+ dom7@^4.0.4 :
118
+ version "4.0.4"
119
+ resolved "https://registry.yarnpkg.com/dom7/-/dom7-4.0.4.tgz#8b68c5d8e5e2ed0fddb1cb93e433bc9060c8f3fb"
120
+ integrity sha512-DSSgBzQ4rJWQp1u6o+3FVwMNnT5bzQbMb+o31TjYYeRi05uAcpF8koxdfzeoe5ElzPmua7W7N28YJhF7iEKqIw==
121
+ dependencies :
122
+ ssr-window "^4.0.0"
123
+
117
124
fill-range@^7.0.1 :
118
125
version "7.0.1"
119
126
resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
@@ -340,11 +347,24 @@ scheduler@^0.20.1:
340
347
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c"
341
348
integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==
342
349
350
+ ssr-window@^4.0.0, ssr-window@^4.0.2 :
351
+ version "4.0.2"
352
+ resolved "https://registry.yarnpkg.com/ssr-window/-/ssr-window-4.0.2.tgz#dc6b3ee37be86ac0e3ddc60030f7b3bc9b8553be"
353
+ integrity sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==
354
+
343
355
344
356
version "5.0.1"
345
357
resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.1.tgz#78fecbbad2bf95ce6cd981a08918ce4696f5fc80"
346
358
integrity sha512-+PIZ/6Uk40mphiQJJI1202b+/dYeTVd9ZnMPR80pgiWbjIwvN2zIp4r9et0BgqBuShh48I0gttPlAXA7WVvBxw==
347
359
360
+ swiper@^8.2.2 :
361
+ version "8.2.2"
362
+ resolved "https://registry.yarnpkg.com/swiper/-/swiper-8.2.2.tgz#d16e9d92ec9b5548399c06f2cda9c400f9f32352"
363
+ integrity sha512-t7Tts4ZD2ahM3InsHDlZ6YY4gi47zepGHx25cACd6fzgcVdAtYLbUihnEmck0HsDzqtkhciyfKsoUEhummZDEA==
364
+ dependencies :
365
+ dom7 "^4.0.4"
366
+ ssr-window "^4.0.2"
367
+
348
368
to-querystring@^1.0.4 :
349
369
version "1.1.1"
350
370
resolved "https://registry.yarnpkg.com/to-querystring/-/to-querystring-1.1.1.tgz#98de5b00c79768a98ca48a2c09a960238d960265"
You can’t perform that action at this time.
0 commit comments