Skip to content

sortabrilliant/ghostwriter

Repository files navigation

Static headings are boring, let’s get them moving.

I love the typing effect generated by typed.js. There is just something so fun about motion and I think we need more of it. I wanted to help people quickly and easily add this effect so we created Ghostwriter (like the 90’s PBS show).

Instead creating an entirely new block we wanted to try adding the effect to the core heading block. I’m fascinated by the prospect of enhancing core blocks with cool new features.

Typed.js Options

typed.js is responsible for the typing effect and any of the typed.js options can be changed in Ghostwriter as well.

Default options:

{
    strings: [ targetHeading.innerText ],
    typeSpeed: 75,
    loop: true
}

You can customize these options with the ghstwrtr_typedjs_options filter. Example:

add_filter( 'ghstwrtr_typedjs_options', function( $options ) {
    $options[ 'typeSpeed' ] = 25;
    return $options;
} );

gw