You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
111 lines
2.5 KiB
111 lines
2.5 KiB
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title><%= process.env.npm_package_productName %></title>
|
|
<meta charset="utf-8">
|
|
<style>
|
|
|
|
<%= __GLOBAL_STYLES__ %>
|
|
|
|
body {
|
|
background: #f9f9f9;
|
|
}
|
|
|
|
#preload {
|
|
-webkit-app-region: drag;
|
|
align-items: center;
|
|
background: #f9f9f9;
|
|
bottom: 0;
|
|
display: none;
|
|
flex-direction: column;
|
|
justify-content: center;
|
|
left: 0;
|
|
opacity: 1;
|
|
position: fixed;
|
|
right: 0;
|
|
top: 0;
|
|
transition: opacity 0.5s ease-in-out;
|
|
z-index: 100;
|
|
}
|
|
|
|
#preload .logo {
|
|
height: 80px;
|
|
width: 80px;
|
|
animation: logo 4s infinite 0.5s;
|
|
transform-origin: 50% 50%;
|
|
}
|
|
|
|
@keyframes logo {
|
|
0% {
|
|
transform: rotate(0deg);
|
|
}
|
|
20% {
|
|
transform: rotate(-360deg);
|
|
}
|
|
30% {
|
|
transform: rotate(-360deg);
|
|
}
|
|
50% {
|
|
transform: rotate(-720deg);
|
|
}
|
|
60% {
|
|
transform: rotate(-720deg);
|
|
}
|
|
100% {
|
|
transform: rotate(0deg);
|
|
}
|
|
}
|
|
|
|
textarea {
|
|
resize: none;
|
|
}
|
|
|
|
</style>
|
|
<script>
|
|
<% if (htmlWebpackPlugin.options.nodeModules) { %>
|
|
require('module').globalPaths.push(
|
|
'<%= htmlWebpackPlugin.options.nodeModules.replace(/\\/g, "\\\\") %>',
|
|
)
|
|
<% } %>
|
|
require('source-map-support/source-map-support.js').install()
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<div id="preload">
|
|
<img class="logo" src="<%= __DEV__ ? '.' : '../static' %>/images/ledgerlive-logo.svg" alt="" />
|
|
</div>
|
|
<div id="app"></div>
|
|
<script>
|
|
const { remote } = require('electron')
|
|
const { name } = remote.getCurrentWindow()
|
|
|
|
const preloadEl = document.getElementById('preload')
|
|
const appEl = document.getElementById('app')
|
|
const logoEl = preloadEl.querySelector('.logo')
|
|
|
|
const initApp = (options = {}) => {
|
|
const { force = false } = options
|
|
|
|
if (force) {
|
|
preloadEl.remove()
|
|
} else {
|
|
preloadEl.style.opacity = 0
|
|
|
|
preloadEl.addEventListener('transitionend', () => preloadEl.remove())
|
|
}
|
|
}
|
|
|
|
if (name === 'MainWindow') {
|
|
preloadEl.style.display = 'flex'
|
|
const startTime = Date.now()
|
|
const PRELOAD_WAIT_TIME_MIN = 3000
|
|
window.onAppReady = () => {
|
|
const delay = Math.max(0, PRELOAD_WAIT_TIME_MIN - (Date.now() - startTime))
|
|
setTimeout(initApp, delay)
|
|
}
|
|
} else {
|
|
initApp({ force: true })
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|