The app gets the text from HTML, clears the text element (h1), wraps every character in span, sets CSS style and --delay variable for every span, and adds all the spans into the text element (h1). In CSS, the animation is defined for spans which animate every span with different delays.