<!-- - @copyright Copyright (c) 2020 Jonas Heinrich - - @author Jonas Heinrich <onny@project-insanity.org> - - @license GNU AGPL version 3 or any later version - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as - published by the Free Software Foundation, either version 3 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - --> <template> <div class="podcastHeaderBg" :style="{ backgroundImage: `url(${imgurl})` }"> <div class="podcastHeader"> <div class="podcastImage" :style="{ backgroundImage: `url(${imgurl})` }" /> <div class="podcastDescription"> <h1>{{ title }}</h1> <div class="podcastAuthor"> by <a :href="htmlURL" target="_blank">{{ author }}</a> </div> <div class="podcastControls"> <button class="icon-add-white podcastButton button primary new-button"> {{ t('podcast', 'Subscribe') }} </button> <ul class="podcastCategory"> <a v-for="(category, idx) in categories" :key="idx" :href="`#/browse/category/${categories[idx]}`"> <li> {{ getCategoryName(categories[idx]) }} </li> </a> </ul> </div> <vue-show-more-text :text="description" additional-container-css="padding: 0px;" /> <slot /> </div> </div> </div> </template> <script> import vueShowMoreText from 'vue-show-more-text' import { getCategoryName } from '../services/podcastApi' export default { name: 'MediaHeader', components: { vueShowMoreText, }, props: { imgurl: { type: String, default: '', }, title: { type: String, default: '', }, author: { type: String, default: '', }, htmlURL: { type: String, default: '', }, categories: { type: Array, default() { return [] }, }, description: { type: String, default: '', }, }, methods: { getCategoryName(categoryid) { return getCategoryName(categoryid) }, }, } </script> <style lang="scss"> .podcastHeaderBg { background-size: cover; background-position: center center; background-attachment: fixed; } .podcastHeader { width: 100%; min-height: 280px; display: flex; color: white; justify-content: center; padding: 40px 20px; /* gap: 30px; */ background-color: rgba(0, 0, 0, .7); backdrop-filter: blur(8px); text-shadow: 1px 1px 2px rgba(0,0,0,.5); .button { text-shadow: 0px 0px 0px; } .podcastImage { width: 200px; height: 200px; flex-shrink: 0; background-size: cover; background-position: center; box-shadow: 0 4px 60px rgba(0,0,0,.5); margin-right: 25px; border-radius: 5px; } .podcastDescription { max-width: 500px; width: 100%; color: #ddd; h1 { font-size: 30px; font-weight: bold; line-height: 1.2em; color: white; } .podcastAuthor { padding-bottom: 7px; a { color: white; } } .podcastControls { display: flex; align-items: center; margin-bottom: 5px; .button { margin-right: 10px; margin-bottom: 5px; margin-top: 0px; align-self: start; } } ul.podcastCategory li { display: inline-block; border: 1px solid var(--color-text-maxcontrast); border-radius: var(--border-radius); margin-right: 5px; cursor: pointer; color: var(--color-text-maxcontrast); padding: 0px 7px; margin-bottom: 5px; } ul.podcastCategory li:hover { border: 1px solid white; color: white; } } } .podcastButton { padding-left: 35px; padding-right: 15px; background-position: 10px center; } @media only screen and (max-width: 500px) { .podcastHeader { flex-direction: column; align-items: center; .podcastImage { margin-right: 0px; margin-bottom: 25px; } .podcastDescription { text-align: center; .podcastControls { justify-content: center; } } } } </style>