diff --git a/public/icons/logo.png b/public/icons/logo.png new file mode 100644 index 0000000..952440b Binary files /dev/null and b/public/icons/logo.png differ diff --git a/src/app/App.tsx b/src/app/App.tsx index 55626f3..76bdea8 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -1,11 +1,14 @@ -import { lazy } from "react"; +import { Loading } from "@/components/Loading"; +import { lazy, Suspense } from "react"; const MainArea = lazy(() => import("@/app/MainArea/index")); function App() { return (
- + }> + +
); } diff --git a/src/components/Loading/index.css b/src/components/Loading/index.css new file mode 100644 index 0000000..d822f57 --- /dev/null +++ b/src/components/Loading/index.css @@ -0,0 +1,26 @@ +.custom-animation { + height: calc(100% - 12px); + will-change: width; + animation: moveBackAndForth 2s infinite linear; +} + +@keyframes moveBackAndForth { + 0% { + transform: translateX(0); + } + 25% { + width: calc(40%); + transform: translateX(calc(50% - 12px)); + } + 50% { + width: calc(20%); + transform: translateX(calc(400% - 12px)); + } + 75% { + width: calc(40%); + transform: translateX(calc(50% - 12px)); + } + 100% { + transform: translateX(0); + } +} \ No newline at end of file diff --git a/src/components/Loading/index.tsx b/src/components/Loading/index.tsx new file mode 100644 index 0000000..dfd9df1 --- /dev/null +++ b/src/components/Loading/index.tsx @@ -0,0 +1,15 @@ +import "./index.css"; +import LogoSvg from "/icons/logo.png"; + +export const Loading = () => { + return ( +
+
+
+
+ +
+
+
+ ); +}; diff --git a/src/hooks/useAudioTest.ts b/src/hooks/useAudioTest.ts deleted file mode 100644 index adda35b..0000000 --- a/src/hooks/useAudioTest.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { useEffect, useRef } from 'react'; - -export function useTtsPlayer() { - const audioRef = useRef(null); - - // 第一次挂载时,创建一个隐藏的