mirror of
https://github.com/BlossomiShymae/clean-cuts.git
synced 2025-12-06 18:20:47 +01:00
Add middleware for background and browser title
This commit is contained in:
11
app.vue
11
app.vue
@@ -14,11 +14,7 @@ AOS.init();
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.app-background {
|
.app-background {
|
||||||
background: rgba(41, 31, 68, 0.9);
|
background: rgba(41, 31, 68, 1);
|
||||||
}
|
|
||||||
|
|
||||||
.app-background-solid {
|
|
||||||
background: rgb(41, 31, 68);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.aos-fix[data-aos][data-aos].aos-animate {
|
.aos-fix[data-aos][data-aos].aos-animate {
|
||||||
@@ -61,6 +57,7 @@ html {
|
|||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
|
transition: all 1s ease-out;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@@ -90,7 +87,7 @@ svg {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
@extend .app-background-solid;
|
@extend .app-background;
|
||||||
}
|
}
|
||||||
|
|
||||||
thead, tbody, th, td {
|
thead, tbody, th, td {
|
||||||
@@ -103,7 +100,7 @@ table > tbody > tr:nth-of-type(2n+1) > * {
|
|||||||
|
|
||||||
|
|
||||||
ul.dropdown-menu {
|
ul.dropdown-menu {
|
||||||
@extend .app-background-solid;
|
@extend .app-background;
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-group-item {
|
.list-group-item {
|
||||||
|
|||||||
7
middleware/background.global.ts
Normal file
7
middleware/background.global.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export default defineNuxtRouteMiddleware((to, from) => {
|
||||||
|
useHead({
|
||||||
|
htmlAttrs: {
|
||||||
|
style: to.fullPath == "/" ? "background: url('/clean-cuts/img/background.jpg');" : "background: rgb(21, 11, 48)"
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
12
middleware/title.global.ts
Normal file
12
middleware/title.global.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
export default defineNuxtRouteMiddleware((to, from) => {
|
||||||
|
useHead({
|
||||||
|
title: to.fullPath == "/" ? "Clean Cuts" : to.fullPath
|
||||||
|
.split("/")
|
||||||
|
.filter(x => x != "")
|
||||||
|
.map(x => x
|
||||||
|
.split("-") // Remove hypens
|
||||||
|
.map(x => x.charAt(0).toUpperCase() + x.slice(1)) // Titlecase words
|
||||||
|
.join(" "))
|
||||||
|
.join(" • ")
|
||||||
|
})
|
||||||
|
});
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
ssr: false,
|
ssr: false,
|
||||||
|
|
||||||
app: {
|
app: {
|
||||||
baseURL: "/clean-cuts/",
|
baseURL: "/clean-cuts/",
|
||||||
pageTransition: {
|
pageTransition: {
|
||||||
@@ -16,7 +15,6 @@ export default defineNuxtConfig({
|
|||||||
head: {
|
head: {
|
||||||
htmlAttrs: {
|
htmlAttrs: {
|
||||||
"data-bs-theme": "dark",
|
"data-bs-theme": "dark",
|
||||||
"style": "background-image: url('/clean-cuts/img/background.jpg');"
|
|
||||||
},
|
},
|
||||||
bodyAttrs: {
|
bodyAttrs: {
|
||||||
class: "h-100"
|
class: "h-100"
|
||||||
|
|||||||
Reference in New Issue
Block a user