@alfalab/core-components-gallery 7.1.1 → 7.1.2-alfasans
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/bottom-button/index.css +5 -5
- package/components/bottom-button/index.module.css.js +1 -1
- package/components/buttons/index.css +5 -5
- package/components/buttons/index.module.css.js +1 -1
- package/components/header/index.css +1 -1
- package/components/header/index.module.css.js +1 -1
- package/components/header-info-block/index.css +4 -4
- package/components/header-info-block/index.module.css.js +1 -1
- package/components/header-mobile/index.css +6 -6
- package/components/header-mobile/index.module.css.js +1 -1
- package/components/image-preview/index.css +17 -17
- package/components/image-preview/index.module.css.js +1 -1
- package/components/image-viewer/component.d.ts +0 -1
- package/components/image-viewer/component.js +2 -4
- package/components/image-viewer/component.js.map +1 -1
- package/components/image-viewer/index.css +86 -25
- package/components/image-viewer/index.module.css.js +1 -1
- package/components/image-viewer/index.module.css.js.map +1 -1
- package/components/image-viewer/video/index.css +7 -7
- package/components/image-viewer/video/index.module.css.js +1 -1
- package/components/info-bar/index.css +3 -3
- package/components/info-bar/index.module.css.js +1 -1
- package/components/navigation-bar/index.css +8 -8
- package/components/navigation-bar/index.module.css.js +1 -1
- package/components/subtitles/index.css +3 -3
- package/components/subtitles/index.module.css.js +1 -1
- package/cssm/components/image-viewer/component.d.ts +0 -1
- package/cssm/components/image-viewer/component.js +2 -4
- package/cssm/components/image-viewer/component.js.map +1 -1
- package/cssm/components/image-viewer/index.module.css +61 -0
- package/esm/components/bottom-button/index.css +5 -5
- package/esm/components/bottom-button/index.module.css.js +1 -1
- package/esm/components/buttons/index.css +5 -5
- package/esm/components/buttons/index.module.css.js +1 -1
- package/esm/components/header/index.css +1 -1
- package/esm/components/header/index.module.css.js +1 -1
- package/esm/components/header-info-block/index.css +4 -4
- package/esm/components/header-info-block/index.module.css.js +1 -1
- package/esm/components/header-mobile/index.css +6 -6
- package/esm/components/header-mobile/index.module.css.js +1 -1
- package/esm/components/image-preview/index.css +17 -17
- package/esm/components/image-preview/index.module.css.js +1 -1
- package/esm/components/image-viewer/component.d.ts +0 -1
- package/esm/components/image-viewer/component.js +2 -3
- package/esm/components/image-viewer/component.js.map +1 -1
- package/esm/components/image-viewer/index.css +86 -25
- package/esm/components/image-viewer/index.module.css.js +1 -1
- package/esm/components/image-viewer/index.module.css.js.map +1 -1
- package/esm/components/image-viewer/video/index.css +7 -7
- package/esm/components/image-viewer/video/index.module.css.js +1 -1
- package/esm/components/info-bar/index.css +3 -3
- package/esm/components/info-bar/index.module.css.js +1 -1
- package/esm/components/navigation-bar/index.css +8 -8
- package/esm/components/navigation-bar/index.module.css.js +1 -1
- package/esm/components/subtitles/index.css +3 -3
- package/esm/components/subtitles/index.module.css.js +1 -1
- package/esm/index.css +9 -9
- package/esm/index.module.css.js +1 -1
- package/index.css +9 -9
- package/index.module.css.js +1 -1
- package/modern/components/bottom-button/index.css +5 -5
- package/modern/components/bottom-button/index.module.css.js +1 -1
- package/modern/components/buttons/index.css +5 -5
- package/modern/components/buttons/index.module.css.js +1 -1
- package/modern/components/header/index.css +1 -1
- package/modern/components/header/index.module.css.js +1 -1
- package/modern/components/header-info-block/index.css +4 -4
- package/modern/components/header-info-block/index.module.css.js +1 -1
- package/modern/components/header-mobile/index.css +6 -6
- package/modern/components/header-mobile/index.module.css.js +1 -1
- package/modern/components/image-preview/index.css +17 -17
- package/modern/components/image-preview/index.module.css.js +1 -1
- package/modern/components/image-viewer/component.d.ts +0 -1
- package/modern/components/image-viewer/component.js +2 -3
- package/modern/components/image-viewer/component.js.map +1 -1
- package/modern/components/image-viewer/index.css +86 -25
- package/modern/components/image-viewer/index.module.css.js +1 -1
- package/modern/components/image-viewer/index.module.css.js.map +1 -1
- package/modern/components/image-viewer/video/index.css +7 -7
- package/modern/components/image-viewer/video/index.module.css.js +1 -1
- package/modern/components/info-bar/index.css +3 -3
- package/modern/components/info-bar/index.module.css.js +1 -1
- package/modern/components/navigation-bar/index.css +8 -8
- package/modern/components/navigation-bar/index.module.css.js +1 -1
- package/modern/components/subtitles/index.css +3 -3
- package/modern/components/subtitles/index.module.css.js +1 -1
- package/modern/index.css +9 -9
- package/modern/index.module.css.js +1 -1
- package/moderncssm/components/image-viewer/component.d.ts +0 -1
- package/moderncssm/components/image-viewer/component.js +2 -3
- package/moderncssm/components/image-viewer/component.js.map +1 -1
- package/moderncssm/components/image-viewer/index.module.css +61 -0
- package/package.json +12 -12
- package/src/components/image-viewer/component.tsx +4 -6
- package/src/components/image-viewer/index.module.css +63 -0
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
--color-static-neutral-translucent-500-inverted-hover: rgba(233, 233, 250, 0.37);
|
|
4
4
|
--color-static-neutral-translucent-500-inverted-press: rgba(238, 238, 254, 0.46);
|
|
5
5
|
}
|
|
6
|
-
.
|
|
6
|
+
.gallery__component_1e8sy {
|
|
7
7
|
background-color: var(--color-static-neutral-translucent-500-inverted);
|
|
8
8
|
}
|
|
9
|
-
.
|
|
9
|
+
.gallery__component_1e8sy:hover {
|
|
10
10
|
background-color: var(--color-static-neutral-translucent-500-inverted-hover);
|
|
11
11
|
}
|
|
12
|
-
.
|
|
12
|
+
.gallery__component_1e8sy:active {
|
|
13
13
|
background-color: var(--color-static-neutral-translucent-500-inverted-press);
|
|
14
14
|
}
|
|
15
|
-
.
|
|
15
|
+
.gallery__component_1e8sy {
|
|
16
16
|
|
|
17
17
|
transition: transform 1s ease-in-out;
|
|
18
18
|
will-change: transform;
|
|
19
19
|
}
|
|
20
|
-
.
|
|
20
|
+
.gallery__notVisible_1e8sy {
|
|
21
21
|
transform: translateY(250%);
|
|
22
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"
|
|
3
|
+
const styles = {"component":"gallery__component_1e8sy","notVisible":"gallery__notVisible_1e8sy"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
--gap-2xl: 32px;
|
|
9
9
|
--gap-32: var(--gap-2xl);
|
|
10
10
|
}
|
|
11
|
-
.
|
|
11
|
+
.gallery__buttons_o84ip {
|
|
12
12
|
display: flex;
|
|
13
13
|
padding-left: var(--gap-32);
|
|
14
14
|
}
|
|
15
|
-
.
|
|
15
|
+
.gallery__buttons_o84ip path {
|
|
16
16
|
color: var(--color-static-neutral-translucent-1300-inverted);
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.gallery__iconButton_o84ip path {
|
|
19
19
|
color: var(--color-static-neutral-100);
|
|
20
20
|
}
|
|
21
|
-
.
|
|
21
|
+
.gallery__iconButton_o84ip:hover path {
|
|
22
22
|
color: var(--color-static-neutral-100-hover);
|
|
23
23
|
}
|
|
24
|
-
.
|
|
24
|
+
.gallery__iconButton_o84ip:active path {
|
|
25
25
|
color: var(--color-static-neutral-100-press);
|
|
26
26
|
}
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
--gap-2xs: 4px;
|
|
3
3
|
--gap-4: var(--gap-2xs);
|
|
4
4
|
}
|
|
5
|
-
.
|
|
5
|
+
.gallery__info_1x86s {
|
|
6
6
|
height: 100%;
|
|
7
7
|
display: flex;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
justify-content: center;
|
|
10
10
|
overflow: hidden;
|
|
11
11
|
}
|
|
12
|
-
.
|
|
12
|
+
.gallery__filenameHead_1x86s {
|
|
13
13
|
display: inline;
|
|
14
14
|
text-overflow: ellipsis;
|
|
15
15
|
overflow: hidden;
|
|
16
16
|
white-space: nowrap;
|
|
17
17
|
}
|
|
18
|
-
.
|
|
18
|
+
.gallery__filenameContainer_1x86s {
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
display: inline-flex;
|
|
21
21
|
}
|
|
22
|
-
.
|
|
22
|
+
.gallery__description_1x86s {
|
|
23
23
|
display: inline;
|
|
24
24
|
text-overflow: ellipsis;
|
|
25
25
|
overflow: hidden;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"info":"
|
|
3
|
+
const styles = {"info":"gallery__info_1x86s","filenameHead":"gallery__filenameHead_1x86s","filenameContainer":"gallery__filenameContainer_1x86s","description":"gallery__description_1x86s"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-static-neutral-0-inverted: #262629;
|
|
3
3
|
}
|
|
4
|
-
.
|
|
4
|
+
.gallery__headerMobile_dd3ue {
|
|
5
5
|
position: relative;
|
|
6
6
|
height: 72px;
|
|
7
7
|
z-index: 3;
|
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
justify-content: space-between;
|
|
11
11
|
align-items: center;
|
|
12
12
|
}
|
|
13
|
-
.
|
|
13
|
+
.gallery__headerMobile_dd3ue.gallery__video_dd3ue {
|
|
14
14
|
position: absolute;
|
|
15
15
|
width: 100%;
|
|
16
16
|
background-color: var(--color-static-neutral-0-inverted);
|
|
17
17
|
transition: transform 0.3s ease-in-out;
|
|
18
18
|
}
|
|
19
|
-
.
|
|
19
|
+
.gallery__hide_dd3ue {
|
|
20
20
|
transform: translateY(-96px);
|
|
21
21
|
}
|
|
22
|
-
.
|
|
23
|
-
.
|
|
22
|
+
.gallery__leftButton_dd3ue,
|
|
23
|
+
.gallery__rightButtons_dd3ue {
|
|
24
24
|
display: flex;
|
|
25
25
|
align-items: center;
|
|
26
26
|
}
|
|
27
|
-
.
|
|
27
|
+
.gallery__description_dd3ue {
|
|
28
28
|
position: absolute;
|
|
29
29
|
left: 50%;
|
|
30
30
|
transform: translateX(-50%);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"headerMobile":"
|
|
3
|
+
const styles = {"headerMobile":"gallery__headerMobile_dd3ue","video":"gallery__video_dd3ue","hide":"gallery__hide_dd3ue","rightButtons":"gallery__rightButtons_dd3ue","description":"gallery__description_dd3ue"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -12,23 +12,23 @@
|
|
|
12
12
|
:root {
|
|
13
13
|
--focus-color: var(--color-light-status-info);
|
|
14
14
|
}
|
|
15
|
-
.
|
|
15
|
+
.gallery__component_1ljn2 {
|
|
16
16
|
display: flex;
|
|
17
17
|
z-index: 3;
|
|
18
18
|
overflow: hidden;
|
|
19
19
|
transition: border 0.15s ease-in-out;
|
|
20
20
|
outline: none;
|
|
21
21
|
}
|
|
22
|
-
.
|
|
22
|
+
.gallery__component_1ljn2 .gallery__image_1ljn2 {
|
|
23
23
|
opacity: 0.3;
|
|
24
24
|
}
|
|
25
|
-
.
|
|
25
|
+
.gallery__component_1ljn2.gallery__mobile_1ljn2 {
|
|
26
26
|
padding: 0;
|
|
27
27
|
}
|
|
28
|
-
.
|
|
28
|
+
.gallery__active_1ljn2 > .gallery__image_1ljn2 {
|
|
29
29
|
opacity: 1;
|
|
30
30
|
}
|
|
31
|
-
.
|
|
31
|
+
.gallery__preview_1ljn2 {
|
|
32
32
|
width: 56px;
|
|
33
33
|
height: 56px;
|
|
34
34
|
flex-shrink: 0;
|
|
@@ -38,15 +38,15 @@
|
|
|
38
38
|
-moz-user-select: none;
|
|
39
39
|
user-select: none;
|
|
40
40
|
}
|
|
41
|
-
.
|
|
41
|
+
.gallery__preview_1ljn2.gallery__mobile_1ljn2 {
|
|
42
42
|
width: 46px;
|
|
43
43
|
height: 46px;
|
|
44
44
|
border-radius: var(--border-radius-8);
|
|
45
45
|
}
|
|
46
|
-
.
|
|
46
|
+
.gallery__image_1ljn2 {
|
|
47
47
|
transition: opacity 0.15s ease-in-out;
|
|
48
48
|
}
|
|
49
|
-
.
|
|
49
|
+
.gallery__image_1ljn2 > img {
|
|
50
50
|
display: block;
|
|
51
51
|
width: 100%;
|
|
52
52
|
height: 100%;
|
|
@@ -56,36 +56,36 @@
|
|
|
56
56
|
overflow: clip;
|
|
57
57
|
overflow-clip-margin: border-box;
|
|
58
58
|
}
|
|
59
|
-
.
|
|
59
|
+
.gallery__image_1ljn2:hover {
|
|
60
60
|
opacity: 0.7;
|
|
61
61
|
}
|
|
62
|
-
.
|
|
62
|
+
.gallery__loading_1ljn2 {
|
|
63
63
|
background-color: var(--color-static-neutral-100-inverted);
|
|
64
64
|
}
|
|
65
|
-
.
|
|
65
|
+
.gallery__loading_1ljn2 .gallery__active_1ljn2 {
|
|
66
66
|
background-color: var(--color-static-neutral-300-inverted);
|
|
67
67
|
}
|
|
68
|
-
.
|
|
68
|
+
.gallery__brokenImageWrapper_1ljn2 {
|
|
69
69
|
display: flex;
|
|
70
70
|
justify-content: center;
|
|
71
71
|
align-items: center;
|
|
72
72
|
background-color: var(--color-static-neutral-300-inverted);
|
|
73
73
|
opacity: 0.3;
|
|
74
74
|
}
|
|
75
|
-
.
|
|
75
|
+
.gallery__brokenImageWrapper_1ljn2.gallery__active_1ljn2 {
|
|
76
76
|
opacity: 1;
|
|
77
77
|
}
|
|
78
|
-
.
|
|
78
|
+
.gallery__brokenIcon_1ljn2 {
|
|
79
79
|
width: 40px;
|
|
80
80
|
height: 40px;
|
|
81
81
|
}
|
|
82
|
-
.
|
|
82
|
+
.gallery__focused_1ljn2 {
|
|
83
83
|
outline: 2px solid var(--focus-color);
|
|
84
84
|
outline-offset: 2px;
|
|
85
85
|
}
|
|
86
|
-
.
|
|
86
|
+
.gallery__canvasPreview_1ljn2 {
|
|
87
87
|
border-radius: var(--border-radius-12);
|
|
88
88
|
}
|
|
89
|
-
.
|
|
89
|
+
.gallery__canvasPreview_1ljn2.gallery__mobile_1ljn2 {
|
|
90
90
|
border-radius: var(--border-radius-8);
|
|
91
91
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"
|
|
3
|
+
const styles = {"component":"gallery__component_1ljn2","image":"gallery__image_1ljn2","mobile":"gallery__mobile_1ljn2","active":"gallery__active_1ljn2","preview":"gallery__preview_1ljn2","loading":"gallery__loading_1ljn2","brokenImageWrapper":"gallery__brokenImageWrapper_1ljn2","brokenIcon":"gallery__brokenIcon_1ljn2","focused":"gallery__focused_1ljn2","canvasPreview":"gallery__canvasPreview_1ljn2"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useCallback, useMemo } from 'react';
|
|
2
2
|
import cn from 'classnames';
|
|
3
|
-
import
|
|
3
|
+
import { A11y, Controller } from 'swiper/modules';
|
|
4
4
|
import { Swiper, SwiperSlide } from 'swiper/react';
|
|
5
5
|
import { useFocus } from '@alfalab/hooks';
|
|
6
6
|
import { ChevronBackHeavyMIcon } from '@alfalab/icons-glyph/ChevronBackHeavyMIcon';
|
|
@@ -10,10 +10,8 @@ import { isVideo, getImageAlt, getImageKey } from '../../utils/utils.js';
|
|
|
10
10
|
import { TestIds } from '../../utils/constants.js';
|
|
11
11
|
import { useHandleImageViewer } from './hooks.js';
|
|
12
12
|
import { Slide } from './slide.js';
|
|
13
|
-
import 'swiper/swiper.min.css';
|
|
14
13
|
import styles from './index.module.css.js';
|
|
15
14
|
|
|
16
|
-
SwiperCore.use([EffectFade, A11y, Controller]);
|
|
17
15
|
const ImageViewer = () => {
|
|
18
16
|
const { images, imagesMeta, fullScreen, currentSlideIndex, initialSlide, setCurrentSlideIndex, getSwiper, setSwiper, slidePrev, slideNext, getCurrentImage, } = useContext(GalleryContext);
|
|
19
17
|
const { handleWrapperClick, isMobile, rightArrowRef, leftArrowRef } = useHandleImageViewer();
|
|
@@ -49,6 +47,7 @@ const ImageViewer = () => {
|
|
|
49
47
|
[styles.mobile]: isMobile,
|
|
50
48
|
[styles.mobileVideo]: isMobile && isVideo(currentImage?.src),
|
|
51
49
|
}),
|
|
50
|
+
modules: [A11y, Controller],
|
|
52
51
|
controller: { control: swiper },
|
|
53
52
|
a11y: {
|
|
54
53
|
slideRole: 'img',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../../src/components/image-viewer/component.tsx"],"sourcesContent":["import React, { type FC, type KeyboardEventHandler, useCallback, useContext, useMemo } from 'react';\nimport cn from 'classnames';\nimport SwiperCore, { A11y, Controller, EffectFade } from 'swiper';\nimport { Swiper, SwiperSlide } from 'swiper/react';\n\nimport { useFocus } from '@alfalab/hooks';\nimport { ChevronBackHeavyMIcon } from '@alfalab/icons-glyph/ChevronBackHeavyMIcon';\nimport { ChevronForwardHeavyMIcon } from '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';\n\nimport { GalleryContext } from '../../context';\nimport { getImageAlt, getImageKey, isVideo, TestIds } from '../../utils';\n\nimport { useHandleImageViewer } from './hooks';\nimport { Slide } from './slide';\n\nimport 'swiper/swiper.min.css';\nimport styles from './index.module.css';\n\nSwiperCore.use([EffectFade, A11y, Controller]);\n\nexport const ImageViewer: FC = () => {\n const {\n images,\n imagesMeta,\n fullScreen,\n currentSlideIndex,\n initialSlide,\n setCurrentSlideIndex,\n getSwiper,\n setSwiper,\n slidePrev,\n slideNext,\n getCurrentImage,\n } = useContext(GalleryContext);\n\n const { handleWrapperClick, isMobile, rightArrowRef, leftArrowRef } = useHandleImageViewer();\n\n const [leftArrowFocused] = useFocus(leftArrowRef, 'keyboard');\n const [rightArrowFocused] = useFocus(rightArrowRef, 'keyboard');\n\n const swiper = getSwiper();\n const currentImage = getCurrentImage();\n\n const handleSlideChange = useCallback(() => {\n setCurrentSlideIndex?.(swiper?.activeIndex ?? initialSlide);\n }, [setCurrentSlideIndex, swiper, initialSlide]);\n\n const handlePrevClick = () => {\n slidePrev();\n };\n\n const handleNextClick = () => {\n slideNext();\n };\n\n const handleArrowLeftKeyDown: KeyboardEventHandler = (event) => {\n if (event.key === 'Enter') {\n slidePrev();\n }\n };\n\n const handleArrowRightKeyDown: KeyboardEventHandler = (event) => {\n if (event.key === 'Enter') {\n slideNext();\n }\n };\n\n const swiperProps = useMemo<Swiper>(\n () => ({\n slidesPerView: 1,\n effect: 'slide',\n className: cn(styles.swiper, {\n [styles.hidden]: fullScreen && !isVideo(currentImage?.src),\n [styles.fullScreenVideo]: fullScreen && isVideo(currentImage?.src),\n [styles.mobile]: isMobile,\n [styles.mobileVideo]: isMobile && isVideo(currentImage?.src),\n }),\n controller: { control: swiper },\n a11y: {\n slideRole: 'img',\n },\n initialSlide,\n simulateTouch: false,\n zoom: { maxRatio: 4, minRatio: 1, toggle: true },\n onSwiper: setSwiper,\n onSlideChange: handleSlideChange,\n lazy: { loadPrevNext: true },\n }),\n [\n fullScreen,\n currentImage?.src,\n isMobile,\n swiper,\n initialSlide,\n setSwiper,\n handleSlideChange,\n ],\n );\n\n const showControls = !fullScreen && !isMobile && !!images.length;\n\n const swiperWidth = swiper?.width || 1;\n const swiperHeight = swiper?.height || swiper?.width || 1;\n\n const swiperAspectRatio = swiperWidth / swiperHeight;\n\n return (\n <div\n className={cn(styles.component, {\n [styles.mobile]: isMobile,\n [styles.mobileVideo]: isMobile && isVideo(currentImage?.src),\n })}\n aria-hidden={true}\n onClick={handleWrapperClick}\n >\n {showControls && (\n <div\n className={cn(styles.arrow, {\n [styles.focused]: leftArrowFocused,\n })}\n onClick={handlePrevClick}\n role='button'\n onKeyDown={handleArrowLeftKeyDown}\n tabIndex={0}\n ref={leftArrowRef}\n aria-label='Предыдущее изображение'\n data-test-id={TestIds.PREV_SLIDE_BUTTON}\n >\n <ChevronBackHeavyMIcon />\n </div>\n )}\n\n {fullScreen && !isVideo(currentImage?.src) && (\n <img\n src={currentImage?.src}\n alt={currentImage ? getImageAlt(currentImage, currentSlideIndex) : ''}\n className={styles.fullScreenImage}\n />\n )}\n\n <Swiper {...swiperProps}>\n {images.map((image, index) => {\n const meta = imagesMeta[index];\n\n const imageWidth = meta?.width || 1;\n const imageHeight = meta?.height || 1;\n\n const imageAspectRatio = imageWidth / imageHeight;\n\n const slideVisible = index === currentSlideIndex;\n\n return (\n <SwiperSlide\n key={getImageKey(image, index)}\n style={{\n pointerEvents: slideVisible ? 'auto' : 'none',\n transitionProperty: 'opacity',\n }}\n >\n {({ isActive }) => (\n <Slide\n isActive={isActive}\n containerAspectRatio={swiperAspectRatio}\n image={image}\n containerHeight={swiperHeight}\n meta={meta}\n index={index}\n imageAspectRatio={imageAspectRatio}\n slideVisible={slideVisible}\n />\n )}\n </SwiperSlide>\n );\n })}\n </Swiper>\n\n {showControls && (\n <div\n className={cn(styles.arrow, {\n [styles.focused]: rightArrowFocused,\n })}\n onClick={handleNextClick}\n role='button'\n onKeyDown={handleArrowRightKeyDown}\n tabIndex={0}\n ref={rightArrowRef}\n aria-label='Следующее изображение'\n data-test-id={TestIds.NEXT_SLIDE_BUTTON}\n >\n <ChevronForwardHeavyMIcon />\n </div>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAkBA,UAAU,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC;AAEvC,MAAM,WAAW,GAAO,MAAK;AAChC,IAAA,MAAM,EACF,MAAM,EACN,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,SAAS,EACT,SAAS,EACT,SAAS,EACT,eAAe,GAClB,GAAG,UAAU,CAAC,cAAc,CAAC;AAE9B,IAAA,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,oBAAoB,EAAE;IAE5F,MAAM,CAAC,gBAAgB,CAAC,GAAG,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC;IAC7D,MAAM,CAAC,iBAAiB,CAAC,GAAG,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAC;AAE/D,IAAA,MAAM,MAAM,GAAG,SAAS,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ACvC,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,YAAY,EAC7B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,EAC5B,CAAA,CACL,CACS;AAEtB,SAAC,CAAC,CACG;QAER,YAAY,KACT,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EACI,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;AACxB,gBAAA,CAAC,MAAM,CAAC,OAAO,GAAG,iBAAiB;aACtC,CAAC,EACF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,uBAAuB,EAClC,QAAQ,EAAE,CAAC,EACX,GAAG,EAAE,aAAa,EAAA,YAAA,EACP,2HAAuB,EAAA,cAAA,EACpB,OAAO,CAAC,iBAAiB,EAAA;AAEvC,YAAA,KAAA,CAAA,aAAA,CAAC,wBAAwB,EAAG,IAAA,CAAA,CAC1B,CACT,CACC;AAEd;;;;"}
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../../src/components/image-viewer/component.tsx"],"sourcesContent":["import React, { type FC, type KeyboardEventHandler, useCallback, useContext, useMemo } from 'react';\nimport cn from 'classnames';\nimport { A11y, Controller } from 'swiper/modules';\nimport { Swiper, type SwiperProps, SwiperSlide } from 'swiper/react';\n\nimport { useFocus } from '@alfalab/hooks';\nimport { ChevronBackHeavyMIcon } from '@alfalab/icons-glyph/ChevronBackHeavyMIcon';\nimport { ChevronForwardHeavyMIcon } from '@alfalab/icons-glyph/ChevronForwardHeavyMIcon';\n\nimport { GalleryContext } from '../../context';\nimport { getImageAlt, getImageKey, isVideo, TestIds } from '../../utils';\n\nimport { useHandleImageViewer } from './hooks';\nimport { Slide } from './slide';\n\nimport styles from './index.module.css';\n\nexport const ImageViewer: FC = () => {\n const {\n images,\n imagesMeta,\n fullScreen,\n currentSlideIndex,\n initialSlide,\n setCurrentSlideIndex,\n getSwiper,\n setSwiper,\n slidePrev,\n slideNext,\n getCurrentImage,\n } = useContext(GalleryContext);\n\n const { handleWrapperClick, isMobile, rightArrowRef, leftArrowRef } = useHandleImageViewer();\n\n const [leftArrowFocused] = useFocus(leftArrowRef, 'keyboard');\n const [rightArrowFocused] = useFocus(rightArrowRef, 'keyboard');\n\n const swiper = getSwiper();\n const currentImage = getCurrentImage();\n\n const handleSlideChange = useCallback(() => {\n setCurrentSlideIndex?.(swiper?.activeIndex ?? initialSlide);\n }, [setCurrentSlideIndex, swiper, initialSlide]);\n\n const handlePrevClick = () => {\n slidePrev();\n };\n\n const handleNextClick = () => {\n slideNext();\n };\n\n const handleArrowLeftKeyDown: KeyboardEventHandler = (event) => {\n if (event.key === 'Enter') {\n slidePrev();\n }\n };\n\n const handleArrowRightKeyDown: KeyboardEventHandler = (event) => {\n if (event.key === 'Enter') {\n slideNext();\n }\n };\n\n const swiperProps = useMemo<SwiperProps>(\n () => ({\n slidesPerView: 1,\n effect: 'slide',\n className: cn(styles.swiper, {\n [styles.hidden]: fullScreen && !isVideo(currentImage?.src),\n [styles.fullScreenVideo]: fullScreen && isVideo(currentImage?.src),\n [styles.mobile]: isMobile,\n [styles.mobileVideo]: isMobile && isVideo(currentImage?.src),\n }),\n modules: [A11y, Controller],\n controller: { control: swiper },\n a11y: {\n slideRole: 'img',\n },\n initialSlide,\n simulateTouch: false,\n zoom: { maxRatio: 4, minRatio: 1, toggle: true },\n onSwiper: setSwiper,\n onSlideChange: handleSlideChange,\n lazy: { loadPrevNext: true },\n }),\n [\n fullScreen,\n currentImage?.src,\n isMobile,\n swiper,\n initialSlide,\n setSwiper,\n handleSlideChange,\n ],\n );\n\n const showControls = !fullScreen && !isMobile && !!images.length;\n\n const swiperWidth = swiper?.width || 1;\n const swiperHeight = swiper?.height || swiper?.width || 1;\n\n const swiperAspectRatio = swiperWidth / swiperHeight;\n\n return (\n <div\n className={cn(styles.component, {\n [styles.mobile]: isMobile,\n [styles.mobileVideo]: isMobile && isVideo(currentImage?.src),\n })}\n aria-hidden={true}\n onClick={handleWrapperClick}\n >\n {showControls && (\n <div\n className={cn(styles.arrow, {\n [styles.focused]: leftArrowFocused,\n })}\n onClick={handlePrevClick}\n role='button'\n onKeyDown={handleArrowLeftKeyDown}\n tabIndex={0}\n ref={leftArrowRef}\n aria-label='Предыдущее изображение'\n data-test-id={TestIds.PREV_SLIDE_BUTTON}\n >\n <ChevronBackHeavyMIcon />\n </div>\n )}\n\n {fullScreen && !isVideo(currentImage?.src) && (\n <img\n src={currentImage?.src}\n alt={currentImage ? getImageAlt(currentImage, currentSlideIndex) : ''}\n className={styles.fullScreenImage}\n />\n )}\n\n <Swiper {...swiperProps}>\n {images.map((image, index) => {\n const meta = imagesMeta[index];\n\n const imageWidth = meta?.width || 1;\n const imageHeight = meta?.height || 1;\n\n const imageAspectRatio = imageWidth / imageHeight;\n\n const slideVisible = index === currentSlideIndex;\n\n return (\n <SwiperSlide\n key={getImageKey(image, index)}\n style={{\n pointerEvents: slideVisible ? 'auto' : 'none',\n transitionProperty: 'opacity',\n }}\n >\n {({ isActive }) => (\n <Slide\n isActive={isActive}\n containerAspectRatio={swiperAspectRatio}\n image={image}\n containerHeight={swiperHeight}\n meta={meta}\n index={index}\n imageAspectRatio={imageAspectRatio}\n slideVisible={slideVisible}\n />\n )}\n </SwiperSlide>\n );\n })}\n </Swiper>\n\n {showControls && (\n <div\n className={cn(styles.arrow, {\n [styles.focused]: rightArrowFocused,\n })}\n onClick={handleNextClick}\n role='button'\n onKeyDown={handleArrowRightKeyDown}\n tabIndex={0}\n ref={rightArrowRef}\n aria-label='Следующее изображение'\n data-test-id={TestIds.NEXT_SLIDE_BUTTON}\n >\n <ChevronForwardHeavyMIcon />\n </div>\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAiBO,MAAM,WAAW,GAAO,MAAK;AAChC,IAAA,MAAM,EACF,MAAM,EACN,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,YAA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
|
|
28
28
|
display: flex;
|
|
29
29
|
flex-grow: 1;
|
|
30
30
|
justify-content: center;
|
|
31
31
|
background-color: var(--color-static-neutral-0-inverted);
|
|
32
|
+
.swiper {
|
|
33
|
+
margin-left: auto;
|
|
34
|
+
margin-right: auto;
|
|
35
|
+
position: relative;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
list-style: none;
|
|
38
|
+
padding: 0;
|
|
39
|
+
z-index: 1;
|
|
40
|
+
display: block;
|
|
41
|
+
}
|
|
42
|
+
.swiper-wrapper {
|
|
43
|
+
position: relative;
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
z-index: 1;
|
|
47
|
+
display: flex;
|
|
48
|
+
transition-property: transform;
|
|
49
|
+
transition-timing-function: var(--swiper-wrapper-transition-timing-function, ease);
|
|
50
|
+
transition-timing-function: var(--swiper-wrapper-transition-timing-function, initial);
|
|
51
|
+
box-sizing: content-box;
|
|
52
|
+
}
|
|
53
|
+
.swiper-android .swiper-slide,
|
|
54
|
+
.swiper-ios .swiper-slide,
|
|
55
|
+
.swiper-wrapper {
|
|
56
|
+
transform: translate3d(0, 0, 0);
|
|
57
|
+
}
|
|
58
|
+
.swiper-horizontal {
|
|
59
|
+
touch-action: pan-y;
|
|
60
|
+
}
|
|
61
|
+
.swiper-slide {
|
|
62
|
+
flex-shrink: 0;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
position: relative;
|
|
66
|
+
transition-property: transform;
|
|
67
|
+
display: block;
|
|
68
|
+
}
|
|
69
|
+
.swiper-slide-invisible-blank {
|
|
70
|
+
visibility: hidden;
|
|
71
|
+
}
|
|
72
|
+
.swiper-autoheight,
|
|
73
|
+
.swiper-autoheight .swiper-slide {
|
|
74
|
+
height: auto;
|
|
75
|
+
}
|
|
76
|
+
.swiper-autoheight .swiper-wrapper {
|
|
77
|
+
align-items: flex-start;
|
|
78
|
+
transition-property: transform, height;
|
|
79
|
+
}
|
|
80
|
+
.swiper-backface-hidden .swiper-slide {
|
|
81
|
+
transform: translateZ(0);
|
|
82
|
+
-webkit-backface-visibility: hidden;
|
|
83
|
+
backface-visibility: hidden;
|
|
84
|
+
}
|
|
85
|
+
.swiper .swiper-notification {
|
|
86
|
+
position: absolute;
|
|
87
|
+
left: 0;
|
|
88
|
+
top: 0;
|
|
89
|
+
pointer-events: none;
|
|
90
|
+
opacity: 0;
|
|
91
|
+
z-index: -1000;
|
|
92
|
+
}
|
|
32
93
|
}
|
|
33
|
-
.
|
|
94
|
+
.gallery__swiper_193kl {
|
|
34
95
|
display: flex;
|
|
35
96
|
width: 100%;
|
|
36
97
|
height: 100%;
|
|
@@ -38,13 +99,13 @@
|
|
|
38
99
|
padding: var(--gap-32) var(--gap-16);
|
|
39
100
|
box-sizing: border-box;
|
|
40
101
|
}
|
|
41
|
-
.
|
|
102
|
+
.gallery__swiper_193kl.gallery__mobile_193kl {
|
|
42
103
|
max-height: calc(100vh - 210px);
|
|
43
104
|
}
|
|
44
|
-
.
|
|
105
|
+
.gallery__swiper_193kl.gallery__mobileVideo_193kl {
|
|
45
106
|
max-height: 100vh;
|
|
46
107
|
}
|
|
47
|
-
.
|
|
108
|
+
.gallery__singleSlideContainer_193kl {
|
|
48
109
|
display: flex;
|
|
49
110
|
width: 100%;
|
|
50
111
|
height: 100%;
|
|
@@ -53,17 +114,17 @@
|
|
|
53
114
|
padding: var(--gap-32);
|
|
54
115
|
box-sizing: border-box;
|
|
55
116
|
}
|
|
56
|
-
.
|
|
117
|
+
.gallery__singleSlideContainer_193kl.gallery__mobile_193kl {
|
|
57
118
|
max-height: calc(100vh - 174px);
|
|
58
119
|
padding: 0;
|
|
59
120
|
}
|
|
60
|
-
.
|
|
121
|
+
.gallery__singleSlideContainer_193kl.gallery__mobileVideo_193kl {
|
|
61
122
|
max-height: 100vh;
|
|
62
123
|
}
|
|
63
|
-
.
|
|
124
|
+
.gallery__hidden_193kl {
|
|
64
125
|
display: none;
|
|
65
126
|
}
|
|
66
|
-
.
|
|
127
|
+
.gallery__slide_193kl {
|
|
67
128
|
position: relative;
|
|
68
129
|
display: flex;
|
|
69
130
|
justify-content: center;
|
|
@@ -71,15 +132,15 @@
|
|
|
71
132
|
width: 100%;
|
|
72
133
|
height: 100%;
|
|
73
134
|
}
|
|
74
|
-
.
|
|
135
|
+
.gallery__slideLoading_193kl {
|
|
75
136
|
background-color: var(--color-static-neutral-translucent-100-inverted);
|
|
76
137
|
border-radius: var(--border-radius-8);
|
|
77
138
|
}
|
|
78
|
-
.
|
|
139
|
+
.gallery__spinner_193kl {
|
|
79
140
|
position: absolute;
|
|
80
141
|
color: var(--color-static-neutral-translucent-1300-inverted);
|
|
81
142
|
}
|
|
82
|
-
.
|
|
143
|
+
.gallery__image_193kl {
|
|
83
144
|
width: 0;
|
|
84
145
|
height: 0;
|
|
85
146
|
-webkit-user-select: none;
|
|
@@ -87,10 +148,10 @@
|
|
|
87
148
|
user-select: none;
|
|
88
149
|
border-radius: var(--border-radius-8);
|
|
89
150
|
}
|
|
90
|
-
.
|
|
151
|
+
.gallery__image_193kl.gallery__mobile_193kl {
|
|
91
152
|
border-radius: var(--border-radius-0);
|
|
92
153
|
}
|
|
93
|
-
.
|
|
154
|
+
.gallery__smallImage_193kl {
|
|
94
155
|
position: relative;
|
|
95
156
|
width: auto;
|
|
96
157
|
height: auto;
|
|
@@ -98,15 +159,15 @@
|
|
|
98
159
|
-moz-user-select: none;
|
|
99
160
|
user-select: none;
|
|
100
161
|
}
|
|
101
|
-
.
|
|
162
|
+
.gallery__verticalImageFit_193kl {
|
|
102
163
|
width: auto;
|
|
103
164
|
height: 100%;
|
|
104
165
|
}
|
|
105
|
-
.
|
|
166
|
+
.gallery__horizontalImageFit_193kl {
|
|
106
167
|
width: 100%;
|
|
107
168
|
height: auto;
|
|
108
169
|
}
|
|
109
|
-
.
|
|
170
|
+
.gallery__arrow_193kl {
|
|
110
171
|
display: flex;
|
|
111
172
|
flex-direction: column;
|
|
112
173
|
justify-content: center;
|
|
@@ -119,17 +180,17 @@
|
|
|
119
180
|
transition: background-color 0.15s ease-in-out;
|
|
120
181
|
outline: none;
|
|
121
182
|
}
|
|
122
|
-
.
|
|
183
|
+
.gallery__arrow_193kl:hover {
|
|
123
184
|
background-color: var(--color-static-neutral-0-inverted-hover);
|
|
124
185
|
}
|
|
125
|
-
.
|
|
186
|
+
.gallery__arrow_193kl:active {
|
|
126
187
|
background-color: var(--color-static-neutral-0-inverted-press);
|
|
127
188
|
}
|
|
128
|
-
.
|
|
189
|
+
.gallery__focused_193kl {
|
|
129
190
|
outline: 2px solid var(--focus-color);
|
|
130
191
|
outline-offset: 2px;
|
|
131
192
|
}
|
|
132
|
-
.
|
|
193
|
+
.gallery__placeholder_193kl {
|
|
133
194
|
display: flex;
|
|
134
195
|
justify-content: center;
|
|
135
196
|
align-items: center;
|
|
@@ -138,7 +199,7 @@
|
|
|
138
199
|
border-radius: var(--border-radius-8);
|
|
139
200
|
background-color: var(--color-static-neutral-300-inverted);
|
|
140
201
|
}
|
|
141
|
-
.
|
|
202
|
+
.gallery__brokenImgWrapper_193kl {
|
|
142
203
|
position: relative;
|
|
143
204
|
display: flex;
|
|
144
205
|
flex-direction: column;
|
|
@@ -146,17 +207,17 @@
|
|
|
146
207
|
width: 150px;
|
|
147
208
|
text-align: center;
|
|
148
209
|
}
|
|
149
|
-
.
|
|
210
|
+
.gallery__brokenImgIcon_193kl {
|
|
150
211
|
width: 80px;
|
|
151
212
|
height: 80px;
|
|
152
213
|
margin-bottom: var(--gap-4);
|
|
153
214
|
}
|
|
154
|
-
.
|
|
215
|
+
.gallery__fullScreenImage_193kl {
|
|
155
216
|
width: 100%;
|
|
156
217
|
height: auto;
|
|
157
218
|
background-color: var(--color-light-base-bg-primary);
|
|
158
219
|
}
|
|
159
|
-
.
|
|
220
|
+
.gallery__fullScreenVideo_193kl {
|
|
160
221
|
width: calc(100% - 192px);
|
|
161
222
|
max-height: calc(100vh - 82px);
|
|
162
223
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './index.css';
|
|
2
2
|
|
|
3
|
-
const styles = {"component":"
|
|
3
|
+
const styles = {"component":"gallery__component_193kl","swiper":"gallery__swiper_193kl","mobile":"gallery__mobile_193kl","mobileVideo":"gallery__mobileVideo_193kl","singleSlideContainer":"gallery__singleSlideContainer_193kl","hidden":"gallery__hidden_193kl","slide":"gallery__slide_193kl","slideLoading":"gallery__slideLoading_193kl","spinner":"gallery__spinner_193kl","image":"gallery__image_193kl","smallImage":"gallery__smallImage_193kl","verticalImageFit":"gallery__verticalImageFit_193kl","horizontalImageFit":"gallery__horizontalImageFit_193kl","arrow":"gallery__arrow_193kl","focused":"gallery__focused_193kl","placeholder":"gallery__placeholder_193kl","brokenImgWrapper":"gallery__brokenImgWrapper_193kl","brokenImgIcon":"gallery__brokenImgIcon_193kl","fullScreenImage":"gallery__fullScreenImage_193kl","fullScreenVideo":"gallery__fullScreenVideo_193kl"};
|
|
4
4
|
|
|
5
5
|
export { styles as default };
|
|
6
6
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.module.css.js","sources":["../../src/components/image-viewer/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n display: flex;\n flex-grow: 1;\n justify-content: center;\n background-color: var(--color-static-neutral-0-inverted);\n}\n\n.swiper {\n display: flex;\n width: 100%;\n height: 100%;\n\n /* 168px - высота хэдера и футера */\n max-height: calc(100vh - 168px);\n padding: var(--gap-32) var(--gap-16);\n box-sizing: border-box;\n\n &.mobile {\n max-height: calc(100vh - 210px);\n }\n\n &.mobileVideo {\n max-height: 100vh;\n }\n}\n\n.singleSlideContainer {\n display: flex;\n width: 100%;\n height: 100%;\n\n max-height: calc(100vh - 80px);\n padding: var(--gap-32);\n box-sizing: border-box;\n\n &.mobile {\n max-height: calc(100vh - 174px);\n padding: 0;\n }\n\n &.mobileVideo {\n max-height: 100vh;\n }\n}\n\n.hidden {\n display: none;\n}\n\n.slide {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n}\n\n.slideLoading {\n background-color: var(--color-static-neutral-translucent-100-inverted);\n border-radius: var(--border-radius-8);\n}\n\n.spinner {\n position: absolute;\n color: var(--color-static-neutral-translucent-1300-inverted);\n}\n\n.image {\n width: 0;\n height: 0;\n user-select: none;\n border-radius: var(--border-radius-8);\n\n &.mobile {\n border-radius: var(--border-radius-0);\n }\n}\n\n.smallImage {\n position: relative;\n width: auto;\n height: auto;\n user-select: none;\n}\n\n.verticalImageFit {\n width: auto;\n height: 100%;\n}\n\n.horizontalImageFit {\n width: 100%;\n height: auto;\n}\n\n.arrow {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n width: 96px;\n height: 100%;\n cursor: pointer;\n color: var(--color-static-neutral-translucent-1300-inverted);\n transition: background-color 0.15s ease-in-out;\n outline: none;\n\n &:hover {\n background-color: var(--color-static-neutral-0-inverted-hover);\n }\n\n &:active {\n background-color: var(--color-static-neutral-0-inverted-press);\n }\n}\n\n.focused {\n @mixin focus-outline;\n}\n\n.placeholder {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n border-radius: var(--border-radius-8);\n background-color: var(--color-static-neutral-300-inverted);\n}\n\n.brokenImgWrapper {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 150px;\n text-align: center;\n}\n\n.brokenImgIcon {\n width: 80px;\n height: 80px;\n margin-bottom: var(--gap-4);\n}\n\n.fullScreenImage {\n width: 100%;\n height: auto;\n background-color: var(--color-light-base-bg-primary);\n}\n\n.fullScreenVideo {\n width: calc(100% - 192px);\n max-height: calc(100vh - 82px);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,0BAA0B,CAAC,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,aAAa,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,qCAAqC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,sBAAsB,CAAC,cAAc,CAAC,6BAA6B,CAAC,SAAS,CAAC,wBAAwB,CAAC,OAAO,CAAC,sBAAsB,CAAC,YAAY,CAAC,2BAA2B,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,oBAAoB,CAAC,mCAAmC,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,CAAC,wBAAwB,CAAC,aAAa,CAAC,4BAA4B,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,eAAe,CAAC,8BAA8B,CAAC,iBAAiB,CAAC,gCAAgC,CAAC,iBAAiB,CAAC,gCAAgC,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"index.module.css.js","sources":["../../src/components/image-viewer/index.module.css"],"sourcesContent":["@import '@alfalab/core-components-vars/src/index.css';\n\n.component {\n display: flex;\n flex-grow: 1;\n justify-content: center;\n background-color: var(--color-static-neutral-0-inverted);\n\n /* swiper/swiper.css; */\n :global(.swiper) {\n margin-left: auto;\n margin-right: auto;\n position: relative;\n overflow: hidden;\n list-style: none;\n padding: 0;\n z-index: 1;\n display: block;\n }\n :global(.swiper-wrapper) {\n position: relative;\n width: 100%;\n height: 100%;\n z-index: 1;\n display: flex;\n transition-property: transform;\n transition-timing-function: var(--swiper-wrapper-transition-timing-function, initial);\n box-sizing: content-box;\n }\n :global(.swiper-android) :global(.swiper-slide),\n :global(.swiper-ios) :global(.swiper-slide),\n :global(.swiper-wrapper) {\n transform: translate3d(0, 0, 0);\n }\n :global(.swiper-horizontal) {\n touch-action: pan-y;\n }\n :global(.swiper-slide) {\n flex-shrink: 0;\n width: 100%;\n height: 100%;\n position: relative;\n transition-property: transform;\n display: block;\n }\n :global(.swiper-slide-invisible-blank) {\n visibility: hidden;\n }\n :global(.swiper-autoheight),\n :global(.swiper-autoheight) :global(.swiper-slide) {\n height: auto;\n }\n :global(.swiper-autoheight) :global(.swiper-wrapper) {\n align-items: flex-start;\n transition-property: transform, height;\n }\n :global(.swiper-backface-hidden) :global(.swiper-slide) {\n transform: translateZ(0);\n backface-visibility: hidden;\n }\n\n /* swiper/modules/a11y.css */\n :global(.swiper) :global(.swiper-notification) {\n position: absolute;\n left: 0;\n top: 0;\n pointer-events: none;\n opacity: 0;\n z-index: -1000;\n }\n}\n\n.swiper {\n display: flex;\n width: 100%;\n height: 100%;\n\n /* 168px - высота хэдера и футера */\n max-height: calc(100vh - 168px);\n padding: var(--gap-32) var(--gap-16);\n box-sizing: border-box;\n\n &.mobile {\n max-height: calc(100vh - 210px);\n }\n\n &.mobileVideo {\n max-height: 100vh;\n }\n}\n\n.singleSlideContainer {\n display: flex;\n width: 100%;\n height: 100%;\n\n max-height: calc(100vh - 80px);\n padding: var(--gap-32);\n box-sizing: border-box;\n\n &.mobile {\n max-height: calc(100vh - 174px);\n padding: 0;\n }\n\n &.mobileVideo {\n max-height: 100vh;\n }\n}\n\n.hidden {\n display: none;\n}\n\n.slide {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n}\n\n.slideLoading {\n background-color: var(--color-static-neutral-translucent-100-inverted);\n border-radius: var(--border-radius-8);\n}\n\n.spinner {\n position: absolute;\n color: var(--color-static-neutral-translucent-1300-inverted);\n}\n\n.image {\n width: 0;\n height: 0;\n user-select: none;\n border-radius: var(--border-radius-8);\n\n &.mobile {\n border-radius: var(--border-radius-0);\n }\n}\n\n.smallImage {\n position: relative;\n width: auto;\n height: auto;\n user-select: none;\n}\n\n.verticalImageFit {\n width: auto;\n height: 100%;\n}\n\n.horizontalImageFit {\n width: 100%;\n height: auto;\n}\n\n.arrow {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n width: 96px;\n height: 100%;\n cursor: pointer;\n color: var(--color-static-neutral-translucent-1300-inverted);\n transition: background-color 0.15s ease-in-out;\n outline: none;\n\n &:hover {\n background-color: var(--color-static-neutral-0-inverted-hover);\n }\n\n &:active {\n background-color: var(--color-static-neutral-0-inverted-press);\n }\n}\n\n.focused {\n @mixin focus-outline;\n}\n\n.placeholder {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n border-radius: var(--border-radius-8);\n background-color: var(--color-static-neutral-300-inverted);\n}\n\n.brokenImgWrapper {\n position: relative;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 150px;\n text-align: center;\n}\n\n.brokenImgIcon {\n width: 80px;\n height: 80px;\n margin-bottom: var(--gap-4);\n}\n\n.fullScreenImage {\n width: 100%;\n height: auto;\n background-color: var(--color-light-base-bg-primary);\n}\n\n.fullScreenVideo {\n width: calc(100% - 192px);\n max-height: calc(100vh - 82px);\n}\n"],"names":[],"mappings":";;AAEgB,eAAe,CAAC,WAAW,CAAC,0BAA0B,CAAC,QAAQ,CAAC,uBAAuB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,aAAa,CAAC,4BAA4B,CAAC,sBAAsB,CAAC,qCAAqC,CAAC,QAAQ,CAAC,uBAAuB,CAAC,OAAO,CAAC,sBAAsB,CAAC,cAAc,CAAC,6BAA6B,CAAC,SAAS,CAAC,wBAAwB,CAAC,OAAO,CAAC,sBAAsB,CAAC,YAAY,CAAC,2BAA2B,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,oBAAoB,CAAC,mCAAmC,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,CAAC,wBAAwB,CAAC,aAAa,CAAC,4BAA4B,CAAC,kBAAkB,CAAC,iCAAiC,CAAC,eAAe,CAAC,8BAA8B,CAAC,iBAAiB,CAAC,gCAAgC,CAAC,iBAAiB,CAAC,gCAAgC,CAAC;;;;"}
|