Skip to content

Commit

Permalink
Playbar volume button, toggle mute
Browse files Browse the repository at this point in the history
  • Loading branch information
avvazana committed Dec 12, 2018
1 parent 195e4ab commit 31512eb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/assets/stylesheets/components/music_player.scss
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ progress[value]::-webkit-progress-value {
color: #1db954;
}

#volume {
margin: 0 5px 0 20px;
transition: color .1s linear;
}
#volume:hover {
cursor: pointer;
color: #1db954;
}

.playbar-container {
height: auto;
display: flex;
Expand Down
8 changes: 8 additions & 0 deletions frontend/components/main/playbar/music_player.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ class MusicPlayer extends React.Component {
</div>

<div className="playbar-right">
{ this.state.volume > 0 ? (
<i id="volume" className="material-icons"
onClick={ () => this.toggleMute() }>volume_up</i>
) : (
<i id="volume" className="material-icons"
onClick={ () => this.toggleMute() }>volume_off</i>
)
}
<input id="volume-control" type="range"
min="0" max="100" step="1"
defaultValue="100"
Expand Down

0 comments on commit 31512eb

Please sign in to comment.