feat: 新增加载动画
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>NIANXX</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta
|
||||
http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' http://8.138.234.141; connect-src 'self' http://8.138.234.141 https://api.iconify.design"
|
||||
/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="../src/renderer/views/loading/index.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
44
public/loading.html
Normal file
44
public/loading.html
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self';">
|
||||
<style>
|
||||
:root {
|
||||
--stop-color-start: #3b82f6;
|
||||
--stop-color-end: #1d4ed8;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
background-color: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<svg width="30" height="30" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient id="gradient" x1="8.042%" y1="0%" x2="65.682%" y2="23.865%">
|
||||
<stop stop-color="var(--stop-color-start)" offset="0%" />
|
||||
<stop stop-color="var(--stop-color-end)" offset="100%" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
<g transform="translate(1 1)" stroke-width="2">
|
||||
<circle stroke-opacity=".2" cx="18" cy="18" r="18" />
|
||||
<path d="M36 18c0-9.94-8.06-18-18-18" stroke="url(#gradient)">
|
||||
<animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s"
|
||||
repeatCount="indefinite" />
|
||||
</path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
public/logo.ico
Normal file
BIN
public/logo.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
@@ -172,7 +172,12 @@ class WindowService {
|
||||
width: size.width,
|
||||
height: size.height,
|
||||
});
|
||||
loadingView.webContents.loadFile(path.join(__dirname, 'loading.html'));
|
||||
|
||||
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
|
||||
loadingView.webContents.loadURL(`${MAIN_WINDOW_VITE_DEV_SERVER_URL}/loading.html`);
|
||||
} else {
|
||||
loadingView.webContents.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/loading.html`));
|
||||
}
|
||||
|
||||
const onRendererIsReady = (e: IpcMainEvent) => {
|
||||
if ((e.sender !== window?.webContents) || rendererIsReady) return;
|
||||
@@ -208,7 +213,7 @@ class WindowService {
|
||||
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
|
||||
return window.loadURL(`${MAIN_WINDOW_VITE_DEV_SERVER_URL}${'/html/' + (name === 'main' ? '' : name)}`);
|
||||
}
|
||||
window.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/html/${name === 'main' ? 'index' : name}.html`));
|
||||
window.loadFile(path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/html/${name === 'main' ? 'login' : name}.html`));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -22,12 +22,10 @@ const components: Plugin = (app) => {
|
||||
|
||||
// 创建 Vue 应用实例
|
||||
const app = createApp(App);
|
||||
const pinia = createPinia();
|
||||
|
||||
// 使用 Pinia 状态管理
|
||||
app.use(createPinia());
|
||||
|
||||
|
||||
// 使用 Vue Router
|
||||
app.use(pinia);
|
||||
app.use(router);
|
||||
app.use(ElementPlus, { locale })
|
||||
app.use(components)
|
||||
|
||||
@@ -19,7 +19,7 @@ const routes = [
|
||||
const router = createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes,
|
||||
scrollBehavior(to: any, from: any, savedPosition: any) {
|
||||
scrollBehavior(_to: any, _from: any, savedPosition: any) {
|
||||
if (savedPosition) {
|
||||
return savedPosition
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import '@renderer/styles/index.css'
|
||||
|
||||
import errorHandler from '@utils/errorHandler'
|
||||
import i18n from '@renderer/i18n'
|
||||
import HeaderBar from '@renderer/components/HeaderBar/index.vue'
|
||||
import DragRegion from '@renderer/components/DragRegion/index.vue'
|
||||
|
||||
import Loading from './index.vue'
|
||||
|
||||
createApp(Loading)
|
||||
.use(i18n)
|
||||
.use(createPinia())
|
||||
.use(errorHandler)
|
||||
.component('HeaderBar', HeaderBar)
|
||||
.component('DragRegion', DragRegion)
|
||||
.mount('#app')
|
||||
@@ -1,5 +0,0 @@
|
||||
<template></template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { resolve } from "path";
|
||||
import { defineConfig } from "vite"
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
// https://vitejs.dev/config
|
||||
export default defineConfig( async () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import { resolve } from "path";
|
||||
import { defineConfig } from 'vite'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
// https://vitejs.dev/config
|
||||
export default defineConfig({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { resolve } from "path";
|
||||
import { resolve } from "node:path";
|
||||
import { defineConfig, type CSSOptions } from "vite";
|
||||
|
||||
// https://vitejs.dev/config
|
||||
@@ -25,13 +25,11 @@ export default defineConfig(async () => {
|
||||
resolve(__dirname, 'html/index.html'),
|
||||
resolve(__dirname, 'html/dialog.html'),
|
||||
resolve(__dirname, 'html/setting.html'),
|
||||
resolve(__dirname, 'html/loading.html'),
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
resolve: {
|
||||
preserveSymlinks: true,
|
||||
alias: {
|
||||
"@renderer": resolve(__dirname, "./src/renderer"),
|
||||
"@api": resolve(__dirname, "./src/renderer/api"),
|
||||
|
||||
Reference in New Issue
Block a user