fix: loading page logo/name flash, settings name flash, post card radius
- LoadingScreen: remove 🌊 logo; show forum name only after server
responds (fades in place), delayed 650ms before switching to home
- AppProvider: new forumNameLoaded flag; title rotation already handled
- settings API: always returns forum_name (inserts default if missing)
- AdminForumSettings: name input starts empty, fills after fetch
- PostDetail: add id=pagePost so #pagePost .post-detail-card styles
apply (border-radius/shadow were missing)
This commit is contained in:
1 parent
e79c8530e3
commit
34c06c206c
7 files changed
+34
-20
No files matched your search
@@ -7,9 +7,16 @@ export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
// 确保 forum_name 始终存在(未设置过则初始化默认值),前端拿到后显示
|
||||
await pool.query(
|
||||
`INSERT INTO settings (key, value) VALUES ('forum_name', 'Forumlify')
|
||||
ON CONFLICT (key) DO NOTHING`
|
||||
);
|
||||
const r = await pool.query('SELECT key, value FROM settings');
|
||||
const settings = {};
|
||||
r.rows.forEach((row) => { settings[row.key] = row.value; });
|
||||
// 兜底:即使插入失败也保证返回 forum_name
|
||||
if (!settings.forum_name) settings.forum_name = 'Forumlify';
|
||||
return Response.json(settings);
|
||||
} catch {
|
||||
return Response.json({ error: '服务器错误' }, { status: 500 });
|
||||
|
||||
+6
-7
@@ -1218,15 +1218,14 @@ svg {
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.loading-logo {
|
||||
font-size: 44px;
|
||||
line-height: 1;
|
||||
animation: float 2.4s ease-in-out infinite;
|
||||
/* 论坛名收到后淡入出现 */
|
||||
.loading-title-appear {
|
||||
animation: titleFadeIn 0.6s ease-out;
|
||||
}
|
||||
|
||||
@keyframes float {
|
||||
0%, 100% { transform: translateY(0); }
|
||||
50% { transform: translateY(-6px); }
|
||||
@keyframes titleFadeIn {
|
||||
from { opacity: 0; transform: translateY(4px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ import Modals from '@/components/Modals';
|
||||
import LoadingScreen from '@/components/LoadingScreen';
|
||||
|
||||
function HomeInner() {
|
||||
const { view, currentPostId, currentUsername, currentPageName, ready } = useApp();
|
||||
const { view, currentPostId, currentUsername, currentPageName, ready, forumName, forumNameLoaded } = useApp();
|
||||
const [modal, setModal] = useState(null); // null | login | register | report
|
||||
const [reportPostId, setReportPostId] = useState(null);
|
||||
|
||||
@@ -27,7 +27,7 @@ function HomeInner() {
|
||||
|
||||
// 初始化未完成:显示全屏加载页,避免未加载完的界面闪烁
|
||||
if (!ready) {
|
||||
return <LoadingScreen />;
|
||||
return <LoadingScreen forumName={forumName} forumNameLoaded={forumNameLoaded} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user