Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat: update styling of preview resize handles (#410)
Browse files Browse the repository at this point in the history
* fix(component): update resize pattern ux
* fix(app): remove unneeded comma
* fix(component): adjust resize hover styling
* fix(component): add transition on hover
  • Loading branch information
markusoelhafen authored and tilmx committed May 3, 2018
1 parent e7e8534 commit 8b8a19c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/component/container/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class App extends React.Component {
key="center"
id="preview"
previewFrame={`http://localhost:${store.getServerPort()}/preview.html`}
/>,
/>
<SideBar side="right" directionVertical hasBorder>
{store.getRightPane() === RightPane.Properties && (
<PropertyPane>
Expand Down
24 changes: 19 additions & 5 deletions src/lsg/patterns/panes/preview-pane/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,48 @@ const StyledPreviewWrapper = styled.div`
`;

const StyledPreviewResizer = styled.div`
width: 9px;
position: absolute;
top: 0;
left: 0;
width: 11px;
height: 100%;
cursor: ew-resize;
background-color: ${colors.blackAlpha13.toString()};
opacity: 0;
transition: opacity 0.15s ease-in-out;
&::after {
content: '';
position: absolute;
top: 50%;
transform: translateY(-50%);
height: 36px;
width: 3px;
margin: 3px;
margin: 4px;
border-radius: 2px;
background: ${colors.grey80.toString()};
}
&:hover {
opacity: 1;
&::after {
background: ${colors.grey60.toString()};
}
}
&:active {
opacity: 1;
&::after {
background: ${colors.blue40.toString()};
background: ${colors.white.toString()};
}
}
&:last-of-type {
right: 0;
left: auto;
}
`;

const BaseStyledPreviewPane = styled.div`
position: relative;
flex-grow: 1;
overflow: hidden;
background: ${colors.white.toString()};
Expand Down Expand Up @@ -83,11 +97,11 @@ export default class PreviewPane extends React.Component<PreviewPaneProps> {
onMouseMove={props.onMouseMove}
onMouseUp={props.onMouseUp}
>
<StyledPreviewResizer onMouseDown={props.onMouseDownLeft} />
<StyledPreviewPane width={props.width}>
<StyledPreviewResizer onMouseDown={props.onMouseDownLeft} />
<StyledPreviewFrame src={props.previewFrame} />
<StyledPreviewResizer onMouseDown={props.onMouseDownRight} />
</StyledPreviewPane>
<StyledPreviewResizer onMouseDown={props.onMouseDownRight} />
</StyledPreviewWrapper>
);
}
Expand Down

0 comments on commit 8b8a19c

Please sign in to comment.