切换导航条
切换导航条
当前项目
正在载入...
登录
术习电报
/
electron-vue-template
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
构建
提交
问题看板
文件
提交
网络
比较
分支
标签
作者
张恒
2019-08-15 21:06:40 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
提交
5f46dbfa51bdf90bd023bdc8a2d0ca4ff133a1d6
5f46dbfa
1 个父辈
46916bf7
尝试让启动图拥有高斯模糊效果
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
162 行增加
和
164 行删除
.electron-vue/webpack.main.config.js
package.json
src/main/index.js
src/main/services/windowManager.js
static/loader.html
.electron-vue/webpack.main.config.js
查看文件 @
5f46dbf
...
...
@@ -57,7 +57,7 @@ let mainConfig = {
],
resolve
:
{
alias
:
{
'config'
:
resolve
(
'config'
),
'
@
config'
:
resolve
(
'config'
),
},
extensions
:
[
'.js'
,
'.json'
,
'.node'
]
},
...
...
package.json
查看文件 @
5f46dbf
...
...
@@ -6,6 +6,7 @@
"license"
:
"MIT"
,
"main"
:
"./dist/electron/main.js"
,
"scripts"
:
{
"dev"
:
"node .electron-vue/dev-runner.js"
,
"build"
:
"node .electron-vue/build.js && electron-builder"
,
"build:win32"
:
"node .electron-vue/build.js && electron-builder --win --ia32"
,
"build:win64"
:
"node .electron-vue/build.js && electron-builder --win --x64"
,
...
...
@@ -13,12 +14,15 @@
"build:dir"
:
"node .electron-vue/build.js && electron-builder --dir"
,
"build:clean"
:
"cross-env BUILD_TARGET=clean node .electron-vue/build.js"
,
"build:web"
:
"cross-env BUILD_TARGET=web node .electron-vue/build.js"
,
"dev"
:
"node .electron-vue/dev-runner.js"
,
"pack"
:
"npm run pack:main && npm run pack:renderer"
,
"pack:main"
:
"cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js"
,
"pack:renderer"
:
"cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js"
},
"build"
:
{
"nsis"
:
{
"oneClick"
:
false
,
"allowToChangeInstallationDirectory"
:
true
},
"productName"
:
"electron-vue-admin"
,
"appId"
:
"org.simulatedgreg.electron-vue"
,
"directories"
:
{
...
...
@@ -28,8 +32,7 @@
"dist/electron/**/*"
],
"dmg"
:
{
"contents"
:
[
{
"contents"
:
[{
"x"
:
410
,
"y"
:
150
,
"type"
:
"link"
,
...
...
@@ -131,4 +134,4 @@
"webpack-hot-middleware"
:
"^2.25.0"
,
"webpack-merge"
:
"^4.2.1"
}
}
}
\ No newline at end of file
...
...
src/main/index.js
查看文件 @
5f46dbf
...
...
@@ -2,20 +2,21 @@
import
{
app
}
from
'electron'
import
'../renderer/store'
import
loadindWindow
from
'./services/windowManager'
import
initWindow
from
'./services/windowManager'
import
path
from
'path'
/**
* Set `__static` path to static files in production
* https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html
*/
if
(
process
.
env
.
NODE_ENV
!==
'development'
)
{
global
.
__static
=
require
(
'path'
)
.
join
(
__dirname
,
'/static'
).
replace
(
/
\\
/g
,
'\\\\'
)
global
.
__static
=
path
.
join
(
__dirname
,
'/static'
).
replace
(
/
\\
/g
,
'\\\\'
)
}
const
loadingURL
=
process
.
env
.
NODE_ENV
===
'development'
?
`http://localhost:9080/static/loader.html`
:
`file://
${
__static
}
/loader.html`
function
onAppReady
()
{
loadind
Window
(
loadingURL
)
init
Window
(
loadingURL
)
}
app
.
isReady
()
?
onAppReady
()
:
app
.
on
(
'ready'
,
onAppReady
)
...
...
@@ -25,7 +26,9 @@ app.on('window-all-closed', () => {
app
.
quit
()
}
})
app
.
on
(
'browser-window-created'
,
()
=>
{
console
.
log
(
11111
)
})
// app.on('activate', () => {
// if (mainWindow === null) {
// createWindow()
...
...
src/main/services/windowManager.js
查看文件 @
5f46dbf
...
...
@@ -13,7 +13,6 @@ function createMainWindow () {
useContentSize
:
true
,
width
:
1000
,
show
:
false
,
backgroundColor
:
'#fffff'
,
titleBarStyle
:
'hidden'
,
webPreferences
:
{
nodeIntegration
:
true
...
...
@@ -32,15 +31,14 @@ function createMainWindow () {
mainWindow
=
null
})
}
// if(require('config').UseUseStartupChart){
// }
function
loadindWindow
(
loadingURL
)
{
const
loadWindow
=
new
BrowserWindow
({
width
:
400
,
height
:
600
,
frame
:
false
,
backgroundColor
:
'#222428'
transparent
:
true
,
webPreferences
:
{
experimentalFeatures
:
true
}
})
loadWindow
.
loadURL
(
loadingURL
)
...
...
@@ -52,5 +50,11 @@ function loadindWindow (loadingURL) {
loadWindow
.
destroy
()
},
2000
)
}
export
default
loadindWindow
function
initWindow
(
loadingURL
)
{
if
(
require
(
'@config'
).
UseStartupChart
)
{
return
loadindWindow
(
loadingURL
)
}
else
{
return
createMainWindow
()
}
}
export
default
initWindow
...
...
static/loader.html
查看文件 @
5f46dbf
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<title></title>
<style>
/* Demo Styles - It's all in the SVG */
html
{
height
:
100%
;
min-height
:
100%
;
overflow
:
hidden
;
}
html
body
{
background
:
#222428
;
background-size
:
163px
;
font
:
14px
/
21px
Monaco
,
sans-serif
;
color
:
#999
;
font-smoothing
:
antialiased
;
-webkit-text-size-adjust
:
100%
;
-moz-text-size-adjust
:
100%
;
<meta
charset=
"utf-8"
>
<title></title>
<style>
/* Demo Styles - It's all in the SVG */
html
{
height
:
100%
;
min-height
:
100%
;
overflow
:
hidden
;
}
html
body
{
background
:
#222428
af
;
backdrop-filter
:
blur
(
8px
);
background-size
:
163px
;
font
:
14px
/
21px
Monaco
,
sans-serif
;
color
:
#999
;
font-smoothing
:
antialiased
;
-webkit-text-size-adjust
:
100%
;
-moz-text-size-adjust
:
100%
;
-ms-text-size-adjust
:
100%
;
text-size-adjust
:
100%
;
height
:
100%
;
min-height
:
100%
;
}
html
body
a
,
html
body
a
:visited
{
text-decoration
:
none
;
color
:
#FF805F
;
}
html
body
h4
{
margin
:
0
;
color
:
#666
;
}
.scene
{
width
:
100%
;
height
:
100%
;
-webkit-perspective
:
600
;
perspective
:
600
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.scene
svg
{
width
:
240px
;
height
:
240px
;
}
.dc-logo
{
position
:
fixed
;
right
:
10px
;
bottom
:
10px
;
}
.dc-logo
:hover
svg
{
-webkit-transform-origin
:
50%
50%
;
transform-origin
:
50%
50%
;
-webkit-animation
:
arrow-spin
2.5s
0s
cubic-bezier
(
0.165
,
0.84
,
0.44
,
1
)
infinite
;
animation
:
arrow-spin
2.5s
0s
cubic-bezier
(
0.165
,
0.84
,
0.44
,
1
)
infinite
;
}
.dc-logo
:hover:hover:before
{
content
:
'\2764'
;
padding
:
6px
;
font
:
10px
/
1
Monaco
,
sans-serif
;
font-size
:
10px
;
color
:
#00fffe
;
text-transform
:
uppercase
;
position
:
absolute
;
left
:
-70px
;
top
:
-30px
;
white-space
:
nowrap
;
z-index
:
20px
;
box-shadow
:
0px
0px
4px
#222
;
background
:
rgba
(
0
,
0
,
0
,
0.4
);
}
.dc-logo
:hover:hover:after
{
content
:
'Digital Craft'
;
padding
:
6px
;
font
:
10px
/
1
Monaco
,
sans-serif
;
font-size
:
10px
;
color
:
#6E6F71
;
text-transform
:
uppercase
;
position
:
absolute
;
right
:
0
;
top
:
-30px
;
white-space
:
nowrap
;
z-index
:
20px
;
box-shadow
:
0px
0px
4px
#222
;
background
:
rgba
(
0
,
0
,
0
,
0.4
);
background-image
:
none
;
}
@-webkit-keyframes
arrow-spin
{
50
%
{
-webkit-transform
:
rotateY
(
360deg
);
transform
:
rotateY
(
360deg
);
}
}
@keyframes
arrow-spin
{
50
%
{
-webkit-transform
:
rotateY
(
360deg
);
transform
:
rotateY
(
360deg
);
}
}
</style>
text-size-adjust
:
100%
;
height
:
100%
;
min-height
:
100%
;
}
html
body
a
,
html
body
a
:visited
{
text-decoration
:
none
;
color
:
#FF805F
;
}
html
body
h4
{
margin
:
0
;
color
:
#666
;
}
.scene
{
width
:
100%
;
height
:
100%
;
-webkit-perspective
:
600
;
perspective
:
600
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.scene
svg
{
width
:
240px
;
height
:
240px
;
}
.dc-logo
{
position
:
fixed
;
right
:
10px
;
bottom
:
10px
;
}
.dc-logo
:hover
svg
{
-webkit-transform-origin
:
50%
50%
;
transform-origin
:
50%
50%
;
-webkit-animation
:
arrow-spin
2.5s
0s
cubic-bezier
(
0.165
,
0.84
,
0.44
,
1
)
infinite
;
animation
:
arrow-spin
2.5s
0s
cubic-bezier
(
0.165
,
0.84
,
0.44
,
1
)
infinite
;
}
.dc-logo
:hover:hover:before
{
content
:
'\2764'
;
padding
:
6px
;
font
:
10px
/
1
Monaco
,
sans-serif
;
font-size
:
10px
;
color
:
#00fffe
;
text-transform
:
uppercase
;
position
:
absolute
;
left
:
-70px
;
top
:
-30px
;
white-space
:
nowrap
;
z-index
:
20px
;
box-shadow
:
0px
0px
4px
#222
;
background
:
rgba
(
0
,
0
,
0
,
0.4
);
}
.dc-logo
:hover:hover:after
{
content
:
'Digital Craft'
;
padding
:
6px
;
font
:
10px
/
1
Monaco
,
sans-serif
;
font-size
:
10px
;
color
:
#6E6F71
;
text-transform
:
uppercase
;
position
:
absolute
;
right
:
0
;
top
:
-30px
;
white-space
:
nowrap
;
z-index
:
20px
;
box-shadow
:
0px
0px
4px
#222
;
background
:
rgba
(
0
,
0
,
0
,
0.4
);
background-image
:
none
;
}
@-webkit-keyframes
arrow-spin
{
50
%
{
-webkit-transform
:
rotateY
(
360deg
);
transform
:
rotateY
(
360deg
);
}
}
@keyframes
arrow-spin
{
50
%
{
-webkit-transform
:
rotateY
(
360deg
);
transform
:
rotateY
(
360deg
);
}
}
</style>
</head>
<body>
<div
class=
"scene"
>
<svg
version=
"1.1"
id=
"dc-spinner"
xmlns=
"http://www.w3.org/2000/svg"
x=
"0px"
y=
"0px"
width:
"
38
"
height:
"
38
"
viewBox=
"0 0 38 38"
preserveAspectRatio=
"xMinYMin meet"
>
<text
x=
"13"
y=
"21"
font-family=
"Monaco"
font-size=
"2px"
style=
"letter-spacing:0.6"
fill=
"grey"
>
准备资源中...
<animate
attributeName=
"opacity"
values=
"0;1;0"
dur=
"1.8s"
repeatCount=
"indefinite"
/>
</text>
<path
fill=
"#373a42"
d=
"M20,35c-8.271,0-15-6.729-15-15S11.729,5,20,5s15,6.729,15,15S28.271,35,20,35z M20,5.203
<div
class=
"scene"
>
<svg
version=
"1.1"
id=
"dc-spinner"
xmlns=
"http://www.w3.org/2000/svg"
x=
"0px"
y=
"0px"
width:
"
38
"
height:
"
38
"
viewBox=
"0 0 38 38"
preserveAspectRatio=
"xMinYMin meet"
>
<text
x=
"13"
y=
"21"
font-family=
"Monaco"
font-size=
"2px"
style=
"letter-spacing:0.6"
fill=
"grey"
>
准备资源中...
<animate
attributeName=
"opacity"
values=
"0;1;0"
dur=
"1.8s"
repeatCount=
"indefinite"
/>
</text>
<path
fill=
"#373a42"
d=
"M20,35c-8.271,0-15-6.729-15-15S11.729,5,20,5s15,6.729,15,15S28.271,35,20,35z M20,5.203
C11.841,5.203,5.203,11.841,5.203,20c0,8.159,6.638,14.797,14.797,14.797S34.797,28.159,34.797,20
C34.797,11.841,28.159,5.203,20,5.203z"
>
</path>
</path>
<path
fill=
"#373a42"
d=
"M20,33.125c-7.237,0-13.125-5.888-13.125-13.125S12.763,6.875,20,6.875S33.125,12.763,33.125,20
<path
fill=
"#373a42"
d=
"M20,33.125c-7.237,0-13.125-5.888-13.125-13.125S12.763,6.875,20,6.875S33.125,12.763,33.125,20
S27.237,33.125,20,33.125z M20,7.078C12.875,7.078,7.078,12.875,7.078,20c0,7.125,5.797,12.922,12.922,12.922
S32.922,27.125,32.922,20C32.922,12.875,27.125,7.078,20,7.078z"
>
</path>
</path>
<path
fill=
"#2AA198"
stroke=
"#2AA198"
stroke-width=
"0.6027"
stroke-miterlimit=
"10"
d=
"M5.203,20
<path
fill=
"#2AA198"
stroke=
"#2AA198"
stroke-width=
"0.6027"
stroke-miterlimit=
"10"
d=
"M5.203,20
c0-8.159,6.638-14.797,14.797-14.797V5C11.729,5,5,11.729,5,20s6.729,15,15,15v-0.203C11.841,34.797,5.203,28.159,5.203,20z"
>
<animateTransform
attributeName=
"transform"
type=
"rotate"
from=
"0 20 20"
to=
"360 20 20"
calcMode=
"spline"
keySplines=
"0.4, 0, 0.2, 1"
keyTimes=
"0;1"
dur=
"2s"
repeatCount=
"indefinite"
/>
</path>
<path
fill=
"#859900"
stroke=
"#859900"
stroke-width=
"0.2027"
stroke-miterlimit=
"10"
d=
"M7.078,20
<animateTransform
attributeName=
"transform"
type=
"rotate"
from=
"0 20 20"
to=
"360 20 20"
calcMode=
"spline"
keySplines=
"0.4, 0, 0.2, 1"
keyTimes=
"0;1"
dur=
"2s"
repeatCount=
"indefinite"
/>
</path>
<path
fill=
"#859900"
stroke=
"#859900"
stroke-width=
"0.2027"
stroke-miterlimit=
"10"
d=
"M7.078,20
c0-7.125,5.797-12.922,12.922-12.922V6.875C12.763,6.875,6.875,12.763,6.875,20S12.763,33.125,20,33.125v-0.203
C12.875,32.922,7.078,27.125,7.078,20z"
>
<animateTransform
attributeName=
"transform"
type=
"rotate"
from=
"0 20 20"
to=
"360 20 20"
dur=
"1.8s"
repeatCount=
"indefinite"
/>
</path>
</svg>
</div>
<animateTransform
attributeName=
"transform"
type=
"rotate"
from=
"0 20 20"
to=
"360 20 20"
dur=
"1.8s"
repeatCount=
"indefinite"
/>
</path>
</svg>
</div>
</body>
</html>
</html>
\ No newline at end of file
...
...
请
注册
或
登录
后发表评论