-
Notifications
You must be signed in to change notification settings - Fork 864
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add splash screen on top of ctx refactor (#2548)
* chore: update ctx refactor * fix: tests * feat: add context.spec.js tests * fix: startup issues * feat: app context supports lazy functions * chore: self-PR-review cleanup * test: fix e2e tests * feat: add splash screen * tmp: trying to fix e2e tests * chore(deps): upgrade playwright * fix: revert daemonReady function * Update src/splash/splash.html * Update src/splash/splash.html * Update src/splash/splash.html * Update src/webui/index.js * Update test/e2e/launch.e2e.test.js * Update test/e2e/launch.e2e.test.js * Update test/e2e/launch.e2e.test.js * Update test/e2e/launch.e2e.test.js * Update test/e2e/launch.e2e.test.js * fix: do not prompt for new port when using CI * fix: handle errors that were breaking e2e tests * feat: splashscreen page background is transparent * make keyframe animation dir normal * remove visual artifacts of drop-shadow on size reduction * make drop-shadow animation better * feat: splash screen animation polish * chore: removed webkit keyframes definition * chore: remove debugging code * chore: remove extra line Co-authored-by: Nishant Arora <[email protected]> * chore(splash-screen): repositioning awaits Co-authored-by: Nishant Arora <[email protected]> * chore: fix after pr comment change * chore: move splash screen css to separate file --------- Co-authored-by: Nishant Arora <[email protected]>
- Loading branch information
Showing
9 changed files
with
192 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
body { | ||
border-radius: 5vh; | ||
} | ||
|
||
.loader { | ||
background-image: url('../../assets/icons/tray/others/on-large.png'); | ||
width: 200px; | ||
height: 200px; | ||
-webkit-animation: heartbeat 1.5s ease-in-out 0s infinite normal both; | ||
animation: heartbeat 1.5s ease-in-out 0s infinite normal both; | ||
-webkit-transform-origin: center center; | ||
transform-origin: center center; | ||
margin: auto; | ||
left: 0; | ||
right: 0; | ||
top: 0px; | ||
bottom: 0; | ||
position: fixed; | ||
background-size: cover; | ||
filter: drop-shadow(0 0 0 #378085); | ||
} | ||
|
||
@keyframes heartbeat { | ||
0% { | ||
animation-timing-function: ease-out; | ||
transform: scale(1); | ||
transform-origin: center center; | ||
filter: drop-shadow(0 0 0 #378085); | ||
} | ||
|
||
45% { | ||
animation-timing-function: ease-in; | ||
transform: scale(1); | ||
filter: drop-shadow(0 0 0rem #378085); | ||
} | ||
|
||
50% { | ||
animation-timing-function: ease-in; | ||
transform: scale(1); | ||
filter: drop-shadow(0 0 0.5rem #378085); | ||
} | ||
|
||
55% { | ||
animation-timing-function: ease-out; | ||
transform: scale(1); | ||
/* Size should be increased on drop-shadow so when scaling down, drop-shadow compensates for size reduction, and we don't get any visual artifacts */ | ||
filter: drop-shadow(0 0 1rem #378085); | ||
} | ||
|
||
67% { | ||
animation-timing-function: ease-in; | ||
transform: scale(1.13); | ||
filter: drop-shadow(0 0 0.75rem #378085); | ||
} | ||
|
||
83% { | ||
animation-timing-function: ease-out; | ||
transform: scale(1.02); | ||
filter: drop-shadow(0 0 0.50rem #378085); | ||
} | ||
|
||
90% { | ||
animation-timing-function: ease-in; | ||
transform: scale(1.09); | ||
filter: drop-shadow(0 0 0.75rem #378085); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<html> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<link rel="stylesheet" href="splash.css"> | ||
</head> | ||
|
||
<body id="e2e-splashScreen"> | ||
<div class="loader"></div> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/** | ||
* A splash screen for the application that is shown while the webui is loading. | ||
* | ||
* This is to prevent the user from seeing the `Could not connect to the IPFS API` error | ||
* while we're still booting up the daemon. | ||
*/ | ||
const { BrowserWindow } = require('electron') | ||
const getCtx = require('../context') | ||
const logger = require('../common/logger') | ||
const path = require('node:path') | ||
|
||
module.exports = async function createSplashScreen () { | ||
const ctx = getCtx() | ||
const splashScreen = new BrowserWindow({ | ||
title: 'IPFS Desktop splash screen', | ||
width: 250, | ||
height: 275, | ||
transparent: true, | ||
frame: false, | ||
alwaysOnTop: true, | ||
show: false | ||
}) | ||
|
||
try { | ||
await splashScreen.loadFile(path.join(__dirname, '../../assets/pages/splash.html')) | ||
} catch (err) { | ||
logger.error('[splashScreen] loadFile failed') | ||
logger.error(err) | ||
return | ||
} | ||
|
||
splashScreen.center() | ||
|
||
ctx.setProp('splashScreen', splashScreen) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export type CONFIG_KEYS = 'AUTO_LAUNCH' | 'AUTO_GARBAGE_COLLECTOR' | 'SCREENSHOT_SHORTCUT' | 'OPEN_WEBUI_LAUNCH' | 'MONOCHROME_TRAY_ICON' | 'EXPERIMENT_PUBSUB' | 'EXPERIMENT_PUBSUB_NAMESYS' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters