Efekt pisaće mašine

← Natrag na nadzornu pločuAlati za programere

Generator efekta pisaće mašine (Typewriter)

Prilagodite i pregledajte glatke animacije tipkanja i brisanja teksta u stvarnom vremenu uz čist kod za React, JS i CSS.

Postavke efekta
Odvojite fraze novim redom (Enter)
Brzi predlošci
Brzina tipkanja80 ms
Brzina brisanja40 ms
Trajanje pauze1.5 s
typewriter-preview.sh
|
Tipkanje (1/4)
0 znakova
Promjene postavki odmah se prikazuju u prozoru terminala.
Generirani izvorni kod
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>
  );
}

Kako koristiti generator efekta pisaće mašine

Stvorite privlačne animacije teksta za naslove web stranica i odredišne stranice.

Pregled u terminalu u stvarnom vremenu

Gledajte kako se vaše fraze glatko ispisuju i brišu u stiliziranom prozoru.

Precizna kontrola brzine i pokazivača

Prilagodite brzinu unosa, brisanja i odaberite stil trepćućeg pokazivača.

Izvoz koda za React, HTML i CSS

Generirajte isječke spremne za umetanje u vaše web projekte.

Quick Brain Break

Što kažete na brzu mini-igru za opuštanje?

Trebate 2-minutno mentalno osvježenje? Uskočite u klasičnu puzzle igru ​​izravno u svom pregledniku.