update: 更新依赖 删除shadcn

This commit is contained in:
xiaozhou233 committed 2026-10-04 22:26:20 +08:00
1 parent 812f0b291f
commit 4725e373c2
3 files changed
+418 -3621

No files matched your search

+7 -3
View File
@@ -6,14 +6,18 @@ export function useTypewriter(text: string, speed = 100) {
useEffect(() => {
let i = 0;
setDisplayed("");
const timer = setInterval(() => {
i++;
setDisplayed(text.slice(0, i));
if (i === text.length) clearInterval(timer);
if (i === text.length) {
clearInterval(timer);
}
}, speed);
return () => clearInterval(timer);
}, [text, speed]);
return displayed;
}
}