Skip to content

Commit d313834

Browse files
committed
feat: warped torus background is in own layout
1 parent edcf844 commit d313834

File tree

3 files changed

+63
-45
lines changed

3 files changed

+63
-45
lines changed

components/site-footer.vue

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<footer id="site-footer" :class="{ 'no-background-image': pageSignup }">
2+
<footer id="site-footer" :class="{ 'no-background-image': noBackgroundImage }">
33

44
<div class="content">
55
<div class="grid-bottom-noBottom-noGutter">
@@ -52,10 +52,18 @@
5252
<script setup>
5353
// ======================================================================== Data
5454
const generalStore = useGeneralStore()
55-
const route = useRoute()
55+
56+
// ======================================================================= Props
57+
const props = defineProps({
58+
noBackgroundImage: {
59+
type: Boolean,
60+
required: false,
61+
default: false
62+
}
63+
})
5664
5765
// ==================================================================== Computed
58-
const pageSignup = computed(() => { return route.name === 'signup' })
66+
const noBackgroundImage = computed(() => { return props.noBackgroundImage })
5967
6068
const authors = computed(() => {
6169
return generalStore.siteContent.general?.footer.authors

layouts/warped-torus-background.vue

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<template>
2+
<div class="layout warped-torus-background" tabindex="-1">
3+
4+
<SiteHeader />
5+
6+
<slot />
7+
8+
<SiteFooter :no-background-image="true" />
9+
10+
</div>
11+
</template>
12+
13+
<style lang="scss" scoped>
14+
// ///////////////////////////////////////////////////////////////////// General
15+
.layout {
16+
display: flex;
17+
flex-direction: column;
18+
&:before {
19+
content: '';
20+
position: absolute;
21+
display: block;
22+
z-index: -1;
23+
overflow: visible;
24+
top: 0;
25+
left: 0;
26+
height: 100%;
27+
width: 100%;
28+
background-image: url('/images/warped-torus-made-of-segments.jpg');
29+
background-size: auto vw(1800px);
30+
background-origin: border-box;
31+
background-position: center 75%;
32+
background-repeat: no-repeat;
33+
@include medium {
34+
background-position: center 45%;
35+
}
36+
@include small {
37+
background-position: center 30%;
38+
}
39+
@include mini {
40+
background-size: auto vw(1100px, 640px);
41+
background-position: center bottom 18rem;
42+
}
43+
@include tiny {
44+
background-size: auto vw(1200px, 415px);
45+
background-position: center top -30%;
46+
}
47+
}
48+
}
49+
</style>

pages/signup.vue

+3-42
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
</template>
2626

2727
<script setup>
28-
28+
definePageMeta({
29+
layout: 'warped-torus-background'
30+
})
2931
// ======================================================================== Data
3032
const generalStore = useGeneralStore()
3133
const { $GetSeo, $CompileSeo } = useNuxtApp()
@@ -59,47 +61,6 @@ const content = computed(() => {
5961
position: relative;
6062
margin-top: 4.875rem;
6163
}
62-
&:before {
63-
content: '';
64-
position: absolute;
65-
display: block;
66-
z-index: -1;
67-
overflow: visible;
68-
top: 0;
69-
left: -8vw;
70-
width: 120vw;
71-
height: calc(100% + toRem(365));
72-
background-image: url('/images/warped-torus-made-of-segments.jpg');
73-
background-size: vw(2200px);
74-
background-origin: border-box;
75-
background-position: center 64%;
76-
background-repeat: no-repeat;
77-
@include gridMaxMQ {
78-
height: calc(100% + toRem(430));
79-
background-position: center 54%;
80-
}
81-
@include large {
82-
background-size: clamp(toRem(1700), vw(2200px), toRem(1833));
83-
background-position: center 44%;
84-
}
85-
86-
@include medium {
87-
height: calc(100% + toRem(480));
88-
}
89-
@include customMaxMQ(toRem(983)) {
90-
background-position: center bottom;
91-
top: 2rem;
92-
}
93-
@include small {
94-
height: 100%;
95-
}
96-
@include mini {
97-
background-size: vw(1030px, 375px);
98-
height: calc(100% + toRem(200));
99-
top: unset;
100-
bottom: -2rem;
101-
}
102-
}
10364
}
10465
10566
.back-home-button {

0 commit comments

Comments
 (0)