update: 更新依赖 删除shadcn
This commit is contained in:
1 parent
812f0b291f
commit
4725e373c2
3 files changed
+418
-3621
No files matched your search
Generated
+411
-3617
File diff suppressed because it is too large.
Load diff
@@ -22,7 +22,6 @@
|
|||||||
"tw-animate-css": "^1.4.0"
|
"tw-animate-css": "^1.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"shadcn": "^4.8.2",
|
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@types/node": "^24.12.4",
|
"@types/node": "^24.12.4",
|
||||||
"@types/react": "^19.2.14",
|
"@types/react": "^19.2.14",
|
||||||
|
|||||||
@@ -6,14 +6,18 @@ export function useTypewriter(text: string, speed = 100) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let i = 0;
|
let i = 0;
|
||||||
setDisplayed("");
|
|
||||||
const timer = setInterval(() => {
|
const timer = setInterval(() => {
|
||||||
i++;
|
i++;
|
||||||
setDisplayed(text.slice(0, i));
|
setDisplayed(text.slice(0, i));
|
||||||
if (i === text.length) clearInterval(timer);
|
|
||||||
|
if (i === text.length) {
|
||||||
|
clearInterval(timer);
|
||||||
|
}
|
||||||
}, speed);
|
}, speed);
|
||||||
|
|
||||||
return () => clearInterval(timer);
|
return () => clearInterval(timer);
|
||||||
}, [text, speed]);
|
}, [text, speed]);
|
||||||
|
|
||||||
return displayed;
|
return displayed;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user