即時終端機視窗預覽
在質感的深色終端介面中,即時體驗多段文案自然連貫的逐字輸入與回退倒退效果。
打字機效果產生器
在瀏覽器中即時自訂並預覽文字逐字打出與消除的質感動畫,一鍵匯出適用於 React、原生 JavaScript 與純 CSS 的乾淨代碼。
import React, { useState, useEffect } from "react";
export function Typewriter() {
const words = [
"Hello, World! 👋",
"Build beautiful web applications.",
"100% Client-Side Typewriter Effect.",
"Fast, smooth, and fully customizable."
];
const [currentText, setCurrentText] = useState("");
const [wordIdx, setWordIdx] = useState(0);
const [isDeleting, setIsDeleting] = useState(false);
useEffect(() => {
const currentWord = words[wordIdx % words.length];
let timer;
if (!isDeleting) {
if (currentText.length < currentWord.length) {
timer = setTimeout(() => {
setCurrentText(currentWord.slice(0, currentText.length + 1));
}, 80);
} else {
timer = setTimeout(() => setIsDeleting(true), 1500);
}
} else {
if (currentText.length > 0) {
timer = setTimeout(() => {
setCurrentText(currentWord.slice(0, currentText.length - 1));
}, 40);
} else {
setIsDeleting(false);
setWordIdx((prev) => (prev + 1) % words.length);
}
}
return () => clearTimeout(timer);
}, [currentText, isDeleting, wordIdx]);
return (
<div className="font-mono text-2xl font-bold text-slate-100 flex items-center">
<span>{currentText}</span>
<span className="animate-pulse ml-0.5 text-blue-500">|</span>
</div>
);
}為網站首頁橫幅、作品集與行銷登陸頁打造生動吸睛的打字動畫效果。
在質感的深色終端介面中,即時體驗多段文案自然連貫的逐字輸入與回退倒退效果。
支援自由調整打字毫秒數、刪除節奏、停頓間隔,並提供多款經典閃爍游標樣式。
自動生成隨插即用的 React Hook 元件、純前端 HTML/JS 腳本與輕量 CSS 關鍵影格代碼。
在工作空檔讓大腦放鬆一下的免費網頁經典遊戲合輯。