Giter Site home page Giter Site logo

techsculptorx / textify.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maggix1404/textify-js

2.0 0.0 0.0 5.56 MB

Simple scroll based text reveal animation library.

Home Page: https://textify-js.vercel.app/

License: MIT License

JavaScript 95.02% CSS 4.98%

textify.js's Introduction

logo

Next Generation Text Animation Library.

maintained - yes contributions - welcome Made with JavaScript

mini-logo
Live Examples


Getting Started

Textify.js is a animation engine for web typography animations, which are use to create smooth, creative or seamless animations of typography. Also it’s provide multiple animations types or custom animations on GSAP's power.

Using packge manager

NPM

Install textify using npm:

npm install textify.js

yarn

Install textify using yarn

yarn add textify.js

Using CDN:

<link src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Textify.min.css" rel="stylesheet"/>

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/Textify.min.js"></script>

ES6 module

<script type="module">
    import Textify from 'https://cdn.jsdelivr.net/npm/textify.js/+esm';

    new Textify();
</script>

Usage

Import Textify.js:

import Textify from "textify.js";

Link Textify.min.css to document:

<link src="https://cdn.jsdelivr.net/npm/textify.js/dist/Textify.min.css" rel="stylesheet"/>

Add data-textify attribute to your paragraph or an element that contain text.

<p data-textify>Some cool text.😎😎</p>

Initialize textify to see magic.

import Textify from "textify.js";

new Textify()

By default textify use default configurations for text animations. You can pass an configuration object during initialization to tweak it.

Configuration options

  splitType: "lines words chars", // chars or words or lines
  largeText: false, // true or false
  observer: {
    repeat: false, // true or false
    threshold: 0.5 // 0.0 ~ 1.0
  },
  animation: {
    by: "chars", // chars or words or lines
    duration: 0.5, // seconds
    stagger: 0.05, // seconds
    delay: 0.0, // seconds
    ease: "ease", // ease or linear or cubic-bezier
    customAnimation: false, // true or false
    transformOrigin: "center center", // center center or top left or top center or top right or center right or bottom right or bottom center or bottom left or center left
    animateProps: {
      opacity: 1, // 0 ~ 1
      y: "100%", // -100 ~ 100 (%)
      x: 0, // -100 ~ 100 (%)
      scale: 1, // 0 ~ 1
      rotate: 0, // -360 ~ 360
      skewX: 0, // -360 ~ 360
      skewY: 0 // -360 ~ 360
    }

For, more information about configs, check Documentation

Documentation

Check main documentation of Textify.js here:

Methods

Textify contains instance methods. these are used to control the animation. these methods are help to maintain animation stability. these
methods are following:
  • animateIn - Reveal animation.
  • animateOut - Hide animation.
  • reset - Re-calulate all texts position and offset (call on DOM changes and resize event)

Example:

const textObj = new Textify();

// reveal all animations of textObj
textObj.animateIn();

// hide all animations of textObj
textObj.animateOut();

// Re-calulate all texts position and offset
textObj.reset();

License

Released under MIT by @MAGGIx1404.

Rate us

Enjoying textify.js? Please leave a short review on Openbase

textify.js's People

Contributors

maggix1404 avatar dependabot[bot] avatar techsculptorx avatar xdarksondagar avatar

Stargazers

 avatar Roman 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.