1.0.0 • Published 5 months ago

kg-type v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

kg-type Web Component

What's this?

⬆️ Back to Top

A pure JavaScript Web Component to write-out text letter by letter, and optionally remove it letter-by-letter. It's quite customizable and comes with sensible defaults.

Usage

Minimal example

<kg-type words="Hello"></kg-type>

Options

OptionDefaultDescription
seperator,Seperator to split provided words list at.
cursor_The curors behind letters, set to empty string to remove.
wordsA list of words to write out, seperated by the seperator (as defined above, or , by default)
clear-interval2000Time in milliseconds (ms) after which the word is cleared
type-interval150Time in milliseconds (ms) at which letters are written
shufflefalseSet to true if words should be shuffled once before writing begins.
delete-reversefalseSet to true to remove word letter by letter after writing

Only words is required as all other values have defaults.

Complete example

Languages I like: <kg-type seperatpr="," cursor="|" words="Rust, JavaScript, Python, Go" clear-interval="3000" type-interval="100" shuffle="true" delete-reverse="true"></kg-type>

Custom CSS

The component adapts the styles of its surrounding but three distinct values can be set using CSS custom properties:

.custom-style {
    --kg-type-display: inline-block;
    --kg-type-color: #000;
    --kg-type-fontsize: 1rem;
}

Contributing

⬆️ Back to Top

We love and welcome every form of contribution.

Where to start?

Here are some good places to start:

Tooling

  • mktoc is used for table of content generation in the README.md
  • With npm run dev a static file server using the nodejs http-server package is started, this is optional

License

⬆️ Back to Top

MIT, see LICENSE file.

1.0.0

5 months ago