From fca123e26dace100a5d286f35adf2823a2d08053 Mon Sep 17 00:00:00 2001 From: Kevin Midboe Date: Sat, 5 Mar 2022 18:24:43 +0100 Subject: [PATCH] Show tagline, human readable runtime & updated to grid layout --- src/components/Movie.vue | 80 +++++++++++++++++++++++++++++----------- 1 file changed, 58 insertions(+), 22 deletions(-) diff --git a/src/components/Movie.vue b/src/components/Movie.vue index 02f770c..5c62a47 100644 --- a/src/components/Movie.vue +++ b/src/components/Movie.vue @@ -14,8 +14,11 @@ /> -

{{ movie.title || movie.name }}

- +
+

{{ movie.title || movie.name }}

+

{{ movie.tagline }}

+
+ @@ -125,9 +128,9 @@ :detail="movie.production_status" /> @@ -286,6 +289,20 @@ export default { poster.src = `${this.ASSET_URL}${this.ASSET_SIZES[0]}${this.poster}`; }, + humanMinutes(minutes) { + if (minutes instanceof Array) { + minutes = minutes[0]; + } + + const hours = Math.floor(minutes / 60); + const minutesLeft = minutes - hours * 60; + + if (minutesLeft == 0) { + return hours > 1 ? `${hours} hours` : `${hours} hour`; + } + + return `${hours}h ${minutesLeft}m`; + }, sendRequest() { request(this.id, this.type).then(resp => { if (resp.success) { @@ -337,7 +354,6 @@ export default { header { $duration: 0.2s; - height: 250px; transform: scaleY(1); transition: height $duration ease; transform-origin: top; @@ -346,23 +362,32 @@ header { background-repeat: no-repeat; background-position: 50% 50%; background-color: $background-color; - display: flex; - align-items: center; + display: grid; + grid-template-columns: 1fr 1fr; + height: 350px; - @include tablet-min { - height: 350px; + @include mobile { + grid-template-columns: 1fr; + height: 250px; + place-items: center; } - &:before { + + * { + z-index: 2; + } + + &::before { content: ""; display: block; position: absolute; top: 0; left: 0; - z-index: 0; + z-index: 1; width: 100%; height: 100%; background: $background-dark-85; } + @include mobile { &.compact { height: 100px; @@ -374,13 +399,11 @@ header { display: none; @include desktop { - background: $background-color; - height: 0; + background: var(--background-color); + height: auto; display: block; - position: absolute; - width: calc(45% - 40px); - top: 40px; - left: 40px; + width: calc(100% - 80px); + margin: 40px; > img { width: 100%; @@ -390,7 +413,6 @@ header { .movie { &__wrap { - display: flex; &--header { align-items: center; height: 100%; @@ -424,23 +446,29 @@ header { &__title { position: relative; padding: 20px; - color: $green; text-align: center; width: 100%; + height: fit-content; + @include tablet-min { - width: 55%; text-align: left; - margin-left: 45%; - padding: 30px 30px 30px 40px; + padding: 140px 30px 0 40px; } h1 { + color: var(--color-green); font-weight: 500; line-height: 1.4; font-size: 24px; + margin-bottom: 0; + @include tablet-min { font-size: 30px; } } + + p { + color: var(--text-color-90); + } } &__actions { @@ -473,6 +501,14 @@ header { &__details { display: flex; flex-wrap: wrap; + + > * { + margin-right: 30px; + + @include mobile { + margin-right: 20px; + } + } } &__admin { width: 100%;