Voltar ao ranking

jschr/textillate

JavaScripttextillate.js.org

A jquery plugin for CSS3 text animations.

css-animationsjavascriptjquerytexttextillate
Crescimento de estrelas
Estrelas
3.7k
Forks
742
Crescimento semanal
Issues
58
1k2k3k
jan. de 2013jul. de 2017jan. de 2022jul. de 2026
Artefatosnpmnpm install textillate
README

Textillate.js v0.4.1 JS.ORG

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.

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,

    // reverse the character sequence
    // (note that reverse doesn't make sense with sync = true)
    reverse: false,

    // callback that executes once the animation has finished
    callback: function () {}
  },

  // out animation settings.
  out: {
    effect: 'hinge',
    delayScale: 1.5,
    delay: 50,
    sync: false,
    shuffle: false,
    reverse: false,
    callback: function () {}
  },

  // callback that executes once textillate has finished
  callback: function () {},

  // set the type of token to animate (available types: 'char' and 'word')
  type: 'char'
});

Events

Textillate triggers the following events:

  • start.tlt - triggered when textillate starts
  • inAnimationBegin.tlt - triggered when the in animation begins
  • inAnimationEnd.tlt - triggered when the in animation ends
  • outAnimationBegin.tlt - triggered when the out animation begins
  • outAnimationEnd.tlt - triggered when the out animation ends
  • end.tlt - triggered when textillate ends
$('.tlt').on('inAnimationBegin.tlt', function () {
  // do something
});

Methods

  • $element.textillate('start') - Manually start/restart textillate
  • $element.textillate('stop') - Manually pause/stop textillate
  • $element.textillate('in') - Trigger the current text's in animation
  • $element.textillate('out') - Trigger the current text's out animation

Code Samples

Repositórios relacionados
animate-css/animate.css

🍿 A cross-browser library of CSS animations. As easy to use as an easy thing.

CSSnpmOthercss-animationscss
animate.style
82.7k16k
DavidHDev/react-bits

An open source collection of animated, interactive & fully customizable React components for building memorable websites.

JavaScriptnpmOtheranimationscomponents
reactbits.dev
43.9k2.1k
sachinchoolur/lightGallery

A customizable, modular, responsive, lightbox gallery plugin.

TypeScriptnpmOtherlightbox-gallery-pluginimage-gallery
lightgalleryjs.com
7k1.3k
l-hammer/You-need-to-know-css

💄CSS tricks for web developers~

CSSnpmOthercsscss-tricks
lhammer.cn/You-need-to-know-css/
5.5k621
sachinchoolur/lightgallery.js

Full featured JavaScript image & video gallery. No dependencies

JavaScriptnpmOthergalleryvideo-gallery
sachinchoolur.github.io/lightgallery.js/
5.3k583
epicmaxco/epic-spinners

Easy to use css spinners collection with Vue.js integration

Vuevuecss-spinners-collection
epic-spinners.epicmax.co
3.9k355
codse/animata

Bring your site to life with easy to use animation & interaction code. Copy. Paste. Animate.

TypeScriptnpmMIT Licenseanimationinteraction
animata.design
2.8k227
ingram-projects/animxyz

The first truly composable CSS animation library. Built for Vue, React, SCSS, and CSS, AnimXYZ will bring your website to life.

CSSnpmMIT Licensecssvue
animxyz.com
2.5k62
webkul/micron

a [μ] microInteraction library built with CSS Animations and controlled by JavaScript Power

CSSnpmMIT Licensejsjavascript
webkul.github.io/micron/
2.3k99
greyby/vue-spinner

vue spinners

VueMIT Licensevuevuejs
greyby.github.io/vue-spinner/
1.8k174
miromannino/Justified-Gallery

Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.

HTMLMIT Licensegalleryjustification
miromannino.github.io/Justified-Gallery/
1.7k301
Martz90/vivify

Vivify is free CSS animation library.

CSSnpmMIT Licenseanimation-librarycss-animations
1.7k148