Skip to content

Commit 8bbf577

Browse files
committed
fix(css): make panels and buttons more responsive
1 parent bbe1c13 commit 8bbf577

10 files changed

+50
-31
lines changed

src/components/views/panel/MoviePanel.vue

+12-4
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ onMounted(() => {
315315
</script>
316316

317317
<template>
318-
<NFlex justify="center" align="center" vertical>
318+
<NFlex class="panel-container" justify="center" align="center" vertical>
319319
<TitleLink
320320
v-if="title"
321321
class="show-title"
@@ -372,8 +372,16 @@ onMounted(() => {
372372
</template>
373373

374374
<style lang="scss" scoped>
375-
.show-title-skeleton {
376-
height: 1.5rem;
377-
margin-top: 0.625rem;
375+
.panel-container {
376+
& > div:nth-child(n + 3) {
377+
@media (width > 1200px) {
378+
max-width: min(var(--half-width), var(--height-70-dvh));
379+
}
380+
}
381+
382+
.show-title-skeleton {
383+
height: 1.5rem;
384+
margin-top: 0.625rem;
385+
}
378386
}
379387
</style>

src/components/views/panel/MoviePanelButtons.vue

+2-8
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ onMounted(() => fetchLists());
223223
.panel-buttons {
224224
display: flex;
225225
flex-wrap: wrap;
226-
gap: 1rem;
226+
gap: 1.25rem;
227227
align-items: center;
228-
justify-content: center;
228+
justify-content: space-around;
229229
width: 100%;
230230
margin: 0.75rem 1rem 1.25rem;
231231
@@ -236,12 +236,6 @@ onMounted(() => fetchLists());
236236
}
237237
}
238238
239-
@media (width > 800px) {
240-
.panel-buttons {
241-
gap: 1.25rem 3rem;
242-
}
243-
}
244-
245239
@media (width < 660px) {
246240
.button-container {
247241
min-width: 45%;

src/components/views/panel/PanelPoster.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ const key = computed(() => {
8181
@include transition.scale;
8282
8383
.poster-container {
84-
--poster-height: calc(50dvw * (9 / 16));
84+
--poster-height: calc(min(var(--half-width), var(--height-70-dvh)) * (9 / 16));
8585
--poster-width: calc(var(--poster-height) * (2 / 3));
8686
8787
&.landscape {
88-
--poster-width: 50dvw;
88+
--poster-width: min(var(--half-width), var(--height-70-dvh));
8989
--poster-height: calc(var(--poster-width) * (9 / 16));
9090
}
9191

src/components/views/panel/PanelRating.vue

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ const _rating = computed(() => (rating?.value ?? 0) * 10);
122122
--duration: 1000ms;
123123
124124
flex: 1 0 6rem;
125+
max-width: 24rem;
125126
126127
.rating-skeleton {
127128
width: 2.125rem;

src/components/views/panel/PanelScore.vue

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ const containerRef = ref<InstanceType<typeof TextField>>();
107107
--duration: 1000ms;
108108
109109
flex: 1 0 6rem;
110+
max-width: 24rem;
110111
111112
.score-label {
112113
align-self: center;

src/components/views/panel/PanelStatistics.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const isCompact = watchMedia('(max-width: 725px)');
4747
</script>
4848

4949
<template>
50-
<NFlex class="statistics-container" justify="space-around">
50+
<NFlex class="statistics-container" justify="center">
5151
<slot v-if="isCompact" />
5252
<PanelRating
5353
v-if="enableRatings"

src/components/views/panel/PersonPanel.vue

+12-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const { openTab } = useLinksStore();
6767
</script>
6868

6969
<template>
70-
<NFlex justify="center" align="center" vertical>
70+
<NFlex class="panel-container" justify="center" align="center" vertical>
7171
<TitleLink
7272
v-if="title"
7373
class="show-title"
@@ -93,8 +93,16 @@ const { openTab } = useLinksStore();
9393
</template>
9494

9595
<style lang="scss" scoped>
96-
.show-title-skeleton {
97-
height: 1.5rem;
98-
margin-top: 0.625rem;
96+
.panel-container {
97+
& > div:nth-child(n + 3) {
98+
@media (width > 1200px) {
99+
max-width: min(var(--half-width), var(--height-70-dvh));
100+
}
101+
}
102+
103+
.show-title-skeleton {
104+
height: 1.5rem;
105+
margin-top: 0.625rem;
106+
}
99107
}
100108
</style>

src/components/views/panel/ShowPanel.vue

+12-4
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ const { openTab } = useLinksStore();
523523
</script>
524524

525525
<template>
526-
<NFlex justify="center" align="center" vertical>
526+
<NFlex class="panel-container" justify="center" align="center" vertical>
527527
<TitleLink
528528
v-if="title"
529529
class="show-title"
@@ -603,8 +603,16 @@ const { openTab } = useLinksStore();
603603
</template>
604604

605605
<style lang="scss" scoped>
606-
.show-title-skeleton {
607-
height: 1.5rem;
608-
margin-top: 0.625rem;
606+
.panel-container {
607+
& > div:nth-child(n + 3) {
608+
@media (width > 1200px) {
609+
max-width: min(var(--half-width), var(--height-70-dvh));
610+
}
611+
}
612+
613+
.show-title-skeleton {
614+
height: 1.5rem;
615+
margin-top: 0.625rem;
616+
}
609617
}
610618
</style>

src/components/views/panel/ShowPanelButtons.vue

+2-8
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,9 @@ onMounted(() => fetchLists());
314314
.panel-buttons {
315315
display: flex;
316316
flex-wrap: wrap;
317-
gap: 1rem;
317+
gap: 1.25rem;
318318
align-items: center;
319-
justify-content: center;
319+
justify-content: space-around;
320320
width: 100%;
321321
margin: 1rem 1rem 1.25rem;
322322
@@ -347,12 +347,6 @@ onMounted(() => fetchLists());
347347
}
348348
}
349349
350-
@media (width > 800px) {
351-
.panel-buttons {
352-
gap: 1.25rem 3rem;
353-
}
354-
}
355-
356350
@media (width < 660px) {
357351
.button-container {
358352
min-width: 45%;

src/styles/base.scss

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
--full-height: 100dvh;
55
--half-height: 50dvh;
66
--height-40-dvh: 40dvh;
7+
--height-70-dvh: 70dvh;
8+
9+
/** width */
10+
--full-width: 100dvw;
11+
--half-width: 50dvw;
712

813
/* font variables */
914
--font-size-xxs: 0.625rem;

0 commit comments

Comments
 (0)