Moved expand click to button & some more animations to icon

This commit is contained in:
2022-03-05 12:56:55 +01:00
parent f21d879af0
commit 0433f8c910

View File

@@ -2,7 +2,6 @@
<header <header
:class="{ expanded, noselect: true }" :class="{ expanded, noselect: true }"
v-bind:style="{ 'background-image': 'url(' + imageFile + ')' }" v-bind:style="{ 'background-image': 'url(' + imageFile + ')' }"
@click="expanded = !expanded"
> >
<div class="container"> <div class="container">
<h1 class="title">Request movies or tv shows</h1> <h1 class="title">Request movies or tv shows</h1>
@@ -11,7 +10,7 @@
> >
</div> </div>
<div class="expand-icon"> <div class="expand-icon" @click="expanded = !expanded">
<IconExpand v-if="!expanded" /> <IconExpand v-if="!expanded" />
<IconShrink v-else /> <IconShrink v-else />
</div> </div>
@@ -46,7 +45,7 @@ export default {
if (this.image && this.image.length > 0) { if (this.image && this.image.length > 0) {
this.imageFile = this.image; this.imageFile = this.image;
} else { } else {
this.imageFile = `/dist/${ this.imageFile = `/assets/${
this.images[Math.floor(Math.random() * this.images.length)] this.images[Math.floor(Math.random() * this.images.length)]
}`; }`;
} }
@@ -60,7 +59,7 @@ export default {
header { header {
width: 100%; width: 100%;
height: 30vh; height: 25vh;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@@ -72,6 +71,20 @@ header {
&.expanded { &.expanded {
height: calc(100vh - var(--header-size)); height: calc(100vh - var(--header-size));
width: calc(100vw - var(--header-size)); width: calc(100vw - var(--header-size));
@include mobile {
width: 100vw;
height: 100vh;
}
&:before {
background-color: transparent;
}
.title,
.subtitle {
opacity: 0;
}
} }
.expand-icon { .expand-icon {
@@ -85,6 +98,11 @@ header {
position: absolute; position: absolute;
top: 0.5rem; top: 0.5rem;
right: 1rem; right: 1rem;
&:hover {
cursor: pointer;
fill: var(--text-color-90);
}
} }
&:hover { &:hover {
@@ -118,6 +136,7 @@ header {
letter-spacing: 0.5px; letter-spacing: 0.5px;
color: $text-color; color: $text-color;
margin: 0; margin: 0;
opacity: 1;
@include tablet-min { @include tablet-min {
font-size: 2.5rem; font-size: 2.5rem;
@@ -130,6 +149,7 @@ header {
font-weight: 300; font-weight: 300;
color: $text-color-70; color: $text-color-70;
margin: 5px 0; margin: 5px 0;
opacity: 1;
@include tablet-min { @include tablet-min {
font-size: 1.3rem; font-size: 1.3rem;