diff --git a/.oxlintrc.json b/.oxlintrc.json index ed1ef5b..8676ed9 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -10,7 +10,9 @@ "vitest" ], "categories": {}, - "rules": {}, + "rules": { + "no-unused-vars": "error" + }, "settings": { "jsdoc": { "ignorePrivate": false, diff --git a/.vscode/settings.json b/.vscode/settings.json index f563e1a..762595d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,9 @@ { "editor.defaultFormatter": "oxc.oxc-vscode", "editor.formatOnSave": true, - // "editor.codeActionsOnSave": { - // "source.fixAll.oxc": "always" - // }, + "editor.codeActionsOnSave": { + "source.fixAll.oxc": "always" + }, "typescript.tsdk": "node_modules\\typescript\\lib", "[typescript]": { "editor.defaultFormatter": "oxc.oxc-vscode" diff --git a/app/app.config.ts b/app/app.config.ts index 32aa854..323d793 100644 --- a/app/app.config.ts +++ b/app/app.config.ts @@ -1,14 +1,28 @@ export default defineAppConfig({ ui: { - primary: 'indigo', - gray: 'neutral', strategy: 'merge', + colors: { + primary: 'indigo', + neutral: 'neutral', + success: 'emerald', + warning: 'amber', + }, + icons: { + loading: 'svg-spinners-180-ring', + }, button: { - icon: { - loading: 'animate-none', + slots: { + leadingIcon: 'animate-none', }, - default: { - loadingIcon: 'i-svg-spinners-180-ring-with-bg', + }, + input: { + slots: { + root: 'w-full', + }, + }, + textarea: { + slots: { + root: 'w-full', }, }, notifications: { diff --git a/app/app.vue b/app/app.vue index 1186dc7..8f3c52f 100644 --- a/app/app.vue +++ b/app/app.vue @@ -4,7 +4,7 @@ import ModalAuthentication from '~/components/ModalAuthentication.vue' const toast = useToast() const route = useRoute() const router = useRouter() -const modal = useModal() +const overlay = useOverlay() const loginState = useLoginState() useHead({ @@ -24,10 +24,11 @@ onMounted(() => { toast.add({ title: '登录失效', description: '登录已过期,请重新登录', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) - modal.open(ModalAuthentication) + const modal = overlay.create(ModalAuthentication) + modal.open() } else if (!loggedIn && !loginState.token) { // Prevents redirect from register page if (route.path === '/user/register') return @@ -41,12 +42,10 @@ onMounted(() => {
- - - - - - - + + + + +
diff --git a/app/assets/css/main.css b/app/assets/css/main.css new file mode 100644 index 0000000..d450cb7 --- /dev/null +++ b/app/assets/css/main.css @@ -0,0 +1,33 @@ +@import 'tailwindcss'; +@import '@nuxt/ui'; + +@config '../../../tailwind.config.ts'; + +@source inline("{hover:,}{bg,text,border,from,to}-{primary,neutral,amber}{-{50,{100..900..100},950},}{/{0..100..5},}"); + +/* + The default border color has changed to `currentcolor` in Tailwind CSS v4, + so we've added these compatibility styles to make sure everything still + looks the same as it did with Tailwind CSS v3. + + If we ever want to remove these styles, we need to add an explicit border + color utility to any element that depends on these defaults. +*/ +@layer base { + *, + ::after, + ::before, + ::backdrop, + ::file-selector-button { + border-color: var(--color-gray-200, currentcolor); + } +} + +@layer base { + html { + box-sizing: border-box; + } +} + +@layer theme { +} diff --git a/app/assets/css/tailwind.css b/app/assets/css/tailwind.css deleted file mode 100644 index 0f90bc1..0000000 --- a/app/assets/css/tailwind.css +++ /dev/null @@ -1,9 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer base { - html { - box-sizing: border-box; - } -} diff --git a/app/components/BubbleTitle.vue b/app/components/BubbleTitle.vue index 648c983..d6286ae 100644 --- a/app/components/BubbleTitle.vue +++ b/app/components/BubbleTitle.vue @@ -14,7 +14,7 @@ const props = defineProps({ }, bubbleColor: { type: String, - default: 'primary-500', + default: 'primary', }, }) @@ -30,7 +30,7 @@ const props = defineProps({

{{ title }}

@@ -43,7 +43,7 @@ const props = defineProps({
diff --git a/app/components/DatePicker.vue b/app/components/DatePicker.vue index 6675b50..814816b 100644 --- a/app/components/DatePicker.vue +++ b/app/components/DatePicker.vue @@ -1,11 +1,10 @@ diff --git a/app/components/SlideCreateCourseGreen.vue b/app/components/SlideCreateCourseGreen.vue index d03dced..050a583 100644 --- a/app/components/SlideCreateCourseGreen.vue +++ b/app/components/SlideCreateCourseGreen.vue @@ -4,9 +4,7 @@ import ModalDigitalHumanSelect from '~/components/ModalDigitalHumanSelect.vue' import type { FormSubmitEvent } from '#ui/types' import { useFetchWrapped } from '~/composables/useFetchWrapped' -const emit = defineEmits(['success']) - -const slide = useSlideover() +const emit = defineEmits(['success', 'close']) const toast = useToast() const loginState = useLoginState() @@ -100,16 +98,16 @@ const onCreateCourseGreenSubmit = async ( toast.add({ title: '创建成功', description: '视频已加入生成队列', - color: 'green', + color: 'success', icon: 'i-tabler-check', }) emit('success') - slide.close() + emit('close') } else { toast.add({ title: '创建失败', description: res.msg || '未知错误', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) } @@ -120,7 +118,7 @@ const onCreateCourseGreenSubmit = async ( toast.add({ title: '创建失败', description: e.message || '未知错误', - color: 'red', + color: 'error', icon: 'i-tabler-alert-triangle', }) }) @@ -128,174 +126,174 @@ const onCreateCourseGreenSubmit = async ( diff --git a/app/components/aigc/RatioSelector.vue b/app/components/aigc/RatioSelector.vue index 8370ed2..ff079a9 100644 --- a/app/components/aigc/RatioSelector.vue +++ b/app/components/aigc/RatioSelector.vue @@ -68,7 +68,7 @@ const getShapeSize = (r: { w: number; h: number }, size: number) => { :class="[ratio.value === selected && 'bg-sky-200/50 dark:bg-sky-700/50']" >
{