import { AfterContentChecked, Component, ViewChild, ViewEncapsulation } from '@angular/core';
import {SwiperComponent} from 'swiper/angular';
import { SwiperOptions } from 'swiper';
import SwiperCore, { Pagination,Autoplay,Navigation,Keyboard } from 'swiper';

SwiperCore.use([Pagination, Autoplay, Navigation, Keyboard]);
@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss'],
  encapsulation: ViewEncapsulation.None
})
export class HomePage implements AfterContentChecked {
  
  @ViewChild('swiper') swiper: SwiperComponent;

  config: SwiperOptions = {
    slidesPerView: 1,  
    pagination: { clickable: true },
    autoplay: {
      delay: 200,
      disableOnInteraction: false,
    },
    loop: true,
    navigation: true,
  }

  constructor() {}

  ngAfterContentChecked() {
    if (this.swiper) {
      this.swiper.updateSwiper({});
    }    
  }

}
