fix: loading screen shows Forumlify on first visit + rotating tab title
- LoadingScreen: drop forumName title (default name flashed on first
visit before settings loaded); show 🌊 logo + spinner instead
- AppProvider: during init rotate document.title Loading. → Loading..
→ Loading... every second; after ready show actual forum name
- layout: initial metadata title is 'Loading...' (client takes over)
This commit is contained in:
1 parent
9880d2b0d0
commit
e79c8530e3
5 files changed
+39
-5
No files matched your search
@@ -1218,6 +1218,17 @@ svg {
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.loading-logo {
|
||||
font-size: 44px;
|
||||
line-height: 1;
|
||||
animation: float 2.4s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes float {
|
||||
0%, 100% { transform: translateY(0); }
|
||||
50% { transform: translateY(-6px); }
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
|
||||
+2
-1
@@ -3,7 +3,8 @@ import './globals.css';
|
||||
import CustomCssLoader from '@/components/CustomCssLoader';
|
||||
|
||||
export const metadata = {
|
||||
title: 'Forumlify',
|
||||
// 初始标题由客户端 AppProvider 接管(加载时轮换 Loading.,完成后显示论坛名)
|
||||
title: 'Loading...',
|
||||
description: 'Forumlify - 简洁优雅的现代社区系统',
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@ import Modals from '@/components/Modals';
|
||||
import LoadingScreen from '@/components/LoadingScreen';
|
||||
|
||||
function HomeInner() {
|
||||
const { view, currentPostId, currentUsername, currentPageName, ready, forumName } = useApp();
|
||||
const { view, currentPostId, currentUsername, currentPageName, ready } = 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 forumName={forumName} />;
|
||||
return <LoadingScreen />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user