Skip to content

Commit b452eba

Browse files
authored
Merge pull request scratchfoundation#60 from cwillisf/show-loading-screen-sooner
Show main window ASAP, even if it's just a loading screen
2 parents 1de581d + 68bb1f4 commit b452eba

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

electron-webpack.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"webpackConfig": "webpack.main.additions.js"
44
},
55
"renderer": {
6+
"template": "src/renderer/index.html",
67
"webpackConfig": "webpack.renderer.additions.js"
78
}
89
}

src/renderer/index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8">
5+
<style>
6+
body {
7+
background-color: #4D97FF;
8+
}
9+
.splash {
10+
color: white;
11+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
12+
font-size: xx-large;
13+
font-weight: bolder;
14+
margin: 0;
15+
position: absolute;
16+
top: 50%;
17+
left: 50%;
18+
transform: translate(-50%, -50%);
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
<div id="app"><p class="splash">Scratch Desktop is loading...</p></div>
24+
</body>
25+
</html>

src/renderer/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
import './app.jsx';
1+
// this is an async import so that it doesn't block the first render
2+
// index.html contains a loading/splash screen which will display while this import loads
3+
import('./app.jsx');

0 commit comments

Comments
 (0)