Revert "feat(loading): slow down teaser typing speed to 65ms and change fallback text to " 请等待\"

This reverts commit 05d9060dc2.
This commit is contained in:
DESKTOP-I1T6TF3\Q
2026-06-04 15:13:03 +08:00
parent a1f3750b6f
commit 589bb31416
+5 -6
View File
@@ -35,11 +35,11 @@ const AUDIO_WAIT_TIMEOUT_MS = 2500;
function useTypewriter(
text: string,
resetKey: string,
opts: { targetDurationMs?: number; waitForAudio: boolean; defaultCharMs?: number } = {
opts: { targetDurationMs?: number; waitForAudio: boolean } = {
waitForAudio: false,
},
): { shown: string; done: boolean; skip: () => void } {
const { targetDurationMs, waitForAudio, defaultCharMs } = opts;
const { targetDurationMs, waitForAudio } = opts;
const [displayed, setDisplayed] = useState("");
const [prevKey, setPrevKey] = useState(resetKey);
const timer = useRef<ReturnType<typeof setInterval> | null>(null);
@@ -71,7 +71,7 @@ function useTypewriter(
const speed =
targetDurationMs && text.length > 0
? Math.max(MIN_CHAR_MS, targetDurationMs / text.length)
: (defaultCharMs ?? DEFAULT_CHAR_MS);
: DEFAULT_CHAR_MS;
let i = 0;
timer.current = setInterval(() => {
@@ -86,7 +86,7 @@ function useTypewriter(
if (timer.current) clearInterval(timer.current);
timer.current = null;
};
}, [resetKey, text, targetDurationMs, waitForAudio, defaultCharMs]);
}, [resetKey, text, targetDurationMs, waitForAudio]);
const skip = useCallback(() => {
if (timer.current) {
@@ -211,7 +211,6 @@ export function PlayCanvas({
const { shown: typedTeaser, done: teaserDone } = useTypewriter(teaserText ?? "", "teaser_reset", {
waitForAudio: false,
defaultCharMs: 65,
});
const [pulseActive, setPulseActive] = useState(false);
@@ -527,7 +526,7 @@ export function PlayCanvas({
<div className="flex flex-col items-center justify-center gap-4">
<div className="w-1.5 h-1.5 bg-clay-500 rounded-full animate-slow-pulse" />
<p className="text-[9px] smallcaps text-clay-500 animate-slow-pulse">
· ·
· · · · · ·
</p>
</div>
)}