added new componente for publication swiper

This commit is contained in:
Eudes Inácio
2024-04-11 08:19:07 +01:00
parent 80fe8a4041
commit 622061bd6b
9 changed files with 521 additions and 47 deletions
@@ -10,7 +10,7 @@ import { ViewPublicationsPage } from './view-publications.page';
import { Attributes, IntersectionObserverHooks, LazyLoadImageModule, LAZYLOAD_IMAGE_HOOKS } from 'ng-lazyload-image';
import { ShowMorePageModule } from 'src/app/shared/publication/view-publications/show-more/show-more.module'
import { VisibilityDirective } from 'src/app/services/directives/visibility1.directive';
import { SwiperPageModule } from 'src/app/shared/swiper/swiper.module';
export class LazyLoadImageHooks extends IntersectionObserverHooks {
setup(attributes: Attributes) {
attributes.offset = 10;
@@ -30,9 +30,10 @@ setup(attributes: Attributes) {
LazyLoadImageModule,
//page
ShowMorePageModule,
SwiperPageModule
],
exports: [ViewPublicationsPage],
declarations: [ViewPublicationsPage, VisibilityDirective],
declarations: [ViewPublicationsPage],
providers: [{provide: LAZYLOAD_IMAGE_HOOKS, useClass: LazyLoadImageHooks}],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
@@ -43,15 +43,24 @@
<ion-card *ngFor="let publication of publicationFolderService.publicationList[folderId] let i = index">
<ion-card-content>
<div style="width: 364px; height: 395px;">
<app-swiper
[publicationList]=publication
></app-swiper>
</div>
<swiper-container #swiper [modules]="swiperModules" [preloadImages]="false" [slidechange]="onSlideChange()">
<!-- <swiper-container #swipers [slidechange]="onSlideChange()">
<swiper-slide *ngFor="let files of publication.Files let k = index">
<div >
<img *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'image'" class="post-img"
[lazyLoad]="'data:image/jpg;base64,' + files.FileBase64">
<video #videoElement [appVisibility]="onVisibilityChange" *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="metadata"
<video #videoElement [appVisibility]="onVisibilityChange" *ngIf="checkFileType.checkFileType(files.FileExtension ) == 'video'" class="post-video" controls="controls" preload="none"
playsinline webkit-playsinline="webkit-playsinline" (play)="stopvideoService.registerVideoWithEvent($event)" (click)="preventVideoPlay($event)">
<source [src]="files.FileBase64" type="video/mp4" >
</video>
@@ -59,19 +68,19 @@
</div>
</swiper-slide>
</swiper-container>
</swiper-container> -->
<!-- <div *ngIf="publication.FileExtension == 'mp4'"
(click)="goToPublicationDetail(publication.DocumentId, publication.ProcessId)" class="post-video">
</div> -->
<div *ngIf="publication.Files.length > 2" class="dots-container">
<!-- <div *ngIf="publication.Files.length > 2" class="dots-container">
<span *ngFor="let files of publication.Files; let k = index"
[class.dotsSwiper]="true"
[class.active-dot]="swiperIndex === k"
(click)="goToSlide(k)">
</span>
</div>
</div> -->
<div (click)="goToPublicationDetail(publication.DocumentId, publication.ProcessId)" class="post-content" >
<div class="post-title-time">
@@ -56,6 +56,8 @@ export class ViewPublicationsPage implements OnInit {
};
swiperModules = [IonicSlides];
publicationList: any
@ViewChild('VideoManager') VideoManager;
@ViewChildren('videoElement') videoElements: QueryList<ElementRef>;
@ViewChild('swiper')
@@ -267,6 +269,7 @@ export class ViewPublicationsPage implements OnInit {
if (!found) {
this.publicationFolderService.publicationList[folderId].push(publicationDetails)
this.publicationFolderService.revertPublicationOrder(folderId)
this.publicationList = this.publicationFolderService.publicationList[folderId];
} else {