@doyourjob/gravity-ui-page-constructor 5.31.112 → 5.31.113-background-effect-for-header-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/build/cjs/blocks/Header/BackgroundEffect/BackgroundEffect.css +30 -0
- package/build/cjs/blocks/Header/BackgroundEffect/BackgroundEffect.d.ts +6 -0
- package/build/cjs/blocks/Header/BackgroundEffect/BackgroundEffect.js +76 -0
- package/build/cjs/blocks/Header/Header.js +3 -1
- package/build/cjs/blocks/Header/schema.d.ts +26 -0
- package/build/cjs/blocks/Header/schema.js +9 -0
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +13 -0
- package/build/cjs/components/Media/Video/utils.d.ts +1 -0
- package/build/cjs/components/Media/Video/utils.js +2 -1
- package/build/cjs/models/constructor-items/blocks.d.ts +4 -0
- package/build/cjs/sub-blocks/CaseStudyCard/CaseStudyCard.css +3 -0
- package/build/cjs/sub-blocks/CaseStudyCard/CaseStudyCard.js +1 -1
- package/build/esm/blocks/Header/BackgroundEffect/BackgroundEffect.css +30 -0
- package/build/esm/blocks/Header/BackgroundEffect/BackgroundEffect.d.ts +7 -0
- package/build/esm/blocks/Header/BackgroundEffect/BackgroundEffect.js +72 -0
- package/build/esm/blocks/Header/Header.js +3 -1
- package/build/esm/blocks/Header/schema.d.ts +26 -0
- package/build/esm/blocks/Header/schema.js +9 -0
- package/build/esm/blocks/HeaderSlider/schema.d.ts +13 -0
- package/build/esm/components/Media/Video/utils.d.ts +1 -0
- package/build/esm/components/Media/Video/utils.js +1 -1
- package/build/esm/models/constructor-items/blocks.d.ts +4 -0
- package/build/esm/sub-blocks/CaseStudyCard/CaseStudyCard.css +3 -0
- package/build/esm/sub-blocks/CaseStudyCard/CaseStudyCard.js +1 -1
- package/package.json +1 -1
- package/schema/index.js +1 -1
- package/server/models/constructor-items/blocks.d.ts +4 -0
- package/widget/index.js +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-background-effect {
|
|
4
|
+
position: absolute;
|
|
5
|
+
inset: 0;
|
|
6
|
+
display: flex;
|
|
7
|
+
}
|
|
8
|
+
.pc-background-effect__left {
|
|
9
|
+
position: absolute;
|
|
10
|
+
inset: 0;
|
|
11
|
+
clip-path: inset(0 0.01% 0 0);
|
|
12
|
+
transition: clip-path 1.5s ease;
|
|
13
|
+
}
|
|
14
|
+
.pc-background-effect__right {
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset: 0;
|
|
17
|
+
clip-path: inset(0 0 0 99.99%);
|
|
18
|
+
transition: clip-path 1.5s ease;
|
|
19
|
+
}
|
|
20
|
+
.pc-header-block:hover .pc-background-effect__left {
|
|
21
|
+
clip-path: inset(0 99.99% 0 0);
|
|
22
|
+
}
|
|
23
|
+
.pc-header-block:hover .pc-background-effect__right {
|
|
24
|
+
clip-path: inset(0 0 0 0.01%);
|
|
25
|
+
}
|
|
26
|
+
.pc-background-effect__video {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
object-fit: cover;
|
|
30
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BackgroundEffect = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const utils_1 = require("../../../components/Media/Video/utils");
|
|
7
|
+
const utils_2 = require("../../../utils");
|
|
8
|
+
const b = (0, utils_2.block)('background-effect');
|
|
9
|
+
const SYNC_THRESHOLD = 0.03;
|
|
10
|
+
const MAX_DESYNC = 0.5;
|
|
11
|
+
const FAST_RATE = 1.05;
|
|
12
|
+
const SLOW_RATE = 0.95;
|
|
13
|
+
const BackgroundEffect = ({ firstSrc, secondSrc }) => {
|
|
14
|
+
const master = (0, react_1.useRef)(null);
|
|
15
|
+
const slave = (0, react_1.useRef)(null);
|
|
16
|
+
(0, react_1.useEffect)(() => {
|
|
17
|
+
const m = master.current;
|
|
18
|
+
const s = slave.current;
|
|
19
|
+
let rafId;
|
|
20
|
+
if (m && s) {
|
|
21
|
+
const syncMaster = (_, metadata) => {
|
|
22
|
+
if (m.paused) {
|
|
23
|
+
m.play().catch(() => { });
|
|
24
|
+
}
|
|
25
|
+
const targetTime = metadata.mediaTime;
|
|
26
|
+
const delta = targetTime - s.currentTime;
|
|
27
|
+
if (s.paused) {
|
|
28
|
+
s.play().catch(() => { });
|
|
29
|
+
}
|
|
30
|
+
if (Math.abs(delta) > MAX_DESYNC) {
|
|
31
|
+
s.currentTime = targetTime;
|
|
32
|
+
}
|
|
33
|
+
else if (Math.abs(delta) > SYNC_THRESHOLD) {
|
|
34
|
+
s.playbackRate = delta > 0 ? FAST_RATE : SLOW_RATE;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
s.playbackRate = 1;
|
|
38
|
+
}
|
|
39
|
+
rafId = m.requestVideoFrameCallback(syncMaster);
|
|
40
|
+
};
|
|
41
|
+
rafId = m.requestVideoFrameCallback(syncMaster);
|
|
42
|
+
}
|
|
43
|
+
const handleVisibility = () => {
|
|
44
|
+
if (!document.hidden && m && s) {
|
|
45
|
+
m.play().catch(() => { });
|
|
46
|
+
s.play().catch(() => { });
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
document.addEventListener('visibilitychange', handleVisibility);
|
|
50
|
+
return () => {
|
|
51
|
+
var _a;
|
|
52
|
+
document.removeEventListener('visibilitychange', handleVisibility);
|
|
53
|
+
if (rafId && m) {
|
|
54
|
+
(_a = m.cancelVideoFrameCallback) === null || _a === void 0 ? void 0 : _a.call(m, rafId);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
58
|
+
if (!firstSrc || !secondSrc) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return (react_1.default.createElement("div", { className: b() },
|
|
62
|
+
react_1.default.createElement("div", { className: b('left') },
|
|
63
|
+
react_1.default.createElement("video", { ref: master, disablePictureInPicture: true, playsInline: true,
|
|
64
|
+
// @ts-ignore
|
|
65
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
66
|
+
pip: "false", autoPlay: true, loop: true, preload: "auto", muted: true, className: b('video') },
|
|
67
|
+
react_1.default.createElement("source", { src: firstSrc, type: (0, utils_1.parseVideoType)(firstSrc) }))),
|
|
68
|
+
react_1.default.createElement("div", { className: b('right') },
|
|
69
|
+
react_1.default.createElement("video", { ref: slave, disablePictureInPicture: true, playsInline: true,
|
|
70
|
+
// @ts-ignore
|
|
71
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
72
|
+
pip: "false", autoPlay: true, loop: true, preload: "auto", muted: true, className: b('video') },
|
|
73
|
+
react_1.default.createElement("source", { src: secondSrc, type: (0, utils_1.parseVideoType)(secondSrc) })))));
|
|
74
|
+
};
|
|
75
|
+
exports.BackgroundEffect = BackgroundEffect;
|
|
76
|
+
exports.default = exports.BackgroundEffect;
|
|
@@ -12,6 +12,7 @@ const theme_1 = require("../../context/theme");
|
|
|
12
12
|
const grid_1 = require("../../grid");
|
|
13
13
|
const utils_2 = require("../../utils");
|
|
14
14
|
const BackButton_1 = tslib_1.__importDefault(require("./BackButton/BackButton"));
|
|
15
|
+
const BackgroundEffect_1 = tslib_1.__importDefault(require("./BackgroundEffect/BackgroundEffect"));
|
|
15
16
|
const Breadcrumbs_1 = tslib_1.__importDefault(require("./Breadcrumbs/Breadcrumbs"));
|
|
16
17
|
const HeaderButtons_1 = tslib_1.__importDefault(require("./HeaderButtons/HeaderButtons"));
|
|
17
18
|
const HeaderDescription_1 = tslib_1.__importDefault(require("./HeaderDescription/HeaderDescription"));
|
|
@@ -30,7 +31,7 @@ const Background = ({ background, isMobile }) => {
|
|
|
30
31
|
const FullWidthBackground = ({ background }) => (react_1.default.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
|
|
31
32
|
// eslint-disable-next-line complexity
|
|
32
33
|
const HeaderBlock = (props) => {
|
|
33
|
-
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', } = props;
|
|
34
|
+
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', backgroundEffect = {}, } = props;
|
|
34
35
|
const isMobile = (0, react_1.useContext)(mobileContext_1.MobileContext);
|
|
35
36
|
const { backButton, blockTag } = (0, react_1.useContext)(headerContext_1.HeaderContext);
|
|
36
37
|
const theme = (0, theme_1.useTheme)();
|
|
@@ -51,6 +52,7 @@ const HeaderBlock = (props) => {
|
|
|
51
52
|
}, className) },
|
|
52
53
|
backgroundThemed && fullWidth && react_1.default.createElement(FullWidthBackground, { background: backgroundThemed }),
|
|
53
54
|
backgroundThemed && react_1.default.createElement(Background, { background: backgroundThemed, isMobile: isMobile }),
|
|
55
|
+
react_1.default.createElement(BackgroundEffect_1.default, Object.assign({}, backgroundEffect)),
|
|
54
56
|
react_1.default.createElement(grid_1.Grid, { containerClass: b('container-fluid') },
|
|
55
57
|
react_1.default.createElement(Breadcrumbs_1.default, { breadcrumbs: breadcrumbs, theme: textTheme }),
|
|
56
58
|
react_1.default.createElement(BackButton_1.default, { backButton: verticalOffset !== '0' && !breadcrumbs ? backButton : undefined, theme: textTheme }),
|
|
@@ -979,6 +979,19 @@ export declare const HeaderProperties: {
|
|
|
979
979
|
};
|
|
980
980
|
};
|
|
981
981
|
};
|
|
982
|
+
backgroundEffect: {
|
|
983
|
+
type: string;
|
|
984
|
+
additionalProperties: boolean;
|
|
985
|
+
required: boolean;
|
|
986
|
+
properties: {
|
|
987
|
+
firstSrc: {
|
|
988
|
+
type: string;
|
|
989
|
+
};
|
|
990
|
+
secondSrc: {
|
|
991
|
+
type: string;
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
};
|
|
982
995
|
};
|
|
983
996
|
export declare const HeaderBlock: {
|
|
984
997
|
'header-block': {
|
|
@@ -1648,6 +1661,19 @@ export declare const HeaderBlock: {
|
|
|
1648
1661
|
};
|
|
1649
1662
|
};
|
|
1650
1663
|
};
|
|
1664
|
+
backgroundEffect: {
|
|
1665
|
+
type: string;
|
|
1666
|
+
additionalProperties: boolean;
|
|
1667
|
+
required: boolean;
|
|
1668
|
+
properties: {
|
|
1669
|
+
firstSrc: {
|
|
1670
|
+
type: string;
|
|
1671
|
+
};
|
|
1672
|
+
secondSrc: {
|
|
1673
|
+
type: string;
|
|
1674
|
+
};
|
|
1675
|
+
};
|
|
1676
|
+
};
|
|
1651
1677
|
anchor: {
|
|
1652
1678
|
type: string;
|
|
1653
1679
|
additionalProperties: boolean;
|
|
@@ -190,6 +190,15 @@ exports.HeaderProperties = {
|
|
|
190
190
|
},
|
|
191
191
|
},
|
|
192
192
|
},
|
|
193
|
+
backgroundEffect: {
|
|
194
|
+
type: 'object',
|
|
195
|
+
additionalProperties: false,
|
|
196
|
+
required: true,
|
|
197
|
+
properties: {
|
|
198
|
+
firstSrc: { type: 'string' },
|
|
199
|
+
secondSrc: { type: 'string' },
|
|
200
|
+
},
|
|
201
|
+
},
|
|
193
202
|
};
|
|
194
203
|
exports.HeaderBlock = {
|
|
195
204
|
'header-block': {
|
|
@@ -673,6 +673,19 @@ export declare const HeaderSliderBlock: {
|
|
|
673
673
|
};
|
|
674
674
|
};
|
|
675
675
|
};
|
|
676
|
+
backgroundEffect: {
|
|
677
|
+
type: string;
|
|
678
|
+
additionalProperties: boolean;
|
|
679
|
+
required: boolean;
|
|
680
|
+
properties: {
|
|
681
|
+
firstSrc: {
|
|
682
|
+
type: string;
|
|
683
|
+
};
|
|
684
|
+
secondSrc: {
|
|
685
|
+
type: string;
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
};
|
|
676
689
|
};
|
|
677
690
|
};
|
|
678
691
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getVideoTypesWithPriority = exports.VideoType = exports.VideoExt = void 0;
|
|
3
|
+
exports.getVideoTypesWithPriority = exports.parseVideoType = exports.VideoType = exports.VideoExt = void 0;
|
|
4
4
|
var VideoExt;
|
|
5
5
|
(function (VideoExt) {
|
|
6
6
|
VideoExt["Mp4"] = "mp4";
|
|
@@ -34,6 +34,7 @@ function parseVideoType(src) {
|
|
|
34
34
|
return undefined;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
+
exports.parseVideoType = parseVideoType;
|
|
37
38
|
const getVideoTypesWithPriority = (sources) => sources
|
|
38
39
|
.map((src) => ({ src, type: parseVideoType(src) }))
|
|
39
40
|
.sort(({ type: typeA }, { type: typeB }) => {
|
|
@@ -199,6 +199,10 @@ export interface HeaderBlockProps {
|
|
|
199
199
|
breadcrumbs?: HeaderBreadCrumbsProps;
|
|
200
200
|
status?: JSX.Element;
|
|
201
201
|
renderTitle?: (title: string) => React.ReactNode;
|
|
202
|
+
backgroundEffect?: {
|
|
203
|
+
firstSrc: string;
|
|
204
|
+
secondSrc: string;
|
|
205
|
+
};
|
|
202
206
|
}
|
|
203
207
|
export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
|
|
204
208
|
title: string;
|
|
@@ -27,6 +27,9 @@ unpredictable css rules order in build */
|
|
|
27
27
|
display: flex;
|
|
28
28
|
flex-direction: column;
|
|
29
29
|
}
|
|
30
|
+
.pc-case-study-card__image {
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
}
|
|
30
33
|
.pc-case-study-card__title {
|
|
31
34
|
font-size: var(--g-text-display-4-font-size, var(--pc-text-display-4-font-size));
|
|
32
35
|
line-height: var(--g-text-display-4-line-height, var(--pc-text-display-4-line-height));
|
|
@@ -9,7 +9,7 @@ const CaseStudyCard = (props) => {
|
|
|
9
9
|
const { image, title, background, text, highlights, labels } = props;
|
|
10
10
|
return (react_1.default.createElement("div", { className: b(), style: { background } },
|
|
11
11
|
react_1.default.createElement("div", { className: b('info') },
|
|
12
|
-
react_1.default.createElement(components_1.Image, { src: image, alt: "", "aria-hidden": "true" }),
|
|
12
|
+
react_1.default.createElement(components_1.Image, { src: image, className: b('image'), alt: "", "aria-hidden": "true" }),
|
|
13
13
|
react_1.default.createElement("h2", { className: `${b('title')} title-font-family` }, title),
|
|
14
14
|
react_1.default.createElement("div", { className: b('content') },
|
|
15
15
|
react_1.default.createElement(components_1.HTML, { block: true }, text),
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-background-effect {
|
|
4
|
+
position: absolute;
|
|
5
|
+
inset: 0;
|
|
6
|
+
display: flex;
|
|
7
|
+
}
|
|
8
|
+
.pc-background-effect__left {
|
|
9
|
+
position: absolute;
|
|
10
|
+
inset: 0;
|
|
11
|
+
clip-path: inset(0 0.01% 0 0);
|
|
12
|
+
transition: clip-path 1.5s ease;
|
|
13
|
+
}
|
|
14
|
+
.pc-background-effect__right {
|
|
15
|
+
position: absolute;
|
|
16
|
+
inset: 0;
|
|
17
|
+
clip-path: inset(0 0 0 99.99%);
|
|
18
|
+
transition: clip-path 1.5s ease;
|
|
19
|
+
}
|
|
20
|
+
.pc-header-block:hover .pc-background-effect__left {
|
|
21
|
+
clip-path: inset(0 99.99% 0 0);
|
|
22
|
+
}
|
|
23
|
+
.pc-header-block:hover .pc-background-effect__right {
|
|
24
|
+
clip-path: inset(0 0 0 0.01%);
|
|
25
|
+
}
|
|
26
|
+
.pc-background-effect__video {
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: 100%;
|
|
29
|
+
object-fit: cover;
|
|
30
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { parseVideoType } from '../../../components/Media/Video/utils';
|
|
3
|
+
import { block } from '../../../utils';
|
|
4
|
+
import './BackgroundEffect.css';
|
|
5
|
+
const b = block('background-effect');
|
|
6
|
+
const SYNC_THRESHOLD = 0.03;
|
|
7
|
+
const MAX_DESYNC = 0.5;
|
|
8
|
+
const FAST_RATE = 1.05;
|
|
9
|
+
const SLOW_RATE = 0.95;
|
|
10
|
+
export const BackgroundEffect = ({ firstSrc, secondSrc }) => {
|
|
11
|
+
const master = useRef(null);
|
|
12
|
+
const slave = useRef(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const m = master.current;
|
|
15
|
+
const s = slave.current;
|
|
16
|
+
let rafId;
|
|
17
|
+
if (m && s) {
|
|
18
|
+
const syncMaster = (_, metadata) => {
|
|
19
|
+
if (m.paused) {
|
|
20
|
+
m.play().catch(() => { });
|
|
21
|
+
}
|
|
22
|
+
const targetTime = metadata.mediaTime;
|
|
23
|
+
const delta = targetTime - s.currentTime;
|
|
24
|
+
if (s.paused) {
|
|
25
|
+
s.play().catch(() => { });
|
|
26
|
+
}
|
|
27
|
+
if (Math.abs(delta) > MAX_DESYNC) {
|
|
28
|
+
s.currentTime = targetTime;
|
|
29
|
+
}
|
|
30
|
+
else if (Math.abs(delta) > SYNC_THRESHOLD) {
|
|
31
|
+
s.playbackRate = delta > 0 ? FAST_RATE : SLOW_RATE;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
s.playbackRate = 1;
|
|
35
|
+
}
|
|
36
|
+
rafId = m.requestVideoFrameCallback(syncMaster);
|
|
37
|
+
};
|
|
38
|
+
rafId = m.requestVideoFrameCallback(syncMaster);
|
|
39
|
+
}
|
|
40
|
+
const handleVisibility = () => {
|
|
41
|
+
if (!document.hidden && m && s) {
|
|
42
|
+
m.play().catch(() => { });
|
|
43
|
+
s.play().catch(() => { });
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
document.addEventListener('visibilitychange', handleVisibility);
|
|
47
|
+
return () => {
|
|
48
|
+
var _a;
|
|
49
|
+
document.removeEventListener('visibilitychange', handleVisibility);
|
|
50
|
+
if (rafId && m) {
|
|
51
|
+
(_a = m.cancelVideoFrameCallback) === null || _a === void 0 ? void 0 : _a.call(m, rafId);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
}, []);
|
|
55
|
+
if (!firstSrc || !secondSrc) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
return (React.createElement("div", { className: b() },
|
|
59
|
+
React.createElement("div", { className: b('left') },
|
|
60
|
+
React.createElement("video", { ref: master, disablePictureInPicture: true, playsInline: true,
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
63
|
+
pip: "false", autoPlay: true, loop: true, preload: "auto", muted: true, className: b('video') },
|
|
64
|
+
React.createElement("source", { src: firstSrc, type: parseVideoType(firstSrc) }))),
|
|
65
|
+
React.createElement("div", { className: b('right') },
|
|
66
|
+
React.createElement("video", { ref: slave, disablePictureInPicture: true, playsInline: true,
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
// eslint-disable-next-line react/no-unknown-property
|
|
69
|
+
pip: "false", autoPlay: true, loop: true, preload: "auto", muted: true, className: b('video') },
|
|
70
|
+
React.createElement("source", { src: secondSrc, type: parseVideoType(secondSrc) })))));
|
|
71
|
+
};
|
|
72
|
+
export default BackgroundEffect;
|
|
@@ -8,6 +8,7 @@ import { useTheme } from '../../context/theme';
|
|
|
8
8
|
import { Col, Grid, Row } from '../../grid';
|
|
9
9
|
import { block, getThemedValue } from '../../utils';
|
|
10
10
|
import BackButton from './BackButton/BackButton';
|
|
11
|
+
import BackgroundEffect from './BackgroundEffect/BackgroundEffect';
|
|
11
12
|
import Breadcrumbs from './Breadcrumbs/Breadcrumbs';
|
|
12
13
|
import HeaderButtons from './HeaderButtons/HeaderButtons';
|
|
13
14
|
import HeaderDescription from './HeaderDescription/HeaderDescription';
|
|
@@ -27,7 +28,7 @@ const Background = ({ background, isMobile }) => {
|
|
|
27
28
|
const FullWidthBackground = ({ background }) => (React.createElement("div", { className: b('background', { ['full-width']: true }), style: { backgroundColor: background === null || background === void 0 ? void 0 : background.color } }));
|
|
28
29
|
// eslint-disable-next-line complexity
|
|
29
30
|
export const HeaderBlock = (props) => {
|
|
30
|
-
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', } = props;
|
|
31
|
+
const { title, switchingTitle, topTags, bottomTags, overtitle, description, buttons, stock, stockPrice, stockShares, image, video, width = 's', imageSize, offset = 'default', background, theme: textTheme = 'light', verticalOffset = 'm', className, breadcrumbs, status, renderTitle, children, mediaView = 'full', backgroundEffect = {}, } = props;
|
|
31
32
|
const isMobile = useContext(MobileContext);
|
|
32
33
|
const { backButton, blockTag } = useContext(HeaderContext);
|
|
33
34
|
const theme = useTheme();
|
|
@@ -48,6 +49,7 @@ export const HeaderBlock = (props) => {
|
|
|
48
49
|
}, className) },
|
|
49
50
|
backgroundThemed && fullWidth && React.createElement(FullWidthBackground, { background: backgroundThemed }),
|
|
50
51
|
backgroundThemed && React.createElement(Background, { background: backgroundThemed, isMobile: isMobile }),
|
|
52
|
+
React.createElement(BackgroundEffect, Object.assign({}, backgroundEffect)),
|
|
51
53
|
React.createElement(Grid, { containerClass: b('container-fluid') },
|
|
52
54
|
React.createElement(Breadcrumbs, { breadcrumbs: breadcrumbs, theme: textTheme }),
|
|
53
55
|
React.createElement(BackButton, { backButton: verticalOffset !== '0' && !breadcrumbs ? backButton : undefined, theme: textTheme }),
|
|
@@ -979,6 +979,19 @@ export declare const HeaderProperties: {
|
|
|
979
979
|
};
|
|
980
980
|
};
|
|
981
981
|
};
|
|
982
|
+
backgroundEffect: {
|
|
983
|
+
type: string;
|
|
984
|
+
additionalProperties: boolean;
|
|
985
|
+
required: boolean;
|
|
986
|
+
properties: {
|
|
987
|
+
firstSrc: {
|
|
988
|
+
type: string;
|
|
989
|
+
};
|
|
990
|
+
secondSrc: {
|
|
991
|
+
type: string;
|
|
992
|
+
};
|
|
993
|
+
};
|
|
994
|
+
};
|
|
982
995
|
};
|
|
983
996
|
export declare const HeaderBlock: {
|
|
984
997
|
'header-block': {
|
|
@@ -1648,6 +1661,19 @@ export declare const HeaderBlock: {
|
|
|
1648
1661
|
};
|
|
1649
1662
|
};
|
|
1650
1663
|
};
|
|
1664
|
+
backgroundEffect: {
|
|
1665
|
+
type: string;
|
|
1666
|
+
additionalProperties: boolean;
|
|
1667
|
+
required: boolean;
|
|
1668
|
+
properties: {
|
|
1669
|
+
firstSrc: {
|
|
1670
|
+
type: string;
|
|
1671
|
+
};
|
|
1672
|
+
secondSrc: {
|
|
1673
|
+
type: string;
|
|
1674
|
+
};
|
|
1675
|
+
};
|
|
1676
|
+
};
|
|
1651
1677
|
anchor: {
|
|
1652
1678
|
type: string;
|
|
1653
1679
|
additionalProperties: boolean;
|
|
@@ -187,6 +187,15 @@ export const HeaderProperties = {
|
|
|
187
187
|
},
|
|
188
188
|
},
|
|
189
189
|
},
|
|
190
|
+
backgroundEffect: {
|
|
191
|
+
type: 'object',
|
|
192
|
+
additionalProperties: false,
|
|
193
|
+
required: true,
|
|
194
|
+
properties: {
|
|
195
|
+
firstSrc: { type: 'string' },
|
|
196
|
+
secondSrc: { type: 'string' },
|
|
197
|
+
},
|
|
198
|
+
},
|
|
190
199
|
};
|
|
191
200
|
export const HeaderBlock = {
|
|
192
201
|
'header-block': {
|
|
@@ -673,6 +673,19 @@ export declare const HeaderSliderBlock: {
|
|
|
673
673
|
};
|
|
674
674
|
};
|
|
675
675
|
};
|
|
676
|
+
backgroundEffect: {
|
|
677
|
+
type: string;
|
|
678
|
+
additionalProperties: boolean;
|
|
679
|
+
required: boolean;
|
|
680
|
+
properties: {
|
|
681
|
+
firstSrc: {
|
|
682
|
+
type: string;
|
|
683
|
+
};
|
|
684
|
+
secondSrc: {
|
|
685
|
+
type: string;
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
};
|
|
676
689
|
};
|
|
677
690
|
};
|
|
678
691
|
};
|
|
@@ -199,6 +199,10 @@ export interface HeaderBlockProps {
|
|
|
199
199
|
breadcrumbs?: HeaderBreadCrumbsProps;
|
|
200
200
|
status?: JSX.Element;
|
|
201
201
|
renderTitle?: (title: string) => React.ReactNode;
|
|
202
|
+
backgroundEffect?: {
|
|
203
|
+
firstSrc: string;
|
|
204
|
+
secondSrc: string;
|
|
205
|
+
};
|
|
202
206
|
}
|
|
203
207
|
export interface ExtendedFeaturesItem extends Omit<ContentBlockProps, 'theme' | 'centered' | 'colSizes' | 'size' | 'title'> {
|
|
204
208
|
title: string;
|
|
@@ -27,6 +27,9 @@ unpredictable css rules order in build */
|
|
|
27
27
|
display: flex;
|
|
28
28
|
flex-direction: column;
|
|
29
29
|
}
|
|
30
|
+
.pc-case-study-card__image {
|
|
31
|
+
max-width: 100%;
|
|
32
|
+
}
|
|
30
33
|
.pc-case-study-card__title {
|
|
31
34
|
font-size: var(--g-text-display-4-font-size, var(--pc-text-display-4-font-size));
|
|
32
35
|
line-height: var(--g-text-display-4-line-height, var(--pc-text-display-4-line-height));
|
|
@@ -7,7 +7,7 @@ const CaseStudyCard = (props) => {
|
|
|
7
7
|
const { image, title, background, text, highlights, labels } = props;
|
|
8
8
|
return (React.createElement("div", { className: b(), style: { background } },
|
|
9
9
|
React.createElement("div", { className: b('info') },
|
|
10
|
-
React.createElement(Image, { src: image, alt: "", "aria-hidden": "true" }),
|
|
10
|
+
React.createElement(Image, { src: image, className: b('image'), alt: "", "aria-hidden": "true" }),
|
|
11
11
|
React.createElement("h2", { className: `${b('title')} title-font-family` }, title),
|
|
12
12
|
React.createElement("div", { className: b('content') },
|
|
13
13
|
React.createElement(HTML, { block: true }, text),
|