Skip to content

Commit 83aaf8b

Browse files
committed
Read commit comment.
1 parent cd7c4fe commit 83aaf8b

3 files changed

Lines changed: 26 additions & 12 deletions

File tree

src/css/main.css

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,21 +337,22 @@ progress::-webkit-progress-value {
337337
}
338338

339339
.song-info {
340-
grid-row: 3;
341340
display: flex;
342341
justify-content: center;
343342
align-items: center;
344343
color: var(--text-color);
345344
font-size: 0.9em;
346345
}
347346

348-
#song-title {
347+
#song-title,
348+
#song-artist {
349349
float: left;
350+
overflow: hidden;
351+
text-overflow: ellipsis;
352+
white-space: nowrap;
353+
max-width: 50%;
350354
}
351355

352-
#song-artist {
353-
float: right;
354-
}
355356

356357
#volume-wrapper {
357358
position: absolute;
@@ -387,10 +388,25 @@ input[type='range']:focus::-webkit-slider-runnable-track {
387388
}
388389

389390
input[type='range']::-webkit-slider-thumb {
390-
margin-top: -4px;
391+
margin-top: -5px;
391392
cursor: pointer;
392393
}
393394

394395
#volume {
395396
background-color: transparent;
396397
}
398+
399+
/**
400+
* Because volume slider is positionied absolute,
401+
* we need this ugly rule to adjust song artist
402+
* and song title
403+
*/
404+
@media (max-width: 1000px) {
405+
#song-title {
406+
max-width: 25%;
407+
}
408+
409+
#song-artist {
410+
max-width: 20%;
411+
}
412+
}

src/index.html

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,9 @@
4646
<div id="timer-end">0:00</div>
4747
</div>
4848
<div class="song-info">
49-
<div>
50-
<div id="song-title">Something</div>
51-
&nbsp;by&nbsp;
52-
<div id="song-artist">Someone</div>
53-
</div>
49+
<div id="song-title">Something</div>
50+
<div>&nbsp;by&nbsp;</div>
51+
<div id="song-artist">Someone</div>
5452
<div id="volume-wrapper">
5553
<div id="volume-button"></div>
5654
<input type="range" min="0" max="100" value="100" id="volume" />

src/js/event-listener.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ module.exports = function() {
100100
require('electron').shell.openExternal('https://codef0x.dev');
101101
});
102102

103-
volumeSlider.addEventListener('change', () => {
103+
volumeSlider.addEventListener('input', () => {
104104
player.volume = volumeSlider.value / 100;
105105
});
106106
};

0 commit comments

Comments
 (0)