bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/whiteboard/styles.js

152 lines
3.5 KiB
JavaScript
Raw Normal View History

import styled, { createGlobalStyle } from 'styled-components';
import { borderSize, borderSizeLarge } from '/imports/ui/stylesheets/styled-components/general';
import { toolbarButtonColor, colorWhite, colorBlack } from '/imports/ui/stylesheets/styled-components/palette';
2023-02-24 07:47:34 +08:00
import {
2023-02-25 07:05:14 +08:00
fontSizeLarger,
2023-02-24 07:47:34 +08:00
} from '/imports/ui/stylesheets/styled-components/typography';
import Button from '/imports/ui/components/common/button/component';
const TldrawGlobalStyle = createGlobalStyle`
2023-05-09 02:50:43 +08:00
div[id^="poll-result-"] * {
pointer-events: none;
user-select: none;
}
${({ hideContextMenu }) => hideContextMenu && `
#TD-ContextMenu {
display: none;
}
`}
2023-03-27 23:33:10 +08:00
${({ menuOffset }) => `
#TD-StylesMenu {
position: relative;
2023-03-27 23:33:10 +08:00
right: ${menuOffset};
}
`}
#TD-PrimaryTools-Image {
display: none;
}
#slide-background-shape div {
pointer-events: none;
user-select: none;
}
div[dir*="ltr"]:has(button[aria-expanded*="false"][aria-controls*="radix-"]) {
pointer-events: none;
}
[aria-expanded*="false"][aria-controls*="radix-"] {
display: none;
}
[class$="-side-right"] {
top: -1px;
}
${({ hasWBAccess, isPresenter, size }) => (hasWBAccess || isPresenter) && `
#TD-Tools-Dots {
height: ${size}px;
width: ${size}px;
}
#TD-Delete {
& button {
height: ${size}px;
width: ${size}px;
}
}
#TD-PrimaryTools button {
height: ${size}px;
width: ${size}px;
}
#TD-Styles {
border-width: ${borderSize};
}
#TD-TopPanel-Undo,
#TD-TopPanel-Redo,
#TD-Styles {
height: 92%;
border-radius: 7px;
&:hover {
border: solid ${borderSize} #ECECEC;
background-color: #ECECEC;
}
&:focus {
border: solid ${borderSize} ${colorBlack};
}
}
#TD-Styles,
#TD-TopPanel-Undo,
#TD-TopPanel-Redo {
margin: ${borderSize} ${borderSizeLarge} 0px ${borderSizeLarge};
}
`}
2023-04-02 22:38:32 +08:00
${({ hasWBAccess, isPresenter, panSelected }) => (hasWBAccess || isPresenter) && panSelected && `
[id^="TD-PrimaryTools-"] {
&:hover > div,
&:focus > div {
2023-04-02 22:38:32 +08:00
background-color: var(--colors-hover) !important;
}
}
`}
${({ darkTheme }) => darkTheme && `
#TD-TopPanel-Undo,
#TD-TopPanel-Redo,
#TD-Styles {
&:focus {
border: solid ${borderSize} ${colorWhite} !important;
}
}
`}
2023-05-04 20:20:36 +08:00
${({ isPresenter, hasWBAccess }) => (!isPresenter && !hasWBAccess) && `
#presentationInnerWrapper div{
cursor: default !important;
}
`}
${({ isToolbarVisible }) => (!isToolbarVisible) && `
#TD-Tools {
visibility: hidden;
}
#TD-Styles-Parent {
visibility: hidden;
}
#WhiteboardOptionButton {
opacity: 0.2;
}
`}
`;
const EditableWBWrapper = styled.div`
&, & > :first-child {
cursor: inherit !important;
}
`;
2023-02-24 07:47:34 +08:00
const PanTool = styled(Button)`
border: none !important;
padding: 0;
margin: 0;
border-radius: 7px;
background-color: ${colorWhite};
color: ${toolbarButtonColor};
& > i {
font-size: ${fontSizeLarger} !important;
[dir="rtl"] & {
-webkit-transform: scale(-1, 1);
-moz-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
transform: scale(-1, 1);
}
}
2023-04-13 22:20:32 +08:00
${({ panSelected }) => !panSelected && `
&:hover,
&:focus {
background-color: var(--colors-hover) !important;
}
`}
2023-02-24 07:47:34 +08:00
`;
export default {
TldrawGlobalStyle,
EditableWBWrapper,
2023-02-24 07:47:34 +08:00
PanTool,
};