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

feat: update styling of preview resizing #410

Merged
merged 5 commits into from
May 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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