diff --git a/app.config.ts b/app.config.ts index 1eb28fb..47aa0be 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,30 +1,30 @@ export default defineAppConfig({ - ui: { - icons: { - dynamic: true, - }, - gray: 'neutral', - primary: 'cyan', - notifications: { - position: 'bottom-0 right-0', - }, - container: { - base: 'mx-auto', - padding: 'px-4 sm:px-6 lg:px-8', - constrained: 'max-w-9xl', - }, - dropdown: { - container: 'z-50', - background: 'bg-white dark:bg-zinc-900/90', - item: { - base: 'duration-300 group flex items-center gap-2 w-full', - }, - }, - button: { - base: 'duration-300 focus:outline-none focus-visible:outline-0 disabled:cursor-not-allowed disabled:opacity-75', - }, - popover: { - container: 'z-50', - }, - }, + ui: { + icons: { + dynamic: true, + }, + gray: 'neutral', + primary: 'cyan', + notifications: { + position: 'bottom-0 right-0', + }, + container: { + base: 'mx-auto', + padding: 'px-4 sm:px-6 lg:px-8', + constrained: 'max-w-9xl', + }, + dropdown: { + container: 'z-50', + background: 'bg-white dark:bg-zinc-900/90', + item: { + base: 'duration-300 group flex items-center gap-2 w-full', + }, + }, + button: { + base: 'duration-300 focus:outline-none focus-visible:outline-0 disabled:cursor-not-allowed disabled:opacity-75', + }, + popover: { + container: 'z-50', + }, + }, }) diff --git a/app/router.options.ts b/app/router.options.ts index 35153e0..3b634f7 100644 --- a/app/router.options.ts +++ b/app/router.options.ts @@ -1,49 +1,49 @@ import type {RouterConfig} from '@nuxt/schema' function findHashPosition(hash: string): { el: string, behavior: ScrollBehavior, top: number } | undefined { - const el = document.querySelector(hash) - // vue-router does not incorporate scroll-margin-top on its own. - if (el) { - const top = Number.parseFloat(getComputedStyle(el).scrollMarginTop) + const el = document.querySelector(hash) + // vue-router does not incorporate scroll-margin-top on its own. + if (el) { + const top = Number.parseFloat(getComputedStyle(el).scrollMarginTop) - return { - el: hash, - behavior: 'smooth', - top, - } - } + return { + el: hash, + behavior: 'smooth', + top, + } + } } // https://router.vuejs.org/api/#routeroptions export default { - scrollBehavior(to, from, savedPosition) { - const nuxtApp = useNuxtApp() + scrollBehavior(to, from, savedPosition) { + const nuxtApp = useNuxtApp() - // If history back - if (savedPosition) { - // Handle Suspense resolution - return new Promise((resolve) => { - nuxtApp.hooks.hookOnce('page:finish', () => { - setTimeout(() => resolve(savedPosition), 50) - }) - }) - } + // If history back + if (savedPosition) { + // Handle Suspense resolution + return new Promise((resolve) => { + nuxtApp.hooks.hookOnce('page:finish', () => { + setTimeout(() => resolve(savedPosition), 50) + }) + }) + } - // Scroll to heading on click - if (to.hash) { - return new Promise((resolve) => { - if (to.path === from.path) { - setTimeout(() => resolve(findHashPosition(to.hash)), 50) - } - else { - nuxtApp.hooks.hookOnce('page:finish', () => { - setTimeout(() => resolve(findHashPosition(to.hash)), 50) - }) - } - }) - } + // Scroll to heading on click + if (to.hash) { + return new Promise((resolve) => { + if (to.path === from.path) { + setTimeout(() => resolve(findHashPosition(to.hash)), 50) + } + else { + nuxtApp.hooks.hookOnce('page:finish', () => { + setTimeout(() => resolve(findHashPosition(to.hash)), 50) + }) + } + }) + } - // Scroll to top of window - return { top: 0 } - }, + // Scroll to top of window + return { top: 0 } + }, } diff --git a/auth.d.ts b/auth.d.ts index 131b5ba..e7435ac 100644 --- a/auth.d.ts +++ b/auth.d.ts @@ -1,10 +1,10 @@ declare module '#auth-utils' { - interface UserSession { - user: { - email: string - username: string - picture: string - admin: boolean - } - } + interface UserSession { + user: { + email: string + username: string + picture: string + admin: boolean + } + } } diff --git a/components/Announcement.vue b/components/Announcement.vue index 966e9bf..c9eb08e 100644 --- a/components/Announcement.vue +++ b/components/Announcement.vue @@ -3,32 +3,32 @@ const { data: announce } = await useFetch('/api/announcement') const appConfig = useAppConfig() function getColor() { - return `bg-${appConfig.ui.primary}-500` + return `bg-${appConfig.ui.primary}-500` }