Class SplitText<StaticProps, ChangeableProps, CallbacksTypes>

Split text into letters, words & lines. Usually used for text animation.

Type Parameters

Hierarchy

  • Component<StaticProps, ChangeableProps, CallbacksTypes>
    • SplitText

Constructors

Properties

_container: HTMLElement

Text container

_initialHTML: string

Initial HTML content

_initialText: string

Initial text

_isBaseSplit: boolean

If the text is already split into letters and words

_letters: ILetter[]

Letters

_lines: ILine[]

Lines

_words: IWord[]

Words

Accessors

  • get isDestroyed(): boolean
  • The module is destroyed

    Returns boolean

  • get isInitialized(): boolean
  • The module is initialized

    Returns boolean

  • get props(): TRequiredModuleProp<StaticProps & ChangeableProps>
  • Current properties

    Returns TRequiredModuleProp<StaticProps & ChangeableProps>

Methods

  • Get Default properties (should be extended)

    Returns DeepRequired<StaticProps & ChangeableProps> & {
        container: string;
        hasLetters: boolean;
        hasLines: boolean;
        resizeDebounce: number;
        textSource: string;
        viewportTarget: string;
    }

  • Add a DOM event listener

    Type Parameters

    • El extends ListenerElement

    • Target extends keyof HTMLElementEventMap

    • Callback extends ((evt) => void)

    Parameters

    • el: El
    • target: Target
    • callback: Callback
    • Optional options: IAddEventListenerOptions

    Returns IAddEventListener