koel/resources/assets/js/components/layout/app-footer/index.vue

68 lines
1.8 KiB
Vue
Raw Normal View History

2022-04-15 14:24:30 +00:00
<template>
2022-04-30 11:55:54 +00:00
<footer id="mainFooter" @contextmenu.prevent="requestContextMenu">
2022-04-15 17:00:08 +00:00
<PlayerControls :song="song"/>
2022-04-15 14:24:30 +00:00
<div class="media-info-wrap">
2022-04-15 17:00:08 +00:00
<MiddlePane :song="song"/>
2022-04-20 15:57:53 +00:00
<ExtraControls :song="song"/>
2022-04-15 14:24:30 +00:00
</div>
</footer>
</template>
2022-04-15 17:00:08 +00:00
<script lang="ts" setup>
import { ref } from 'vue'
2022-04-15 14:24:30 +00:00
import { eventBus } from '@/utils'
2022-04-15 17:00:08 +00:00
2022-04-20 15:57:53 +00:00
import ExtraControls from '@/components/layout/app-footer/FooterExtraControls.vue'
import MiddlePane from '@/components/layout/app-footer/FooterMiddlePane.vue'
import PlayerControls from '@/components/layout/app-footer/FooterPlayerControls.vue'
2022-04-15 14:24:30 +00:00
2022-04-15 17:00:08 +00:00
const song = ref<Song | null>(null)
const viewingQueue = ref(false)
2022-04-15 14:24:30 +00:00
2022-04-15 17:00:08 +00:00
const requestContextMenu = (event: MouseEvent) => {
song.value?.id && eventBus.emit('SONG_CONTEXT_MENU_REQUESTED', event, song.value)
}
2022-04-15 14:24:30 +00:00
2022-04-15 17:00:08 +00:00
eventBus.on({
SONG_STARTED: (newSong: Song) => (song.value = newSong),
ACTIVATE_SCREEN: (screen: ScreenName) => (viewingQueue.value = screen === 'Queue')
2022-04-15 14:24:30 +00:00
})
</script>
<style lang="scss" scoped>
footer {
background: var(--color-bg-secondary);
height: var(--footer-height);
display: flex;
position: relative;
2022-07-29 12:12:55 +00:00
z-index: 99;
2022-04-15 14:24:30 +00:00
.media-info-wrap {
flex: 1;
display: flex;
}
// Add a reverse gradient here to eliminate the "hard cut" feel.
&::before {
content: " ";
position: absolute;
width: 100%;
height: calc(2 * var(--footer-height) / 3);
bottom: var(--footer-height);
left: 0;
// Safari 8 won't recognize rgba(255, 255, 255, 0) and treat it as black.
// rgba(#000, 0) is a workaround.
background-image: linear-gradient(to bottom, rgba(#000, 0) 0%, rgba(#000, .1) 100%);
pointer-events: none; // click-through
}
@media only screen and (max-width: 768px) {
2022-07-29 12:12:55 +00:00
@include themed-background();
2022-04-15 14:24:30 +00:00
height: var(--footer-height-mobile);
2022-07-29 12:12:55 +00:00
padding-top: 12px; // leave space for the audio track
2022-04-15 14:24:30 +00:00
}
}
</style>