-
Notifications
You must be signed in to change notification settings - Fork 51
/
present.component.ts
96 lines (88 loc) · 2.58 KB
/
present.component.ts
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
import { CommonModule } from '@angular/common';
import { Component, OnInit, ChangeDetectionStrategy, WritableSignal, signal } from '@angular/core';
import { CarouselModule, OwlOptions, SlidesOutputData } from 'ngx-owl-carousel-o';
import { MatMenuModule } from '@angular/material/menu';
import { MatButtonModule } from '@angular/material/button';
interface CarouselData {
id?: string;
text: string;
dataMerge?: number;
width: number;
dotContent?: string;
src?: string;
dataHash?: string;
}
@Component({
selector: 'app-present',
standalone: true,
imports: [CommonModule, CarouselModule, MatMenuModule, MatButtonModule],
templateUrl: './present.component.html',
styleUrl: './present.component.sass',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PresentComponent implements OnInit {
carouselData: CarouselData[] = [
{ text: 'Slide 1 PM', dataMerge: 2, width: 300, dotContent: 'text1' },
{ text: 'Slide 2 PM', dataMerge: 1, width: 500, dotContent: 'text2' },
{ text: 'Slide 3 PM', dataMerge: 3, width: 500, dotContent: 'text3' },
{ text: 'Slide 4 PM', width: 450, dotContent: 'text4' },
{ text: 'Slide 5 PM', dataMerge: 2, width: 500, dotContent: 'text5' },
// { text: 'Slide 6', dotContent: 'text5'},
// { text: 'Slide 7', dotContent: 'text5'},
// { text: 'Slide 8', dotContent: 'text5'},
// { text: 'Slide 9', dotContent: 'text5'},
// { text: 'Slide 10', dotContent: 'text5'},
];
title = 'owl-carousel-libdemo';
owlNext = '→';
owlPrev = '←';
customOptions: OwlOptions = {
// autoWidth: true,
loop: true,
// items: '10',
// margin: 10,
// slideBy: 'page',
// merge: true,
autoplay: true,
autoplayTimeout: 1000,
autoplayHoverPause: true,
autoplaySpeed: 900,
dotsSpeed: 500,
autoplayMouseleaveTimeout: 1100,
// dots: false,
// dotsData: true,
// mouseDrag: false,
// touchDrag: false,
// pullDrag: false,
smartSpeed: 400,
// fluidSpeed: 499,
dragEndSpeed: 350,
// dotsEach: 4,
// center: true,
// rewind: true,
// rtl: true,
// startPosition: 1,
// navText: [ '<i class=fa-chevron-left>left</i>', '<i class=fa-chevron-right>right</i>' ],
responsive: {
0: {
items: 1
},
600: {
items: 2
},
900: {
items: 3
}
},
// stagePadding: 40,
nav: true
}
activeSlides: WritableSignal<SlidesOutputData> = signal({});
constructor() { }
ngOnInit() {
}
getPassedData(data: any) {
this.activeSlides.set(data);
// console.log(this.activeSlides());
}
}