Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
simplified splash
Browse files Browse the repository at this point in the history
  • Loading branch information
forman committed Mar 20, 2018
1 parent e77641f commit 0d2ccff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
29 changes: 12 additions & 17 deletions app/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,18 @@
<html>
<head>
<style type='text/css'>
#image {
overflow: hidden;
position: relative;
width: 100%;
#content {
width: 256px;
height: 256px;
}
#message-container {
overflow: hidden;
position: absolute;
bottom: 10px;
right: 10px;
width: 100%;
color: white;
text-align: right;
font-weight: lighter;
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
font-size: 12px;
/*text-shadow: 0 0 8px white;*/
font-size: 0.8em;
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,sans-serif;
color: white;
text-shadow: 0 0 8px black;
text-align: center;
margin: 2px;
}
</style>
<script>
Expand All @@ -32,9 +27,9 @@
</script>
</head>
<body onload="init()" style="overflow: hidden;">
<div id="image">
<img src="resources/images/splash.png"/>
<span id="message-container">Loading Cate, please wait...</span>
<div id="content">
<img src="resources/cate-icon@16x.png"/>
<div id="message-container"></div>
</div>
</body>
</html>
8 changes: 5 additions & 3 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ class CateDesktopApp {
if (this.webAPIStartTime === null) {
// Set start time, unless it has already been done
this.resetWebAPIStartTime();
this.showSplashMessage('Waiting for Cate service...');
}

log.info(`Waiting for response from Cate service ${this.webAPIRestUrl}`);
this.showSplashMessage('Waiting for Cate service response...');
request(this.webAPIRestUrl, this.webAPIAccessTimeout)
.then((response: string) => {
log.info('Connected to Cate service. Response: ', response);
Expand All @@ -281,6 +281,7 @@ class CateDesktopApp {
const delta = this.webAPIStartTimeDelta;
const deltaStr = delta.toFixed(2);
log.info(`No response from Cate service after ${deltaStr} seconds: ${err}`);
this.showSplashMessage(`Waiting for Cate service (${deltaStr}s)`);
let callback = () => {
if (delta > this.webAPIStartTimeout) {
log.error(`Failed to start Cate service within ${deltaStr} seconds.`, err);
Expand Down Expand Up @@ -456,8 +457,8 @@ class CateDesktopApp {

private showSplashWindow(callback: () => void) {
this.splashWindow = new electron.BrowserWindow({
width: 830,
height: 320,
width: 300,
height: 300,
center: true,
show: true,
useContentSize: true,
Expand All @@ -467,6 +468,7 @@ class CateDesktopApp {
parent: this.mainWindow
});

this.splashWindow.setIgnoreMouseEvents(true);
this.splashWindow.on('closed', () => {
this.splashWindow = null;
});
Expand Down

0 comments on commit 0d2ccff

Please sign in to comment.