Added fullscreen volume control
This commit is contained in:
1 parent
1d2bec7317
commit
16e309c346
2 files changed
+40
-7
No files matched your search
@@ -55,9 +55,7 @@ nuxtApp.hook("page:finish", () => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="content-container" :class="{ lyrics: song.lyrics }">
|
<div class="content-container" :class="{ lyrics: song.lyrics }">
|
||||||
<PlayerFullscreenTrackDisplay
|
<PlayerFullscreenTrackDisplay :show-buttons="mouseMovedRecently" />
|
||||||
:show-buttons="mouseMovedRecently"
|
|
||||||
/>
|
|
||||||
<PlayerFullscreenLyricsDisplay
|
<PlayerFullscreenLyricsDisplay
|
||||||
:animation-duration="0.2"
|
:animation-duration="0.2"
|
||||||
:offset="150"
|
:offset="150"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const {
|
|||||||
repeat,
|
repeat,
|
||||||
secondsPlayed,
|
secondsPlayed,
|
||||||
duration,
|
duration,
|
||||||
|
volume,
|
||||||
} = usePlayer()
|
} = usePlayer()
|
||||||
|
|
||||||
const secondsPlayedFormatted = computed(() =>
|
const secondsPlayedFormatted = computed(() =>
|
||||||
@@ -66,6 +67,22 @@ const durationFormatted = computed(() =>
|
|||||||
@click="repeat = !repeat"
|
@click="repeat = !repeat"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="volume-slider" :class="{ hidden: !showButtons }">
|
||||||
|
<Icon name="lucide:volume-2" />
|
||||||
|
<RangeSlider
|
||||||
|
:model-value="volume"
|
||||||
|
@update:model-value="
|
||||||
|
(v) => {
|
||||||
|
if (v !== undefined) volume = v
|
||||||
|
}
|
||||||
|
"
|
||||||
|
:max="1"
|
||||||
|
:min="0"
|
||||||
|
:step="0.01"
|
||||||
|
monochrome
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</article>
|
</article>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -127,12 +144,11 @@ const durationFormatted = computed(() =>
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
|
|
||||||
overflow: hidden;
|
transition: opacity 0.2s ease-in-out;
|
||||||
max-height: 30px;
|
|
||||||
transition: max-height 0.2s ease-in-out;
|
|
||||||
|
|
||||||
&.hidden {
|
&.hidden {
|
||||||
max-height: 0;
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
@@ -143,4 +159,23 @@ const durationFormatted = computed(() =>
|
|||||||
color: $color-accent;
|
color: $color-accent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.volume-slider {
|
||||||
|
align-self: stretch;
|
||||||
|
margin: 0.5rem 1rem 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.75rem;
|
||||||
|
opacity: 1;
|
||||||
|
transition: opacity 0.2s ease-in-out;
|
||||||
|
|
||||||
|
:deep(.slider) {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.hidden {
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
Reference in new issue
Block a user