react-typist icon indicating copy to clipboard operation
react-typist copied to clipboard

Possible to type centered text without text shifting?

Open srwiseman opened this issue 6 years ago • 4 comments

Basically, when you apply this component to a centered string of text, its shifts the already-typed text to the left, as you're typing on the right. This makes the text hard to read.

Is it possible to have the text placement static on centered text? I.e. it starts typing on the left of the screen and finishes typing on the left.

As an example, look at the effect here: https://caferati.me/ The text is in a static position as it's being typed, yet it's centered.

srwiseman avatar Apr 06 '18 00:04 srwiseman

@srwiseman good catch! I'll see if we can take into account text centering.

happy to receive PRs for this too!

jstejada avatar Apr 15 '18 17:04 jstejada

@jstejada Cool! If I get some time I'll make a PR. I imagine each time a letter is typed, you're rendering it to the DOM. I think this could be accomplished by rendering all of the letters from at the start but have them transparent. Then each time a letter is typed, it removes the transparency. Not sure. Just an idea...

srwiseman avatar Apr 15 '18 19:04 srwiseman

hey guys, any progress on this issue? i just thought of this as well

dav-sap avatar Sep 22 '18 13:09 dav-sap

I had this issue as well. Was able to resolve it by setting the following styles on the cursor:

.Typist .Cursor {
  display: inline-block;
  width: 0;
}

Default cursor character (|) will still be visible (overflowing outside the bounds of the cursor container).

gillennium avatar Mar 04 '20 18:03 gillennium