-
-
Notifications
You must be signed in to change notification settings - Fork 576
Typing Animation
Jakub T. Jankiewicz edited this page Aug 12, 2021
·
23 revisions
Typing was first added in version 2.24.0 but in current form, with all updates and fixes, you should use at least 2.28.0 to use all the features.
term.set_prompt("name: ", { typing: true, delay: 200 });
term.echo("Hello", { typing: true, delay: 200 });
Low-level API is single method terminal::typing
:
term.typing(<type>, <delay>, <string>, options);
-
terminal::typing
returns a promise that resolves when the animation ends. - there is only one option,
finalize
- type is one of the strings:
'prompt'
,'echo'
or'enter'
. - prompt animation as the name suggests is an animation of the prompt and at the end, the prompt is set to the given string.
- echo animation as the name suggests animate the string that is echo into the terminal.
- enter animation is an animation of entering the command and pressing enter, it uses the current prompt as a prefix after the animation starts. Enter animation doesn't have a higher-level counterpart.
To see examples of typing animation see demos:
Library for Web-Based Terminal in JavaScript, (jQuery Terminal: git repo)
Copyright (c) 2011-2023 Jakub T. Jankiewicz