aboutus.component.ts 4.06 KB
Newer Older
Ooh-Ao committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
import { Component, ElementRef, ViewChild } from '@angular/core';
import KeenSlider, { KeenSliderHooks, KeenSliderInstance } from 'keen-slider';
import { OwlOptions } from 'ngx-owl-carousel-o';
import SwiperCore, {
  Navigation,
  Pagination,
  Scrollbar,
  A11y,
  Virtual,
  Zoom,
  Autoplay,
  Thumbs,
} from 'swiper';
export interface PhotosApi {
  albumId?: number;
  id?: number;
  title?: string;
  url?: string;
  thumbnailUrl?: string;
}

SwiperCore.use([
  Navigation,
  Pagination,
  Scrollbar,
  A11y,
  Virtual,
  Zoom,
  Autoplay,
  Thumbs,
]);

@Component({
  selector: 'app-aboutus',  
  templateUrl: './aboutus.component.html',
  styleUrls: ['./aboutus.component.scss'],
})
export class AboutusComponent {
  @ViewChild('sliderRef')
  sliderRef!: ElementRef<HTMLElement>;

  slider: KeenSliderInstance<object, object, KeenSliderHooks> | null = null;

  constructor() {
    document.querySelector('#maincontent')?.classList.remove('main-content');
  }

  ngAfterViewInit() {
    if (this.sliderRef && this.sliderRef.nativeElement) {
      this.slider = new KeenSlider(this.sliderRef.nativeElement, {
        loop: true,
        mode: 'free',
        slides: {
          perView: 4,
          spacing: 10,
        },
      });

      this.slider.on('created', () => {
        setInterval(() => {
          this.slider?.next();
        }, 5000); // Adjust autoplay duration (in milliseconds)
      });
    }
  }

  ngOnDestroy() {
    document.querySelector('#maincontent')?.classList.add('main-content');
    if (this.slider) this.slider.destroy();
  }
  sliderOptions: any = {
    slidesPerView: 3, // Default number of slides per view
    breakpoints: {
      600: {
        slidesPerView: 1, // Number of slides per view for screens below 600px width
      },
      900: {
        slidesPerView: 2, // Number of slides per view for screens below 900px width
      },
    },
  };
  // ngx owl carousel
  customOptions: OwlOptions = {
    loop: true,
    mouseDrag: true,
    autoplay: true,
    touchDrag: true,
    pullDrag: true,
    dots: false,
    nav: false,
    navText: [
      '<button type="button" role="presentation" class="owl-prev"><span aria-label="Previous">‹</span></button>',
      '<button type="button" role="presentation" class="owl-next"><span aria-label="Next">›</span></button>',
    ],
    margin: 15,
    autoWidth: false,
    autoHeight: false,
    navSpeed: 100,

    responsive: {
      0: {
        items: 1,
      },
      400: {
        items: 2,
      },
      740: {
        items: 3,
      },
      1200: {
        items: 4,
      },
    },
  };

  slidesStore = [
    {
      id: '1',
      src: './assets/img/users/2.jpg',
      title: 'UI Developer',
      summary:
        'Synth chartreuse iPhone lomo cray raw denim brunch everyday carry neutra before they sold out fixie 90s microdosing. Tacos pinterest fanny pack venmo.',
      name: 'Socrates Itumay',
    },

    {
      id: '2',
      src: './assets/img/users/12.jpg',
      title: 'UI Developer',
      summary:
        'Synth chartreuse iPhone lomo cray raw denim brunch everyday carry neutra before they sold out fixie 90s microdosing. Tacos pinterest fanny pack venmo.',
      name: 'Socrates Itumay',
    },

    {
      id: '3',
      src: './assets/img/users/10.jpg',
      title: 'UI Developer',
      summary:
        'Synth chartreuse iPhone lomo cray raw denim brunch everyday carry neutra before they sold out fixie 90s microdosing. Tacos pinterest fanny pack venmo.',
      name: 'Socrates Itumay',
    },

    {
      id: '4',
      src: './assets/img/users/13.jpg',
      title: 'UI Developer',
      summary:
        'Synth chartreuse iPhone lomo cray raw denim brunch everyday carry neutra before they sold out fixie 90s microdosing. Tacos pinterest fanny pack venmo.',
      name: 'Socrates Itumay',
    },
    {
      id: '5',
      src: './assets/img/users/11.jpg',
      title: 'UI Developer',
      summary:
        'Synth chartreuse iPhone lomo cray raw denim brunch everyday carry neutra before they sold out fixie 90s microdosing. Tacos pinterest fanny pack venmo.',
      name: 'Socrates Itumay',
    },
  ];
}