Skip to content

Commit 8f85896

Browse files
committed
improve skills component
1 parent ad09097 commit 8f85896

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

public/src/app/components/landing/skills/skills.component.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export class SkillsComponent implements OnInit {
5959

6060
ngAfterViewInit() {
6161
this.initSwiper();
62+
this.mySwiper.destroy();
63+
setTimeout(() => { this.initSwiper(); }, 20);
6264
}
6365
previousSlide() {
6466
this.mySwiper.slidePrev();
@@ -76,12 +78,13 @@ export class SkillsComponent implements OnInit {
7678
if(this.mySwiper) this.mySwiper.update();
7779
}
7880
initSwiper() {
79-
this.mySwiper = new Swiper('.skills__body', {
80-
paginationClickable: false,
81-
grabCursor: true,
82-
loop: true,
83-
slidesPerView: this.slidesPerView
84-
});
81+
this.mySwiper = new Swiper('.skills__body', {
82+
autoplay: 3000,
83+
paginationClickable: false,
84+
grabCursor: true,
85+
loop: true,
86+
slidesPerView: this.slidesPerView
87+
});
8588
}
8689
ngOnInit() {
8790
this.handleSlidesAmount();
@@ -91,7 +94,7 @@ export class SkillsComponent implements OnInit {
9194
if (res) {
9295
console.log('destroy swiper');
9396
this.mySwiper.destroy();
94-
setTimeout(() => { this.initSwiper() }, 20);
97+
setTimeout(() => { this.initSwiper(); }, 20);
9598
this.storeService.setLangChanged(false);
9699
}
97100
}

0 commit comments

Comments
 (0)