Skip to content

Commit 774f6bd

Browse files
committed
testimonials
1 parent 2c58a34 commit 774f6bd

File tree

3 files changed

+68
-25
lines changed

3 files changed

+68
-25
lines changed

client/src/Testimonial.js

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,44 @@
11
import { Swiper, SwiperSlide } from 'swiper/react';
2-
import { Navigation, Pagination, EffectCoverflow, Thumbs, Autoplay } from 'swiper';
2+
import { Navigation, Pagination, EffectCoverflow, Thumbs, Autoplay, FreeMode } from 'swiper';
33
import { useState } from 'react';
44

55
import 'swiper/css';
66
import 'swiper/css/navigation';
77
import 'swiper/css/pagination';
88
import 'swiper/css/effect-coverflow';
99
import 'swiper/css/thumbs';
10+
import "swiper/css/free-mode";
1011

1112
export default function TestimonialSection() {
1213

1314
const [thumbsSwiper, setThumbsSwiper] = useState(null);
1415

1516
return (
17+
<>
1618
<section id="testimonial" className="spacer">
1719
<div className="testimonial-section">
1820
<div className="testi-user-img">
19-
<Swiper
20-
className="gallery-thumbs"
21-
spaceBetween={10}
22-
slidesPerView={4}
23-
// slideToClickedSlide
24-
watchSlidesProgress
25-
onSwiper={setThumbsSwiper}
26-
>
21+
<Swiper
22+
className="gallery-thumbs"
23+
effect={'coverflow'}
24+
grabCursor={true}
25+
centeredSlides={true}
26+
loop={true}
27+
slidesPerView={'auto'}
28+
coverflowEffect={{
29+
rotate: 0,
30+
stretch: 0,
31+
depth: 100,
32+
modifier: 5.5,
33+
}}
34+
pagination={{ el: '.swiper-pagination', clickable: true }}
35+
autoplay={{
36+
delay: 3000,
37+
disableOnInteraction: false
38+
}}
39+
thumbs={{swiper: thumbsSwiper && !thumbsSwiper.destroyed ? thumbsSwiper : null}}
40+
modules={[EffectCoverflow, Pagination, Navigation, Autoplay, Thumbs, FreeMode]}
41+
>
2742
<SwiperSlide>
2843
<img className="u3" src="http://placekitten.com/100/150" alt="" />
2944
</SwiperSlide>
@@ -41,16 +56,13 @@ export default function TestimonialSection() {
4156
<div className="user-saying">
4257
<Swiper
4358
className="testimonial"
44-
spaceBetween={30}
4559
direction="vertical"
46-
pagination={{ clickable: true }}
47-
modules={[Navigation, Pagination, EffectCoverflow, Thumbs, Autoplay]}
48-
autoplay={{
49-
delay: 3000,
50-
disableOnInteraction: false
51-
}}
52-
// thumbs={{ swiper: ".gallery-thumbs" }}
53-
thumbs={{ swiper: thumbsSwiper && !thumbsSwiper.destroyed ? thumbsSwiper : null }}
60+
onSwiper={setThumbsSwiper}
61+
spaceBetween={10}
62+
slidesPerView={1}
63+
freeMode={true}
64+
watchSlidesProgress={true}
65+
modules={[FreeMode, Navigation, Thumbs]}
5466
>
5567
<SwiperSlide>
5668
<div className="quote">
@@ -96,5 +108,7 @@ export default function TestimonialSection() {
96108
</div>
97109
</div>
98110
</section>
111+
</>
112+
99113
)
100114
}

client/src/assets/css/App.css

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ a{
66
}
77
body{
88
color: #222;
9-
}
10-
img{
9+
} */
10+
/* img{
1111
max-width: 100%;
1212
}
1313
main{
1414
padding: 10px;
1515
max-width: 960px;
1616
margin: 0 auto;
17-
}
18-
header{
17+
} */
18+
/* header{
1919
display:flex;
2020
justify-content:space-between;
2121
margin-top: 20px;
@@ -33,7 +33,10 @@ header a.logo{
3333
header nav{
3434
display:flex;
3535
gap: 24px;
36-
}
36+
} */
37+
38+
39+
3740

3841
div.post{
3942
display: grid;
@@ -71,7 +74,7 @@ div.post p.summary{
7174
line-height: 1.8rem;
7275
}
7376

74-
form.login, form.register{
77+
/* form.login, form.register{
7578
max-width: 400px;
7679
margin: 0 auto;
7780
}
@@ -194,7 +197,7 @@ body > section {
194197
}
195198

196199
.textContainer{
197-
width:50%;
200+
width: 45%;
198201
}
199202
.textContainer p{
200203
width: 100% !important;
@@ -3129,6 +3132,7 @@ justify-content: center;
31293132
padding-left: 100px;
31303133
padding-right: 100px;
31313134
}
3135+
31323136
.swiper-container.testimonial {
31333137
/* height: 100vh; */
31343138
}
@@ -3171,4 +3175,23 @@ display: block;
31713175
margin-bottom: 30px;
31723176
}
31733177

3178+
@media all and (max-width: 920px) {
3179+
.testimonial-section .quote {
3180+
padding-left: 75px;
3181+
}
3182+
}
3183+
3184+
@media all and (max-width: 766px) {
3185+
.testi-user-img{
3186+
display: none;
3187+
}
3188+
.testimonial-section .user-saying {
3189+
width: 100% !important;
3190+
}
3191+
3192+
.testimonial-section .quote {
3193+
padding-left: 100px;
3194+
}
3195+
}
3196+
31743197
/* Modal */

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)