2021-11-17 01:15:02 +08:00
|
|
|
import styled, { css, keyframes } from 'styled-components';
|
2021-10-28 21:16:36 +08:00
|
|
|
import {
|
2024-06-14 00:46:45 +08:00
|
|
|
borderSizeSmall,
|
2021-10-28 21:16:36 +08:00
|
|
|
borderSize,
|
|
|
|
borderSizeLarge,
|
2024-06-14 00:46:45 +08:00
|
|
|
mdPaddingX,
|
|
|
|
titlePositionLeft,
|
|
|
|
lgPaddingY,
|
2021-10-28 21:16:36 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/general';
|
|
|
|
import {
|
|
|
|
colorGrayLabel,
|
|
|
|
colorWhite,
|
2024-06-14 00:46:45 +08:00
|
|
|
colorBlack,
|
2021-10-28 21:16:36 +08:00
|
|
|
colorGrayLighter,
|
2024-06-14 00:46:45 +08:00
|
|
|
colorGrayLightest,
|
2021-10-28 21:16:36 +08:00
|
|
|
colorPrimary,
|
|
|
|
colorText,
|
|
|
|
} from '/imports/ui/stylesheets/styled-components/palette';
|
|
|
|
import {
|
|
|
|
fontSizeLarge,
|
|
|
|
lineHeightComputed,
|
|
|
|
headingsFontWeight,
|
2024-06-14 00:46:45 +08:00
|
|
|
fontSizeLarger,
|
|
|
|
fontSizeSmall,
|
2021-10-28 21:16:36 +08:00
|
|
|
} 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';
|
2023-03-20 21:08:35 +08:00
|
|
|
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';
|
2024-06-14 00:46:45 +08:00
|
|
|
import Button from '/imports/ui/components/common/button/component';
|
|
|
|
import {
|
|
|
|
Tab, Tabs, TabList,
|
|
|
|
} from 'react-tabs';
|
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;
|
|
|
|
|
2024-04-10 23:59:12 +08:00
|
|
|
@media ${smallOnly} {
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
overflow: auto;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const InternCol = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
height: 100%;
|
|
|
|
justify-content: center;
|
|
|
|
margin: 0 0.5rem 0 0.5rem;
|
|
|
|
|
|
|
|
@media ${smallOnly} {
|
|
|
|
width: 90%;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const ContentCol = styled.div`
|
|
|
|
width: 60%;
|
|
|
|
height: 25vh;
|
|
|
|
|
2021-10-28 21:16:36 +08:00
|
|
|
@media ${smallOnly} {
|
|
|
|
width: 90%;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2024-06-14 00:46:45 +08:00
|
|
|
const BackgroundCol = styled.div`
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
`;
|
|
|
|
|
2021-10-28 21:16:36 +08:00
|
|
|
const VideoCol = styled(Col)`
|
|
|
|
align-items: center;
|
2021-12-10 22:55:37 +08:00
|
|
|
|
|
|
|
@media ${landscape} {
|
2024-06-14 00:46:45 +08:00
|
|
|
width: 50%;
|
2021-12-10 22:55:37 +08:00
|
|
|
}
|
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;
|
|
|
|
|
|
|
|
@media ${smallOnly} {
|
2024-04-10 23:59:12 +08:00
|
|
|
display: flex;
|
|
|
|
flex-wrap: wrap;
|
|
|
|
flex-direction: row;
|
|
|
|
margin: 5px;
|
2021-10-28 21:16:36 +08:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
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;
|
2024-06-14 00:46:45 +08:00
|
|
|
flex-direction: column;
|
2021-10-28 21:16:36 +08:00
|
|
|
`;
|
|
|
|
|
2024-04-10 23:59:12 +08:00
|
|
|
const FooterContainer = styled.div`
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: ${({ showStopAllButton }) => (showStopAllButton ? 'flex-start' : 'flex-end')};
|
|
|
|
|
|
|
|
@media ${smallOnly} {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2021-10-28 21:16:36 +08:00
|
|
|
const Actions = styled.div`
|
2024-06-14 00:46:45 +08:00
|
|
|
display: flex;
|
|
|
|
justify-content: flex-end;
|
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};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-03-20 21:08:35 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
${({ 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-11-17 01:15:02 +08:00
|
|
|
`;
|
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;
|
2022-09-29 20:49:36 +08:00
|
|
|
user-select: none;
|
2022-08-26 22:50:46 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const MarkerDynamicWrapper = styled.div`
|
|
|
|
position: relative;
|
|
|
|
height: 1rem;
|
2022-09-29 20:49:36 +08:00
|
|
|
user-select: none;
|
2022-08-26 22:50:46 +08:00
|
|
|
`;
|
|
|
|
|
2024-06-14 00:46:45 +08:00
|
|
|
const Container = styled.div`
|
|
|
|
padding: 0 calc(${mdPaddingX} / 2 + ${borderSize});
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Header = styled.div`
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
border: none;
|
|
|
|
line-height: ${titlePositionLeft};
|
|
|
|
margin-bottom: ${lgPaddingY};
|
|
|
|
`;
|
|
|
|
|
|
|
|
const WebcamTabs = styled(Tabs)`
|
|
|
|
display: flex;
|
|
|
|
flex-flow: column;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
const WebcamTabList = styled(TabList)`
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-around;
|
|
|
|
padding: 0;
|
|
|
|
list-style-type: none;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const WebcamTabSelector = styled(Tab)`
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
flex-grow: 1;
|
|
|
|
text-align: center;
|
|
|
|
font-weight: bold;
|
|
|
|
color: ${colorGrayLighter};
|
|
|
|
|
|
|
|
&.is-selected {
|
|
|
|
border: none;
|
|
|
|
color: ${colorBlack};
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const HeaderSeparator = styled.div`
|
|
|
|
border-left: 1px solid ${colorText};
|
|
|
|
content: '|';
|
|
|
|
margin: 0 1.5rem;
|
|
|
|
height: 1.5rem;
|
|
|
|
align-self: center;
|
|
|
|
opacity: 0.75;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const BottomSeparator = styled.div`
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
height: ${borderSizeSmall};
|
|
|
|
background-color: ${colorGrayLightest};
|
|
|
|
margin-top: calc(${lineHeightComputed} * 1.25);
|
|
|
|
margin-bottom: calc(${lineHeightComputed} * 1.25);
|
|
|
|
`;
|
|
|
|
|
|
|
|
const IconSvg = styled.img`
|
|
|
|
height: ${fontSizeLarger};
|
|
|
|
border-radius: 5px;
|
|
|
|
margin: 5px;
|
|
|
|
|
2023-10-05 02:00:24 +08:00
|
|
|
${({ darkThemeState }) => darkThemeState && css`
|
|
|
|
filter: invert(1);
|
|
|
|
`}
|
|
|
|
|
2024-06-14 00:46:45 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const SharingButton = styled(Button)`
|
|
|
|
margin: 0 0.5rem;
|
|
|
|
border-radius: 5px;
|
|
|
|
height: 2.5rem;
|
|
|
|
font-weight: bold;
|
|
|
|
text-transform: uppercase;
|
|
|
|
font-size: ${fontSizeSmall};
|
2023-10-05 02:00:24 +08:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: #007bff;
|
|
|
|
color: white;
|
|
|
|
transition: background-color 0.2s, color 0.2s, transform 0.2s;
|
|
|
|
}
|
2024-06-14 00:46:45 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const CancelButton = styled(Button)`
|
|
|
|
background-color: transparent;
|
|
|
|
color: red;
|
|
|
|
border: 1px solid red;
|
|
|
|
margin: 0 0.5rem;
|
|
|
|
border-radius: 5px;
|
|
|
|
height: 2.5rem;
|
|
|
|
font-weight: bold;
|
|
|
|
text-transform: uppercase;
|
|
|
|
font-size: ${fontSizeSmall};
|
2023-10-05 02:00:24 +08:00
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: rgba(255, 0, 0, 0.1);
|
|
|
|
color: red;
|
|
|
|
transition: background-color 0.2s, transform 0.2s;
|
|
|
|
}
|
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
const StopAllButton = styled(Button)`
|
|
|
|
border: 1px solid red;
|
|
|
|
margin: 0 0.5rem;
|
|
|
|
border-radius: 5px;
|
|
|
|
height: 2.5rem;
|
|
|
|
font-weight: bold;
|
|
|
|
text-transform: uppercase;
|
|
|
|
font-size: ${fontSizeSmall};
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
background-color: #cc0000;
|
|
|
|
color: white;
|
|
|
|
transition: background-color 0.2s, color 0.2s, transform 0.2s;
|
|
|
|
}
|
|
|
|
|
2024-06-14 00:46:45 +08:00
|
|
|
`;
|
|
|
|
|
2021-10-28 21:16:36 +08:00
|
|
|
export default {
|
|
|
|
Warning,
|
|
|
|
Main,
|
|
|
|
Text,
|
|
|
|
Col,
|
2024-04-10 23:59:12 +08:00
|
|
|
ContentCol,
|
|
|
|
InternCol,
|
2024-06-14 00:46:45 +08:00
|
|
|
Container,
|
|
|
|
Header,
|
|
|
|
WebcamTabs,
|
|
|
|
WebcamTabList,
|
|
|
|
WebcamTabSelector,
|
|
|
|
HeaderSeparator,
|
|
|
|
BottomSeparator,
|
2021-10-28 21:16:36 +08:00
|
|
|
VideoCol,
|
2024-06-14 00:46:45 +08:00
|
|
|
BackgroundCol,
|
|
|
|
IconSvg,
|
|
|
|
SharingButton,
|
|
|
|
CancelButton,
|
2023-10-05 02:00:24 +08:00
|
|
|
StopAllButton,
|
2021-10-28 21:16:36 +08:00
|
|
|
Label,
|
|
|
|
Select,
|
|
|
|
Content,
|
|
|
|
BrowserWarning,
|
|
|
|
Footer,
|
2024-04-10 23:59:12 +08:00
|
|
|
FooterContainer,
|
2021-10-28 21:16:36 +08:00
|
|
|
Actions,
|
|
|
|
ExtraActions,
|
|
|
|
VideoPreviewModal,
|
|
|
|
FetchingAnimation,
|
|
|
|
VideoPreview,
|
2022-08-26 22:50:46 +08:00
|
|
|
Marker,
|
|
|
|
MarkerDynamic,
|
|
|
|
MarkerWrapper,
|
|
|
|
MarkerDynamicWrapper,
|
2021-11-17 01:15:02 +08:00
|
|
|
};
|