diff --git a/components.d.ts b/components.d.ts index e5683504..9923e741 100644 --- a/components.d.ts +++ b/components.d.ts @@ -304,11 +304,14 @@ declare module '@vue/runtime-core' { NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default'] NCheckbox: typeof import('naive-ui')['NCheckbox'] NCode: typeof import('naive-ui')['NCode'] + NCollapseTransition: typeof import('naive-ui')['NCollapseTransition'] + NColorPicker: typeof import('naive-ui')['NColorPicker'] 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'] + 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'] @@ -319,11 +322,30 @@ declare module '@vue/runtime-core' { 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'] + NImage: typeof import('naive-ui')['NImage'] NInputNumber: typeof import('naive-ui')['NInputNumber'] NLayout: typeof import('naive-ui')['NLayout'] NLayoutSider: typeof import('naive-ui')['NLayoutSider'] NMenu: typeof import('naive-ui')['NMenu'] NP: typeof import('naive-ui')['NP'] + NRadio: typeof import('naive-ui')['NRadio'] + NRadioGroup: typeof import('naive-ui')['NRadioGroup'] + NScrollbar: typeof import('naive-ui')['NScrollbar'] + NSelect: typeof import('naive-ui')['NSelect'] + NSlider: typeof import('naive-ui')['NSlider'] + NSpace: typeof import('naive-ui')['NSpace'] + NSpin: typeof import('naive-ui')['NSpin'] + 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'] + NP: typeof import('naive-ui')['NP'] NScrollbar: typeof import('naive-ui')['NScrollbar'] NumberInput: typeof import('./src/tools/pomodoro-timer/app/components/NumberInput.vue')['default'] NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default'] diff --git a/package.json b/package.json index 303bb42d..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", @@ -367,6 +368,7 @@ "vite": "^4.4.9", "vite-plugin-node-polyfills": "^0.23.0", "vite-plugin-pwa": "^1.0.0", + "vite-plugin-splash-screen": "^0.2.0", "vite-plugin-vue-markdown": "^0.23.5", "vite-plugin-wasm": "^3.4.1", "vite-svg-loader": "^4.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d144b7cd..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) @@ -994,6 +997,9 @@ devDependencies: vite-plugin-pwa: specifier: ^1.0.0 version: 1.0.0(vite@4.4.9)(workbox-build@7.3.0)(workbox-window@7.3.0) + vite-plugin-splash-screen: + specifier: ^0.2.0 + version: 0.2.0 vite-plugin-vue-markdown: specifier: ^0.23.5 version: 0.23.5(rollup@2.79.2)(vite@4.4.9) @@ -18210,6 +18216,10 @@ packages: - supports-color dev: true + /vite-plugin-splash-screen@0.2.0: + resolution: {integrity: sha512-PCUiVq8wjx7dHMa9vOqnB+bewKp60VFbhPJJjQOA8UdwmPdf9ChBGuxh+sku4szrnJFsriB0gIDAURAmOqBcUQ==} + dev: true + /vite-plugin-vue-markdown@0.23.5(rollup@2.79.2)(vite@4.4.9): resolution: {integrity: sha512-NXTZ4y+n691gLPWayMBbh4jldQeaqDp9e9WjWUYbn9obsLqS9qU+hr4RAruDq5kP4siTOp7JDV34Sw5eA7WxLg==} peerDependencies: @@ -18472,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/public/logo.svg b/public/logo.svg new file mode 100644 index 00000000..148d54a4 --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,117 @@ + + + + \ No newline at end of file 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 63ca5a13..1d467994 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,9 +3,11 @@ 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'; +import { hideSplashScreen } from 'vite-plugin-splash-screen/runtime'; import { plausible } from './plugins/plausible.plugin'; import 'virtual:uno.css'; @@ -24,6 +26,7 @@ registerSW(); const app = createApp(App); +app.use(LoadingPlugin); app.use(createPinia()); app.use(createHead()); app.use(i18nPlugin); @@ -34,3 +37,5 @@ app.use(shadow); app.use(store, 'pomodoro-store'); app.mount('#app'); + +hideSplashScreen(); 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; diff --git a/src/shims.d.ts b/src/shims.d.ts index ef2e2f39..e3500397 100644 --- a/src/shims.d.ts +++ b/src/shims.d.ts @@ -38,4 +38,8 @@ declare module 'pdf-signature-reader' { const verifySignature: (pdf: ArrayBuffer) => ({signatures: SignatureInfo[]}); export default verifySignature; -} \ No newline at end of file +} + +declare module 'vite-plugin-splash-screen/runtime' { + export function hideSplashScreen(); +} diff --git a/vite.config.ts b/vite.config.ts index 6876ecdc..047bff82 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,6 +2,7 @@ import { URL, fileURLToPath } from 'node:url'; import { resolve } from 'node:path'; import { nodePolyfills } from 'vite-plugin-node-polyfills'; import wasm from 'vite-plugin-wasm'; +import { splashScreen } from "vite-plugin-splash-screen"; import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; @@ -105,6 +106,10 @@ export default defineConfig({ Unocss(), nodePolyfills(), wasm(), + splashScreen({ + logoSrc: 'logo.svg', + splashBg: '#101014', + }), ], base: baseUrl, resolve: {