Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typewriting

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typewriting

TypeWriting.js is a javascript library to make a typewriter effect.

  • 1.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

TypeWriting.js

GitHub repo / DEMO

Note: TypeWriting.js doesn't depend on jQuery since version 1.2. If you want to keep the old version, please check another branch - jQuery-v1.1.3.


Setup

<!-- just typewriting.js or .min.js -->
<script type="text/javascript" src="path/to/typewriting.min.js"></script>

or

// import in your .js file
import TypeWriting from 'typewriting';

I use the height of targetElement to set the cursor height. You could use its line-height to control cursor height.


TypeWriting()

  • targetElement: HTML element required
    Your element
  • inputString: String required
    Your text
  • typing_interval: Int
    Interval between each character
  • blink_interval: String
    Interval of the cursor blinks
  • cursor_color: String
    Color of the cursor

Second parameter is the function after typing effect.

var typeWriting = new TypeWriting({
	targetElement	: document.getElementsByClassName('terminal')[0],
	inputString		: 'Hello, world.',
	typing_interval	: 130,
	blink_interval	: '1s',
	cursor_color	: '#00fd55',
}, function() {
	console.log("END");
});

rewrite()

You could use this function to do the same effect but different text at same element.

typeWriting.rewrite( "This is TypeWriting.js", function() {
	console.log("Rewrite is finished");
});

Author

Eddie Wen: m20021991y@gmail.com
GitHub: https://github.com/EddieWen-Taiwan

Keywords

FAQs

Package last updated on 16 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc