diff --git a/napcat.webui/.gitignore b/napcat.webui/.gitignore new file mode 100644 index 00000000..a547bf36 --- /dev/null +++ b/napcat.webui/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/napcat.webui/.vscode/extensions.json b/napcat.webui/.vscode/extensions.json new file mode 100644 index 00000000..a7cea0b0 --- /dev/null +++ b/napcat.webui/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +} diff --git a/napcat.webui/README.md b/napcat.webui/README.md new file mode 100644 index 00000000..33895ab2 --- /dev/null +++ b/napcat.webui/README.md @@ -0,0 +1,5 @@ +# Vue 3 + TypeScript + Vite + +This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 ` + + diff --git a/napcat.webui/package.json b/napcat.webui/package.json new file mode 100644 index 00000000..b57951d1 --- /dev/null +++ b/napcat.webui/package.json @@ -0,0 +1,21 @@ +{ + "name": "napcat.webui", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vue-tsc -b && vite build", + "preview": "vite preview" + }, + "dependencies": { + "tdesign-vue-next": "^1.10.3", + "vue": "^3.5.12" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^5.1.4", + "typescript": "~5.6.2", + "vite": "^5.4.10", + "vue-tsc": "^2.1.8" + } +} diff --git a/napcat.webui/public/logo.png b/napcat.webui/public/logo.png new file mode 100644 index 00000000..0eef6b84 Binary files /dev/null and b/napcat.webui/public/logo.png differ diff --git a/napcat.webui/public/vite.svg b/napcat.webui/public/vite.svg new file mode 100644 index 00000000..e7b8dfb1 --- /dev/null +++ b/napcat.webui/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/napcat.webui/src/App.vue b/napcat.webui/src/App.vue new file mode 100644 index 00000000..033318a9 --- /dev/null +++ b/napcat.webui/src/App.vue @@ -0,0 +1,96 @@ + + + + + \ No newline at end of file diff --git a/napcat.webui/src/assets/logo.png b/napcat.webui/src/assets/logo.png new file mode 100644 index 00000000..0eef6b84 Binary files /dev/null and b/napcat.webui/src/assets/logo.png differ diff --git a/napcat.webui/src/assets/vue.svg b/napcat.webui/src/assets/vue.svg new file mode 100644 index 00000000..770e9d33 --- /dev/null +++ b/napcat.webui/src/assets/vue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/napcat.webui/src/components/HelloWorld.vue b/napcat.webui/src/components/HelloWorld.vue new file mode 100644 index 00000000..b58e52b9 --- /dev/null +++ b/napcat.webui/src/components/HelloWorld.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/napcat.webui/src/main.ts b/napcat.webui/src/main.ts new file mode 100644 index 00000000..91b995ec --- /dev/null +++ b/napcat.webui/src/main.ts @@ -0,0 +1,12 @@ +import { createApp } from 'vue' +import './style.css' +import App from './App.vue' +import { Button as TButton, Input as TInput, Form as TForm, FormItem as TFormItem } from 'tdesign-vue-next'; + +const app = createApp(App); +app.use(TButton); +app.use(TInput); +app.use(TForm); +app.use(TFormItem); + +app.mount('#app'); \ No newline at end of file diff --git a/napcat.webui/src/style.css b/napcat.webui/src/style.css new file mode 100644 index 00000000..1f25ad19 --- /dev/null +++ b/napcat.webui/src/style.css @@ -0,0 +1,107 @@ +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} + +a:hover { + color: #535bf2; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} + +button:hover { + border-color: #646cff; +} + +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +.card { + padding: 2em; +} + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + + a:hover { + color: #747bff; + } + + button { + background-color: #f9f9f9; + } +} + + +/* 竖排展示 demo 行间距 16px */ +.tdesign-demo-block-column { + display: flex; + flex-direction: column; + row-gap: 16px; +} + +/* 竖排展示 demo 行间距 32px */ +.tdesign-demo-block-column-large { + display: flex; + flex-direction: column; + row-gap: 32px; +} + +/* 横排排展示 demo 列间距 16px */ +.tdesign-demo-block-row { + display: flex; + column-gap: 16px; + align-items: center; +} + diff --git a/napcat.webui/src/vite-env.d.ts b/napcat.webui/src/vite-env.d.ts new file mode 100644 index 00000000..11f02fe2 --- /dev/null +++ b/napcat.webui/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/napcat.webui/tsconfig.app.json b/napcat.webui/tsconfig.app.json new file mode 100644 index 00000000..cb88a5a6 --- /dev/null +++ b/napcat.webui/tsconfig.app.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + "jsx": "preserve", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/napcat.webui/tsconfig.json b/napcat.webui/tsconfig.json new file mode 100644 index 00000000..1ffef600 --- /dev/null +++ b/napcat.webui/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/napcat.webui/tsconfig.node.json b/napcat.webui/tsconfig.node.json new file mode 100644 index 00000000..abcd7f0d --- /dev/null +++ b/napcat.webui/tsconfig.node.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "ES2022", + "lib": ["ES2023"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "isolatedModules": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/napcat.webui/vite.config.ts b/napcat.webui/vite.config.ts new file mode 100644 index 00000000..bbcf80cc --- /dev/null +++ b/napcat.webui/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [vue()], +})