Skip to content

[QUAR-801][BpkOverlay] Update video overlay to align with heavy overlay design #3787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions examples/bpk-component-overlay/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import STYLES from './examples.module.scss';

const IMAGE_SRC =
'https://content.skyscnr.com/m/1c8c6338a92a7a94/original/matt-hardy-6ArTTluciuA-unsplash.jpg';
const VIDEO_IMG_SRC =
const HEAVY_IMG_SRC =
'https://content.skyscnr.com/m/2af45124245b6759/original/SOCIAL9.png';

const getClassName = cssModules(STYLES);
Expand Down Expand Up @@ -200,16 +200,16 @@ const VignetteExample = () => {
);
};

const VideoOverlayExamples = () => {
const overlayTypeTop = OVERLAY_TYPES.videoTop;
const overlayTypeBottom = OVERLAY_TYPES.videoBottom;
const HeavyOverlayExamples = () => {
const overlayTypeTop = OVERLAY_TYPES.heavyTop;
const overlayTypeBottom = OVERLAY_TYPES.heavyBottom;
return (
<div className={getClassName('bpk-overlay-stories')}>
{[overlayTypeTop, overlayTypeBottom].map((overlayType) => (
<div className={getClassName('bpk-overlay-stories__overlay-story')}>
<BpkOverlay overlayType={overlayType}>
<BpkImage
src={VIDEO_IMG_SRC}
src={HEAVY_IMG_SRC}
altText="Sail boat"
aspectRatio={360 / 640}
/>
Expand All @@ -225,7 +225,7 @@ const VideoOverlayExamples = () => {
<BpkOverlay overlayType={overlayTypeTop}>
<BpkOverlay overlayType={overlayTypeBottom}>
<BpkImage
src={VIDEO_IMG_SRC}
src={HEAVY_IMG_SRC}
altText="Sail boat"
aspectRatio={360 / 640}
/>
Expand Down Expand Up @@ -283,7 +283,7 @@ export {
LeftExamples,
RightExamples,
VignetteExample,
VideoOverlayExamples,
HeavyOverlayExamples,
WithForegroundContentExample,
MixedExample,
};
4 changes: 2 additions & 2 deletions examples/bpk-component-overlay/stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
BottomExamples,
LeftExamples,
RightExamples,
VideoOverlayExamples,
HeavyOverlayExamples,
VignetteExample,
WithForegroundContentExample,
MixedExample,
Expand All @@ -42,7 +42,7 @@ export const Bottom = BottomExamples;
export const Left = LeftExamples;
export const Right = RightExamples;
export const Vignette = VignetteExample;
export const VideoOverlays = VideoOverlayExamples;
export const HeavyOverlays = HeavyOverlayExamples;

export const WithForegroundContent = WithForegroundContentExample;

Expand Down
6 changes: 3 additions & 3 deletions packages/bpk-component-overlay/src/BpkOverlay.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@
box-shadow: inset 0 0 50px rgba(tokens.$bpk-text-primary-day, 0.12);
}

&--video {
&--heavy {
&-top {
background: linear-gradient(
180deg,
rgba(tokens.$bpk-text-primary-day, 0.45) 0%,
rgba(tokens.$bpk-text-primary-day, 0) 40%,
rgba(tokens.$bpk-text-primary-day, 0.15) 60%,
rgba(tokens.$bpk-text-primary-day, 0.05) 80%,
rgba(tokens.$bpk-text-primary-day, 0) 100%
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kirstybryce I noticed you changed this. I didn't see the Percy has a failure due to the color change. Does it cause a visual change? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it does, it might not be a big enough change to be picked up by percy though 🤔 you can see in the screenshots the visual differences. It's only extending dark part of the gradient to take up more of the height, it's the same colour and opacity otherwise

Copy link
Contributor

@Faye-Xiao Faye-Xiao Apr 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's very interesting. I'll take a look at the Percy-related document later.
The code looks good to me!

);
}
Expand All @@ -174,7 +175,6 @@
background: linear-gradient(
180deg,
rgba(tokens.$bpk-text-primary-day, 0) 0%,
rgba(tokens.$bpk-text-primary-day, 0) 60%,
rgba(tokens.$bpk-text-primary-day, 0.9) 100%
);
}
Expand Down
8 changes: 4 additions & 4 deletions packages/bpk-component-overlay/src/BpkOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ export const OVERLAY_TYPES = {
rightMedium: 'rightMedium',
rightHigh: 'rightHigh',
vignette: 'vignette',
videoTop: 'videoTop',
videoBottom: 'videoBottom',
heavyTop: 'heavyTop',
heavyBottom: 'heavyBottom',
off: 'off',
} as const;

Expand All @@ -63,8 +63,8 @@ const overlayTypeClassSuffixes = {
[OVERLAY_TYPES.rightMedium]: 'right-medium',
[OVERLAY_TYPES.rightHigh]: 'right-high',
[OVERLAY_TYPES.vignette]: 'vignette',
[OVERLAY_TYPES.videoTop]: 'video-top',
[OVERLAY_TYPES.videoBottom]: 'video-bottom',
[OVERLAY_TYPES.heavyTop]: 'heavy-top',
[OVERLAY_TYPES.heavyBottom]: 'heavy-bottom',
[OVERLAY_TYPES.off]: 'off',
} as const;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ exports[`BpkOverlay should render correctly with overlayType={bottomMedium} 1`]
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={leftHigh} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={heavyBottom} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -88,13 +88,13 @@ exports[`BpkOverlay should render correctly with overlayType={leftHigh} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--left-high"
class="bpk-overlay__overlay bpk-overlay__overlay--heavy-bottom"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={leftLow} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={heavyTop} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -103,13 +103,13 @@ exports[`BpkOverlay should render correctly with overlayType={leftLow} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--left-low"
class="bpk-overlay__overlay bpk-overlay__overlay--heavy-top"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={leftMedium} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={leftHigh} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -118,13 +118,13 @@ exports[`BpkOverlay should render correctly with overlayType={leftMedium} 1`] =
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--left-medium"
class="bpk-overlay__overlay bpk-overlay__overlay--left-high"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={off} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={leftLow} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -133,13 +133,13 @@ exports[`BpkOverlay should render correctly with overlayType={off} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay"
class="bpk-overlay__overlay bpk-overlay__overlay--left-low"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={rightHigh} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={leftMedium} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -148,13 +148,13 @@ exports[`BpkOverlay should render correctly with overlayType={rightHigh} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--right-high"
class="bpk-overlay__overlay bpk-overlay__overlay--left-medium"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={rightLow} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={off} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -163,13 +163,13 @@ exports[`BpkOverlay should render correctly with overlayType={rightLow} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--right-low"
class="bpk-overlay__overlay"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={rightMedium} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={rightHigh} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -178,13 +178,13 @@ exports[`BpkOverlay should render correctly with overlayType={rightMedium} 1`] =
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--right-medium"
class="bpk-overlay__overlay bpk-overlay__overlay--right-high"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={solidHigh} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={rightLow} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -193,13 +193,13 @@ exports[`BpkOverlay should render correctly with overlayType={solidHigh} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--solid-high"
class="bpk-overlay__overlay bpk-overlay__overlay--right-low"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={solidLow} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={rightMedium} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -208,13 +208,13 @@ exports[`BpkOverlay should render correctly with overlayType={solidLow} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--solid-low"
class="bpk-overlay__overlay bpk-overlay__overlay--right-medium"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={solidMedium} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={solidHigh} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -223,13 +223,13 @@ exports[`BpkOverlay should render correctly with overlayType={solidMedium} 1`] =
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--solid-medium"
class="bpk-overlay__overlay bpk-overlay__overlay--solid-high"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={topHigh} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={solidLow} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -238,13 +238,13 @@ exports[`BpkOverlay should render correctly with overlayType={topHigh} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--top-high"
class="bpk-overlay__overlay bpk-overlay__overlay--solid-low"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={topLow} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={solidMedium} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -253,13 +253,13 @@ exports[`BpkOverlay should render correctly with overlayType={topLow} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--top-low"
class="bpk-overlay__overlay bpk-overlay__overlay--solid-medium"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={topMedium} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={topHigh} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -268,13 +268,13 @@ exports[`BpkOverlay should render correctly with overlayType={topMedium} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--top-medium"
class="bpk-overlay__overlay bpk-overlay__overlay--top-high"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={videoBottom} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={topLow} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -283,13 +283,13 @@ exports[`BpkOverlay should render correctly with overlayType={videoBottom} 1`] =
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--video-bottom"
class="bpk-overlay__overlay bpk-overlay__overlay--top-low"
/>
</div>
</DocumentFragment>
`;

exports[`BpkOverlay should render correctly with overlayType={videoTop} 1`] = `
exports[`BpkOverlay should render correctly with overlayType={topMedium} 1`] = `
<DocumentFragment>
<div
class="bpk-overlay__wrapper"
Expand All @@ -298,7 +298,7 @@ exports[`BpkOverlay should render correctly with overlayType={videoTop} 1`] = `
Backpack
</span>
<div
class="bpk-overlay__overlay bpk-overlay__overlay--video-top"
class="bpk-overlay__overlay bpk-overlay__overlay--top-medium"
/>
</div>
</DocumentFragment>
Expand Down
Loading