Skip to content

Commit

Permalink
feat: ui optimize
Browse files Browse the repository at this point in the history
  • Loading branch information
funnyzak committed Nov 12, 2021
1 parent 830d52c commit 11e6ae4
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 19 deletions.
15 changes: 7 additions & 8 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@
<meta name="branch" content="<%= gitInfo.BRANCH %>" />
<meta name="hash" content="<%= gitInfo.COMMITHASH %>" />
</head>

<body>
<div id="root"></div>
<script>
function initTopDrag() {
const topDiv = document.createElement('div'); // 创建节点
topDiv.style.position = 'fixed'; // 一直在顶部
const topDiv = document.createElement('div');
topDiv.style.position = 'fixed';
topDiv.style.top = '0';
topDiv.style.left = '0';
topDiv.style.height = '20px'; // 顶部20px才可拖动
topDiv.style.width = '100%'; // 宽度100%
topDiv.style.zIndex = '9999'; // 悬浮于最外层
topDiv.style.height = '20px';
topDiv.style.width = '100%';
topDiv.style.zIndex = '9999';
topDiv.style.pointerEvents = 'none'; // 用于点击穿透
// @ts-ignore
topDiv.style['-webkit-user-select'] = 'none'; // 禁止选择文字
// @ts-ignore
topDiv.style['-webkit-app-region'] = 'drag'; // 拖动
document.body.appendChild(topDiv); // 添加节点
document.body.appendChild(topDiv);
}

window.addEventListener(
Expand Down
4 changes: 4 additions & 0 deletions src/App.less
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@
@border-color-base: #d9d9d9; // 边框色
@box-shadow-base: 0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05); // 浮层阴影

.border-radius-base {
border-radius: @border-radius-base;
}
6 changes: 3 additions & 3 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ function createWindow() {
win = new BrowserWindow({
show: isDevelopment,
width: 1024,
height: 750,
minHeight: 750,
height: 745,
minHeight: 745,
minWidth: 1024,
fullscreenable: isDevelopment,
maximizable: true,
Expand Down Expand Up @@ -175,7 +175,7 @@ const menuTemplate: any = [
}
},
{
label: '下新版',
label: '检查更新',
click: async () => {
await shell.openExternal(
'https://github.com/funnyzak/tts-now/releases'
Expand Down
12 changes: 10 additions & 2 deletions src/layout/AppMain/Batch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ const Wrapper = styled.div`
`;

const MainWrapper = styled.div`
height: calc(100vh - 80px - 115px - 10px) !important;
height: calc(100vh - 80px - 115px - 15px) !important;
border: 1px solid #f4f6fa;
display: flex;
flex-direction: column;
justify-content: space-between;
margin-bottom: 10px;
margin-bottom: 15px;
`;

const tableStyle = css`
Expand Down Expand Up @@ -123,6 +123,7 @@ const SelectFilesComponent: React.FC<ICallBackFileListProp> = ({

return (
<MainWrapper
className="border-radius-base"
css={css`
align-items: center;
justify-content: center;
Expand Down Expand Up @@ -163,6 +164,10 @@ const OutPutPathSelectComponent: React.FC<{
<Button
css={css`
margin: 0;
border: 0;
color: #666;
border-radius: 0;
background: #eee;
`}
type="primary"
size="large"
Expand All @@ -175,6 +180,9 @@ const OutPutPathSelectComponent: React.FC<{
<Button
css={css`
margin: 0;
border: 0;
border-left: 1px solid #f4f6fa;
border-radius: 0;
`}
size="large"
onClick={() => {
Expand Down
4 changes: 2 additions & 2 deletions src/layout/AppMain/Single.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ const actionButtonStyle = css`
`;

const singleTxtStyle = {
height: 'calc(100vh - 80px - 115px - 10px) !important',
height: 'calc(100vh - 80px - 115px - 15px) !important',
padding: '15px',
margin: 0,
overflow: 'hidden',
marginBottom: '10px',
marginBottom: '15px',
lineHeight: '22px !important'
};

Expand Down
2 changes: 1 addition & 1 deletion src/layout/Dialog/SetttingKeyDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Index: React.FC<IDialogProp> = ({ closeCallBack }) => {
return (
<>
<Modal
title="配置"
title="阿里云配置"
centered
okText="确定"
cancelText="取消"
Expand Down
3 changes: 2 additions & 1 deletion src/layout/SiderBar/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import { appName } from '@/config';

const Header = styled.div`
width: 280px;
height: 60px;
height: 80px;
background-color: #748bad;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
font-size: 24px;
color: #fff;
padding-top: 20px;
`;

const Index = () => (
Expand Down
4 changes: 2 additions & 2 deletions src/layout/SiderBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Wrapper = styled.div`

const Wrapper2 = styled.div`
width: 280px;
height: calc(100vh - 60px - 80px - 60px);
height: calc(100vh - 80px - 80px - 60px);
padding: 0 20px;
overflow-y: auto;
box-sizing: border-box;
Expand All @@ -26,7 +26,7 @@ const Wrapper2 = styled.div`
const settingButtonStyle = css`
width: 280px;
height: 60px;
padding: 12px 20px 0;
padding: 7px 20px 0;
border-right: 1px solid #f4f6fa;
background-color: #fff;
`;
Expand Down

0 comments on commit 11e6ae4

Please sign in to comment.