{
  "id": "typewriter-word-loop",
  "name": "Typewriter Word Loop",
  "category": "text",
  "tags": [
    "typing",
    "rotating words",
    "hero",
    "headline",
    "caret",
    "steps"
  ],
  "description": "A headline that types and deletes a list of words in turn, with a blinking caret and no JavaScript.",
  "url": "https://copy-css.com/snippets/typewriter-word-loop",
  "markdown": "https://copy-css.com/snippets/typewriter-word-loop.md",
  "html": "<h2 class=\"tw-loop\">Make it\n  <span class=\"tw-loop-words\">\n    <span style=\"--n: 4\">fast</span>\n    <span style=\"--n: 6\">simple</span>\n    <span style=\"--n: 5\">yours</span>\n  </span>\n</h2>",
  "css": "/* --n is each word's character count. 3 words x 3s each = 9s */\n.tw-loop {\n  margin: 0;\n  color: #3b0764;\n  font: 700 28px/1.3 ui-monospace, Menlo, monospace;\n}\n\n.tw-loop-words {\n  display: inline-grid;\n  vertical-align: bottom;\n  color: #c026d3;\n  border-right: 0.1em solid;\n  animation: tw-loop-blink 0.8s step-end infinite;\n}\n\n.tw-loop-words span {\n  grid-area: 1 / 1;\n  width: 0;\n  overflow: hidden;\n  white-space: nowrap;\n  animation: tw-loop-type 9s steps(var(--n)) infinite;\n}\n\n.tw-loop-words span:nth-child(2) {\n  animation-delay: 3s;\n}\n\n.tw-loop-words span:nth-child(3) {\n  animation-delay: 6s;\n}\n\n@keyframes tw-loop-type {\n  0% { width: 0; }\n  12%, 24% { width: calc(var(--n) * 1ch); }\n  33%, 100% { width: 0; }\n}\n\n@keyframes tw-loop-blink {\n  50% { border-color: transparent; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .tw-loop-words,\n  .tw-loop-words span { animation: none; }\n\n  .tw-loop-words span:first-child { width: auto; }\n}",
  "features": [
    "keyframe animations",
    "CSS Grid",
    "custom properties",
    "reduced-motion support"
  ],
  "customProperties": []
}
