Skip to content

Commit

Permalink
✨ Miniplayer improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
rickpalmeira committed Aug 3, 2020
1 parent baf217d commit 72e0eb5
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 29 deletions.
6 changes: 4 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -964,11 +964,13 @@ function createWindow() {
),
width: settingsProvider.get('settings-miniplayer-size'),
height: settingsProvider.get('settings-miniplayer-size'),
backgroundColor: '#000000',
backgroundColor: '#232323',
minWidth: 100,
minHeight: 100,
autoHideMenuBar: true,
skipTaskbar: false,
skipTaskbar: !settingsProvider.get(
'settings-miniplayer-show-task'
),
webPreferences: {
nodeIntegration: true,
},
Expand Down
1 change: 1 addition & 0 deletions src/locales/scaffold.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"LABEL_SETTINGS_TAB_MINIPLAYER_ALWAYS_SHOW_CONTROLS": "Always show controls",
"LABEL_SETTINGS_TAB_MINIPLAYER_PAINT_CONTROLS": "Paint controls with album color",
"LABEL_SETTINGS_TAB_MINIPLAYER_RESIZABLE": "Allow resizing",
"LABEL_SETTINGS_TAB_MINIPLAYER_SHOW_TASK": "Show on taskbar",
"LABEL_SETTINGS_TAB_RAINMETER_WEB_NOW_PLAYING": "Rainmeter (WebNowPlaying)",
"LABEL_SETTINGS_TAB_READ_CLIPBOARD": "Read clipboard for youtube links",
"LABEL_SETTINGS_TAB_SHORTCUTS": "Shortcuts",
Expand Down
11 changes: 8 additions & 3 deletions src/pages/miniplayer/miniplayer.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
body {
background-repeat: no-repeat;
background-size: 100vmin;
}

body:hover .player-info,
body:hover .cmd-btn,
body.showinfo .player-info,
Expand All @@ -18,12 +23,12 @@ body.showinfo #background {

.player-info {
filter: opacity(0);
height: 78vmin
height: 78vmin;
}

.cmd-bar {
margin: 4px 4px 0;
height: 10vmin
height: 10vmin;
}

#btn-drag {
Expand Down Expand Up @@ -108,7 +113,7 @@ body.showinfo #background {
.progress-bar {
margin-top: 1.4vmin;
height: 0.6vmin;
width: 100vw;
width: 100vmin;
}

#progress {
Expand Down
4 changes: 0 additions & 4 deletions src/pages/miniplayer/miniplayer.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@

<div id="background"></div>
<div id="secondsEffect"></div>
<!--div class="hover-top"></div>
<div class="hover-left"></div>
<div class="hover-right"></div>
<div class="hover-bottom"></div-->
</body>

<script src="./miniplayer.js"></script>
Expand Down
1 change: 1 addition & 0 deletions src/pages/miniplayer/miniplayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ document.addEventListener('dblclick', (ev) => {

function setPlayerInfo(data) {
document.title = `${data.track.title} - ${data.track.author}`
body.style.backgroundImage = `url(${data.track.cover})`
background.style.backgroundImage = `url(${data.track.cover})`
title.innerHTML = data.track.title || 'Title'
author.innerHTML = data.track.author || 'Author'
Expand Down
56 changes: 37 additions & 19 deletions src/pages/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,25 @@
</td>
</tr>

<tr>
<td>
<span
i18n="i18n_LABEL_SETTINGS_TAB_GENERAL_DISABLE_HARDWARE_ACCELERATION"
></span>
</td>
<td class="right">
<div class="switch">
<label>
<input
type="checkbox"
id="settings-disable-hardware-acceleration"
/>
<span class="lever"></span>
</label>
</div>
</td>
</tr>

<tr>
<td>
<span
Expand Down Expand Up @@ -268,25 +287,6 @@
</td>
</tr>

<tr>
<td>
<span
i18n="i18n_LABEL_SETTINGS_TAB_GENERAL_DISABLE_HARDWARE_ACCELERATION"
></span>
</td>
<td class="right">
<div class="switch">
<label>
<input
type="checkbox"
id="settings-disable-hardware-acceleration"
/>
<span class="lever"></span>
</label>
</div>
</td>
</tr>

<tr class="macos-specific">
<td colspan="2">
<div
Expand Down Expand Up @@ -394,6 +394,24 @@
</div>
</td>
</tr>
<tr>
<td>
<span
i18n="i18n_LABEL_SETTINGS_TAB_MINIPLAYER_SHOW_TASK"
></span>
</td>
<td class="right">
<div class="switch">
<label>
<input
type="checkbox"
id="settings-miniplayer-show-task"
/>
<span class="lever"></span>
</label>
</div>
</td>
</tr>
</tbody>
</table>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/pages/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ document.addEventListener('DOMContentLoaded', function () {

initElement('settings-miniplayer-always-top', 'click')
initElement('settings-miniplayer-resizable', 'click')
initElement('settings-miniplayer-show-task', 'click')
initElement('settings-miniplayer-always-show-controls', 'click')
initElement('settings-miniplayer-paint-controls', 'click')
initElement('settings-enable-taskbar-progressbar', 'click')
Expand Down
4 changes: 3 additions & 1 deletion src/utils/defaultSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ settingsProvider.setInitialValue('settings-app-language', 'en') // English

settingsProvider.setInitialValue('settings-miniplayer-size', '200') // Normal size

settingsProvider.setInitialValue('settings-miniplayer-resizable', true) // Normal size
settingsProvider.setInitialValue('settings-miniplayer-resizable', false) // Not resizable

settingsProvider.setInitialValue('settings-miniplayer-show-task', false) // hide from taskbar

settingsProvider.setInitialValue('settings-lyrics-provider', '1') // OVH

Expand Down

0 comments on commit 72e0eb5

Please sign in to comment.