diff --git a/components.d.ts b/components.d.ts index f607cf18..5d47099e 100644 --- a/components.d.ts +++ b/components.d.ts @@ -310,9 +310,11 @@ declare module '@vue/runtime-core' { NCheckbox: typeof import('naive-ui')['NCheckbox'] NCode: typeof import('naive-ui')['NCode'] NCollapseTransition: typeof import('naive-ui')['NCollapseTransition'] + NColorPicker: typeof import('naive-ui')['NColorPicker'] NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NDivider: typeof import('naive-ui')['NDivider'] NEllipsis: typeof import('naive-ui')['NEllipsis'] + NForm: typeof import('naive-ui')['NForm'] NFormItem: typeof import('naive-ui')['NFormItem'] NGi: typeof import('naive-ui')['NGi'] NginxFormatter: typeof import('./src/tools/nginx-formatter/nginx-formatter.vue')['default'] @@ -322,8 +324,10 @@ declare module '@vue/runtime-core' { NH1: typeof import('naive-ui')['NH1'] NH3: typeof import('naive-ui')['NH3'] NIcon: typeof import('naive-ui')['NIcon'] + NImage: typeof import('naive-ui')['NImage'] NInput: typeof import('naive-ui')['NInput'] NInputGroup: typeof import('naive-ui')['NInputGroup'] + NInputGroupLabel: typeof import('naive-ui')['NInputGroupLabel'] NInputNumber: typeof import('naive-ui')['NInputNumber'] NLayout: typeof import('naive-ui')['NLayout'] NLayoutSider: typeof import('naive-ui')['NLayoutSider'] @@ -339,6 +343,8 @@ declare module '@vue/runtime-core' { NStatistic: typeof import('naive-ui')['NStatistic'] NSwitch: typeof import('naive-ui')['NSwitch'] NTable: typeof import('naive-ui')['NTable'] + NTabPane: typeof import('naive-ui')['NTabPane'] + NTabs: typeof import('naive-ui')['NTabs'] NTag: typeof import('naive-ui')['NTag'] NTooltip: typeof import('naive-ui')['NTooltip'] NumberInput: typeof import('./src/tools/pomodoro-timer/app/components/NumberInput.vue')['default'] diff --git a/package.json b/package.json index f334b3ba..092d3470 100644 --- a/package.json +++ b/package.json @@ -279,6 +279,7 @@ "vue": "^3.3.4", "vue-color-wheel": "^0.1.1", "vue-i18n": "^9.14.3", + "vue-loading-overlay": "^6.0", "vue-markdown-render": "^2.2.1", "vue-mathjax-next": "^0.0.6", "vue-router": "^4.1.6", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 74a78ba0..5159b78a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -734,6 +734,9 @@ dependencies: vue-i18n: specifier: ^9.14.3 version: 9.14.4(vue@3.3.4) + vue-loading-overlay: + specifier: ^6.0 + version: 6.0.6(vue@3.3.4) vue-markdown-render: specifier: ^2.2.1 version: 2.2.1(vue@3.3.4) @@ -18479,6 +18482,15 @@ packages: '@vue/devtools-api': 6.5.0 vue: 3.3.4 + /vue-loading-overlay@6.0.6(vue@3.3.4): + resolution: {integrity: sha512-ZPrWawjCoNKGbCG9z4nePgbs/K9KXPa1j1oAJXP6T8FQho3NO+/chhjx4MLYFzfpwr+xkiQ8SNrV1kUG1bZPAw==} + engines: {node: '>=12.13.0'} + peerDependencies: + vue: ^3.2.0 + dependencies: + vue: 3.3.4 + dev: false + /vue-markdown-render@2.2.1(vue@3.3.4): resolution: {integrity: sha512-XkYnC0PMdbs6Vy6j/gZXSvCuOS0787Se5COwXlepRqiqPiunyCIeTPQAO2XnB4Yl04EOHXwLx5y6IuszMWSgyQ==} peerDependencies: diff --git a/src/App.vue b/src/App.vue index 8e65335d..4ffc5828 100644 --- a/src/App.vue +++ b/src/App.vue @@ -49,4 +49,18 @@ html { * { box-sizing: border-box; } + +body .vld-container { + position:absolute; + left:0; + top:0; + width: 100%; + height: 100vh; + background-color: #101014; + z-index: 9999; + text-align: center; +} +body .vld-container .vl-overlay.vl-active { + margin-top: 15%; +} diff --git a/src/main.ts b/src/main.ts index 9221a8cd..1d467994 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,6 +3,7 @@ import { createPinia } from 'pinia'; import { createHead } from '@vueuse/head'; import { library } from '@fortawesome/fontawesome-svg-core'; import { fas } from '@fortawesome/free-solid-svg-icons'; +import {LoadingPlugin} from 'vue-loading-overlay'; import { registerSW } from 'virtual:pwa-register'; import shadow from 'vue-shadow-dom'; @@ -25,6 +26,7 @@ registerSW(); const app = createApp(App); +app.use(LoadingPlugin); app.use(createPinia()); app.use(createHead()); app.use(i18nPlugin); diff --git a/src/router.ts b/src/router.ts index da0c4f1e..03a73861 100644 --- a/src/router.ts +++ b/src/router.ts @@ -5,6 +5,9 @@ import NotFound from './pages/404.page.vue'; import { tools } from './tools'; import { config } from './config'; import { routes as demoRoutes } from './ui/demo/demo.routes'; +import {useLoading, type ActiveLoader} from 'vue-loading-overlay' + +const $loading = useLoading(); const toolsRoutes = tools.map(({ path, name, component, ...config }) => ({ path, @@ -37,5 +40,15 @@ const router = createRouter({ { path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound }, ], }); +let loader: ActiveLoader; +router.beforeEach(() => { + loader = $loading?.show({ + color: '#fff', + backgroundColor: '#101014', + }); +}); +router.afterEach(() => { + loader?.hide(); +}); export default router;