Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!--
- @copyright Copyright (c) 2021 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="podcastSection">
<div class="podcastSectionHeader">
<h1>{{ title }}</h1>
</div>
<div class="grid">
<div
v-for="(podcast, idx) in podcasts"
:key="idx"
class="podcastCard">
<router-link :to="{ path: `/browse/show/${podcast.id}`}">
<div v-lazy:background-image="podcast.smallImageURL"
class="podcastImage" />
<span class="title">
{{ podcast.title }}
</span>
<span class="subtitle">
{{ podcast.author }}
</span>
</router-link>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'ItemGrid',
props: {
title: {
type: String,
default: '',
},
podcasts: {
type: Object,
default() { return {} },
},
},
}
</script>
<style lang="scss">
.podcastSection {
margin-bottom: 20px;
}
.podcastSectionHeader {
padding: 10px 0px;
z-index: 60;
position: sticky;
top: 50px;
background: white;
display: flex;
align-items: center;
margin-bottom: 10px;
h1 {
flex-grow: 1;
font-size: 1.6em;
}
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.podcastCard {
height: 220px;
margin-right: 15px;
flex-shrink: 0;
background: rgba(241, 241, 241, 0.6);
border-radius: 3px;
padding: 15px;
transition: all 0.2s ease-in-out;
* {
cursor: pointer;
}
.podcastImage {
background-size: cover;
background-position: center;
box-shadow: 1px 1px 2px rgba(0,0,0,.5);
border: 1px solid rgba(0,0,0,.5);
border-radius: 5px;
width: 140px;
height: 140px;
margin-bottom: 5px;
transition: opacity .4s ease;
}
span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
}
span.title {
font-size: 1em;
}
span.subtitle {
font-size: 0.9em;
color: #b5b1b1;
}
}
.podcastCard:hover {
background: rgb(236, 236, 236);
}
</style>