Skip to content
Snippets Groups Projects
Commit f1b42535 authored by R En's avatar R En
Browse files

add new volume control bar

parent a569611e
No related branches found
No related tags found
No related merge requests found
...@@ -60,27 +60,31 @@ ...@@ -60,27 +60,31 @@
:title="labels.previousTrack" :title="labels.previousTrack"
class="two wide column control" class="two wide column control"
:disabled="emptyQueue"> :disabled="emptyQueue">
<i @click="previous" :class="['ui', 'backward', {'disabled': emptyQueue}, 'big', 'icon']"></i> <i @click="previous" :class="['ui', 'backward', {'disabled': emptyQueue}, 'secondary', 'icon']"></i>
</div> </div>
<div <div
v-if="!playing" v-if="!playing"
:title="labels.play" :title="labels.play"
class="two wide column control"> class="two wide column control">
<i @click="togglePlay" :class="['ui', 'play', {'disabled': !currentTrack}, 'big', 'icon']"></i> <i @click="togglePlay" :class="['ui', 'play', {'disabled': !currentTrack}, 'secondary', 'icon']"></i>
</div> </div>
<div <div
v-else v-else
:title="labels.pause" :title="labels.pause"
class="two wide column control"> class="two wide column control">
<i @click="togglePlay" :class="['ui', 'pause', {'disabled': !currentTrack}, 'big', 'icon']"></i> <i @click="togglePlay" :class="['ui', 'pause', {'disabled': !currentTrack}, 'secondary', 'icon']"></i>
</div> </div>
<div <div
:title="labels.next" :title="labels.next"
class="two wide column control" class="two wide column control"
:disabled="!hasNext"> :disabled="!hasNext">
<i @click="next" :class="['ui', {'disabled': !hasNext}, 'step', 'forward', 'big', 'icon']" ></i> <i @click="next" :class="['ui', {'disabled': !hasNext}, 'step', 'forward', 'secondary', 'icon']" ></i>
</div> </div>
<div class="two wide column control volume-control"> <div
class="wide column control volume-control"
v-on:mouseover="showVolume = true"
v-on:mouseleave="showVolume = false"
v-bind:class="{ active : showVolume }">
<i <i
:title="labels.unmute" :title="labels.unmute"
@click="$store.commit('player/volume', 1)" v-if="volume === 0" class="volume off secondary icon"></i> @click="$store.commit('player/volume', 1)" v-if="volume === 0" class="volume off secondary icon"></i>
...@@ -90,9 +94,15 @@ ...@@ -90,9 +94,15 @@
<i <i
:title="labels.mute" :title="labels.mute"
@click="$store.commit('player/volume', 0)" v-else class="volume up secondary icon"></i> @click="$store.commit('player/volume', 0)" v-else class="volume up secondary icon"></i>
<input type="range" step="0.05" min="0" max="1" v-model="sliderVolume" /> <input
type="range"
step="0.05"
min="0"
max="1"
v-model="sliderVolume"
v-if="showVolume" />
</div> </div>
<div class="two wide column control looping"> <div class="two wide column control looping" v-if="!showVolume">
<i <i
:title="labels.loopingDisabled" :title="labels.loopingDisabled"
v-if="looping === 0" v-if="looping === 0"
...@@ -118,14 +128,16 @@ ...@@ -118,14 +128,16 @@
<div <div
:disabled="queue.tracks.length === 0" :disabled="queue.tracks.length === 0"
:title="labels.shuffle" :title="labels.shuffle"
v-if="!showVolume"
class="two wide column control"> class="two wide column control">
<div v-if="isShuffling" class="ui inline shuffling inverted small active loader"></div> <div v-if="isShuffling" class="ui inline shuffling inverted small active loader"></div>
<i v-else @click="shuffle()" :class="['ui', 'random', 'secondary', {'disabled': queue.tracks.length === 0}, 'icon']" ></i> <i v-else @click="shuffle()" :class="['ui', 'random', 'secondary', {'disabled': queue.tracks.length === 0}, 'icon']" ></i>
</div> </div>
<div class="one wide column"></div> <div class="one wide column" v-if="!showVolume"></div>
<div <div
:disabled="queue.tracks.length === 0" :disabled="queue.tracks.length === 0"
:title="labels.clear" :title="labels.clear"
v-if="!showVolume"
class="two wide column control"> class="two wide column control">
<i @click="clean()" :class="['ui', 'trash', 'secondary', {'disabled': queue.tracks.length === 0}, 'icon']" ></i> <i @click="clean()" :class="['ui', 'trash', 'secondary', {'disabled': queue.tracks.length === 0}, 'icon']" ></i>
</div> </div>
...@@ -168,6 +180,7 @@ export default { ...@@ -168,6 +180,7 @@ export default {
renderAudio: true, renderAudio: true,
sliderVolume: this.volume, sliderVolume: this.volume,
defaultAmbiantColors: defaultAmbiantColors, defaultAmbiantColors: defaultAmbiantColors,
showVolume: false,
ambiantColors: defaultAmbiantColors ambiantColors: defaultAmbiantColors
} }
}, },
...@@ -370,16 +383,16 @@ export default { ...@@ -370,16 +383,16 @@ export default {
} }
.volume-control { .volume-control {
position: relative; position: relative;
width: 12.5% !important;
.icon { .icon {
// margin: 0; // margin: 0;
} }
[type="range"] { [type="range"] {
max-width: 100%; max-width: 70%;
position: absolute; position: absolute;
bottom: 5px; bottom: 1.1rem;
left: 10%; left: 25%;
cursor: pointer; cursor: pointer;
display: none;
} }
input[type=range] { input[type=range] {
-webkit-appearance: none; -webkit-appearance: none;
...@@ -390,22 +403,29 @@ export default { ...@@ -390,22 +403,29 @@ export default {
input[type=range]::-webkit-slider-runnable-track { input[type=range]::-webkit-slider-runnable-track {
cursor: pointer; cursor: pointer;
background: white; background: white;
opacity: 0.3;
} }
input[type=range]::-webkit-slider-thumb { input[type=range]::-webkit-slider-thumb {
background: white; background: white;
cursor: pointer; cursor: pointer;
-webkit-appearance: none; -webkit-appearance: none;
border-radius: 3px;
width: 10px;
} }
input[type=range]:focus::-webkit-slider-runnable-track { input[type=range]:focus::-webkit-slider-runnable-track {
background: #white; background: #white;
opacity: 0.3;
} }
input[type=range]::-moz-range-track { input[type=range]::-moz-range-track {
cursor: pointer; cursor: pointer;
background: white; background: white;
opacity: 0.3;
} }
input[type=range]::-moz-range-thumb { input[type=range]::-moz-range-thumb {
background: white; background: white;
cursor: pointer; cursor: pointer;
border-radius: 3px;
width: 10px;
} }
input[type=range]::-ms-track { input[type=range]::-ms-track {
cursor: pointer; cursor: pointer;
...@@ -415,13 +435,17 @@ export default { ...@@ -415,13 +435,17 @@ export default {
} }
input[type=range]::-ms-fill-lower { input[type=range]::-ms-fill-lower {
background: white; background: white;
opacity: 0.3;
} }
input[type=range]::-ms-fill-upper { input[type=range]::-ms-fill-upper {
background: white; background: white;
opacity: 0.3;
} }
input[type=range]::-ms-thumb { input[type=range]::-ms-thumb {
background: white; background: white;
cursor: pointer; cursor: pointer;
border-radius: 3px;
width: 10px;
} }
input[type=range]:focus::-ms-fill-lower { input[type=range]:focus::-ms-fill-lower {
background: white; background: white;
...@@ -429,11 +453,10 @@ export default { ...@@ -429,11 +453,10 @@ export default {
input[type=range]:focus::-ms-fill-upper { input[type=range]:focus::-ms-fill-upper {
background: #white; background: #white;
} }
&:hover { }
[type="range"] {
display: block; .active.volume-control {
} width: 60% !important;
}
} }
.looping.control { .looping.control {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment