mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
- Added a loading background color for light and dark theme (#166)
- Changed the color of the loader from white to the primary green color of IT-Tools - Made the background of the splashscreen a slightly lighter gray to ease the difference between the loading background color of light and dark mode FIx #161
This commit is contained in:
1 parent
0462c17fc1
commit
0325b11746
4 files changed
+32
-11
No files matched your search
+26
-7
@@ -4,6 +4,7 @@ import { NGlobalStyle, NMessageProvider, NNotificationProvider, darkTheme } from
|
||||
import { darkThemeOverrides, lightThemeOverrides } from './themes';
|
||||
import { layouts } from './layouts';
|
||||
import { useStyleStore } from './stores/style.store';
|
||||
import { useAppTheme } from './ui/theme/themes';
|
||||
|
||||
const route = useRoute();
|
||||
const layout = computed(() => route?.meta?.layout ?? layouts.base);
|
||||
@@ -14,6 +15,21 @@ const themeOverrides = computed(() => (styleStore.isDarkTheme ? darkThemeOverrid
|
||||
|
||||
const { locale } = useI18n();
|
||||
|
||||
const colorPalette = useAppTheme();
|
||||
|
||||
// Create CSS custom properties for the color palette
|
||||
const cssVars = computed(() => ({
|
||||
'--loading-background-color': colorPalette.value.loading_background,
|
||||
}));
|
||||
|
||||
// Apply CSS variables to the document root
|
||||
watchEffect(() => {
|
||||
const root = document.documentElement;
|
||||
Object.entries(cssVars.value).forEach(([key, value]) => {
|
||||
root.style.setProperty(key, value);
|
||||
});
|
||||
});
|
||||
|
||||
syncRef(
|
||||
locale,
|
||||
useStorage('locale', locale),
|
||||
@@ -25,9 +41,11 @@ syncRef(
|
||||
<NGlobalStyle />
|
||||
<NMessageProvider placement="bottom">
|
||||
<NNotificationProvider placement="bottom-right">
|
||||
<component :is="layout">
|
||||
<RouterView />
|
||||
</component>
|
||||
<div>
|
||||
<component :is="layout">
|
||||
<RouterView />
|
||||
</component>
|
||||
</div>
|
||||
</NNotificationProvider>
|
||||
</NMessageProvider>
|
||||
</n-config-provider>
|
||||
@@ -51,15 +69,16 @@ html {
|
||||
}
|
||||
|
||||
body .vld-container {
|
||||
position:absolute;
|
||||
left:0;
|
||||
top:0;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: #101014;
|
||||
background-color: var(--loading-background-color);
|
||||
z-index: 9999;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
body .vld-container .vl-overlay.vl-active {
|
||||
margin-top: 15%;
|
||||
}
|
||||
|
||||
+3
-3
@@ -6,9 +6,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 { useAppTheme } from './ui/theme/themes';
|
||||
|
||||
const $loading = useLoading();
|
||||
|
||||
const toolsRoutes = tools.map(({ path, name, component, ...config }) => ({
|
||||
path,
|
||||
name,
|
||||
@@ -46,9 +46,9 @@ 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) {
|
||||
const theme = useAppTheme();
|
||||
loader = $loading?.show({
|
||||
color: '#fff',
|
||||
backgroundColor: '#292929',
|
||||
color: theme.value.primary.color,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -36,6 +36,7 @@ export const { themes: appThemes, useTheme: useAppTheme } = defineThemes({
|
||||
colorPressed: '#ab1f3f',
|
||||
colorFaded: '#d030502a',
|
||||
},
|
||||
loading_background: '#f1f5f9',
|
||||
},
|
||||
dark: {
|
||||
background: '#1e1e1e',
|
||||
@@ -72,5 +73,6 @@ export const { themes: appThemes, useTheme: useAppTheme } = defineThemes({
|
||||
colorPressed: '#e57272',
|
||||
colorFaded: '#e8808029',
|
||||
},
|
||||
loading_background: '#1c1c1c',
|
||||
},
|
||||
});
|
||||
+1
-1
@@ -108,7 +108,7 @@ export default defineConfig({
|
||||
wasm(),
|
||||
splashScreen({
|
||||
logoSrc: 'logo.svg',
|
||||
splashBg: '#292929',
|
||||
splashBg: '#383838',
|
||||
}),
|
||||
],
|
||||
base: baseUrl,
|
||||
|
||||
Reference in new issue
Block a user