From 1ce9844a85c2cc81f17e8c3046cb5c4a9f1ff52d Mon Sep 17 00:00:00 2001
From: ALGang <863209181@qq.com>
Date: Mon, 22 Jul 2019 08:40:33 +0800
Subject: [PATCH 01/31] init feature
---
package.json | 1 +
src/index.ejs | 6 +
src/main/index.js | 19 ++-
src/main/touchbar.js | 27 ++++
src/renderer/App.vue | 52 ++++++-
src/renderer/assets/eyedropper-touchbar.png | Bin 0 -> 1696 bytes
src/renderer/assets/settings-touchbar.png | Bin 0 -> 2475 bytes
src/renderer/components/menu/TopMenu.vue | 34 +++++
src/renderer/components/sider/LeftSider.vue | 55 +++++---
src/renderer/components/sider/index.vue | 143 +++++---------------
src/renderer/layouts/GlobalLayout.vue | 18 +--
src/renderer/pages/editor/index.vue | 2 +-
src/resources/colorsbook-touchbar.png | Bin 0 -> 1288 bytes
src/resources/eyedropper-touchbar.png | Bin 0 -> 1696 bytes
src/resources/settings-touchbar.png | Bin 0 -> 2475 bytes
15 files changed, 208 insertions(+), 149 deletions(-)
create mode 100644 src/main/touchbar.js
create mode 100644 src/renderer/assets/eyedropper-touchbar.png
create mode 100644 src/renderer/assets/settings-touchbar.png
create mode 100644 src/renderer/components/menu/TopMenu.vue
create mode 100644 src/resources/colorsbook-touchbar.png
create mode 100644 src/resources/eyedropper-touchbar.png
create mode 100644 src/resources/settings-touchbar.png
diff --git a/package.json b/package.json
index 2a2a935..4cec4cd 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,7 @@
"vue-router": "^3.0.1",
"vuex": "^3.0.1",
"vuex-electron": "^1.0.0",
+ "web-frame": "^0.0.2",
"wordwrap": "^1.0.0"
},
"devDependencies": {
diff --git a/src/index.ejs b/src/index.ejs
index c9f13da..2d414db 100644
--- a/src/index.ejs
+++ b/src/index.ejs
@@ -2,16 +2,22 @@
+
+
bloggo
<% if (htmlWebpackPlugin.options.nodeModules) { %>
<% } %>
+
+
<% if (!process.browser) { %>
diff --git a/src/main/index.js b/src/main/index.js
index 507216e..009fca8 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -1,4 +1,5 @@
-import { app, BrowserWindow } from 'electron' // eslint-disable-line
+import electron,{ app, BrowserWindow, Menu } from 'electron' // eslint-disable-line
+
/**
* Set `__static` path to static files in production
@@ -18,9 +19,21 @@ function createWindow() {
* Initial window options
*/
mainWindow = new BrowserWindow({
- height: 563,
+
+ height: 900,
useContentSize: true,
- width: 1000,
+ minWidth: 500,
+ minHeight: 387,
+ skipTaskbar: false,
+
+ backgroundColor: 'rgba(62,63,65,.1)',
+ width: 830,
+ titleBarStyle: 'hiddenInset',
+ webPreferences: {
+ nodeIntegration: true,
+ nodeIntegrationInWorker: true,
+ backgroundThrottling: false,
+ },
});
mainWindow.loadURL(winURL);
diff --git a/src/main/touchbar.js b/src/main/touchbar.js
new file mode 100644
index 0000000..560e457
--- /dev/null
+++ b/src/main/touchbar.js
@@ -0,0 +1,27 @@
+
+
+const { TouchBar } = require('electron');
+const { TouchBarColorPicker, TouchBarButton } = TouchBar;
+
+module.exports = (dirname, eventEmitter) => {
+ const colorpicker = new TouchBarColorPicker({
+ change: color => eventEmitter.emit('changeColor', color),
+ });
+ const eyedropper = new TouchBarButton({
+ icon: `${dirname}/resources/eyedropper-touchbar.png`,
+ click: () => eventEmitter.emit('launchPicker'),
+ });
+ const colorsbook = new TouchBarButton({
+ icon: `${dirname}/resources/colorsbook-touchbar.png`,
+ click: () => eventEmitter.emit('launchColorsbook'),
+ });
+ const settings = new TouchBarButton({
+ icon: `${dirname}/resources/settings-touchbar.png`,
+ click: () => eventEmitter.emit('showPreferences'),
+ });
+
+ const touchbar = new TouchBar([colorpicker, eyedropper, colorsbook, settings]);
+
+
+ return touchbar;
+};
diff --git a/src/renderer/App.vue b/src/renderer/App.vue
index 53c0cb1..cc18b40 100644
--- a/src/renderer/App.vue
+++ b/src/renderer/App.vue
@@ -1,12 +1,34 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -21,6 +43,30 @@
#app
user-select none
overflow hidden
+ .header
+ padding: 0
+ -webkit-app-region drag
+ background rgba(62,63,65,1)
+ position fixed
+ z-index 1
+ height 38px
+ width 100%
+ border-bottom .3px solid rgba(0,0,0,1)
+ .content
+ width 100%
+ color #fff
+ margin-top 35px
+ .ant-layout-sider
+ background rgba(30,31,33,1)
+ position fixed
+ height 100%
+ border-right:.3px solid rgba(0,0,0,1);
+ .ant-layout-content
+ width 100%
+ margin-left 375px
+ position fixed
+ height 100%
+ background rgba(39,38,39,1)
.el-button-group
width 100%
.el-button
diff --git a/src/renderer/assets/eyedropper-touchbar.png b/src/renderer/assets/eyedropper-touchbar.png
new file mode 100644
index 0000000000000000000000000000000000000000..dd3757334177a30c5c263a5da924e6505bfa8998
GIT binary patch
literal 1696
zcmV;R24DG!P)_-XL&=H`aYmdq&2r#$=5C8%U9)ZEDj~)O53?6}#tIy2$Q%b+2
zlErb0RZ8hC5xw^;GI{{dXe#f;%s;1;ex1P2u$8%!Nbw@2^pc1~
zj;ad+RE5u$nVF?^|Cv$}0ctOS|CETH)Z7RH)I?92mzkxN3;0LMES6+4B>X`{GDMg!
z2w)DGEdw)upHlkkVvM)lK%e@mq&I*7`T(0#PF?<+i%FgN9>xqZH;~>yJvV>=#t3VZ
zGqZH}&$a0t(_ItM1MU4FfHqQwbki(fTK-wr3nF@~`EUrJiIO4B3Elou=^hi23<;|j
z1lWp@;r|1{pG*D2*2WP8FaTal8W6q|_Z1O6Tq`#Oa1bCU{JCZii0FE$nh>B;fZ*_@
zcB`v`p#@-O*^igyn#`JCT3u)W{^nd@SOJ(>*65d8v+AXjM71IKQe4>_dYTh_NC7hN
z=h&zuXbis8?KKg}SI&2?;RINLuacla_;bC!&2146C4d6{sss(gmwIJa1H%YlfS;A1
zark2kPyqic2|9o;^~r7xci#h4z@H_MgBEgv$9iS_)E_>1sA5Rn{C?RO^-@K@)P@(@Y(
zNO~7N05i)M9lsqprEcuA9xgpM(7XWCx%+pG0Xed`pNMF24+8=miQ=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ider.vue b/src/renderer/components/sider/LeftSider.vue
index 8807598..4dc2062 100644
--- a/src/renderer/components/sider/LeftSider.vue
+++ b/src/renderer/components/sider/LeftSider.vue
@@ -1,23 +1,32 @@
-
-
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
{{item.title}}
- {{item.description}}
+ {{item.description}}
@@ -37,8 +46,11 @@
@@ -94,7 +114,10 @@ export default {
margin-top: 10px
margin-right: 25px
.item
- &:hover
- color: #eee
-
+ cursor pointer
+ &:hover
+ .more
+ display inline-block
+ .more
+ display none
\ No newline at end of file
diff --git a/src/renderer/components/sider/index.vue b/src/renderer/components/sider/index.vue
index 4dc2062..225e491 100644
--- a/src/renderer/components/sider/index.vue
+++ b/src/renderer/components/sider/index.vue
@@ -1,123 +1,46 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+ 123
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item.title}}
- {{item.description}}
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
+
+ 456
+
+
+
+
-
\ No newline at end of file
diff --git a/src/renderer/layouts/GlobalLayout.vue b/src/renderer/layouts/GlobalLayout.vue
index 4150809..46b6334 100644
--- a/src/renderer/layouts/GlobalLayout.vue
+++ b/src/renderer/layouts/GlobalLayout.vue
@@ -1,23 +1,9 @@
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
diff --git a/src/renderer/pages/editor/index.vue b/src/renderer/pages/editor/index.vue
index 43adf03..2f7545b 100644
--- a/src/renderer/pages/editor/index.vue
+++ b/src/renderer/pages/editor/index.vue
@@ -1,6 +1,6 @@
-
+
@@ -54,21 +81,25 @@
border-bottom .3px solid rgba(0,0,0,1)
.content
width 100%
+ height 100vh
color #fff
margin-top 35px
+ background rgba(30,31,33,1)
.ant-layout-sider
background rgba(30,31,33,1)
position fixed
height 100%
border-right:.3px solid rgba(0,0,0,1);
+ .presentation
+ width 10px
+ height 100%
+ position absolute
+ right 0px
+ &:hover
+ cursor w-resize
.ant-layout-content
width 100%
- margin-left 375px
position fixed
height 100%
background rgba(39,38,39,1)
- .el-button-group
- width 100%
- .el-button
- width 50%
diff --git a/src/renderer/components/menu/TopMenu.vue b/src/renderer/components/menu/TopMenu.vue
index 377c15e..95f37fd 100644
--- a/src/renderer/components/menu/TopMenu.vue
+++ b/src/renderer/components/menu/TopMenu.vue
@@ -1,5 +1,5 @@
-