-

+
-
-
-
-
![]()
-
-
-
-

-
-
-
1" class="left" (click)="go('decrement')">
-

-
-
1" class="right" (click)="go('increment')">
-

-
-
-
-
-
![]()
-
-
+
+
-
-
-
-

-
-
-
1">
-

-
-
-
-
-
-
![]()
-
-
-
-
-
1">
-

-
-
-
diff --git a/src/app/_modules/pages/sections/types/basic/images/images-section.component.scss b/src/app/_modules/pages/sections/types/basic/images/images-section.component.scss
index e69de29..6acc99a 100644
--- a/src/app/_modules/pages/sections/types/basic/images/images-section.component.scss
+++ b/src/app/_modules/pages/sections/types/basic/images/images-section.component.scss
@@ -0,0 +1,3 @@
+:host{
+ position: relative;
+}
\ No newline at end of file
diff --git a/src/app/_modules/pages/sections/types/basic/images/images-section.component.ts b/src/app/_modules/pages/sections/types/basic/images/images-section.component.ts
index c510388..a9e4bef 100644
--- a/src/app/_modules/pages/sections/types/basic/images/images-section.component.ts
+++ b/src/app/_modules/pages/sections/types/basic/images/images-section.component.ts
@@ -80,36 +80,7 @@ export class ImagesSectionComponent {
}
show(i:number): void {
- this.parsedPhotos?.forEach((photo: any) => {
- if (photo.id === this.items[i].id) {
- this.photo = photo.links.full
- this.showFullscreen = true
- }
- })
this.activeIndex = i;
- }
-
- go(how: string) {
- this.show(this.activeIndex)
- switch(how) {
- case 'decrement':
- this.activeIndex--
- if (this.activeIndex < 0) this.activeIndex = this.parsedPhotos.length - 1
- break
- case 'increment':
- this.activeIndex++
- if (this.activeIndex == this.parsedPhotos.length) this.activeIndex = 0
- break
- }
- this.parsedPhotos = this.parsedPhotos.map((item: any, index: number) => {
- if (index === this.activeIndex) {
- item.active = true
- this.photo = item.links.full
- this.showId = item.id
- } else {
- item.active = false
- }
- return item
- })
+ this.showFullscreen = true
}
}
diff --git a/src/app/_modules/widjet/swiper-gallery/swiper-gallery.component.html b/src/app/_modules/widjet/swiper-gallery/swiper-gallery.component.html
new file mode 100644
index 0000000..5f8f0b2
--- /dev/null
+++ b/src/app/_modules/widjet/swiper-gallery/swiper-gallery.component.html
@@ -0,0 +1,34 @@
+
+
![]()
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+
+
+
+
+
+
+
diff --git a/src/app/_modules/widjet/swiper-gallery/swiper-gallery.component.scss b/src/app/_modules/widjet/swiper-gallery/swiper-gallery.component.scss
new file mode 100644
index 0000000..02c1843
--- /dev/null
+++ b/src/app/_modules/widjet/swiper-gallery/swiper-gallery.component.scss
@@ -0,0 +1,65 @@
+.single{
+ width: 100%;
+ height: 100%;
+ img{
+ width: 100%;
+ height: 100%;
+ object-fit:contain;
+ }
+}
+
+.top-swiper{
+ width: 100%;
+ height: 80%;
+ position: relative;
+ --swiper-navigation-color: #fff;
+ --swiper-pagination-color: #fff;
+ >swiper{
+ height: 100%;
+ img {
+ object-fit:contain;
+ }
+ }
+}
+.thumb{
+ margin-top: 10px;
+ width: 100%;
+ height: calc( 20% - 10px);
+ cursor: pointer;
+ img {
+ width: 100%;
+ height: 100%;
+ object-fit:cover;
+ &:not(.active){
+ filter: brightness(50%);
+ }
+ }
+}
+.slide{
+ width: 100%;
+ height: 100%;
+ display: block;
+ background-color: grey;
+ cursor:w-resize;
+ img {
+ object-fit: cover;
+ width: 100%;
+ height: 100%;
+ }
+}
+.swiper-close{
+ position: absolute;
+ z-index: 10;
+ top: 20px;
+ right: 20px;
+ width: 40px;
+ height: 40px;
+ background-color: #fff;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.16);
+ border-radius: 20px;
+ cursor: pointer;
+}
+
diff --git a/src/app/_modules/widjet/swiper-gallery/swiper-gallery.component.ts b/src/app/_modules/widjet/swiper-gallery/swiper-gallery.component.ts
new file mode 100644
index 0000000..c7d26ca
--- /dev/null
+++ b/src/app/_modules/widjet/swiper-gallery/swiper-gallery.component.ts
@@ -0,0 +1,67 @@
+import { Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';
+import SwiperCore, {Navigation, Pagination, SwiperOptions} from 'swiper';
+import { SwiperComponent } from "swiper/angular";
+SwiperCore.use([Navigation, Pagination]);
+
+@Component({
+ selector: 'swiper-gallery',
+ templateUrl: './swiper-gallery.component.html',
+ styleUrls: ['./swiper-gallery.component.scss']
+})
+export class SwiperGalleryComponent {
+ @Input() items: any;
+ @Input() start = 0;
+ @Input() closing:boolean;
+ @Output() event = new EventEmitter
()
+ @ViewChild('swiper', { static: false }) swiper?: SwiperComponent;
+ @ViewChild('thumb', { static: false }) thumb?: SwiperComponent;
+ public active:number;
+ public single: boolean;
+
+ public config: SwiperOptions = {
+ slidesPerView: 1,
+ spaceBetween: 50,
+ navigation: {
+ nextEl: ".swiper-button-next",
+ prevEl: ".swiper-button-prev",
+ },
+ pagination: {
+ el: ".swiper-pagination",
+ }
+ };
+
+ public thumbConfig: SwiperOptions = {
+ spaceBetween: 10,
+ slidesPerView: 5,
+ freeMode: true,
+ watchSlidesProgress: true,
+ }
+
+ ngOnInit(){
+ this.active = this.start;
+ this.single = this.items.length === 1;
+ }
+
+ swiperOn(swiper){
+ this.swiper.swiperRef.slideTo(this.start)
+ }
+
+ onSwiperChange(event) {
+ this.thumb.swiperRef.slideTo(event[0].realIndex-1)
+ }
+
+ thumbOn(swiper){
+ this.thumb.swiperRef.slideTo(this.start-2)
+ }
+
+ select(i){
+ this.active = i;
+ this.thumb.swiperRef.slideTo(i)
+ this.swiper.swiperRef.slideTo(i)
+ }
+
+ close(){
+ console.log('click')
+ this.event.emit('close')
+ }
+}
diff --git a/src/app/_modules/widjet/widjet.module.ts b/src/app/_modules/widjet/widjet.module.ts
index e3c84af..5626776 100644
--- a/src/app/_modules/widjet/widjet.module.ts
+++ b/src/app/_modules/widjet/widjet.module.ts
@@ -10,12 +10,15 @@ import { SwitchComponent } from './switch/switch.component';
import { LocaleComponent } from './locale/locale.component';
import { FileIcoComponent } from './file-ico/file-ico.component';
import { ModalComponent } from './modal/modal.component';
+import {SwiperModule} from "swiper/angular";
+import { SwiperGalleryComponent } from './swiper-gallery/swiper-gallery.component';
@NgModule({
imports:[
BrowserModule,
- RouterModule
+ RouterModule,
+ SwiperModule
// QRCodeModule
],
declarations: [
@@ -27,6 +30,7 @@ import { ModalComponent } from './modal/modal.component';
LocaleComponent,
FileIcoComponent,
ModalComponent,
+ SwiperGalleryComponent,
],
exports: [
IcoComponent,
@@ -36,7 +40,8 @@ import { ModalComponent } from './modal/modal.component';
SwitchComponent,
LocaleComponent,
FileIcoComponent,
- ModalComponent
+ ModalComponent,
+ SwiperGalleryComponent
]
})
export class WidjetModule {
diff --git a/src/vniigaz-v2/css/_pages-section.scss b/src/vniigaz-v2/css/_pages-section.scss
index b2a46ef..14a0e60 100644
--- a/src/vniigaz-v2/css/_pages-section.scss
+++ b/src/vniigaz-v2/css/_pages-section.scss
@@ -212,21 +212,18 @@ images-section{
}
}
.center {
- width: 600px;
- }
- }
-
- .slide {
- width: 600px;
- height: 450px;
-
- display: block;
- img {
- object-fit: cover;
+ display: block;
width: 100%;
- height: 100%;
+ aspect-ratio: 16 / 9;
}
}
+
+ .swiper-box{
+ width: 100%;
+ height: 50vw;
+ max-height: 400px;
+ }
+
.fullscreen {
top: 0;
@@ -236,69 +233,9 @@ images-section{
z-index: 2;
position: fixed;
align-items: center;
- justify-content: center;
+ width: 100vw;
+ height: 100vh;
background-color: rgba(37, 46, 52, 60%);
-
- .content {
- position: fixed;
- display: flex;
- pointer-events: none;
-
-
- width: calc(100vw - 2 * 24px);
- height: calc(100vh - 2 * 24px);
- left: 24px;
- right: 24px;
- *{
- pointer-events:all;
- }
- img {
- object-fit: contain;
- width: 100%;
- height: 100%;
- }
-
- .left {
- width: 72px;
- flex-grow: 0;
- display: flex;
- cursor: pointer;
- align-items: center;
- justify-content: center;
- }
- .right {
- width: 72px;
- flex-grow: 0;
- display: flex;
- cursor: pointer;
- align-items: center;
- justify-content: center;
- }
- }
- .between{
- justify-content:space-between;
- }
- .center{
- justify-content:center;
- }
- .bottom{
- align-items: flex-end;
- gap: 8px;
- .thumbnails{
- position: static;
- display: block;
- width: 72px;
- height: 52px;
- border: 2px solid var(--prime);
-
- img{
- width: 100%;
- height: 100%;
- object-fit:cover;
- };
- };
-
- }
}