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';
|
2023-03-20 21:08:35 +08:00
|
|
|
import ModalSimple 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';
|
2022-11-11 02:09:21 +08:00
|
|
|
import { colorPrimary } from '/imports/ui/stylesheets/styled-components/palette';
|
2021-11-09 21:22:59 +08:00
|
|
|
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;
|
2024-06-05 19:26:27 +08:00
|
|
|
text-align: center;
|
2021-11-09 21:22:59 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
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;
|
|
|
|
`}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-03-20 21:08:35 +08:00
|
|
|
const AudioModal = styled(ModalSimple)`
|
2022-10-28 01:54:34 +08:00
|
|
|
padding: 1rem;
|
2021-11-09 21:22:59 +08:00
|
|
|
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 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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2024-08-28 00:39:11 +08:00
|
|
|
const Background = styled.span`
|
|
|
|
${({ isBlurred }) => isBlurred
|
|
|
|
&& css`
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
backdrop-filter: blur(10px);
|
|
|
|
z-index: 998;
|
|
|
|
`}
|
|
|
|
`;
|
|
|
|
|
2021-11-09 21:22:59 +08:00
|
|
|
export default {
|
|
|
|
AudioOptions,
|
|
|
|
AudioModalButton,
|
|
|
|
AudioDial,
|
2024-08-28 00:39:11 +08:00
|
|
|
Background,
|
2021-11-09 21:22:59 +08:00
|
|
|
Connecting,
|
|
|
|
ConnectingAnimation,
|
|
|
|
AudioModal,
|
|
|
|
BrowserWarning,
|
|
|
|
Content,
|
|
|
|
};
|