-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
297 additions
and
2 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,43 @@ | ||
import { app, BrowserWindow } from 'electron' | ||
import { join } from 'path' | ||
|
||
export function createUpdaterWindow(): BrowserWindow { | ||
const win = new BrowserWindow({ | ||
width: 500, | ||
height: 250, | ||
frame: false, | ||
transparent: true, | ||
alwaysOnTop: true, | ||
x: 0, | ||
y: 0, | ||
webPreferences: { | ||
preload: join(__dirname, './../preload/index.js'), | ||
nodeIntegration: false, | ||
webSecurity: true, | ||
sandbox: false, | ||
contextIsolation: true | ||
} | ||
}) | ||
|
||
const updaterScreenSrc = app.isPackaged | ||
? join(process.resourcesPath, 'updaterScreen.html') | ||
: join(__dirname, './../../', 'updaterScreen.html') | ||
|
||
win.loadFile(updaterScreenSrc) | ||
|
||
// win.webContents.on('did-finish-load', () => { | ||
// win.webContents | ||
// .executeJavaScript( | ||
// ` | ||
// const version = document.getElementById('version') | ||
// version.textContent = '${appVersion}' | ||
// ` | ||
// ) | ||
// .then((result) => { | ||
// console.log('Executed in renderer:', result) | ||
// }) | ||
// .catch(console.error) | ||
// }) | ||
|
||
return win | ||
} |
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,232 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<!-- <meta | ||
http-equiv="Content-Security-Policy" | ||
content="script-src 'self' 'sha256-nIcnn83YNljR5yr5x/oVAdAFNemfHxxTO3zjtez52do='" | ||
/> --> | ||
<title>Robotics Academy</title> | ||
<style> | ||
body { | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
height: 100%; | ||
width: 100%; | ||
overflow: hidden !important; | ||
margin: 0; | ||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', | ||
'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
user-select: none !important; | ||
} | ||
|
||
html { | ||
color: #333333; | ||
} | ||
|
||
h1 { | ||
margin-left: 0px; | ||
} | ||
|
||
.updater-container { | ||
height: 100%; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: start; | ||
align-items: center; | ||
background-color: white; | ||
} | ||
.loading-area { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
.loading-logo { | ||
width: 170px; | ||
} | ||
.loading-dots { | ||
position: relative; | ||
top: -5px; | ||
width: 45px; | ||
} | ||
.developer { | ||
font-size: 12px; | ||
margin: 4px; | ||
padding: 0; | ||
color: #a4a4a4; | ||
display: flex; | ||
justify-content: end; | ||
align-items: center; | ||
width: 100%; | ||
} | ||
.developer > span { | ||
font-size: 15px; | ||
font-weight: 500; | ||
margin: 2px; | ||
} | ||
.version { | ||
position: absolute; | ||
top: 88%; | ||
left: 90%; | ||
color: #f3f3f3; | ||
font-size: 12px; | ||
} | ||
|
||
.orginzationText { | ||
/* font-size: 150px; */ | ||
font-weight: 800; | ||
outline: none; | ||
background: linear-gradient( | ||
135deg, | ||
#5335cf 0%, | ||
#de005e 25%, | ||
#f66e48 50%, | ||
#de005e 75%, | ||
#5335cf 100% | ||
); | ||
background-size: 400%; | ||
-webkit-background-clip: text; | ||
-webkit-text-fill-color: transparent; | ||
animation: textAnimate 20s linear infinite; | ||
} | ||
@keyframes textAnimate { | ||
to { | ||
background-position: 400%; | ||
} | ||
} | ||
|
||
/* start */ | ||
/* header */ | ||
.header { | ||
width: 100%; | ||
height: 2.5rem; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
padding: 0px 12px; | ||
background-color: #d9d9d9; | ||
box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.2); | ||
} | ||
.header > .header-logo { | ||
margin-left: 12px; | ||
height: 2rem; | ||
width: 2rem; | ||
} | ||
.header > .header-title { | ||
font-size: 16px; | ||
font-weight: 500; | ||
opacity: 80%; | ||
margin-left: -60px; | ||
} | ||
.header > .header-close { | ||
padding: 7px 20px; | ||
fill: #333; | ||
cursor: pointer; | ||
transition-duration: 300ms; | ||
transition-property: fill; | ||
} | ||
.header > .header-close:hover { | ||
background: red; | ||
fill: white; | ||
} | ||
|
||
/* updater-body */ | ||
.updater-body { | ||
margin-top: 20px; | ||
display: flex; | ||
gap: 16px; | ||
font-size: 16px; | ||
color: rgba(51, 51, 51, 100); | ||
font-weight: 400; | ||
align-items: self-start; | ||
width: 100%; | ||
justify-content: center; | ||
} | ||
.updater-body > .updater-body-download-icon { | ||
} | ||
.updater-body > .updater-body-update-info { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
} | ||
.updater-body > .updater-body-update-info > p { | ||
margin: 0px !important; | ||
} | ||
</style> | ||
<script> | ||
window.onload = async function () { | ||
// get current version | ||
try { | ||
const c_version = await window.api.getAppVersion() | ||
const version = document.getElementById('current-version') | ||
if (c_version.status === 'SUCCESS') { | ||
version.textContent = c_version.data | ||
} | ||
} catch (err) { | ||
console.log(err) | ||
} | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div class="updater-container"> | ||
<!-- header --> | ||
<div class="header"> | ||
<img src="./resources/icons/icon.png" alt="jdeRobot" class="header-logo" /> | ||
<span class="header-title">Robotics Academy Desktop Update Available</span> | ||
<div class="header-close" id="close-window"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
height="24px" | ||
viewBox="0 -960 960 960" | ||
width="25px" | ||
> | ||
<path | ||
d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z" | ||
/> | ||
</svg> | ||
</div> | ||
</div> | ||
<!-- updater-body --> | ||
<div class="updater-body"> | ||
<!-- download-icon --> | ||
<div class="updater-body-download-icon"> | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
height="48px" | ||
viewBox="0 -960 960 960" | ||
width="48px" | ||
fill="#0C94FB" | ||
> | ||
<path | ||
d="M260-120v-73l47-47H140q-24 0-42-18t-18-42v-480q0-24 18-42t42-18h397v60H140v480h680v-139h60v139q0 24-18 42t-42 18H652l48 47v73H260Zm367-226L434-539l42-42 121 120v-379h60v379l121-120 42 42-193 193Z" | ||
/> | ||
</svg> | ||
</div> | ||
<!-- update informations --> | ||
<div class="updater-body-update-info"> | ||
<p>A new version of Robotics Academy Desktop Available.</p> | ||
<p>Do you want to download version 2.0.1 ?</p> | ||
<p>Current Version <span id="current-version">2.0.0</span></p> | ||
</div> | ||
</div> | ||
<!-- button --> | ||
<!-- footer --> | ||
</div> | ||
|
||
<script> | ||
const closeButton = document.getElementById('close-window') | ||
closeButton.addEventListener('click', async () => { | ||
try { | ||
window.api.updaterWindowClose() | ||
} catch (err) { | ||
console.log(err) | ||
} | ||
}) | ||
</script> | ||
</body> | ||
</html> |