bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/nav-bar/talking-indicator/styles.js

173 lines
3.6 KiB
JavaScript
Raw Normal View History

2021-11-03 00:25:39 +08:00
import styled from 'styled-components';
import {
borderSize,
borderRadius,
talkerBorderRadius,
talkerPaddingXsm,
talkerPaddingLg,
talkerMaxWidth,
talkerMarginSm,
spokeOpacity,
talkerPaddingXl,
} from '/imports/ui/stylesheets/styled-components/general';
import {
colorWhite,
colorSuccess,
colorDanger,
btnMutedColor,
2021-11-03 00:25:39 +08:00
} from '/imports/ui/stylesheets/styled-components/palette';
import {
fontSizeBase,
talkerFontWeight,
fontSizeXS,
fontSizeSmaller,
fontSizeSmall,
2021-11-03 00:25:39 +08:00
} from '/imports/ui/stylesheets/styled-components/typography';
2022-03-15 21:11:20 +08:00
import { phoneLandscape } from '/imports/ui/stylesheets/styled-components/breakpoints';
2022-02-15 04:20:50 +08:00
import Button from '/imports/ui/components/common/button/component';
import Icon from '/imports/ui/components/common/icon/component';
2021-11-03 00:25:39 +08:00
const TalkingIndicatorButton = styled(Button)`
display: flex;
flex-direction: row;
outline: transparent;
outline-style: dotted;
outline-width: ${borderSize};
flex: 0 0 auto;
color: ${colorWhite};
font-weight: ${talkerFontWeight};
border-radius: ${talkerBorderRadius} ${talkerBorderRadius};
font-size: ${fontSizeBase};
padding: ${talkerPaddingXsm} ${talkerPaddingLg} ${talkerPaddingXsm} ${talkerPaddingLg};
box-shadow: none !important;
@media ${phoneLandscape} {
height: 1rem;
}
2021-11-03 00:25:39 +08:00
i,
span {
position: relative;
}
span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin: 0 0 0 0 !important;
max-width: ${talkerMaxWidth};
@media ${phoneLandscape} {
font-size: ${fontSizeXS};
}
[dir="rtl"] & {
margin-left: ${talkerMarginSm};
}
}
i {
font-size: ${fontSizeSmaller};
width: 1rem;
height: 1rem;
line-height: 1rem;
background-color: ${colorSuccess};
border-radius: 50%;
position: relative;
right: ${talkerMarginSm};
@media ${phoneLandscape} {
height: ${talkerMarginSm};
width: ${talkerMarginSm};
font-size: ${fontSizeXS};
}
[dir="rtl"] & {
right: calc(${talkerMarginSm} * -1);
}
}
span:hover {
opacity: 1;
}
${({ $spoke }) => $spoke && `
2021-11-03 00:25:39 +08:00
opacity: ${spokeOpacity};
[dir="rtl"] & {
padding-right: ${talkerPaddingLg}
}
`}
${({ $muted }) => $muted && `
2021-11-03 00:25:39 +08:00
cursor: default;
2021-11-03 00:25:39 +08:00
i {
background-color: ${colorDanger};
}
`}
${({ $isViewer }) => $isViewer && `
2021-11-03 00:25:39 +08:00
cursor: default;
`}
`;
const CCIcon = styled(Icon)`
align-self: center;
color: ${colorWhite};
margin: 0 ${borderRadius};
font-size: calc(${fontSizeSmall} * .85);
opacity: ${({ muted, talking }) => ((muted || !talking) && `${spokeOpacity};`)
|| '1;'};
`;
const TalkingIndicatorWrapper = styled.div`
border-radius: ${talkerBorderRadius} ${talkerBorderRadius};
display: flex;
margin: 0 ${borderRadius};
opacity: ${({ muted, talking }) => ((muted || !talking) && `${spokeOpacity};`)
|| '1;'};
background: ${({ muted, talking }) => ((muted || !talking) && `${btnMutedColor};`)
|| `${colorSuccess}`}
`;
2021-11-03 00:25:39 +08:00
const Hidden = styled.div`
display: none;
`;
const IsTalkingWrapper = styled.div`
display: flex;
flex-direction: row;
position: relative;
margin-top: ${talkerMarginSm};
overflow: hidden;
`;
const Speaking = styled.div`
display: flex;
flex-direction: row;
flex-wrap: nowrap;
overflow-x: auto;
overflow-y: hidden;
max-height: ${talkerPaddingXl};
scrollbar-width: 0; // firefox
scrollbar-color: transparent;
&::-webkit-scrollbar {
width: 0px;
height: 0px;
background: transparent;
}
`;
export default {
TalkingIndicatorButton,
TalkingIndicatorWrapper,
CCIcon,
2021-11-03 00:25:39 +08:00
Hidden,
IsTalkingWrapper,
Speaking,
};