feat(hud): 添加击杀信息生成器并优化页面加载体验
- 新增击杀信息生成器页面,支持CS2和CStrike两种游戏样式 - 引入字体文件用于击杀信息渲染 - 添加多种骨架屏组件(AuthSkeleton、PageSkeleton等)改善加载体验 - 更新依赖包,新增html-to-image、react-icons等库 - 优化现有组件的样式和导入路径 - 统一使用@别名导入模块
This commit is contained in:
20
web/src/components/LoadingFallback.tsx
Normal file
20
web/src/components/LoadingFallback.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { AuthSkeleton } from "./AuthSkeleton";
|
||||
import { PageSkeleton } from "./PageSkeleton";
|
||||
|
||||
export function LoadingFallback() {
|
||||
const location = useLocation();
|
||||
const path = location.pathname;
|
||||
|
||||
if (path === "/login" || path === "/register") {
|
||||
return <AuthSkeleton />;
|
||||
}
|
||||
|
||||
// For Kill Generation (DeathMsg) or other HUD tools
|
||||
if (path.startsWith("/hud") || path.startsWith("/demo")) {
|
||||
return <PageSkeleton />;
|
||||
}
|
||||
|
||||
// Default fallback (Home, About, etc.)
|
||||
return <PageSkeleton />;
|
||||
}
|
||||
Reference in New Issue
Block a user