Style tweaks
This commit is contained in:
parent
0a5e7e16b6
commit
a939abd017
5 changed files with 24 additions and 15 deletions
|
@ -6,14 +6,6 @@ import type {PanelPosition} from '@theatre/studio/store/types'
|
||||||
import useLockSet from '@theatre/studio/uiComponents/useLockSet'
|
import useLockSet from '@theatre/studio/uiComponents/useLockSet'
|
||||||
import React, {useContext} from 'react'
|
import React, {useContext} from 'react'
|
||||||
import useWindowSize from 'react-use/esm/useWindowSize'
|
import useWindowSize from 'react-use/esm/useWindowSize'
|
||||||
import styled from 'styled-components'
|
|
||||||
|
|
||||||
const Container = styled.div`
|
|
||||||
position: absolute;
|
|
||||||
box-sizing: border-box;
|
|
||||||
pointer-events: auto;
|
|
||||||
z-index: 1000;
|
|
||||||
`
|
|
||||||
|
|
||||||
type PanelStuff = {
|
type PanelStuff = {
|
||||||
panelId: string
|
panelId: string
|
||||||
|
|
|
@ -8,7 +8,7 @@ import React, {useMemo, useRef, useState} from 'react'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
import {panelDimsToPanelPosition, usePanel} from './BasePanel'
|
import {panelDimsToPanelPosition, usePanel} from './BasePanel'
|
||||||
|
|
||||||
const Base = styled.div<{isDragging: boolean}>`
|
const Base = styled.div`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
|
@ -21,9 +21,19 @@ const Base = styled.div<{isDragging: boolean}>`
|
||||||
display: block;
|
display: block;
|
||||||
content: ' ';
|
content: ' ';
|
||||||
}
|
}
|
||||||
opacity: ${(props) => (props.isDragging ? 1 : 0)};
|
|
||||||
background: ${(props) =>
|
opacity: 0;
|
||||||
props.isDragging ? lighten(0.2, '#478698') : '#478698'};
|
background-color: #478698;
|
||||||
|
|
||||||
|
&.isHighlighted {
|
||||||
|
opacity: 0.7;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.isDragging {
|
||||||
|
opacity: 1;
|
||||||
|
/* background-color: ${lighten(0.2, '#478698')}; */
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
@ -211,10 +221,15 @@ const PanelResizeHandle: React.FC<{
|
||||||
useDrag(node, dragOpts)
|
useDrag(node, dragOpts)
|
||||||
const Comp = els[which]
|
const Comp = els[which]
|
||||||
|
|
||||||
|
const isOnCorner = which.length <= 6
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Comp
|
<Comp
|
||||||
ref={ref}
|
ref={ref}
|
||||||
isDragging={isDragging || panelStuff.boundsHighlighted}
|
className={[
|
||||||
|
isDragging ? 'isDragging' : '',
|
||||||
|
panelStuff.boundsHighlighted && isOnCorner ? 'isHighlighted' : '',
|
||||||
|
].join(' ')}
|
||||||
style={{cursor: cursors[which]}}
|
style={{cursor: cursors[which]}}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,7 +17,7 @@ const Container = styled.div`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 50px;
|
top: 10px;
|
||||||
bottom: 8px;
|
bottom: 8px;
|
||||||
z-index: ${panelZIndexes.propsPanel};
|
z-index: ${panelZIndexes.propsPanel};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ const Container = styled.div`
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 50px;
|
top: 50px;
|
||||||
bottom: 8px;
|
bottom: 0px;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: ${panelZIndexes.outlinePanel};
|
z-index: ${panelZIndexes.outlinePanel};
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ const Content = styled.div`
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
transform: translateX(-100%);
|
transform: translateX(-100%);
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
|
/* background-color: blue; */
|
||||||
|
|
||||||
${Container}:hover & {
|
${Container}:hover & {
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
|
|
|
@ -30,6 +30,7 @@ import {
|
||||||
|
|
||||||
const Container = styled(PanelWrapper)`
|
const Container = styled(PanelWrapper)`
|
||||||
z-index: ${panelZIndexes.sequenceEditorPanel};
|
z-index: ${panelZIndexes.sequenceEditorPanel};
|
||||||
|
box-shadow: 2px 2px 0 rgb(0 0 0 / 11%);
|
||||||
`
|
`
|
||||||
|
|
||||||
const LeftBackground = styled.div`
|
const LeftBackground = styled.div`
|
||||||
|
|
Loading…
Reference in a new issue