-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced default update dialog with custom window modal
- Loading branch information
1 parent
7707bbe
commit ad06c80
Showing
6 changed files
with
224 additions
and
30 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,110 @@ | ||
@import url("./fonts/fonts.css"); | ||
|
||
:root { | ||
user-select: none; | ||
-webkit-user-select: none; | ||
} | ||
|
||
div#window { | ||
height: 40px; | ||
width: -webkit-fill-available; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
-webkit-app-region: drag; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
} | ||
|
||
|
||
div#window>div#title>div#windowlogo { | ||
font-family: 'Montserrat'; | ||
font-size: 24px; | ||
font-weight: 700; | ||
letter-spacing: 1px; | ||
width: 30px; | ||
user-select: none; | ||
-webkit-user-select: none; | ||
padding-right: 10px; | ||
} | ||
|
||
div#window>div#title>div#windowtitle { | ||
font-family: 'Uni Sans CAPS', 'Montserrat'; | ||
font-size: 14px; | ||
font-weight: 700; | ||
user-select: none; | ||
-webkit-user-select: none; | ||
text-transform: uppercase; | ||
} | ||
|
||
body { | ||
margin: 0; | ||
} | ||
|
||
div#title { | ||
display: flex; | ||
align-items: center; | ||
flex-direction: row; | ||
justify-content: center; | ||
width: -webkit-fill-available; | ||
} | ||
|
||
html { | ||
color: white; | ||
animation: updateBackground 5s both infinite alternate; | ||
} | ||
|
||
@keyframes updateBackground { | ||
0% { | ||
background-color: #6495ed; | ||
} | ||
100% { | ||
background-color: #404; | ||
} | ||
} | ||
|
||
div#update { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
align-content: space-around; | ||
justify-content: space-evenly; | ||
flex-wrap: wrap; | ||
height: calc(100% - 40px); | ||
font-family: 'Montserrat'; | ||
font-weight: 700; | ||
} | ||
|
||
div#choices { | ||
height: 150px; | ||
width: 90%; | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-around; | ||
} | ||
|
||
div.choice { | ||
height: calc(100% - 5px); | ||
width: 45%; | ||
border: 2.5px white solid; | ||
border-radius: 16px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
transition: background-color 0.125s ease-in-out; | ||
} | ||
|
||
div.choice:hover { | ||
cursor: pointer; | ||
background-color: rgba(255, 255, 255, 0.404); | ||
} | ||
|
||
choiceicon { | ||
font-size: 72px !important; | ||
margin-bottom: 12px; | ||
} | ||
|
||
choicetext { | ||
font-size: 12px; | ||
} |
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,27 @@ | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="update.css"> | ||
<title>update downloaded</title> | ||
</head> | ||
<body> | ||
<div id="window"> | ||
<div id="title"> | ||
<div id="windowlogo">××</div><div id="windowtitle">deadforge</div></div> | ||
</div> | ||
</div> | ||
<div id="update"> | ||
<div id="updatemessage">Update has been downloaded.</div> | ||
<div id="choices"> | ||
<div class="choice" id="choicenow" onclick="updateNow()"> | ||
<choiceicon class="material-symbols-outlined">restart_alt</choiceicon> | ||
<choicetext>Install now</choicetext> | ||
</div> | ||
<div class="choice" id="choiceclose" onclick="updateUponClose()"> | ||
<choiceicon class="material-symbols-outlined">schedule</choiceicon> | ||
<choicetext>Install after closing</choicetext> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
<script src="update.js"></script> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { BrowserWindow } = require('@electron/remote'); | ||
const { ipcRenderer } = require('electron'); | ||
|
||
ipcRenderer.on('updateVersion', (event, version) => { | ||
document.querySelector('div#updatemessage').textContent = 'Update ' + version + ' has been downloaded.'; | ||
}) | ||
|
||
function updateNow() { | ||
ipcRenderer.send('update', true); | ||
} | ||
|
||
function updateUponClose() { | ||
ipcRenderer.send('update', false); | ||
} |