Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added episode number in header #144

Merged
merged 4 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/Tv/TVEpisode.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<img :src="`${directusUrl}/assets/${episode.tile}?width=600`" alt="" />
<div>
<h3>
<span v-if="!hideNumber">{{ episode.episode_number }}:</span>
<span v-if="!hideNumber">Episode {{ episode.episode_number }}:</span>
{{ episode.title }}
<span class="meta">
<span v-if="episode.length">{{ episode.length }}m</span>
Expand Down
18 changes: 18 additions & 0 deletions pages/tv/all.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
:buttons="heroButtons"
/>
<BaseContainer class="main">
<p class="stat">
Displaying all {{ episodes.length }} episodes across {{ shows.length }} shows. We hope you enjoy them!
</p>
<ul class="episodes">
<li v-for="episode in episodesWithShowTitles" :key="episode.id">
<TVEpisode :show="episode.season.show" :episode="episode" :hide-number="true" />
Expand All @@ -31,10 +34,13 @@ const globals = await directus.request(
readSingleton('globals', { fields: ['og', { featured: ['*', { season: [{ show: ['*'] }] }] }] }),
);

const shows = await directus.request(readItems('shows', { fields: ['id'], limit: -1 }));

const episodes = await directus.request(
readItems('episodes', {
fields: ['*', { season: ['*', { show: ['title', 'slug'] }] }],
sort: ['-published'],
limit: -1,
}),
);

Expand Down Expand Up @@ -79,6 +85,13 @@ useSeoMeta({
</script>

<style scoped>
.stat {
margin-top: 4rem;
margin-bottom: 1rem;
font-size: 1.25rem;
opacity: 0.5;
line-height: 1.125;
}
.episodes {
padding-left: 0;
list-style-type: none;
Expand All @@ -87,4 +100,9 @@ useSeoMeta({
li {
margin-top: 2em;
}
@media (width > 35rem) {
.stat {
font-size: 2rem;
}
}
</style>
2 changes: 1 addition & 1 deletion pages/tv/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<TVHero
:cover="globals.featured.season.show.cover"
:logo="globals.featured.season.show.logo"
:title="globals.featured.title"
:title="`Episode ${globals.featured.episode_number}: ${globals.featured.title}`"
:description="globals.featured.description"
:buttons="heroButtons"
/>
Expand Down