bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/video-preview/styles.js

268 lines
4.9 KiB
JavaScript
Raw Normal View History

import styled, { css, keyframes } from 'styled-components';
2021-10-28 21:16:36 +08:00
import {
borderSize,
borderSizeLarge,
} from '/imports/ui/stylesheets/styled-components/general';
import {
colorGrayLabel,
colorWhite,
colorGrayLighter,
colorPrimary,
colorText,
} from '/imports/ui/stylesheets/styled-components/palette';
import {
fontSizeLarge,
lineHeightComputed,
headingsFontWeight,
} from '/imports/ui/stylesheets/styled-components/typography';
2021-12-10 22:55:37 +08:00
import { smallOnly, landscape } from '/imports/ui/stylesheets/styled-components/breakpoints';
import ModalSimple from '/imports/ui/components/common/modal/simple/component';
2022-02-15 23:54:55 +08:00
import ModalStyles from '/imports/ui/components/common/modal/simple/styles';
2021-10-28 21:16:36 +08:00
const Warning = styled.div`
text-align: center;
font-weight: ${headingsFontWeight};
font-size: 5rem;
white-space: normal;
`;
const Main = styled.h4`
margin: ${lineHeightComputed};
text-align: center;
font-size: ${fontSizeLarge};
`;
const Text = styled.div`
margin: ${lineHeightComputed};
text-align: center;
`;
const Col = styled.div`
display: flex;
flex-direction: column;
height: 100%;
justify-content: center;
margin: 0 0.5rem 0 0.5rem;
width: 50%;
@media ${smallOnly} {
width: 90%;
height: unset;
}
`;
const VideoCol = styled(Col)`
align-items: center;
2021-12-10 22:55:37 +08:00
@media ${landscape} {
width: 33.3%;
}
2021-10-28 21:16:36 +08:00
`;
const Label = styled.label`
margin-top: 8px;
font-size: 0.85rem;
font-weight: bold;
color: ${colorGrayLabel};
`;
const Select = styled.select`
background-color: ${colorWhite};
border: ${borderSize} solid ${colorWhite};
border-radius: ${borderSize};
border-bottom: 0.1rem solid ${colorGrayLighter};
color: ${colorGrayLabel};
width: 100%;
height: 1.75rem;
padding: 1px;
&:focus {
outline: none;
border-radius: ${borderSize};
box-shadow: 0 0 0 ${borderSize} ${colorPrimary}, inset 0 0 0 1px ${colorPrimary};
}
&:hover,
&:focus {
outline: transparent;
outline-style: dotted;
outline-width: ${borderSize};
}
`;
const Content = styled.div`
display: flex;
justify-content: center;
align-items: center;
overflow: auto;
color: ${colorText};
font-weight: normal;
padding: ${lineHeightComputed} 0;
@media ${smallOnly} {
flex-direction: column;
margin: 0;
}
`;
const BrowserWarning = styled.p`
padding: 0.5rem;
border-width: ${borderSizeLarge};
border-style: solid;
border-radius: 0.25rem;
margin: ${lineHeightComputed};
text-align: center;
`;
const Footer = styled.div`
display: flex;
`;
const Actions = styled.div`
margin-left: auto;
2022-10-28 01:54:34 +08:00
margin-right: auto;
2021-10-28 21:16:36 +08:00
[dir="rtl"] & {
margin-right: auto;
background:red;
margin-left: ${borderSizeLarge};
}
& > :first-child {
margin-right: ${borderSizeLarge};
margin-left: inherit;
[dir="rtl"] & {
margin-right: inherit;
margin-left: ${borderSizeLarge};
}
}
`;
const ExtraActions = styled.div`
margin-right: auto;
margin-left: ${borderSizeLarge};
[dir="rtl"] & {
margin-left: auto;
margin-right: ${borderSizeLarge};
}
& > :first-child {
margin-left: ${borderSizeLarge};
margin-right: inherit;
[dir="rtl"] & {
margin-left: inherit;
margin-right: ${borderSizeLarge};
}
}
`;
const VideoPreviewModal = styled(ModalSimple)`
2021-10-28 21:16:36 +08:00
padding: 1rem;
2021-12-10 22:55:37 +08:00
min-height: 25rem;
2022-12-09 01:37:19 +08:00
max-height: 100vh;
2021-12-10 22:55:37 +08:00
@media ${smallOnly} {
height: unset;
min-height: 22.5rem;
max-height: unset;
}
${({ isPhone }) => isPhone && `
min-height: 100%;
min-width: 100%;
border-radius: 0;
`}
2022-01-11 02:42:22 +08:00
${ModalStyles.Content} {
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
2021-10-28 21:16:36 +08:00
`;
const ellipsis = keyframes`
to {
width: 1.5em;
}
`;
2021-10-28 21:16:36 +08:00
const FetchingAnimation = styled.span`
margin: auto;
display: inline-block;
width: 1.5em;
&:after {
overflow: hidden;
display: inline-block;
vertical-align: bottom;
content: "\\2026"; /* ascii code for the ellipsis character */
width: 0;
margin-left: 0.25em;
${({ animations }) => animations && css`
animation: ${ellipsis} steps(4, end) 900ms infinite;
`}
}
`;
const VideoPreview = styled.video`
height: 100%;
width: 100%;
@media ${smallOnly} {
height: 10rem;
}
${({ mirroredVideo }) => mirroredVideo && `
transform: scale(-1, 1);
`}
`;
2022-08-26 22:50:46 +08:00
const Marker = styled.div`
width: 2rem;
text-align: center;
`;
const MarkerDynamic = styled(Marker)`
position: absolute;
top: 0;
`;
const MarkerWrapper = styled.div`
display: flex;
justify-content: space-between;
user-select: none;
2022-08-26 22:50:46 +08:00
`;
const MarkerDynamicWrapper = styled.div`
position: relative;
height: 1rem;
user-select: none;
2022-08-26 22:50:46 +08:00
`;
2021-10-28 21:16:36 +08:00
export default {
Warning,
Main,
Text,
Col,
VideoCol,
Label,
Select,
Content,
BrowserWarning,
Footer,
Actions,
ExtraActions,
VideoPreviewModal,
FetchingAnimation,
VideoPreview,
2022-08-26 22:50:46 +08:00
Marker,
MarkerDynamic,
MarkerWrapper,
MarkerDynamicWrapper,
};