GithubHelp home page GithubHelp logo

supasate / react-reveal-text Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adrianmcli/react-reveal-text

1.0 2.0 0.0 1.7 MB

✨ A small react library for animating the revealing of text.

Home Page: https://adrianmcli.github.io/react-reveal-text/

JavaScript 98.77% CSS 1.23%

react-reveal-text's Introduction

React Reveal Text

npm travis bithound dependencies license

A small react library for animating the revealing of text.

gif animation

The demo page was built with React Storybook.

Features 🎉

  • Simple – Just plain ol' CSS transition animations.
  • Zero dependencies – Keeping it light and lit up!
  • Flexible – Choose your own easing function and timing.
  • Customizeable – Customize and theme like a regular div.
  • Dynamic – Intelligent generation of random transition delay numbers.

Getting Started

  1. Install:
npm install --save react-reveal-text
  1. Use:
<ReactRevealText>WELCOME!</ReactRevealText>

API

Interactive docs with live-editable props here.

This component has many props that you can manipulate; below is a list of all of them.

Note that the component only re-renders when the show property has been changed.

Basic Properties

  • text (string)
    You can set the text either by passing in text as children or by using the text property.

  • show (boolean)
    This prop allows you to control what state the component is in. It allows you to hide or reveal the text.

  • className (string)
    This prop allows you to set the className for the div surrounding the text.

  • style (object)
    This prop allows you to pass in styles for the div surrounding the text.

Transition Properties

Each letter has its own randomly generated delay before its transition begins.

  • transitionTime (integer) [default: 1300]
    The time it takes for each letter's transition.

  • timingFunction (string) [default: 'linear']
    The CSS transition-timing-function property. On this page, you are given a dropdown selection, but in practice (and in the sandbox), you can enter in any valid string.

  • delayMin (integer) [default: 200]
    The minimum allowable delay before the transition for a letter is to begin.

  • delayMax (integer) [default: 1200]
    The maximum allowable delay before the transition for a letter is to begin.

  • threshold (float) [default: 0.2]
    The difference between the random numbers generated for each letter compared to the previous letter. Setting this higher will force the delays to be very different between each letter, spreading out the effect. Setting this lower will allow delays to be similar between letters, sometimes creating a chunking effect.

Contributing

This project was built using my two other tools: React Build Lib and React Build Dist. These tools are still very early in development, so if you are building these libraries, you may encounter some bugs. PRs and issues are welcomed and encouraged! Should probably add some testing too.

react-reveal-text's People

Contributors

adrianmcli avatar

Stargazers

 avatar

Watchers

Supasate "Ping" Choochaisri 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.