2015-12-13 04:42:28 +00:00
|
|
|
<template>
|
2016-01-05 14:04:00 +00:00
|
|
|
<section id="favoritesWrapper">
|
2015-12-13 04:42:28 +00:00
|
|
|
<h1 class="heading">
|
|
|
|
<span>Songs You Love
|
2016-01-06 16:41:59 +00:00
|
|
|
<i class="fa fa-angle-down toggler"
|
2015-12-13 04:42:28 +00:00
|
|
|
v-show="isPhone && !showingControls"
|
|
|
|
@click="showingControls = true"></i>
|
2016-01-06 16:41:59 +00:00
|
|
|
<i class="fa fa-angle-up toggler"
|
2015-12-13 04:42:28 +00:00
|
|
|
v-show="isPhone && showingControls"
|
|
|
|
@click.prevent="showingControls = false"></i>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div class="buttons" v-show="!isPhone || showingControls">
|
|
|
|
<button class="play-shuffle"
|
|
|
|
@click.prevent="shuffle"
|
2015-12-14 04:25:42 +00:00
|
|
|
v-if="state.songs.length && selectedSongs.length < 2"
|
2015-12-13 04:42:28 +00:00
|
|
|
>
|
|
|
|
<i class="fa fa-random"></i> All
|
|
|
|
</button>
|
2015-12-14 04:25:42 +00:00
|
|
|
<button class="play-shuffle" @click.prevent="shuffleSelected" v-if="selectedSongs.length > 1">
|
|
|
|
<i class="fa fa-random"></i> Selected
|
|
|
|
</button>
|
2016-01-05 14:04:00 +00:00
|
|
|
<button class="add-to" @click.prevent="showingAddToMenu = !showingAddToMenu" v-if="selectedSongs.length">
|
|
|
|
{{ showingAddToMenu ? 'Cancel' : 'Add To…' }}
|
|
|
|
</button>
|
|
|
|
|
|
|
|
<add-to-menu
|
|
|
|
:songs="selectedSongs"
|
2016-01-06 09:12:10 +00:00
|
|
|
:showing="showingAddToMenu && state.songs.length"
|
2016-01-05 14:04:00 +00:00
|
|
|
:settings="{ canLike: false }">
|
|
|
|
</add-to-menu>
|
2015-12-13 04:42:28 +00:00
|
|
|
</div>
|
|
|
|
</h1>
|
|
|
|
|
2016-01-06 07:12:36 +00:00
|
|
|
<song-list
|
|
|
|
v-show="state.songs.length"
|
|
|
|
:items="state.songs"
|
|
|
|
:selected-songs.sync="selectedSongs"
|
|
|
|
type="favorites">
|
|
|
|
</song-list>
|
|
|
|
|
2016-01-06 09:21:38 +00:00
|
|
|
<div v-show="!state.songs.length" class="none">
|
2016-01-06 07:12:36 +00:00
|
|
|
Start loving!
|
|
|
|
Click the <i style="margin: 0 5px" class="fa fa-heart"></i> icon when a song is playing to add it
|
|
|
|
to this list.
|
|
|
|
</div>
|
2015-12-13 04:42:28 +00:00
|
|
|
</section>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import isMobile from 'ismobilejs';
|
|
|
|
|
|
|
|
import songList from '../../shared/song-list.vue';
|
|
|
|
import favoriteStore from '../../../stores/favorite';
|
|
|
|
import playback from '../../../services/playback';
|
2015-12-14 04:25:42 +00:00
|
|
|
import shuffleSelectedMixin from '../../../mixins/shuffle-selected';
|
2016-01-06 09:12:10 +00:00
|
|
|
import hasAddToMenuMixin from '../../../mixins/has-add-to-menu';
|
2015-12-13 04:42:28 +00:00
|
|
|
|
|
|
|
export default {
|
2016-01-06 09:12:10 +00:00
|
|
|
mixins: [shuffleSelectedMixin, hasAddToMenuMixin],
|
2015-12-14 04:25:42 +00:00
|
|
|
|
2016-01-06 09:12:10 +00:00
|
|
|
components: { songList },
|
2015-12-13 04:42:28 +00:00
|
|
|
|
|
|
|
data () {
|
|
|
|
return {
|
|
|
|
state: favoriteStore.state,
|
|
|
|
isPhone: isMobile.phone,
|
|
|
|
showingControls: false,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
/**
|
|
|
|
* Shuffle the current favorite songs.
|
|
|
|
*/
|
|
|
|
shuffle() {
|
|
|
|
playback.queueAndPlay(this.state.songs, true);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="sass">
|
|
|
|
@import "resources/assets/sass/partials/_vars.scss";
|
|
|
|
@import "resources/assets/sass/partials/_mixins.scss";
|
|
|
|
|
2016-01-05 14:04:00 +00:00
|
|
|
#favoritesWrapper {
|
2015-12-13 04:42:28 +00:00
|
|
|
button.play-shuffle, button.del {
|
|
|
|
i {
|
|
|
|
margin-right: 0 !important;
|
|
|
|
}
|
|
|
|
}
|
2016-01-06 07:12:36 +00:00
|
|
|
|
|
|
|
.none {
|
|
|
|
color: $color2ndText;
|
|
|
|
padding: 16px 24px;
|
|
|
|
|
|
|
|
a {
|
|
|
|
color: $colorHighlight;
|
|
|
|
}
|
|
|
|
}
|
2015-12-13 04:42:28 +00:00
|
|
|
}
|
|
|
|
</style>
|