@alfalab/core-components-gallery 6.0.0 → 6.0.1
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/Component.js +59 -26
- package/components/header-mobile/Component.js.map +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.js +2 -4
- package/components/image-viewer/component.js.map +1 -1
- package/components/image-viewer/index.css +25 -25
- package/components/image-viewer/index.module.css.js +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/header-mobile/Component.js +59 -26
- package/cssm/components/header-mobile/Component.js.map +1 -1
- package/cssm/components/image-viewer/component.js +2 -4
- package/cssm/components/image-viewer/component.js.map +1 -1
- 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/Component.js +59 -26
- package/esm/components/header-mobile/Component.js.map +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.js +2 -4
- package/esm/components/image-viewer/component.js.map +1 -1
- package/esm/components/image-viewer/index.css +25 -25
- package/esm/components/image-viewer/index.module.css.js +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/Component.js +41 -15
- package/modern/components/header-mobile/Component.js.map +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.js +2 -4
- package/modern/components/image-viewer/component.js.map +1 -1
- package/modern/components/image-viewer/index.css +25 -25
- package/modern/components/image-viewer/index.module.css.js +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/header-mobile/Component.js +41 -15
- package/moderncssm/components/header-mobile/Component.js.map +1 -1
- package/moderncssm/components/image-viewer/component.js +2 -4
- package/moderncssm/components/image-viewer/component.js.map +1 -1
- package/package.json +2 -2
- package/src/components/header-mobile/Component.tsx +45 -17
- package/src/components/image-viewer/component.tsx +1 -1
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
--color-static-neutral-translucent-500-inverted: rgba(228, 228, 251, 0.28);
|
|
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
|
+
} .gallery__component_1pgxx {
|
|
6
6
|
background-color: var(--color-static-neutral-translucent-500-inverted);
|
|
7
|
-
} .
|
|
7
|
+
} .gallery__component_1pgxx:hover {
|
|
8
8
|
background-color: var(--color-static-neutral-translucent-500-inverted-hover);
|
|
9
|
-
} .
|
|
9
|
+
} .gallery__component_1pgxx:active {
|
|
10
10
|
background-color: var(--color-static-neutral-translucent-500-inverted-press);
|
|
11
|
-
} .
|
|
11
|
+
} .gallery__component_1pgxx {
|
|
12
12
|
|
|
13
13
|
transition: transform 1s ease-in-out;
|
|
14
14
|
will-change: transform;
|
|
15
|
-
} .
|
|
15
|
+
} .gallery__notVisible_1pgxx {
|
|
16
16
|
transform: translateY(250%);
|
|
17
17
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"
|
|
5
|
+
var styles = {"component":"gallery__component_1pgxx","notVisible":"gallery__notVisible_1pgxx"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
} :root {
|
|
7
7
|
--gap-2xl: 32px;
|
|
8
8
|
--gap-32: var(--gap-2xl);
|
|
9
|
-
} .
|
|
9
|
+
} .gallery__buttons_18gty {
|
|
10
10
|
display: flex;
|
|
11
11
|
padding-left: var(--gap-32)
|
|
12
|
-
} .
|
|
12
|
+
} .gallery__buttons_18gty path {
|
|
13
13
|
color: var(--color-static-neutral-translucent-1300-inverted);
|
|
14
|
-
} .
|
|
14
|
+
} .gallery__iconButton_18gty path {
|
|
15
15
|
color: var(--color-static-neutral-100);
|
|
16
|
-
} .
|
|
16
|
+
} .gallery__iconButton_18gty:hover path {
|
|
17
17
|
color: var(--color-static-neutral-100-hover);
|
|
18
|
-
} .
|
|
18
|
+
} .gallery__iconButton_18gty:active path {
|
|
19
19
|
color: var(--color-static-neutral-100-press);
|
|
20
20
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--gap-2xs: 4px;
|
|
3
3
|
--gap-4: var(--gap-2xs);
|
|
4
|
-
} .
|
|
4
|
+
} .gallery__info_eau9a {
|
|
5
5
|
height: 100%;
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
justify-content: center;
|
|
9
9
|
overflow: hidden;
|
|
10
|
-
} .
|
|
10
|
+
} .gallery__filenameHead_eau9a {
|
|
11
11
|
display: inline;
|
|
12
12
|
text-overflow: ellipsis;
|
|
13
13
|
overflow: hidden;
|
|
14
14
|
white-space: nowrap;
|
|
15
|
-
} .
|
|
15
|
+
} .gallery__filenameContainer_eau9a {
|
|
16
16
|
overflow: hidden;
|
|
17
17
|
display: inline-flex;
|
|
18
|
-
} .
|
|
18
|
+
} .gallery__description_eau9a {
|
|
19
19
|
display: inline;
|
|
20
20
|
text-overflow: ellipsis;
|
|
21
21
|
overflow: hidden;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"info":"
|
|
5
|
+
var styles = {"info":"gallery__info_eau9a","filenameHead":"gallery__filenameHead_eau9a","filenameContainer":"gallery__filenameContainer_eau9a","description":"gallery__description_eau9a"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -27,39 +27,72 @@ var HeaderMobile = function () {
|
|
|
27
27
|
var canDownload = (_b = currentImage === null || currentImage === void 0 ? void 0 : currentImage.canDownload) !== null && _b !== void 0 ? _b : true;
|
|
28
28
|
var showDownloadButton = !(meta === null || meta === void 0 ? void 0 : meta.broken) && canDownload;
|
|
29
29
|
var handleShareClick = function () { return tslib.__awaiter(void 0, void 0, void 0, function () {
|
|
30
|
-
var title,
|
|
31
|
-
var
|
|
32
|
-
return tslib.__generator(this, function (
|
|
33
|
-
switch (
|
|
30
|
+
var title, url, response, blob, file, shareData;
|
|
31
|
+
var _b, _c;
|
|
32
|
+
return tslib.__generator(this, function (_d) {
|
|
33
|
+
switch (_d.label) {
|
|
34
34
|
case 0:
|
|
35
|
-
if (!currentImage)
|
|
35
|
+
if (!currentImage || !navigator.share) {
|
|
36
36
|
return [2 /*return*/];
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
}
|
|
38
|
+
title = (_b = currentImage.name) !== null && _b !== void 0 ? _b : new Date().toISOString().split('T')[0];
|
|
39
|
+
url = currentImage.src;
|
|
40
|
+
_d.label = 1;
|
|
39
41
|
case 1:
|
|
40
|
-
|
|
41
|
-
return [
|
|
42
|
+
_d.trys.push([1, 10, , 12]);
|
|
43
|
+
if (!utils.isVideo(url)) return [3 /*break*/, 3];
|
|
44
|
+
// Если видео — всегда делим ссылку
|
|
45
|
+
return [4 /*yield*/, navigator.share({
|
|
46
|
+
title: title,
|
|
47
|
+
url: url,
|
|
48
|
+
text: 'Видео',
|
|
49
|
+
})];
|
|
42
50
|
case 2:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
];
|
|
51
|
+
// Если видео — всегда делим ссылку
|
|
52
|
+
_d.sent();
|
|
53
|
+
return [2 /*return*/];
|
|
54
|
+
case 3: return [4 /*yield*/, fetch(url, { mode: 'cors' })];
|
|
55
|
+
case 4:
|
|
56
|
+
response = _d.sent();
|
|
57
|
+
return [4 /*yield*/, response.blob()];
|
|
58
|
+
case 5:
|
|
59
|
+
blob = _d.sent();
|
|
60
|
+
file = new File([blob], "".concat(title, ".png"), {
|
|
61
|
+
type: blob.type,
|
|
62
|
+
lastModified: Date.now(),
|
|
63
|
+
});
|
|
50
64
|
shareData = {
|
|
51
|
-
files:
|
|
65
|
+
files: [file],
|
|
66
|
+
title: title,
|
|
67
|
+
text: 'Картинка',
|
|
52
68
|
};
|
|
53
|
-
if (!(navigator.canShare(shareData) &&
|
|
69
|
+
if (!(((_c = navigator.canShare) === null || _c === void 0 ? void 0 : _c.call(navigator, shareData)) && response.ok)) return [3 /*break*/, 7];
|
|
54
70
|
return [4 /*yield*/, navigator.share(shareData)];
|
|
55
|
-
case
|
|
56
|
-
|
|
57
|
-
return [3 /*break*/,
|
|
58
|
-
case
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
71
|
+
case 6:
|
|
72
|
+
_d.sent();
|
|
73
|
+
return [3 /*break*/, 9];
|
|
74
|
+
case 7:
|
|
75
|
+
// Fallback: делимся только ссылкой
|
|
76
|
+
return [4 /*yield*/, navigator.share({
|
|
77
|
+
title: title,
|
|
78
|
+
text: 'Картинка',
|
|
79
|
+
url: url,
|
|
80
|
+
})];
|
|
81
|
+
case 8:
|
|
82
|
+
// Fallback: делимся только ссылкой
|
|
83
|
+
_d.sent();
|
|
84
|
+
_d.label = 9;
|
|
85
|
+
case 9: return [3 /*break*/, 12];
|
|
86
|
+
case 10:
|
|
87
|
+
_d.sent();
|
|
88
|
+
return [4 /*yield*/, navigator.share({
|
|
89
|
+
title: title,
|
|
90
|
+
url: url,
|
|
91
|
+
})];
|
|
92
|
+
case 11:
|
|
93
|
+
_d.sent();
|
|
94
|
+
return [3 /*break*/, 12];
|
|
95
|
+
case 12: return [2 /*return*/];
|
|
63
96
|
}
|
|
64
97
|
});
|
|
65
98
|
}); };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.js","sources":["../../src/components/header-mobile/Component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { GalleryContext } from '../../context';\nimport { isVideo, TestIds } from '../../utils';\nimport * as Buttons from '../buttons';\n\nimport styles from './index.module.css';\n\nexport const HeaderMobile = () => {\n const {\n onClose,\n images,\n currentSlideIndex,\n getCurrentImage,\n getCurrentImageMeta,\n hideNavigation,\n } = useContext(GalleryContext);\n\n const currentImage = getCurrentImage();\n const meta = getCurrentImageMeta();\n\n const description = images.length > 1 && `${currentSlideIndex + 1} из ${images.length}`;\n\n const canDownload = currentImage?.canDownload ?? true;\n const showDownloadButton = !meta?.broken && canDownload;\n\n const handleShareClick = async () => {\n if (!currentImage) return;\n\n const title = currentImage.name ?? new Date().toISOString().split('T')[0];\n\n const
|
|
1
|
+
{"version":3,"file":"Component.js","sources":["../../src/components/header-mobile/Component.tsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport cn from 'classnames';\n\nimport { Text } from '@alfalab/core-components-typography';\n\nimport { GalleryContext } from '../../context';\nimport { isVideo, TestIds } from '../../utils';\nimport * as Buttons from '../buttons';\n\nimport styles from './index.module.css';\n\nexport const HeaderMobile = () => {\n const {\n onClose,\n images,\n currentSlideIndex,\n getCurrentImage,\n getCurrentImageMeta,\n hideNavigation,\n } = useContext(GalleryContext);\n\n const currentImage = getCurrentImage();\n const meta = getCurrentImageMeta();\n\n const description = images.length > 1 && `${currentSlideIndex + 1} из ${images.length}`;\n\n const canDownload = currentImage?.canDownload ?? true;\n const showDownloadButton = !meta?.broken && canDownload;\n\n const handleShareClick = async () => {\n if (!currentImage || !navigator.share) {\n return;\n }\n\n const title = currentImage.name ?? new Date().toISOString().split('T')[0];\n const url = currentImage.src;\n\n try {\n if (isVideo(url)) {\n // Если видео — всегда делим ссылку\n await navigator.share({\n title,\n url,\n text: 'Видео',\n });\n\n return;\n }\n\n // Попробуем скачать изображение\n const response = await fetch(url, { mode: 'cors' });\n const blob = await response.blob();\n\n const file = new File([blob], `${title}.png`, {\n type: blob.type,\n lastModified: Date.now(),\n });\n\n const shareData: ShareData = {\n files: [file],\n title,\n text: 'Картинка',\n };\n\n // Попробуем поделиться файлом\n if (navigator.canShare?.(shareData) && response.ok) {\n await navigator.share(shareData);\n } else {\n // Fallback: делимся только ссылкой\n await navigator.share({\n title,\n text: 'Картинка',\n url,\n });\n }\n } catch {\n await navigator.share({\n title,\n url,\n });\n }\n };\n\n return (\n <div\n className={cn(styles.headerMobile, {\n [styles.video]: isVideo(currentImage?.src),\n [styles.hide]: hideNavigation,\n })}\n >\n <Buttons.BackArrow onClick={onClose} />\n <Text\n className={styles.description}\n tag='div'\n view='component-primary'\n color='static-primary-light'\n >\n {description}\n </Text>\n <div className={styles.rightButtons}>\n {showDownloadButton && (\n <Buttons.Download\n href={currentImage?.src}\n download={currentImage?.name}\n dataTestId={TestIds.DOWNLOAD_BUTTON}\n />\n )}\n {!meta?.broken && <Buttons.Share onClick={handleShareClick} />}\n </div>\n </div>\n );\n};\n"],"names":["useContext","GalleryContext","__awaiter","isVideo","React","cn","styles","Buttons.BackArrow","Text","Buttons.Download","TestIds","Buttons.Share"],"mappings":";;;;;;;;;;;;;;;;;;;AAWa,IAAA,YAAY,GAAG,YAAA;;;IAClB,IAAA,EAAA,GAOFA,gBAAU,CAACC,sBAAc,CAAC,EAN1B,OAAO,GAAA,EAAA,CAAA,OAAA,EACP,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,iBAAiB,GAAA,EAAA,CAAA,iBAAA,EACjB,eAAe,GAAA,EAAA,CAAA,eAAA,EACf,mBAAmB,GAAA,EAAA,CAAA,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KAAZ,IAAA,IAAA,YAAY,uBAAZ,YAAY,CAAE,IAAI,EAC5B,UAAU,EAAEC,iBAAO,CAAC,eAAe,GACrC,CACL;YACA,EAAC,IAAI,KAAJ,IAAA,IAAA,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA,IAAIN,sBAAA,CAAA,aAAA,CAACO,WAAa,IAAC,OAAO,EAAE,gBAAgB,EAAI,CAAA,CAC5D,CACJ;AAEd;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
:root {
|
|
2
2
|
--color-static-neutral-0-inverted: #262629;
|
|
3
|
-
} .
|
|
3
|
+
} .gallery__headerMobile_161it {
|
|
4
4
|
position: relative;
|
|
5
5
|
height: 72px;
|
|
6
6
|
z-index: 3;
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
display: flex;
|
|
9
9
|
justify-content: space-between;
|
|
10
10
|
align-items: center
|
|
11
|
-
} .
|
|
11
|
+
} .gallery__headerMobile_161it.gallery__video_161it {
|
|
12
12
|
position: absolute;
|
|
13
13
|
width: 100%;
|
|
14
14
|
background-color: var(--color-static-neutral-0-inverted);
|
|
15
15
|
transition: transform 0.3s ease-in-out;
|
|
16
|
-
} .
|
|
16
|
+
} .gallery__hide_161it {
|
|
17
17
|
transform: translateY(-96px);
|
|
18
|
-
} .
|
|
19
|
-
.
|
|
18
|
+
} .gallery__leftButton_161it,
|
|
19
|
+
.gallery__rightButtons_161it {
|
|
20
20
|
display: flex;
|
|
21
21
|
align-items: center;
|
|
22
|
-
} .
|
|
22
|
+
} .gallery__description_161it {
|
|
23
23
|
position: absolute;
|
|
24
24
|
left: 50%;
|
|
25
25
|
transform: translateX(-50%);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"headerMobile":"
|
|
5
|
+
var styles = {"headerMobile":"gallery__headerMobile_161it","video":"gallery__video_161it","hide":"gallery__hide_161it","rightButtons":"gallery__rightButtons_161it","description":"gallery__description_161it"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -9,19 +9,19 @@
|
|
|
9
9
|
--border-radius-12: var(--border-radius-l);
|
|
10
10
|
} :root {
|
|
11
11
|
--focus-color: var(--color-light-status-info);
|
|
12
|
-
} .
|
|
12
|
+
} .gallery__component_1cpps {
|
|
13
13
|
display: flex;
|
|
14
14
|
z-index: 3;
|
|
15
15
|
overflow: hidden;
|
|
16
16
|
transition: border 0.15s ease-in-out;
|
|
17
17
|
outline: none
|
|
18
|
-
} .
|
|
18
|
+
} .gallery__component_1cpps .gallery__image_1cpps {
|
|
19
19
|
opacity: 0.3;
|
|
20
|
-
} .
|
|
20
|
+
} .gallery__component_1cpps.gallery__mobile_1cpps {
|
|
21
21
|
padding: 0;
|
|
22
|
-
} .
|
|
22
|
+
} .gallery__active_1cpps > .gallery__image_1cpps {
|
|
23
23
|
opacity: 1;
|
|
24
|
-
} .
|
|
24
|
+
} .gallery__preview_1cpps {
|
|
25
25
|
width: 56px;
|
|
26
26
|
height: 56px;
|
|
27
27
|
flex-shrink: 0;
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
-webkit-user-select: none;
|
|
31
31
|
-moz-user-select: none;
|
|
32
32
|
user-select: none
|
|
33
|
-
} .
|
|
33
|
+
} .gallery__preview_1cpps.gallery__mobile_1cpps {
|
|
34
34
|
width: 46px;
|
|
35
35
|
height: 46px;
|
|
36
36
|
border-radius: var(--border-radius-8);
|
|
37
|
-
} .
|
|
37
|
+
} .gallery__image_1cpps {
|
|
38
38
|
transition: opacity 0.15s ease-in-out
|
|
39
|
-
} .
|
|
39
|
+
} .gallery__image_1cpps > img {
|
|
40
40
|
display: block;
|
|
41
41
|
width: 100%;
|
|
42
42
|
height: 100%;
|
|
@@ -45,28 +45,28 @@
|
|
|
45
45
|
object-fit: cover;
|
|
46
46
|
overflow: clip;
|
|
47
47
|
overflow-clip-margin: border-box;
|
|
48
|
-
} .
|
|
48
|
+
} .gallery__image_1cpps:hover {
|
|
49
49
|
opacity: 0.7;
|
|
50
|
-
} .
|
|
50
|
+
} .gallery__loading_1cpps {
|
|
51
51
|
background-color: var(--color-static-neutral-100-inverted)
|
|
52
|
-
} .
|
|
52
|
+
} .gallery__loading_1cpps .gallery__active_1cpps {
|
|
53
53
|
background-color: var(--color-static-neutral-300-inverted);
|
|
54
|
-
} .
|
|
54
|
+
} .gallery__brokenImageWrapper_1cpps {
|
|
55
55
|
display: flex;
|
|
56
56
|
justify-content: center;
|
|
57
57
|
align-items: center;
|
|
58
58
|
background-color: var(--color-static-neutral-300-inverted);
|
|
59
59
|
opacity: 0.3
|
|
60
|
-
} .
|
|
60
|
+
} .gallery__brokenImageWrapper_1cpps.gallery__active_1cpps {
|
|
61
61
|
opacity: 1;
|
|
62
|
-
} .
|
|
62
|
+
} .gallery__brokenIcon_1cpps {
|
|
63
63
|
width: 40px;
|
|
64
64
|
height: 40px;
|
|
65
|
-
} .
|
|
65
|
+
} .gallery__focused_1cpps {
|
|
66
66
|
outline: 2px solid var(--focus-color);
|
|
67
67
|
outline-offset: 2px;
|
|
68
|
-
} .
|
|
68
|
+
} .gallery__canvasPreview_1cpps {
|
|
69
69
|
border-radius: var(--border-radius-12)
|
|
70
|
-
} .
|
|
70
|
+
} .gallery__canvasPreview_1cpps.gallery__mobile_1cpps {
|
|
71
71
|
border-radius: var(--border-radius-8);
|
|
72
72
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"
|
|
5
|
+
var styles = {"component":"gallery__component_1cpps","image":"gallery__image_1cpps","mobile":"gallery__mobile_1cpps","active":"gallery__active_1cpps","preview":"gallery__preview_1cpps","loading":"gallery__loading_1cpps","brokenImageWrapper":"gallery__brokenImageWrapper_1cpps","brokenIcon":"gallery__brokenIcon_1cpps","focused":"gallery__focused_1cpps","canvasPreview":"gallery__canvasPreview_1cpps"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|
|
@@ -88,12 +88,10 @@ var ImageViewer = function () {
|
|
|
88
88
|
var swiperWidth = (swiper === null || swiper === void 0 ? void 0 : swiper.width) || 1;
|
|
89
89
|
var swiperHeight = (swiper === null || swiper === void 0 ? void 0 : swiper.height) || (swiper === null || swiper === void 0 ? void 0 : swiper.width) || 1;
|
|
90
90
|
var swiperAspectRatio = swiperWidth / swiperHeight;
|
|
91
|
-
return (
|
|
92
|
-
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */
|
|
93
|
-
React__default.default.createElement("div", { className: cn__default.default(index_module.component, (_a = {},
|
|
91
|
+
return (React__default.default.createElement("div", { className: cn__default.default(index_module.component, (_a = {},
|
|
94
92
|
_a[index_module.mobile] = isMobile,
|
|
95
93
|
_a[index_module.mobileVideo] = isMobile && utils.isVideo(currentImage === null || currentImage === void 0 ? void 0 : currentImage.src),
|
|
96
|
-
_a)), onClick: handleWrapperClick },
|
|
94
|
+
_a)), "aria-hidden": true, onClick: handleWrapperClick },
|
|
97
95
|
showControls && (React__default.default.createElement("div", { className: cn__default.default(index_module.arrow, (_b = {},
|
|
98
96
|
_b[index_module.focused] = leftArrowFocused,
|
|
99
97
|
_b)), onClick: handlePrevClick, role: 'button', onKeyDown: handleArrowLeftKeyDown, tabIndex: 0, ref: leftArrowRef, "aria-label": '\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435', "data-test-id": constants.TestIds.PREV_SLIDE_BUTTON },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sources":["../../src/components/image-viewer/component.tsx"],"sourcesContent":["import React, { FC, 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 /* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */\n <div\n className={cn(styles.component, {\n [styles.mobile]: isMobile,\n [styles.mobileVideo]: isMobile && isVideo(currentImage?.src),\n })}\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":["SwiperCore","EffectFade","A11y","Controller","useContext","GalleryContext","useHandleImageViewer","useFocus","useCallback","useMemo","cn","styles","isVideo","React","TestIds","ChevronBackHeavyMIcon","getImageAlt","Swiper","__assign","SwiperSlide","getImageKey","Slide","ChevronForwardHeavyMIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkBAA,2BAAU,CAAC,GAAG,CAAC,CAACC,qBAAU,EAAEC,eAAI,EAAEC,qBAAU,CAAC,CAAC;AAEjC,IAAA,WAAW,GAAO,YAAA;;AACrB,IAAA,IAAA,KAYFC,gBAAU,CAACC,sBAAc,CAAC,EAX1B,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,UAAU,gBAAA,EACV,UAAU,gBAAA,EACV,iBAAiB,uBAAA,EACjB,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,oBAAoB,GAAA,EAAA,CAAA,oBAAA,EACpB,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,SAAS,eAAA,EACT,SAAS,eAAA,EACT,eAAe,qBACW;AAExB,IAAA,IAAA,EAAgE,GAAAC,0BAAoB,EAAE,EAApF,kBAAkB,GAAA,EAAA,CAAA,kBAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,aAAa,GAAA,EAAA,CAAA,aAAA,EAAE,YA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,GAAA,EAAA,CAAA,QAAA;AAAO,gBAAA,QACfP,sBAAC,CAAA,aAAA,CAAAQ,WAAK,EACF,EAAA,QAAQ,EAAE,QAAQ,EAClB,oBAAoB,EAAE,iBAAiB,EACvC,KAAK,EAAE,KAAK,EACZ,eAAe,EAAE,YAAY,EAC7B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,YAAY,GAC5B;aACL,CACS;AAEtB,SAAC,CAAC,CACG;QAER,YAAY,KACTR,sBACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEH,mBAAE,CAACC,YAAM,CAAC,KAAK,GAAA,EAAA,GAAA,EAAA;AACtB,gBAAA,EAAA,CAACA,YAAM,CAAC,OAAO,CAAA,GAAG,iBAAiB;oBACrC,EACF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,uBAAuB,EAClC,QAAQ,EAAE,CAAC,EACX,GAAG,EAAE,aAAa,gBACP,2HAAuB,EAAA,cAAA,EACpBG,iBAAO,CAAC,iBAAiB,EAAA;AAEvC,YAAAD,sBAAA,CAAA,aAAA,CAACS,iDAAwB,EAAG,IAAA,CAAA,CAC1B,CACT,CACC;AAEd;;;;"}
|
|
1
|
+
{"version":3,"file":"component.js","sources":["../../src/components/image-viewer/component.tsx"],"sourcesContent":["import React, { FC, 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":["SwiperCore","EffectFade","A11y","Controller","useContext","GalleryContext","useHandleImageViewer","useFocus","useCallback","useMemo","cn","styles","isVideo","React","TestIds","ChevronBackHeavyMIcon","getImageAlt","Swiper","__assign","SwiperSlide","getImageKey","Slide","ChevronForwardHeavyMIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAkBAA,2BAAU,CAAC,GAAG,CAAC,CAACC,qBAAU,EAAEC,eAAI,EAAEC,qBAAU,CAAC,CAAC;AAEjC,IAAA,WAAW,GAAO,YAAA;;AACrB,IAAA,IAAA,KAYFC,gBAAU,CAACC,sBAAc,CAAC,EAX1B,MAAM,GAAA,EAAA,CAAA,MAAA,EACN,UAAU,gBAAA,EACV,UAAU,gBAAA,EACV,iBAAiB,uBAAA,EACjB,YAAY,GAAA,EAAA,CAAA,YAAA,EACZ,oBAAoB,GAAA,EAAA,CAAA,oBAAA,EACpB,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,SAAS,eAAA,EACT,SAAS,eAAA,EACT,eAAe,qBACW;AAExB,IAAA,IAAA,EAAgE,GAAAC,0BAAoB,EAAE,EAApF,kBAAkB,GAAA,EAAA,CAAA,kBAAA,EAAE,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,aAAa,GAAA,EAAA,CAAA,aAAA,EAAE,YAAY,kBAA2B;IAErF,IAAA,gBAAgB,GAAIC,gBAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,CAAA,CAAA,CAAtC;IAChB,IAAA,iBAAiB,GAAIA,gBAAQ,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA,CAAA,CAAvC;AAExB,IAAA,IAAM,MAAM,GAAG,SAAS,EAAE;AAC1B,IAAA,IAAM,YAAY,GAAG,eAAe,EAAE;IAEtC,IAAM,iBAAiB,GAAGC,iBAAW,CAAC,YAAA;;AAClC,QAAA,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,YAAY,KACTR,sBACI,CAAA,aAAA,CAAA,KAAA,EAAA,EAAA,SAAS,EAAEH,mBAAE,CAACC,YAAM,CAAC,KAAK,GAAA,EAAA,GAAA,EAAA;AACtB,gBAAA,EAAA,CAACA,YAAM,CAAC,OAAO,CAAA,GAAG,iBAAiB;oBACrC,EACF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,uBAAuB,EAClC,QAAQ,EAAE,CAAC,EACX,GAAG,EAAE,aAAa,gBACP,2HAAuB,EAAA,cAAA,EACpBG,iBAAO,CAAC,iBAAiB,EAAA;AAEvC,YAAAD,sBAAA,CAAA,aAAA,CAACS,iDAAwB,EAAG,IAAA,CAAA,CAC1B,CACT,CACC;AAEd;;;;"}
|
|
@@ -19,23 +19,23 @@
|
|
|
19
19
|
--gap-32: var(--gap-2xl);
|
|
20
20
|
} :root {
|
|
21
21
|
--focus-color: var(--color-light-status-info);
|
|
22
|
-
} .
|
|
22
|
+
} .gallery__component_1eaei {
|
|
23
23
|
display: flex;
|
|
24
24
|
flex-grow: 1;
|
|
25
25
|
justify-content: center;
|
|
26
26
|
background-color: var(--color-static-neutral-0-inverted);
|
|
27
|
-
} .
|
|
27
|
+
} .gallery__swiper_1eaei {
|
|
28
28
|
display: flex;
|
|
29
29
|
width: 100%;
|
|
30
30
|
height: 100%;
|
|
31
31
|
max-height: calc(100vh - 168px);
|
|
32
32
|
padding: var(--gap-32) var(--gap-16);
|
|
33
33
|
box-sizing: border-box
|
|
34
|
-
} .
|
|
34
|
+
} .gallery__swiper_1eaei.gallery__mobile_1eaei {
|
|
35
35
|
max-height: calc(100vh - 210px);
|
|
36
|
-
} .
|
|
36
|
+
} .gallery__swiper_1eaei.gallery__mobileVideo_1eaei {
|
|
37
37
|
max-height: 100vh;
|
|
38
|
-
} .
|
|
38
|
+
} .gallery__singleSlideContainer_1eaei {
|
|
39
39
|
display: flex;
|
|
40
40
|
width: 100%;
|
|
41
41
|
height: 100%;
|
|
@@ -43,49 +43,49 @@
|
|
|
43
43
|
max-height: calc(100vh - 80px);
|
|
44
44
|
padding: var(--gap-32);
|
|
45
45
|
box-sizing: border-box
|
|
46
|
-
} .
|
|
46
|
+
} .gallery__singleSlideContainer_1eaei.gallery__mobile_1eaei {
|
|
47
47
|
max-height: calc(100vh - 174px);
|
|
48
48
|
padding: 0;
|
|
49
|
-
} .
|
|
49
|
+
} .gallery__singleSlideContainer_1eaei.gallery__mobileVideo_1eaei {
|
|
50
50
|
max-height: 100vh;
|
|
51
|
-
} .
|
|
51
|
+
} .gallery__hidden_1eaei {
|
|
52
52
|
display: none;
|
|
53
|
-
} .
|
|
53
|
+
} .gallery__slide_1eaei {
|
|
54
54
|
position: relative;
|
|
55
55
|
display: flex;
|
|
56
56
|
justify-content: center;
|
|
57
57
|
align-items: center;
|
|
58
58
|
width: 100%;
|
|
59
59
|
height: 100%;
|
|
60
|
-
} .
|
|
60
|
+
} .gallery__slideLoading_1eaei {
|
|
61
61
|
background-color: var(--color-static-neutral-translucent-100-inverted);
|
|
62
62
|
border-radius: var(--border-radius-8);
|
|
63
|
-
} .
|
|
63
|
+
} .gallery__spinner_1eaei {
|
|
64
64
|
position: absolute;
|
|
65
65
|
color: var(--color-static-neutral-translucent-1300-inverted);
|
|
66
|
-
} .
|
|
66
|
+
} .gallery__image_1eaei {
|
|
67
67
|
width: 0;
|
|
68
68
|
height: 0;
|
|
69
69
|
-webkit-user-select: none;
|
|
70
70
|
-moz-user-select: none;
|
|
71
71
|
user-select: none;
|
|
72
72
|
border-radius: var(--border-radius-8)
|
|
73
|
-
} .
|
|
73
|
+
} .gallery__image_1eaei.gallery__mobile_1eaei {
|
|
74
74
|
border-radius: var(--border-radius-0);
|
|
75
|
-
} .
|
|
75
|
+
} .gallery__smallImage_1eaei {
|
|
76
76
|
position: relative;
|
|
77
77
|
width: auto;
|
|
78
78
|
height: auto;
|
|
79
79
|
-webkit-user-select: none;
|
|
80
80
|
-moz-user-select: none;
|
|
81
81
|
user-select: none;
|
|
82
|
-
} .
|
|
82
|
+
} .gallery__verticalImageFit_1eaei {
|
|
83
83
|
width: auto;
|
|
84
84
|
height: 100%;
|
|
85
|
-
} .
|
|
85
|
+
} .gallery__horizontalImageFit_1eaei {
|
|
86
86
|
width: 100%;
|
|
87
87
|
height: auto;
|
|
88
|
-
} .
|
|
88
|
+
} .gallery__arrow_1eaei {
|
|
89
89
|
display: flex;
|
|
90
90
|
flex-direction: column;
|
|
91
91
|
justify-content: center;
|
|
@@ -97,14 +97,14 @@
|
|
|
97
97
|
color: var(--color-static-neutral-translucent-1300-inverted);
|
|
98
98
|
transition: background-color 0.15s ease-in-out;
|
|
99
99
|
outline: none
|
|
100
|
-
} .
|
|
100
|
+
} .gallery__arrow_1eaei:hover {
|
|
101
101
|
background-color: var(--color-static-neutral-0-inverted-hover);
|
|
102
|
-
} .
|
|
102
|
+
} .gallery__arrow_1eaei:active {
|
|
103
103
|
background-color: var(--color-static-neutral-0-inverted-press);
|
|
104
|
-
} .
|
|
104
|
+
} .gallery__focused_1eaei {
|
|
105
105
|
outline: 2px solid var(--focus-color);
|
|
106
106
|
outline-offset: 2px;
|
|
107
|
-
} .
|
|
107
|
+
} .gallery__placeholder_1eaei {
|
|
108
108
|
display: flex;
|
|
109
109
|
justify-content: center;
|
|
110
110
|
align-items: center;
|
|
@@ -112,22 +112,22 @@
|
|
|
112
112
|
height: 100%;
|
|
113
113
|
border-radius: var(--border-radius-8);
|
|
114
114
|
background-color: var(--color-static-neutral-300-inverted);
|
|
115
|
-
} .
|
|
115
|
+
} .gallery__brokenImgWrapper_1eaei {
|
|
116
116
|
position: relative;
|
|
117
117
|
display: flex;
|
|
118
118
|
flex-direction: column;
|
|
119
119
|
align-items: center;
|
|
120
120
|
width: 150px;
|
|
121
121
|
text-align: center;
|
|
122
|
-
} .
|
|
122
|
+
} .gallery__brokenImgIcon_1eaei {
|
|
123
123
|
width: 80px;
|
|
124
124
|
height: 80px;
|
|
125
125
|
margin-bottom: var(--gap-2xs);
|
|
126
|
-
} .
|
|
126
|
+
} .gallery__fullScreenImage_1eaei {
|
|
127
127
|
width: 100%;
|
|
128
128
|
height: auto;
|
|
129
129
|
background-color: var(--color-light-base-bg-primary);
|
|
130
|
-
} .
|
|
130
|
+
} .gallery__fullScreenVideo_1eaei {
|
|
131
131
|
width: calc(100% - 192px);
|
|
132
132
|
max-height: calc(100vh - 82px);
|
|
133
133
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('./index.css');
|
|
4
4
|
|
|
5
|
-
var styles = {"component":"
|
|
5
|
+
var styles = {"component":"gallery__component_1eaei","swiper":"gallery__swiper_1eaei","mobile":"gallery__mobile_1eaei","mobileVideo":"gallery__mobileVideo_1eaei","singleSlideContainer":"gallery__singleSlideContainer_1eaei","hidden":"gallery__hidden_1eaei","slide":"gallery__slide_1eaei","slideLoading":"gallery__slideLoading_1eaei","spinner":"gallery__spinner_1eaei","image":"gallery__image_1eaei","smallImage":"gallery__smallImage_1eaei","verticalImageFit":"gallery__verticalImageFit_1eaei","horizontalImageFit":"gallery__horizontalImageFit_1eaei","arrow":"gallery__arrow_1eaei","focused":"gallery__focused_1eaei","placeholder":"gallery__placeholder_1eaei","brokenImgWrapper":"gallery__brokenImgWrapper_1eaei","brokenImgIcon":"gallery__brokenImgIcon_1eaei","fullScreenImage":"gallery__fullScreenImage_1eaei","fullScreenVideo":"gallery__fullScreenVideo_1eaei"};
|
|
6
6
|
|
|
7
7
|
module.exports = styles;
|
|
8
8
|
//# sourceMappingURL=index.module.css.js.map
|