GithubHelp home page GithubHelp logo

chemzqm-textillate's Introduction

This repository is a mirror of the component module chemzqm/textillate. It has been modified to work with NPM+Browserify. You can install it using the command npm install npmcomponent/chemzqm-textillate. Please do not open issues or send pull requests against this repo. If you have issues with this repo, report it to npmcomponent. #Textillate.js v0.1

See a live demo here.

Textillate.js combines some awesome libraries to provide an easy-to-use plugin for applying CSS3 animations to any text.

Note: you should get the names of css animation from ianstormtaylor/animate

Install

component install chemzqm/textillate

Example

var textillate = require('textillate');
var el = document.getElementById('title');
textillate(el, { in : { effect: 'roll-in' }});

##Usage

Let's start with the basic markup:

<h1 class="tlt">My Title</h1>

And your JavaScript should look like this:

$(function () {
	$('.tlt').textillate();
})

This will animate using the default options. To change the defaults, you can either use the html data api:

<h1 class="tlt" data-in-effect="rollIn">Title</h1>

or pass in options on initialization (see full list of options below):

$('.tlt').textillate({ in: { effect: 'rollIn' } });

You can also tell textillate.js to animate a list with the following markup:

<h1 class="tlt">
	<ul class="texts">
		<li data-out-effect="fadeOut" data-out-shuffle="true">Some Title</li>	
		<li data-in-effect="fadeIn">Another Title</li>
	</ul>
</h1>
$('.tlt').textillate();

Notice that you can control the animation parameters on each text (<li>) using the data api.

##Dependencies To start using textillate.js, you will need the following:

##Options

$('.tlt').textillate({
  // the default selector to use when detecting multiple texts to animate
  selector: '.texts',
  
  // enable looping
  loop: false,
  
  // sets the minimum display time for each text before it is replaced
  minDisplayTime: 2000,
  
  // sets the initial delay before starting the animation
  // (note that depending on the in effect you may need to manually apply 
  // visibility: hidden to the element before running this plugin)
  initialDelay: 0,
    
  // set whether or not to automatically start animating
  autoStart: true,
  
  // custom set of 'in' effects. This effects whether or not the 
  // character is shown/hidden before or after an animation  
  inEffects: [],
  
  // custom set of 'out' effects
  outEffects: [ 'hinge' ],
  
  // in animation settings
  in: {
  	// set the effect name
    effect: 'fadeInLeftBig',
    
    // set the delay factor applied to each consecutive character
    delayScale: 1.5,
    
    // set the delay between each character
    delay: 50,
    
    // set to true to animate all the characters at the same time
    sync: false,
    
    // randomize the character sequence 
    // (note that shuffle doesn't make sense with sync = true)
    shuffle: false
  },
  
  // out animation settings.
  out: {
    effect: 'hinge',
    delayScale: 1.5,
    delay: 50,
    sync: false,
    shuffle: false,
  }
});

chemzqm-textillate's People

Contributors

airportyh avatar chemzqm avatar jodytate avatar sippsolutions avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.