Better centering of elements and lazy load image

This commit is contained in:
2022-03-05 12:47:11 +01:00
parent 38813229c9
commit a5a4bd2641

View File

@@ -1,11 +1,11 @@
<template> <template>
<div> <div>
<section class="not-found"> <section class="not-found" :style="background">
<h1 class="not-found__title">Page Not Found</h1> <h1 class="not-found__title">Page Not Found</h1>
<seasoned-button class="button" @click="goBack">
go back to previous page
</seasoned-button>
</section> </section>
<seasoned-button class="button" @click="goBack"
>go back to previous page</seasoned-button
>
</div> </div>
</template> </template>
@@ -15,6 +15,11 @@ import SeasonedButton from "@/components/ui/SeasonedButton";
export default { export default {
components: { SeasonedButton }, components: { SeasonedButton },
data() {
return {
background: 'background-image: url("/assets/pulp-fiction.jpg")'
};
},
computed: { computed: {
...mapGetters("popup", ["isOpen"]) ...mapGetters("popup", ["isOpen"])
}, },
@@ -36,14 +41,9 @@ export default {
.button { .button {
font-size: 1.2rem; font-size: 1.2rem;
position: fixed; z-index: 10;
top: 50%;
left: calc(50% + 46px);
transform: translate(-50%, -50%);
@include mobile { @include mobile {
top: 60%;
left: 50%;
font-size: 1rem; font-size: 1rem;
width: content; width: content;
} }
@@ -51,11 +51,13 @@ export default {
.not-found { .not-found {
display: flex; display: flex;
height: calc(100vh - var(--header-size)); justify-content: center;
background: url("~assets/pulp-fiction.jpg") no-repeat 50% 50%;
background-size: cover;
align-items: center; align-items: center;
flex-direction: column; flex-direction: column;
height: calc(100vh - var(--header-size));
background-size: cover;
background-position: 50% 50%;
background-repeat: no-repeat no-repeat;
&::before { &::before {
content: ""; content: "";
@@ -63,14 +65,16 @@ export default {
height: calc(100vh - var(--header-size)); height: calc(100vh - var(--header-size));
width: 100%; width: 100%;
pointer-events: none; pointer-events: none;
background: $background-40; background: var(--background-40);
} }
&__title { &__title {
margin-top: 30vh;
font-size: 2.5rem; font-size: 2.5rem;
font-weight: 500; font-weight: 500;
color: $text-color; padding: 0 1rem;
color: var(--text-color);
position: relative; position: relative;
background-color: var(--background-90);
@include tablet-min { @include tablet-min {
font-size: 3.5rem; font-size: 3.5rem;