mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
Added loading delay (#92)
Added a loading delay of 750ms to prevent the loading screen from appearing too quickly. This caused a flickering effect when a page did load quickly Added extra logic to prevent the loading screen from popping up when query parameters were changed (as some tools update query params when you change values) Made the background color of the loading screen lighter to better see the black wrench in the logo of it-tools (#101014 -> #292929) Improvements for #32 --------- Co-authored-by: ShareVB <sharevb@gmail.com>
This commit is contained in:
1 parent
1e405c3446
commit
be25e17687
3 files changed
+47
-9
No files matched your search
Vendored
+29
@@ -298,13 +298,25 @@ declare module '@vue/runtime-core' {
|
||||
MorseConverter: typeof import('./src/tools/morse-converter/morse-converter.vue')['default']
|
||||
MultiLinkDownloader: typeof import('./src/tools/multi-link-downloader/multi-link-downloader.vue')['default']
|
||||
MyIp: typeof import('./src/tools/my-ip/my-ip.vue')['default']
|
||||
NA: typeof import('naive-ui')['NA']
|
||||
NanoidGenerator: typeof import('./src/tools/nanoid-generator/nanoid-generator.vue')['default']
|
||||
NanoMemo: typeof import('./src/tools/nano-memo/nano-memo.vue')['default']
|
||||
'NanoMemo.content': typeof import('./src/tools/nano-memo/nano-memo.content.md')['default']
|
||||
NavbarButtons: typeof import('./src/components/NavbarButtons.vue')['default']
|
||||
<<<<<<< HEAD
|
||||
NButton: typeof import('naive-ui')['NButton']
|
||||
NCard: typeof import('naive-ui')['NCard']
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
NCode: typeof import('naive-ui')['NCode']
|
||||
>>>>>>> 1e405c34468067d5be1186268d190ad3c0739efa
|
||||
>>>>>>> chore/all-my-stuffs
|
||||
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']
|
||||
NginxFormatter: typeof import('./src/tools/nginx-formatter/nginx-formatter.vue')['default']
|
||||
NginxMemo: typeof import('./src/tools/nginx-memo/nginx-memo.vue')['default']
|
||||
@@ -312,13 +324,30 @@ declare module '@vue/runtime-core' {
|
||||
NH1: typeof import('naive-ui')['NH1']
|
||||
NH3: typeof import('naive-ui')['NH3']
|
||||
NIcon: typeof import('naive-ui')['NIcon']
|
||||
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']
|
||||
NMenu: typeof import('naive-ui')['NMenu']
|
||||
<<<<<<< HEAD
|
||||
NRadio: typeof import('naive-ui')['NRadio']
|
||||
NRadioGroup: typeof import('naive-ui')['NRadioGroup']
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSpace: typeof import('naive-ui')['NSpace']
|
||||
NSpin: typeof import('naive-ui')['NSpin']
|
||||
NTable: typeof import('naive-ui')['NTable']
|
||||
NTabPane: typeof import('naive-ui')['NTabPane']
|
||||
NTabs: typeof import('naive-ui')['NTabs']
|
||||
=======
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
NScrollbar: typeof import('naive-ui')['NScrollbar']
|
||||
NSpace: typeof import('naive-ui')['NSpace']
|
||||
NSwitch: typeof import('naive-ui')['NSwitch']
|
||||
>>>>>>> 1e405c34468067d5be1186268d190ad3c0739efa
|
||||
>>>>>>> chore/all-my-stuffs
|
||||
NumberInput: typeof import('./src/tools/pomodoro-timer/app/components/NumberInput.vue')['default']
|
||||
NumeronymGenerator: typeof import('./src/tools/numeronym-generator/numeronym-generator.vue')['default']
|
||||
OcrImage: typeof import('./src/tools/ocr-image/ocr-image.vue')['default']
|
||||
|
||||
+16
-7
@@ -40,15 +40,24 @@ const router = createRouter({
|
||||
{ path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
|
||||
],
|
||||
});
|
||||
let loader: ActiveLoader;
|
||||
router.beforeEach(() => {
|
||||
loader = $loading?.show({
|
||||
color: '#fff',
|
||||
backgroundColor: '#101014',
|
||||
});
|
||||
|
||||
let loader: ActiveLoader | null = null;
|
||||
|
||||
router.beforeEach((to, from) => {
|
||||
// Only show loading for actual route changes, not just query param changes
|
||||
if (to.path !== from.path) {
|
||||
loader = $loading?.show({
|
||||
color: '#fff',
|
||||
backgroundColor: '#292929',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
loader?.hide();
|
||||
if (loader) {
|
||||
loader.hide();
|
||||
loader = null;
|
||||
}
|
||||
});
|
||||
|
||||
export default router;
|
||||
+2
-2
@@ -2,7 +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 { splashScreen } from 'vite-plugin-splash-screen';
|
||||
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
@@ -108,7 +108,7 @@ export default defineConfig({
|
||||
wasm(),
|
||||
splashScreen({
|
||||
logoSrc: 'logo.svg',
|
||||
splashBg: '#101014',
|
||||
splashBg: '#292929',
|
||||
}),
|
||||
],
|
||||
base: baseUrl,
|
||||
|
||||
Reference in new issue
Block a user