ISSUE-053 - Have worked out the scaled video feed element.
Didn't have to do anything to position the element, which made me pretty happy. I assumed I'd have to do some annoying amount of finagling to get it to position correctly in the frame. It just worked. Lucky me.
This commit is contained in:
1 parent
40292620d6
commit
d083df7245
4 files changed
+99
-4
No files matched your search
@@ -1,9 +1,12 @@
|
||||
import styled, { css } from "styled-components/macro";
|
||||
|
||||
import { Fraction, Px } from "../../../types/style";
|
||||
|
||||
type VideoFeedFrameProps = {
|
||||
centered?: boolean,
|
||||
};
|
||||
export const VideoFeedFrame = styled.div<VideoFeedFrameProps>`
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: ${p => p.theme.colors.videoFrameBG};
|
||||
@@ -20,6 +23,19 @@ export const VideoFeedFrame = styled.div<VideoFeedFrameProps>`
|
||||
`}
|
||||
`;
|
||||
|
||||
type BroadcastLayoutProps = {
|
||||
height: Px,
|
||||
width: Px,
|
||||
scale: Fraction,
|
||||
};
|
||||
export const BroadcastLayout = styled.div.attrs<BroadcastLayoutProps>(({
|
||||
height,
|
||||
width,
|
||||
scale,
|
||||
}) => ({ style: { height, width, transform: `scale(${scale})` } }))<BroadcastLayoutProps>`
|
||||
position: absolute;
|
||||
`;
|
||||
|
||||
export const BackgroundImage = styled.img`
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
@@ -37,3 +53,11 @@ export const BackgroundImageDiv = styled.div<BackgroundImageDivProps>`
|
||||
background-repeat: no-repeat;
|
||||
background-position: 0% 50%;
|
||||
`;
|
||||
|
||||
export const DimensionsSpan = styled.span`
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
color: ${p => p.theme.colors.textWhite};
|
||||
font-family: ${p => p.theme.fonts.f1Regular};
|
||||
`;
|
||||
Reference in new issue
Block a user