3.1.0 • Published 3 years ago

@kissmybutton/motorcortex-typewriting v3.1.0

Weekly downloads
71
License
MIT
Repository
github
Last release
3 years ago

MotorCortex Typewriting

Installation

$ npm install @kissmybutton/motorcortex-typewriting
# OR
$ yarn add @kissmybutton/motorcortex-typewriting
import TypeWriting from "@kissmybutton/motorcortex-typewriting";

Key Concepts / Features

MotorCortex TypeWriting add the type writing effect to your clips.

Documentation

Import and load the plugin to MotorCortex

import { HTMLClip, loadPlugin } from "@kissmybutton/motorcortex/";
import TypeWritingDefinition from "@kissmybutton/motorcortex-typewriting";
const TypeWriting = loadPlugin(TypeWritingDefinition);

const clip = new HTMLClip({
  html: `
    <div class="container"></div>`,
  css: `
  .container{
    width:100%;
    height:100%;
    background:#151515;
    display:flex;
    justify-content: flex-start;
    align-items: center;
    padding-left: 10%;
  }
`,
  host: document.getElementById("clip"),
  containerParams: {
    width: "720px",
    height: "640px",
  },
});

const typewrite = new TypeWriting.TypeWriting(
  {
    css: `color:#37ff00;font-size:20px;font-weight:bold`,
    showCursor: true,
    cursorCss: "color:#37ff00;font-size:20px;font-weight:bold;",
    blinkDelay: 3000,
    blinkhiatus: 2000,
    text: `Wake up, Neo...`,
  },
  { selector: ".container" }
);

const typewriteOne = new TypeWriting.TypeWriting(
  {
    css: `color:#37ff00;font-size:20px;font-weight:bold`,
    showCursor: true,
    cursorCss: "color:#37ff00;font-size:20px;font-weight:bold;",
    blinkDelay: 3000,
    blinkhiatus: 2000,
    text: `The Matrix has you...`,
  },
  { selector: ".container" }
);

clip.addIncident(typewrite, 0);
clip.addIncident(typewriteOne, 6000);
clip.play();

Attributes

NameDescriptionDefaultType
cssThe CSS for the text""string
cursorCssThe CSS for the cursor""string
showCursorShow or hide cursorfalseboolean
blinkDelayBlink cursor duration in milliseconds before start typing0number
blinkhiatusBlink cursor duration in milliseconds after end of typing0number
textThe text to be typed""string

Demo

https://kissmybutton.github.io/motorcortex-typewriting/demo/

License

MIT License

Kiss My Button

3.1.0

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.0.0

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago