mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
move progress bar and hot keys to new components
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<div class="result-item border">
|
||||
<router-link
|
||||
:to="{
|
||||
name: 'AlbumView',
|
||||
params: { album: album.name, artist: album.artist },
|
||||
}"
|
||||
class="result-item border"
|
||||
>
|
||||
<div
|
||||
class="album-art image"
|
||||
:style="{
|
||||
@@ -8,7 +14,7 @@
|
||||
></div>
|
||||
<div class="title ellip">{{ album.name }}</div>
|
||||
<div class="artistsx ellipsis">{{ album.artist }}</div>
|
||||
</div>
|
||||
</router-link>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -48,4 +54,4 @@ export default {
|
||||
color: rgba(40, 116, 216, 0.767);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div class="nav">
|
||||
<div class="image" id="previous" @click="playPrev"></div>
|
||||
<div
|
||||
class="image play-pause"
|
||||
@click="playPause"
|
||||
:class="{ isPlaying: isPlaying }"
|
||||
></div>
|
||||
<div class="image" id="next" @click="playNext"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import playAudio from "../../composables/playAudio";
|
||||
|
||||
const playPause = playAudio.playPause;
|
||||
const playNext = playAudio.playNext;
|
||||
const playPrev = playAudio.playPrev;
|
||||
|
||||
const isPlaying = playAudio.playing;
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.nav {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
width: 100%;
|
||||
gap: $small;
|
||||
|
||||
& * {
|
||||
height: 2rem;
|
||||
width: 2rem;
|
||||
background-size: 1.2rem !important;
|
||||
cursor: pointer;
|
||||
border-radius: 0.5rem;
|
||||
|
||||
&:hover {
|
||||
background-color: $pink;
|
||||
}
|
||||
}
|
||||
|
||||
#previous {
|
||||
background-image: url(../../assets/icons/previous.svg);
|
||||
}
|
||||
|
||||
.play-pause {
|
||||
background-image: url(../../assets/icons/play.svg);
|
||||
}
|
||||
|
||||
.isPlaying {
|
||||
background-image: url(../../assets/icons/pause.svg);
|
||||
}
|
||||
|
||||
#next {
|
||||
background-image: url(../../assets/icons/next.svg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,20 @@
|
||||
<template>
|
||||
<input
|
||||
id="progress"
|
||||
type="range"
|
||||
:value="pos"
|
||||
min="0"
|
||||
max="1000"
|
||||
@change="seek()"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import playAudio from "../../composables/playAudio";
|
||||
const pos = ref(playAudio.pos);
|
||||
|
||||
const seek = () => {
|
||||
playAudio.seek(document.getElementById("progress").value);
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user