From 71519301e47a49e8461978d8286beb83f275543c Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 15 Jun 2026 03:01:39 +0800 Subject: [PATCH] fix: improve meteor effects and fix document management add functionality --- .../src/features/doc-categories/index.tsx | 10 ++++--- .../src/features/docs-management/index.tsx | 8 ++++-- web/default/src/features/docs/index.tsx | 22 +++++++++++----- .../home/components/sections/hero.tsx | 26 ++++++++++++------- web/default/src/features/pricing/index.tsx | 22 +++++++++++----- 5 files changed, 62 insertions(+), 26 deletions(-) diff --git a/web/default/src/features/doc-categories/index.tsx b/web/default/src/features/doc-categories/index.tsx index 4652053c8..be2b3402c 100644 --- a/web/default/src/features/doc-categories/index.tsx +++ b/web/default/src/features/doc-categories/index.tsx @@ -76,14 +76,18 @@ export function DocCategories() { try { const payload = { name: form.name, - slug: form.slug || form.name.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9-]/g, ''), + slug: form.slug || form.name.toLowerCase().replace(/\s+/g, '-').replace(/[^a-z0-9\u4e00-\u9fff-]/g, ''), parent_id: form.parent_id ? parseInt(form.parent_id) : null, sort_order: form.sort_order, } + let res if (editingCategory) { - await api.put(`/api/admin/docs/categories/${editingCategory.id}`, payload) + res = await api.put(`/api/admin/docs/categories/${editingCategory.id}`, payload) } else { - await api.post('/api/admin/docs/categories', payload) + res = await api.post('/api/admin/docs/categories', payload) + } + if (res.data?.success === false) { + return } setDialogOpen(false) fetchCategories() diff --git a/web/default/src/features/docs-management/index.tsx b/web/default/src/features/docs-management/index.tsx index 1abd209e2..126993739 100644 --- a/web/default/src/features/docs-management/index.tsx +++ b/web/default/src/features/docs-management/index.tsx @@ -113,10 +113,14 @@ export function DocsManagement() { visibility: form.visibility, sort_order: form.sort_order, } + let res if (editingDoc) { - await api.put(`/api/admin/docs/${editingDoc.id}`, payload) + res = await api.put(`/api/admin/docs/${editingDoc.id}`, payload) } else { - await api.post('/api/admin/docs/', payload) + res = await api.post('/api/admin/docs/', payload) + } + if (res.data?.success === false) { + return } setDialogOpen(false) fetchData() diff --git a/web/default/src/features/docs/index.tsx b/web/default/src/features/docs/index.tsx index d5a4f24ce..1fb43bf41 100644 --- a/web/default/src/features/docs/index.tsx +++ b/web/default/src/features/docs/index.tsx @@ -279,6 +279,11 @@ export function Docs() {
+
+
+
+
+
@@ -504,16 +509,21 @@ export function Docs() { .dark .meteor::after { background: linear-gradient(to bottom, oklch(0.78 0.15 210 / 0.7) 0%, oklch(0.78 0.15 210 / 0.35) 15%, oklch(0.78 0.15 210 / 0.1) 50%, transparent 100%); } - .meteor-1 { left: 15%; top: -2%; animation-duration: 1.8s; animation-delay: 3s; } - .meteor-2 { left: 50%; top: -2%; animation-duration: 1.6s; animation-delay: 10s; } - .meteor-3 { left: 80%; top: -2%; animation-duration: 2.0s; animation-delay: 18s; } + .meteor-1 { left: 5%; top: -2%; animation-duration: 2.0s; animation-delay: 1s; } + .meteor-2 { left: 20%; top: -2%; animation-duration: 1.7s; animation-delay: 5s; } + .meteor-3 { left: 38%; top: -2%; animation-duration: 2.2s; animation-delay: 9s; } + .meteor-4 { left: 52%; top: -2%; animation-duration: 1.8s; animation-delay: 13s; } + .meteor-5 { left: 65%; top: -2%; animation-duration: 2.1s; animation-delay: 17s; } + .meteor-6 { left: 78%; top: -2%; animation-duration: 1.6s; animation-delay: 21s; } + .meteor-7 { left: 88%; top: -2%; animation-duration: 1.9s; animation-delay: 25s; } + .meteor-8 { left: 95%; top: -2%; animation-duration: 2.3s; animation-delay: 29s; } @keyframes meteor-fall { 0% { height: 0; opacity: 0; transform: translateY(0) translateX(0) rotate(220deg); } 8% { opacity: 1; } - 20% { height: 100px; opacity: 0.9; } - 50% { height: 160px; opacity: 0.5; } + 20% { height: 120px; opacity: 0.9; } + 50% { height: 180px; opacity: 0.5; } 80% { height: 60px; opacity: 0.15; } - 100% { height: 0; opacity: 0; transform: translateY(700px) translateX(-200px) rotate(220deg); } + 100% { height: 0; opacity: 0; transform: translateY(800px) translateX(-120px) rotate(220deg); } } @media (prefers-reduced-motion: reduce) { .nebula-cloud, .meteor { animation: none !important; opacity: 0 !important; } diff --git a/web/default/src/features/home/components/sections/hero.tsx b/web/default/src/features/home/components/sections/hero.tsx index 50ed28b4c..fb6dd6b8b 100644 --- a/web/default/src/features/home/components/sections/hero.tsx +++ b/web/default/src/features/home/components/sections/hero.tsx @@ -175,6 +175,10 @@ export function Hero(props: HeroProps) {
+
+
+
+
{/* Section navigation dots (desktop only) */} @@ -469,12 +473,16 @@ export function Hero(props: HeroProps) { transparent 100% ); } - .meteor-1 { left: 8%; top: -2%; animation-duration: 1.8s; animation-delay: 1s; } - .meteor-2 { left: 30%; top: -2%; animation-duration: 1.5s; animation-delay: 5s; } - .meteor-3 { left: 52%; top: -2%; animation-duration: 2.0s; animation-delay: 9s; } - .meteor-4 { left: 75%; top: -2%; animation-duration: 1.6s; animation-delay: 14s; } - .meteor-5 { left: 20%; top: -2%; animation-duration: 1.9s; animation-delay: 19s; } - .meteor-6 { left: 65%; top: -2%; animation-duration: 1.7s; animation-delay: 24s; } + .meteor-1 { left: 5%; top: -2%; animation-duration: 2.0s; animation-delay: 0s; } + .meteor-2 { left: 15%; top: -2%; animation-duration: 1.7s; animation-delay: 3s; } + .meteor-3 { left: 25%; top: -2%; animation-duration: 2.2s; animation-delay: 6s; } + .meteor-4 { left: 35%; top: -2%; animation-duration: 1.8s; animation-delay: 9s; } + .meteor-5 { left: 48%; top: -2%; animation-duration: 2.1s; animation-delay: 12s; } + .meteor-6 { left: 58%; top: -2%; animation-duration: 1.6s; animation-delay: 15s; } + .meteor-7 { left: 68%; top: -2%; animation-duration: 1.9s; animation-delay: 18s; } + .meteor-8 { left: 78%; top: -2%; animation-duration: 2.3s; animation-delay: 21s; } + .meteor-9 { left: 88%; top: -2%; animation-duration: 1.7s; animation-delay: 24s; } + .meteor-10 { left: 95%; top: -2%; animation-duration: 2.0s; animation-delay: 27s; } @keyframes meteor-fall { 0% { height: 0; @@ -485,11 +493,11 @@ export function Hero(props: HeroProps) { opacity: 1; } 20% { - height: 100px; + height: 120px; opacity: 0.9; } 50% { - height: 160px; + height: 180px; opacity: 0.5; } 80% { @@ -499,7 +507,7 @@ export function Hero(props: HeroProps) { 100% { height: 0; opacity: 0; - transform: translateY(700px) translateX(-200px) rotate(220deg); + transform: translateY(800px) translateX(-120px) rotate(220deg); } } diff --git a/web/default/src/features/pricing/index.tsx b/web/default/src/features/pricing/index.tsx index f7ba17169..20a897439 100644 --- a/web/default/src/features/pricing/index.tsx +++ b/web/default/src/features/pricing/index.tsx @@ -197,6 +197,11 @@ export function Pricing() {
+
+
+
+
+
@@ -388,16 +393,21 @@ export function Pricing() { .dark .meteor::after { background: linear-gradient(to bottom, oklch(0.78 0.15 210 / 0.7) 0%, oklch(0.78 0.15 210 / 0.35) 15%, oklch(0.78 0.15 210 / 0.1) 50%, transparent 100%); } - .meteor-1 { left: 15%; top: -2%; animation-duration: 1.8s; animation-delay: 2s; } - .meteor-2 { left: 50%; top: -2%; animation-duration: 1.6s; animation-delay: 9s; } - .meteor-3 { left: 80%; top: -2%; animation-duration: 2.0s; animation-delay: 16s; } + .meteor-1 { left: 5%; top: -2%; animation-duration: 2.0s; animation-delay: 0s; } + .meteor-2 { left: 20%; top: -2%; animation-duration: 1.7s; animation-delay: 4s; } + .meteor-3 { left: 38%; top: -2%; animation-duration: 2.2s; animation-delay: 8s; } + .meteor-4 { left: 52%; top: -2%; animation-duration: 1.8s; animation-delay: 12s; } + .meteor-5 { left: 65%; top: -2%; animation-duration: 2.1s; animation-delay: 16s; } + .meteor-6 { left: 78%; top: -2%; animation-duration: 1.6s; animation-delay: 20s; } + .meteor-7 { left: 88%; top: -2%; animation-duration: 1.9s; animation-delay: 24s; } + .meteor-8 { left: 95%; top: -2%; animation-duration: 2.3s; animation-delay: 28s; } @keyframes meteor-fall { 0% { height: 0; opacity: 0; transform: translateY(0) translateX(0) rotate(220deg); } 8% { opacity: 1; } - 20% { height: 100px; opacity: 0.9; } - 50% { height: 160px; opacity: 0.5; } + 20% { height: 120px; opacity: 0.9; } + 50% { height: 180px; opacity: 0.5; } 80% { height: 60px; opacity: 0.15; } - 100% { height: 0; opacity: 0; transform: translateY(700px) translateX(-200px) rotate(220deg); } + 100% { height: 0; opacity: 0; transform: translateY(800px) translateX(-120px) rotate(220deg); } } @media (prefers-reduced-motion: reduce) { .nebula-cloud, .meteor { animation: none !important; opacity: 0 !important; }