All Projects → camwiegert → Typical

camwiegert / Typical

Licence: mit
Animated typing in ~400 bytes 🐡 of JavaScript

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Typical

Currencyviewer
Short python framework that dynamically displays and converts the cryptocurrencies in your Kraken wallet into equivalents fiat money.
Stars: ✭ 13 (-98.68%)
Mutual labels:  module
Falling Words Typing Game
This is the source code for a Falling Words Typing Game created in Unity during a Twitch Livestream.
Stars: ✭ 31 (-96.86%)
Mutual labels:  typing
Module Project
扩展性和灵活性非常好的模块化开发框架,内置很灵活高效的模板引擎
Stars: ✭ 33 (-96.65%)
Mutual labels:  module
Java9 Jigsaw Depvis
DepVis (Java 9 Jigsaw Dependency Visualizer)
Stars: ✭ 14 (-98.58%)
Mutual labels:  module
Dropwizard Jwt Cookie Authentication
Dropwizard bundle managing authentication through JWT cookies
Stars: ✭ 29 (-97.06%)
Mutual labels:  module
Mob Suite
MOB-suite: Software tools for clustering, reconstruction and typing of plasmids from draft assemblies
Stars: ✭ 32 (-96.75%)
Mutual labels:  typing
Apache24 Modules
Modules for Apache 2.4 and maybe 2.2
Stars: ✭ 12 (-98.78%)
Mutual labels:  module
Html Sass Babel Webpack Boilerplate
Webpack 4 + Babel + ES6 + SASS + HTML Modules + Livereload
Stars: ✭ 35 (-96.45%)
Mutual labels:  module
Sao Nm
Scaffold out a node module.
Stars: ✭ 30 (-96.96%)
Mutual labels:  module
Jcnavigator
A decoupled navigator framework of jumping between modules or apps for iOS development.
Stars: ✭ 33 (-96.65%)
Mutual labels:  module
Typet
Types that make coding in Python quick and safe.
Stars: ✭ 15 (-98.48%)
Mutual labels:  typing
Keystroke dynamics
a keystroke dynamics algorithm in python (recognizes a person by the way s/he types)
Stars: ✭ 21 (-97.87%)
Mutual labels:  typing
Java9 Jigsaw Examples
Java 9, Jigsaw Example Suite
Stars: ✭ 32 (-96.75%)
Mutual labels:  module
Typing
Work related to PEP 484: typing.py and typing_extensions.py (both released via PyPI) and issue tracker for type system bugs/features.
Stars: ✭ 878 (-10.95%)
Mutual labels:  typing
Swift Template
A template based module generator for Swift projects.
Stars: ✭ 34 (-96.55%)
Mutual labels:  module
Nginx Cleantalk Service
LUA configuration to filter any POST requests.
Stars: ✭ 13 (-98.68%)
Mutual labels:  module
Snippetpx
Invocable Snippet Support in PowerShell
Stars: ✭ 31 (-96.86%)
Mutual labels:  module
Module Federation Examples
Implementation examples of module federation , by the creators of module federation
Stars: ✭ 979 (-0.71%)
Mutual labels:  module
Pm2 Syslog
PM2 module to redirect application logs to syslog
Stars: ✭ 34 (-96.55%)
Mutual labels:  module
Easyandroid
一个完整基于kotlin的安卓开发框架,采用了mvvm设计模式。涵盖了: 1、基于retrofit2封装的通过kotlin协程实现的网络框架 2、基于阿里开源router修改的api-router实现项目模块化 3、基于glide的图片加载缓存框架 4、基于room实现的往来数据缓存加载 5、基于step实现的数据异步提交 6、基于PreferenceHolder实现的本地数据快速存储 7、基于mlist实现的简单复杂列表的快速开发扩展 8、定制的toolbar可以自适应异形屏,挖孔屏,水滴屏等等。。 本框架几乎涵盖了开发所需的所有模块组件。简单fork之后就可以基于框架快速开发。
Stars: ✭ 33 (-96.65%)
Mutual labels:  module

typical

Animated typing in ~400 bytes 🐡 of JavaScript.

  • Zero dependencies
  • MIT licensed
  • Emoji support
  • Smart delete: only delete what needs deleting
  • Pausing: pause between steps
  • Looping: easily loop from any point
  • Waiting: wait on arbitrary Promises
  • Humanity: slightly varied typing speed

Demo →


Install

npm install @camwiegert/typical
More install options

Instead of using a package manager, you can download typical.js from GitHub and import it locally or import it directly from a CDN like unpkg.

API

type(target: HTMLElement, ...steps: any[]) => Promise<void>;

The module exports a single function, type, which takes a target element as its first argument, and any number of additional arguments as the steps to perform. Additional arguments perform actions based on their type:

Type Action
string Type text
number Pause (milliseconds)
function Call with target element
Promise Wait for resolution

Usage

The most basic usage of type is providing a target element and a string to type.

import { type } from '@camwiegert/typical';

type(element, 'text');

Pausing

In order to pause typing at any point, pass a number of milliseconds to pause.

type(element, 'Hello', 1000, 'Hello world!');

Looping

In order to loop, pass type as a parameter to itself at the point at which you'd like to start looping. It can be helpful to alias type as loop to be explicit.

import {
    type,
    type as loop
};

const steps = [1000, 'Ready', 1000, 'Set', 1000, 'Go'];

type(element, ...steps, loop);

To loop a finite amount, pass your steps multiple times.

type(element, ...steps, ...steps, ...steps);

Waiting

When passed a Promise, type will wait for it to resolve before continuing. Because type itself returns a Promise, that means you can wait on a set of steps to complete before starting another.

const init = type(target, 'In a moment...', 500);

type(target, init, 'start', 500, 'looping', loop);

Functions

Function arguments are passed the target element, and can be useful for operating on the target element between steps. If you return a Promise, type will wait for it to resolve.

const toggle = (element) =>
    element.classList.toggle('is-typing');

type(target, toggle, 'Type me', toggle);

Support

  • [x] Chrome
  • [x] Edge
  • [x] Firefox
  • [x] Safari
  • [ ] Internet Explorer

Related

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].