2021-11-09 21:22:59 +08:00
|
|
|
import styled, { css, keyframes } from 'styled-components';
|
2022-02-15 04:20:50 +08:00
|
|
|
import Button from '/imports/ui/components/common/button/component';
|
2022-02-15 23:54:55 +08:00
|
|
|
import Modal from '/imports/ui/components/common/modal/simple/component';
|
2021-11-09 21:22:59 +08:00
|
|
|
import { smallOnly } from '/imports/ui/stylesheets/styled-components/breakpoints';
|
|
|
|
import {
|
|
|
|
colorPrimary,
|
2021-11-17 01:15:02 +08:00
|
|
|
colorGrayDark,
|
2021-11-09 21:22:59 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/palette';
|
|
|
|
import {
|
|
|
|
mdPaddingY,
|
2022-06-04 02:59:22 +08:00
|
|
|
btnSpacing,
|
2021-11-09 21:22:59 +08:00
|
|
|
} from '/imports/ui/stylesheets/styled-components/general';
|
|
|
|
import { lineHeightComputed } from '/imports/ui/stylesheets/styled-components/typography';
|
|
|
|
|
|
|
|
const AudioOptions = styled.span`
|
|
|
|
margin-top: auto;
|
|
|
|
margin-bottom: auto;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const AudioModalButton = styled(Button)`
|
|
|
|
i {
|
|
|
|
color: #3c5764;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Modifies the audio button icon colour
|
|
|
|
& span:first-child {
|
2022-06-28 02:23:57 +08:00
|
|
|
display: inline-block;
|
2021-11-09 21:22:59 +08:00
|
|
|
color: #1b3c4b;
|
|
|
|
background-color: #f1f8ff;
|
|
|
|
box-shadow: none;
|
|
|
|
border: 5px solid #f1f8ff;
|
|
|
|
font-size: 3.5rem;
|
|
|
|
|
|
|
|
@media ${smallOnly} {
|
|
|
|
font-size: 2.5rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// When hovering over a button of class audioBtn, change the border colour of first span-child
|
|
|
|
&:hover span:first-child,
|
|
|
|
&:focus span:first-child {
|
|
|
|
border: 5px solid ${colorPrimary};
|
|
|
|
background-color: #f1f8ff;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Modifies the button label text
|
|
|
|
& span:last-child {
|
2022-06-28 02:23:57 +08:00
|
|
|
display: block;
|
2021-11-09 21:22:59 +08:00
|
|
|
color: black;
|
|
|
|
font-size: 1rem;
|
|
|
|
font-weight: 600;
|
2022-06-04 02:59:22 +08:00
|
|
|
margin-top: ${btnSpacing};
|
|
|
|
line-height: 1.5;
|
2021-11-09 21:22:59 +08:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const AudioDial = styled(Button)`
|
|
|
|
margin: 0 auto;
|
|
|
|
margin-top: ${mdPaddingY};
|
|
|
|
display: block;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Connecting = styled.div`
|
|
|
|
margin-top: auto;
|
|
|
|
margin-bottom: auto;
|
|
|
|
font-size: 2rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const ellipsis = keyframes`
|
|
|
|
to {
|
|
|
|
width: 1.5em;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const ConnectingAnimation = 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 AudioModal = styled(Modal)`
|
|
|
|
padding: 1.5rem;
|
|
|
|
min-height: 20rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const BrowserWarning = styled.p`
|
|
|
|
margin: ${lineHeightComputed};
|
|
|
|
text-align: center;
|
|
|
|
padding: 0.5rem;
|
|
|
|
border-width: 3px;
|
|
|
|
border-style: solid;
|
|
|
|
border-radius: 0.25rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Header = styled.header`
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
border: none;
|
|
|
|
line-height: 2rem;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Title = styled.h2`
|
|
|
|
text-align: center;
|
|
|
|
font-weight: 400;
|
|
|
|
font-size: 1.3rem;
|
2021-11-17 01:15:02 +08:00
|
|
|
color: ${colorGrayDark};
|
2021-11-09 21:22:59 +08:00
|
|
|
white-space: normal;
|
2022-06-04 02:59:22 +08:00
|
|
|
margin: 0;
|
2021-11-09 21:22:59 +08:00
|
|
|
|
|
|
|
@media ${smallOnly} {
|
|
|
|
font-size: 1rem;
|
|
|
|
padding: 0 1rem;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Content = styled.div`
|
|
|
|
flex-grow: 1;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
padding: 0;
|
|
|
|
margin-top: auto;
|
|
|
|
margin-bottom: auto;
|
|
|
|
padding: 0.5rem 0;
|
|
|
|
|
|
|
|
button:first-child {
|
|
|
|
margin: 0 3rem 0 0;
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
margin: 0 0 0 3rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
@media ${smallOnly} {
|
|
|
|
margin: 0 1rem 0 0;
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
margin: 0 0 0 1rem;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
button:only-child {
|
|
|
|
margin: inherit 0 inherit inherit;
|
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
margin: inherit inherit inherit 0 !important;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
export default {
|
|
|
|
AudioOptions,
|
|
|
|
AudioModalButton,
|
|
|
|
AudioDial,
|
|
|
|
Connecting,
|
|
|
|
ConnectingAnimation,
|
|
|
|
AudioModal,
|
|
|
|
BrowserWarning,
|
|
|
|
Header,
|
|
|
|
Title,
|
|
|
|
Content,
|
|
|
|
};
|