Skip to content

Commit e4f261d

Browse files
committed
2.0 - Styling update bar
1 parent 946e0ef commit e4f261d

File tree

6 files changed

+110
-51
lines changed

6 files changed

+110
-51
lines changed

dist/assets/css/main.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,22 @@ a:active {
548548
border-radius: 30px;
549549
}
550550

551+
.update-bar {
552+
position: fixed;
553+
z-index: 999;
554+
background-color: #0097ef;
555+
color: white;
556+
bottom: 0;
557+
font-size: 14px;
558+
padding: 5px 15px;
559+
width: 100%;
560+
display: none;
561+
}
562+
563+
.update-bar.active {
564+
display: block;
565+
}
566+
551567
.current-video-all {
552568
padding: 0px 10px;
553569
display: inline-block;
@@ -664,10 +680,12 @@ a:active {
664680
}
665681

666682
.player-buttons button:not(#play-song):hover {
683+
color: var(--c-primary);
667684
text-shadow: 0 0 10px var(--c-primary);
668685
}
669686

670687
.player-buttons button:not(#play-song):active {
688+
color: var(--c-primary);
671689
transform: scale(1.2);
672690
}
673691

@@ -2180,6 +2198,10 @@ iframe {
21802198
border: 1px solid var(--c-primary-active);
21812199
}
21822200

2201+
#app-container.light-mode .player-buttons button {
2202+
color: var(--c-primary);
2203+
}
2204+
21832205
#app-container.light-mode .app-feed:before {
21842206
display: none;
21852207
}

dist/index.html

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
1111
</head>
1212
<body class="application app-win">
13-
<div class="updates" style="position: fixed; top: 0; z-index: 999; background-color: red; color: white">
13+
<div class="update-bar">
1414
<div id="output"></div>
1515
</div>
1616
<app-yt>
@@ -22,28 +22,34 @@
2222
<script>
2323
const AutoUpdater = require( "nw-autoupdater" ),
2424
updater = new AutoUpdater( require( "./package.json" ) ),
25-
output = document.querySelector( "#output" );
25+
output = document.querySelector( "#output" ),
26+
updateBar = document.getElementsByClassName("update-bar")[0].classList;
2627

2728
async function main(){
2829
try {
29-
// Update copy is running to replace app with the update
30-
if ( updater.isSwapRequest() ) {
31-
output.innerHTML += `\nSwapping...`;
32-
await updater.swap();
33-
output.innerHTML += `\nDone...`;
34-
await updater.restart();
35-
return;
36-
}
37-
// Download/unpack update if any available
38-
const rManifest = await updater.readRemoteManifest();
39-
const needsUpdate = await updater.checkNewVersion( rManifest );
40-
if ( !needsUpdate ) {
41-
output.innerHTML += `\nIs up to date...`;
42-
return;
43-
}
44-
if ( !confirm( "New release is available. Do you want to upgrade?" ) ) {
45-
return;
30+
// Update copy is running to replace app with the update
31+
if ( updater.isSwapRequest() ) {
32+
output.innerHTML += `\nSwapping...`;
33+
await updater.swap();
34+
output.innerHTML += `\nDone...`;
35+
await updater.restart();
36+
return;
37+
}
38+
// Download/unpack update if any available
39+
const rManifest = await updater.readRemoteManifest();
40+
const needsUpdate = await updater.checkNewVersion( rManifest );
41+
if ( !needsUpdate ) {
42+
output.innerHTML += `\nis up to date...`;
43+
updateBar.add('active');
44+
} else {
45+
output.innerHTML = `There is new update`;
46+
updateBar.add('active');
47+
}
48+
} catch ( e ) {
49+
console.error( e );
4650
}
51+
}
52+
function updateApp() {
4753
// Subscribe for progress events
4854
updater.on( "download", ( downloadSize, totalSize ) => {
4955
output.innerHTML = `Downloading...`;
@@ -53,13 +59,10 @@
5359
output.innerHTML = `Installing...\n`;
5460
console.log( "install progress", Math.floor( installFiles / totalFiles * 100 ), "%" );
5561
});
56-
const updateFile = await updater.download( rManifest );
57-
await updater.unpack( updateFile );
62+
const updateFile = updater.download( rManifest );
63+
updater.unpack( updateFile );
5864
alert( `The application will automatically restart to finish installing the update` );
59-
await updater.restartToSwap();
60-
} catch ( e ) {
61-
console.error( e );
62-
}
65+
updater.restartToSwap();
6366
}
6467
output.innerHTML = `Application v${nw.App.manifest.version}\n`;
6568
main();

dist/inline.bundle.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scss/_common.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,4 +282,19 @@
282282
border-radius: 30px;
283283
}
284284
}
285+
}
286+
287+
.update-bar {
288+
position: fixed;
289+
z-index: 999;
290+
background-color: #0097ef;
291+
color: white;
292+
bottom: 0;
293+
font-size: 14px;
294+
padding: 5px 15px;
295+
width: 100%;
296+
display: none;
297+
&.active {
298+
display: block;
299+
}
285300
}

src/assets/css/main.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,22 @@ a:active {
548548
border-radius: 30px;
549549
}
550550

551+
.update-bar {
552+
position: fixed;
553+
z-index: 999;
554+
background-color: #0097ef;
555+
color: white;
556+
bottom: 0;
557+
font-size: 14px;
558+
padding: 5px 15px;
559+
width: 100%;
560+
display: none;
561+
}
562+
563+
.update-bar.active {
564+
display: block;
565+
}
566+
551567
.current-video-all {
552568
padding: 0px 10px;
553569
display: inline-block;

0 commit comments

Comments
 (0)