Skip to content

Commit d7245af

Browse files
committed
fix(panel): adjust css to make active episode more visible
1 parent 881749f commit d7245af

File tree

5 files changed

+46
-9
lines changed

5 files changed

+46
-9
lines changed

src/components/common/buttons/ButtonLink.vue

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<script lang="ts" setup>
22
import { type ButtonProps, NButton } from 'naive-ui';
3+
import { type PropType } from 'vue';
34
import { RouterLink, type RouterLinkProps } from 'vue-router';
45
5-
import type { PropType } from 'vue';
6-
76
defineProps({
87
link: {
98
type: Object as PropType<RouterLinkProps>,
@@ -13,6 +12,11 @@ defineProps({
1312
type: Object as PropType<ButtonProps>,
1413
required: false,
1514
},
15+
muted: {
16+
type: Boolean,
17+
required: false,
18+
default: false,
19+
},
1620
});
1721
</script>
1822

@@ -27,7 +31,11 @@ defineProps({
2731
:secondary="isActive"
2832
:quaternary="!isActive"
2933
class="button-link"
30-
:class="$attrs.class"
34+
:class="{
35+
muted,
36+
'is-active': isActive,
37+
'is-exact-active': isExactActive,
38+
}"
3139
:style="$attrs.style"
3240
round
3341
size="small"
@@ -46,5 +54,13 @@ defineProps({
4654
height: 1.5rem;
4755
margin: 0;
4856
padding: 0.125rem;
57+
58+
&.is-active {
59+
--n-color: var(--n-color-focus) !important;
60+
}
61+
62+
&.muted:not(.is-active) {
63+
opacity: 0.5;
64+
}
4965
}
5066
</style>

src/components/views/panel/MoviePanel.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,13 @@ onMounted(() => {
268268
</script>
269269

270270
<template>
271-
<NFlex class="panel-container" justify="center" align="center" vertical>
271+
<NFlex
272+
class="panel-container"
273+
justify="center"
274+
align="center"
275+
vertical
276+
:data-movie="movieId"
277+
>
272278
<AnchorLink
273279
v-if="title"
274280
class="show-title"

src/components/views/panel/PersonPanel.vue

+7-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,13 @@ const titleUrl = computed(() => {
6464
</script>
6565

6666
<template>
67-
<NFlex class="panel-container" justify="center" align="center" vertical>
67+
<NFlex
68+
class="panel-container"
69+
justify="center"
70+
align="center"
71+
vertical
72+
:data-person="personId"
73+
>
6874
<AnchorLink
6975
v-if="title"
7076
class="show-title"

src/components/views/panel/ShowPanel.vue

+10-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,16 @@ onMounted(() => {
404404
</script>
405405

406406
<template>
407-
<NFlex class="panel-container" justify="center" align="center" vertical>
407+
<NFlex
408+
class="panel-container"
409+
justify="center"
410+
align="center"
411+
vertical
412+
:data-mode="panelType"
413+
:data-show="showId"
414+
:data-season="season?.ids?.trakt"
415+
:data-episode="episode?.ids?.trakt"
416+
>
408417
<AnchorLink
409418
v-if="title"
410419
class="show-title"

src/components/views/panel/ShowPanelPicker.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ const i18n = useI18n('panel', 'picker');
108108
v-for="{ link, number, finished, collected, aired } in seasonsLinks"
109109
:key="`season-${number}`"
110110
:link="{ to: link }"
111-
:button="{ type: finished ? 'primary' : collected ? 'info' : undefined }"
112-
:style="{ opacity: aired ? 1 : 0.75 }"
111+
:button="{ type: finished ? 'primary' : collected ? 'info' : 'default' }"
112+
:muted="!aired"
113113
>
114114
{{ number }}
115115
</ButtonLink>
@@ -132,7 +132,7 @@ const i18n = useI18n('panel', 'picker');
132132
v-slot="{ isActive }"
133133
:link="{ to: link }"
134134
:button="{ type: finished ? 'primary' : collected ? 'info' : undefined }"
135-
:style="{ opacity: aired ? 1 : 0.75 }"
135+
:muted="!aired"
136136
>
137137
<span class="label" :class="{ active: isActive }">{{ number }}</span>
138138
</ButtonLink>

0 commit comments

Comments
 (0)