Skip to content

Commit c0cab5e

Browse files
committed
init project
0 parents  commit c0cab5e

39 files changed

+13004
-0
lines changed

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Nuxt dev/build outputs
2+
.output
3+
.data
4+
.nuxt
5+
.nitro
6+
.cache
7+
dist
8+
9+
# Node dependencies
10+
node_modules
11+
12+
# Logs
13+
logs
14+
*.log
15+
16+
# Misc
17+
.DS_Store
18+
.fleet
19+
.idea
20+
21+
# Local env files
22+
.env
23+
.env.*
24+
!.env.example

.vscode/global.code-snippets

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"import": {
3+
"scope": "javascript,typescript",
4+
"prefix": "im",
5+
"body": [
6+
"import { $1 } from '$2';"
7+
],
8+
"description": "Import a module"
9+
},
10+
"export-all": {
11+
"scope": "javascript,typescript",
12+
"prefix": "ex",
13+
"body": [
14+
"export * from '$2';"
15+
],
16+
"description": "Export a module"
17+
},
18+
"vue-script-setup": {
19+
"scope": "vue",
20+
"prefix": "<sc",
21+
"body": [
22+
"<script setup lang=\"ts\">",
23+
"const props = defineProps<{",
24+
" modelValue?: boolean,",
25+
"}>()",
26+
"$1",
27+
"</script>",
28+
"",
29+
"<template>",
30+
" <div>",
31+
" <slot/>",
32+
" </div>",
33+
"</template>",
34+
]
35+
},
36+
"vue-template-ref": {
37+
"scope": "javascript,typescript,vue",
38+
"prefix": "tref",
39+
"body": [
40+
"const ${1:el} = shallowRef<HTMLDivElement>()",
41+
]
42+
},
43+
"vue-computed": {
44+
"scope": "javascript,typescript,vue",
45+
"prefix": "com",
46+
"body": [
47+
"computed(() => { $1 })"
48+
]
49+
},
50+
"vue-watch-effect": {
51+
"scope": "javascript,typescript,vue",
52+
"prefix": "watchE",
53+
"body": [
54+
"watchEffect(() => {",
55+
" $1",
56+
"})"
57+
]
58+
},
59+
"if-vitest": {
60+
"scope": "javascript,typescript",
61+
"prefix": "ifv",
62+
"body": [
63+
"if (import.meta.vitest) {",
64+
" const { describe, it, expect } = import.meta.vitest",
65+
" ${1}",
66+
"}"
67+
]
68+
},
69+
"markdown-api-table": {
70+
"scope": "markdown",
71+
"prefix": "table",
72+
"body": [
73+
"<table>",
74+
"<tr>",
75+
"<td width=\"400px\" valign=\"top\">",
76+
"",
77+
"### API",
78+
"",
79+
"Description",
80+
"",
81+
"</td>",
82+
"<td width=\"600px\"><br>",
83+
"",
84+
"```ts",
85+
"// code block",
86+
"```",
87+
"",
88+
"</td>",
89+
"</tr>",
90+
"</table>",
91+
],
92+
}
93+
}

.vscode/settings.json

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
// Disable the default formatter, use eslint instead
3+
"prettier.enable": false,
4+
"editor.formatOnSave": false,
5+
6+
// Auto fix
7+
"editor.codeActionsOnSave": {
8+
"source.fixAll.eslint": "explicit",
9+
"source.organizeImports": "never"
10+
},
11+
12+
// Silent the stylistic rules in you IDE, but still auto fix them
13+
"eslint.rules.customizations": [
14+
{ "rule": "style/*", "severity": "off" },
15+
{ "rule": "*-indent", "severity": "off" },
16+
{ "rule": "*-spacing", "severity": "off" },
17+
{ "rule": "*-spaces", "severity": "off" },
18+
{ "rule": "*-order", "severity": "off" },
19+
{ "rule": "*-dangle", "severity": "off" },
20+
{ "rule": "*-newline", "severity": "off" },
21+
{ "rule": "*quotes", "severity": "off" },
22+
{ "rule": "*semi", "severity": "off" }
23+
],
24+
25+
// Enable eslint for all supported languages
26+
"eslint.validate": [
27+
"javascript",
28+
"javascriptreact",
29+
"typescript",
30+
"typescriptreact",
31+
"vue",
32+
"html",
33+
"markdown",
34+
"json",
35+
"jsonc",
36+
"yaml"
37+
],
38+
"interline-translate.knownPopularWordCount": 6000,
39+
"iconify.annotations": true,
40+
"iconify.inplace": true,
41+
42+
"files.associations": {
43+
"*.css": "tailwindcss"
44+
},
45+
"editor.quickSuggestions": {
46+
"strings": true
47+
},
48+
49+
"tailwindCSS.experimental.configFile": "tailwind.config.ts",
50+
"tailwindCSS.experimental.classRegex": [
51+
["ui:\\s*{([^)]*)\\s*}", "[\"'`]([^\"'`]*).*?[\"'`]"],
52+
["/\\*\\s?ui\\s?\\*/\\s*{([^;]*)}", ":\\s*[\"'`]([^\"'`]*).*?[\"'`]"]
53+
],
54+
"tailwindCSS.classAttributes": [
55+
"class",
56+
"className",
57+
"ngClass",
58+
"ui"
59+
]
60+
}

README.md

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Manga Wiki
2+
3+
Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more.
4+
5+
## Setup
6+
7+
Make sure to install the dependencies:
8+
9+
```bash
10+
# npm
11+
npm install
12+
13+
# pnpm
14+
pnpm install
15+
16+
# yarn
17+
yarn install
18+
19+
# bun
20+
bun install
21+
```
22+
23+
## Development Server
24+
25+
Start the development server on `http://localhost:3000`:
26+
27+
```bash
28+
# npm
29+
npm run dev
30+
31+
# pnpm
32+
pnpm run dev
33+
34+
# yarn
35+
yarn dev
36+
37+
# bun
38+
bun run dev
39+
```
40+
41+
## Production
42+
43+
Build the application for production:
44+
45+
```bash
46+
# npm
47+
npm run build
48+
49+
# pnpm
50+
pnpm run build
51+
52+
# yarn
53+
yarn build
54+
55+
# bun
56+
bun run build
57+
```
58+
59+
Locally preview production build:
60+
61+
```bash
62+
# npm
63+
npm run preview
64+
65+
# pnpm
66+
pnpm run preview
67+
68+
# yarn
69+
yarn preview
70+
71+
# bun
72+
bun run preview
73+
```
74+
75+
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

app/app.config.ts

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default defineAppConfig({
2+
ui: {
3+
primary: 'green',
4+
gray: 'slate',
5+
},
6+
})

app/app.vue

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<template>
2+
<div>
3+
<!-- 进度条 -->
4+
<NuxtLoadingIndicator />
5+
6+
<!-- 布局 -->
7+
<NuxtLayout>
8+
<!-- 路由 -->
9+
<NuxtPage />
10+
</NuxtLayout>
11+
12+
<!-- 通知 -->
13+
<UNotifications />
14+
<!-- 模态窗 -->
15+
<UModals />
16+
</div>
17+
</template>

app/components/H1.vue

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script setup lang="ts">
2+
import type { VNodeChild } from 'vue'
3+
4+
const { label } = defineProps<{
5+
label?: number | string
6+
}>()
7+
const slots = defineSlots<{
8+
default?: () => VNodeChild
9+
}>()
10+
</script>
11+
12+
<template>
13+
<h1 class="text-gray-900 dark:text-white text-2xl font-bold truncate">
14+
<slot v-if="slots.default" />
15+
<template v-else>
16+
{{ label }}
17+
</template>
18+
</h1>
19+
</template>

app/components/H2.vue

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<script setup lang="ts">
2+
import type { VNodeChild } from 'vue'
3+
4+
const { label } = defineProps<{
5+
label?: number | string
6+
}>()
7+
const slots = defineSlots<{
8+
default?: () => VNodeChild
9+
}>()
10+
</script>
11+
12+
<template>
13+
<h2 class="text-gray-900 dark:text-white text-xl font-bold truncate">
14+
<slot v-if="slots.default" />
15+
<template v-else>
16+
{{ label }}
17+
</template>
18+
</h2>
19+
</template>

app/components/PageCharacterList.vue

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<script lang="ts" setup>
2+
const { title, data, size, to, slice } = defineProps<{
3+
title: number | string
4+
data: any
5+
size?: 'large'
6+
to?: string
7+
slice?: boolean
8+
}>()
9+
10+
const count = 10
11+
const slicedData = computed<any[]>(() => slice ? useSlice(data, 0, count) : data)
12+
</script>
13+
14+
<template>
15+
<div
16+
v-if="data.length"
17+
class="flex flex-col gap-4"
18+
>
19+
<div class="flex justify-between items-center">
20+
<H2 :label="title" />
21+
<ULink
22+
v-if="slice && data.length > count"
23+
:to
24+
class="flex items-center text-sm hover:text-primary-500 hover:dark:text-primary-400"
25+
>
26+
<span>更多{{ title }}</span>
27+
<UIcon name="i-icon-park-outline-right" />
28+
</ULink>
29+
</div>
30+
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-4">
31+
<ULink
32+
v-for="item in slicedData"
33+
:key="item.id"
34+
:to="item.to"
35+
class="flex group"
36+
>
37+
<div class="flex-shrink-0">
38+
<img
39+
loading="lazy"
40+
:src="item.covers.small"
41+
:alt="item.name || '未知'"
42+
:class="size === 'large' && 'w-[80px] h-[80px]'"
43+
class="rounded-md object-contain bg-gray-100 w-[60px] h-[60px] border border-gray-200 dark:border-gray-800"
44+
>
45+
</div>
46+
<div class="flex flex-col justify-between ml-2 min-w-0">
47+
<div class="font-medium truncate group-hover:text-primary-500 group-hover:dark:text-primary-400">
48+
{{ item.name }}
49+
</div>
50+
<UBadge
51+
:label="item.relation"
52+
color="gray"
53+
class="w-max"
54+
/>
55+
</div>
56+
</ULink>
57+
</div>
58+
</div>
59+
</template>

0 commit comments

Comments
 (0)