mirror of
https://github.com/BlossomiShymae/clean-cuts.git
synced 2025-12-06 10:10: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">
|
||||
.app-background {
|
||||
background: rgba(41, 31, 68, 0.9);
|
||||
}
|
||||
|
||||
.app-background-solid {
|
||||
background: rgb(41, 31, 68);
|
||||
background: rgba(41, 31, 68, 1);
|
||||
}
|
||||
|
||||
.aos-fix[data-aos][data-aos].aos-animate {
|
||||
@@ -61,6 +57,7 @@ html {
|
||||
|
||||
position: relative;
|
||||
z-index: 0;
|
||||
transition: all 1s ease-out;
|
||||
}
|
||||
|
||||
body {
|
||||
@@ -90,7 +87,7 @@ svg {
|
||||
}
|
||||
|
||||
table {
|
||||
@extend .app-background-solid;
|
||||
@extend .app-background;
|
||||
}
|
||||
|
||||
thead, tbody, th, td {
|
||||
@@ -103,7 +100,7 @@ table > tbody > tr:nth-of-type(2n+1) > * {
|
||||
|
||||
|
||||
ul.dropdown-menu {
|
||||
@extend .app-background-solid;
|
||||
@extend .app-background;
|
||||
}
|
||||
|
||||
.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({
|
||||
devtools: { enabled: true },
|
||||
ssr: false,
|
||||
|
||||
app: {
|
||||
baseURL: "/clean-cuts/",
|
||||
pageTransition: {
|
||||
@@ -16,7 +15,6 @@ export default defineNuxtConfig({
|
||||
head: {
|
||||
htmlAttrs: {
|
||||
"data-bs-theme": "dark",
|
||||
"style": "background-image: url('/clean-cuts/img/background.jpg');"
|
||||
},
|
||||
bodyAttrs: {
|
||||
class: "h-100"
|
||||
|
||||
Reference in New Issue
Block a user