0
Fork 0
mirror of https://codeberg.org/SafeTwitch/safetwitch.git synced 2024-12-22 05:12:57 -05:00

Add dynamic titles #71

This commit is contained in:
dragongoose 2024-06-02 11:42:35 -04:00
parent a3d462e9db
commit f3f6dd88aa
No known key found for this signature in database
GPG key ID: 01397EEC371CDAA5
9 changed files with 49 additions and 6 deletions

View file

@ -1,8 +1,11 @@
<script lang="ts"> <script lang="ts">
import VueTitle from './VueTitle.vue';
export default {} export default {}
</script> </script>
<template> <template>
<VueTitle title="Error"></VueTitle>
<div <div
class="flex flex-col max-w-prose justify-center text-center mx-auto p-6 bg-crust rounded-lg text-contrast" class="flex flex-col max-w-prose justify-center text-center mx-auto p-6 bg-crust rounded-lg text-contrast"
> >

View file

@ -0,0 +1,12 @@
<script setup lang="ts">
import { onMounted } from 'vue';
const props = defineProps<{
title: string
}>()
onMounted(function () {
document.title = props.title
})
</script>

View file

@ -8,10 +8,12 @@ import FollowButton from '@/components/FollowButton.vue'
import LoadingScreen from '@/components/LoadingScreen.vue' import LoadingScreen from '@/components/LoadingScreen.vue'
import AboutTab from '@/components/user/AboutTab.vue' import AboutTab from '@/components/user/AboutTab.vue'
import ShareModal from '@/components/popups/ShareButtonModal.vue' import ShareModal from '@/components/popups/ShareButtonModal.vue'
import VueTitle from '@/components/VueTitle.vue'
import type { Video } from '@/types' import type { Video } from '@/types'
import { truncate, abbreviate, getEndpoint } from '@/mixins' import { truncate, abbreviate, getEndpoint } from '@/mixins'
export default { export default {
inject: ['rootBackendUrl'], inject: ['rootBackendUrl'],
async setup() { async setup() {
@ -69,7 +71,8 @@ export default {
FollowButton, FollowButton,
LoadingScreen, LoadingScreen,
AboutTab, AboutTab,
ShareModal ShareModal,
VueTitle
}, },
methods: { methods: {
truncate, truncate,
@ -90,6 +93,7 @@ export default {
v-else-if="data" v-else-if="data"
class="w-full justify-center md:inline-flex space-y-4 md:space-y-0 md:space-x-4 md:p-4" class="w-full justify-center md:inline-flex space-y-4 md:space-y-0 md:space-x-4 md:p-4"
> >
<VueTitle :title=" 'Clip - ' + data.title"></VueTitle>
<div <div
class="flex bg-crust flex-col p-6 rounded-lg w-[99vw] md:max-w-prose md:min-w-[65ch] lg:max-w-[70rem] text-contrast" class="flex bg-crust flex-col p-6 rounded-lg w-[99vw] md:max-w-prose md:min-w-[65ch] lg:max-w-[70rem] text-contrast"
> >

View file

@ -4,6 +4,7 @@ import { ref, inject } from 'vue'
import FollowButton from '@/components/FollowButton.vue' import FollowButton from '@/components/FollowButton.vue'
import LoadingScreen from '@/components/LoadingScreen.vue' import LoadingScreen from '@/components/LoadingScreen.vue'
import ErrorMessage from '@/components/ErrorMessage.vue' import ErrorMessage from '@/components/ErrorMessage.vue'
import VueTitle from '@/components/VueTitle.vue'
import { getFollows } from '@/settingsManager' import { getFollows } from '@/settingsManager'
import { postEndpoint, abbreviate, getParsedFollowing } from '@/mixins' import { postEndpoint, abbreviate, getParsedFollowing } from '@/mixins'
@ -55,7 +56,8 @@ export default {
components: { components: {
LoadingScreen, LoadingScreen,
FollowButton, FollowButton,
ErrorMessage ErrorMessage,
VueTitle
} }
} }
</script> </script>
@ -66,6 +68,7 @@ export default {
v-else-if="data" v-else-if="data"
class="md:max-w-[50rem] w-full mx-auto text-contrast flex flex-col justify-center" class="md:max-w-[50rem] w-full mx-auto text-contrast flex flex-col justify-center"
> >
<vue-title title="Following"></vue-title>
<div v-if="data.length == 0" class="text-center"> <div v-if="data.length == 0" class="text-center">
<h1 class="text-3xl font-bold">{{ $t('following.empty') }}</h1> <h1 class="text-3xl font-bold">{{ $t('following.empty') }}</h1>
<p>{{ $t('following.followAdvice') }}</p> <p>{{ $t('following.followAdvice') }}</p>

View file

@ -9,6 +9,7 @@ import CategoryPreview from '@/components/CategoryPreview.vue'
import { getEndpoint, followersStreaming } from '@/mixins' import { getEndpoint, followersStreaming } from '@/mixins'
import type { CategoryPreview as CategoryPreviewInterface } from '@/types' import type { CategoryPreview as CategoryPreviewInterface } from '@/types'
import { getFollows } from '@/settingsManager' import { getFollows } from '@/settingsManager'
import VueTitle from '@/components/VueTitle.vue'
export default { export default {
async setup() { async setup() {
@ -96,7 +97,8 @@ export default {
StreamPreviewVue, StreamPreviewVue,
ErrorMessage, ErrorMessage,
LoadingScreen, LoadingScreen,
CategoryPreview CategoryPreview,
VueTitle
} }
} }
</script> </script>
@ -106,6 +108,7 @@ export default {
<error-message v-show="status == 'error'"></error-message> <error-message v-show="status == 'error'"></error-message>
<div v-show="data" class="max-w-5xl mx-auto"> <div v-show="data" class="max-w-5xl mx-auto">
<vue-title title="Discover"></vue-title>
<div v-if="following && following.length > 0" class="p-2 text-contrast"> <div v-if="following && following.length > 0" class="p-2 text-contrast">
<h1 class="font-bold text-5xl">{{ $t('home.following') }}</h1> <h1 class="font-bold text-5xl">{{ $t('home.following') }}</h1>
<p class="text-xl">{{ $t('home.streamersYouFollow') }}</p> <p class="text-xl">{{ $t('home.streamersYouFollow') }}</p>

View file

@ -1,8 +1,15 @@
<script lang="ts"> <script lang="ts">
export default {} import VueTitle from '@/components/VueTitle.vue';
export default {
components: {
VueTitle
}
}
</script> </script>
<template> <template>
<vue-title title="Not Found"></vue-title>
<div class="flex flex-col items-center pt-10 font-bold text-5xl text-contrast"> <div class="flex flex-col items-center pt-10 font-bold text-5xl text-contrast">
<h1>{{ $t('error.oops') }}</h1> <h1>{{ $t('error.oops') }}</h1>
<h1>{{ $t('error.notfound') }}</h1> <h1>{{ $t('error.notfound') }}</h1>

View file

@ -9,6 +9,7 @@ import {
getFollows getFollows
} from '@/settingsManager' } from '@/settingsManager'
import type { Settings } from '@/settingsManager' import type { Settings } from '@/settingsManager'
import VueTitle from '@/components/VueTitle.vue';
export default { export default {
setup() { setup() {
@ -79,11 +80,15 @@ export default {
this.settings = settings this.settings = settings
this.save() this.save()
} }
},
components: {
VueTitle
} }
} }
</script> </script>
<template> <template>
<vue-title title="Settings"></vue-title>
<div class="mx-auto w-[35rem] max-w-[95vw] p-5 py-3 bg-secondary rounded-md text-contrast"> <div class="mx-auto w-[35rem] max-w-[95vw] p-5 py-3 bg-secondary rounded-md text-contrast">
<h1 class="font-bold text-3xl">{{ $t('nav.settings') }}</h1> <h1 class="font-bold text-3xl">{{ $t('nav.settings') }}</h1>
<hr class="my-2" /> <hr class="my-2" />

View file

@ -11,6 +11,7 @@ import VideoTab from '@/components/user/VideoTab.vue'
import AudioPlayer from '@/components/AudioPlayer.vue' import AudioPlayer from '@/components/AudioPlayer.vue'
import AboutTab from '@/components/user/AboutTab.vue' import AboutTab from '@/components/user/AboutTab.vue'
import ShareModal from '@/components/popups/ShareButtonModal.vue' import ShareModal from '@/components/popups/ShareButtonModal.vue'
import VueTitle from '@/components/VueTitle.vue'
import type { StreamerData } from '@/types' import type { StreamerData } from '@/types'
import { truncate, abbreviate, getEndpoint } from '@/mixins' import { truncate, abbreviate, getEndpoint } from '@/mixins'
@ -71,7 +72,8 @@ export default {
VideoTab, VideoTab,
AudioPlayer, AudioPlayer,
AboutTab, AboutTab,
ShareModal ShareModal,
VueTitle
}, },
methods: { methods: {
truncate, truncate,
@ -98,6 +100,7 @@ export default {
v-else-if="data" v-else-if="data"
class="w-full justify-center md:inline-flex space-y-4 md:space-y-0 md:space-x-4 md:p-4" class="w-full justify-center md:inline-flex space-y-4 md:space-y-0 md:space-x-4 md:p-4"
> >
<vue-title :title="data.username"></vue-title>
<div <div
class="flex bg-crust flex-col p-6 rounded-lg w-[99vw] md:max-w-prose md:min-w-[65ch] lg:max-w-[70rem] text-contrast" class="flex bg-crust flex-col p-6 rounded-lg w-[99vw] md:max-w-prose md:min-w-[65ch] lg:max-w-[70rem] text-contrast"
> >

View file

@ -13,6 +13,7 @@ import ShareModal from '@/components/popups/ShareButtonModal.vue'
import type { Video } from '@/types' import type { Video } from '@/types'
import { truncate, abbreviate, getEndpoint } from '@/mixins' import { truncate, abbreviate, getEndpoint } from '@/mixins'
import { getSetting } from '@/settingsManager' import { getSetting } from '@/settingsManager'
import VueTitle from '@/components/VueTitle.vue'
interface ChatComponent { interface ChatComponent {
updateVodComments: (time: number) => void updateVodComments: (time: number) => void
@ -61,7 +62,8 @@ export default {
FollowButton, FollowButton,
LoadingScreen, LoadingScreen,
AboutTab, AboutTab,
ShareModal ShareModal,
VueTitle
}, },
methods: { methods: {
truncate, truncate,
@ -94,6 +96,7 @@ export default {
v-else-if="data" v-else-if="data"
class="w-full justify-center md:inline-flex space-y-4 md:space-y-0 md:space-x-4 md:p-4" class="w-full justify-center md:inline-flex space-y-4 md:space-y-0 md:space-x-4 md:p-4"
> >
<vue-title :title="'VOD - ' + data.title"></vue-title>
<div <div
class="flex bg-crust flex-col p-6 rounded-lg w-[99vw] md:max-w-prose md:min-w-[65ch] lg:max-w-[70rem] text-contrast" class="flex bg-crust flex-col p-6 rounded-lg w-[99vw] md:max-w-prose md:min-w-[65ch] lg:max-w-[70rem] text-contrast"
> >