Git Product home page Git Product logo

usemix's Introduction

useMix

A package to create a cool "mixing effect" on a sample text. The function is automatically run on load, but can be set to run on hover as well.

Import

import { useMix } from "@pranjalg1122/usemix";

Usage

Parameters

const [text, play] = useMix({
  entry: "sample",
  tick: 2,
  delay: 30,
  upper: true,
});

entry: This is the text that can be inputed and will exhibit the mixing effect.

tick: The factor of revolutions of random letters that will cycle through when run.

delay: The delay in milliseconds of which a letter will return to the original letter in the sample text after the mixing effect has run.

upper: If true, the random letters being mixed will be uppercase, else it'll be lowercase. By default, it's a mix of both.

Output

text: This text will show the mix effect and finally the sample text. Put this inside a { } in a react JSX element.

play: Running this function will run the mixing effect. It can be used to run on hover over an element.

Example

Given below is a piece of code that shows how the text and play function can be used with an anchor tag. Using the OnMouseOver event in React, we can execute the mixing effect when the mouse enters the anchor tag region.

<a href="https://website.com" onMouseOver={play}>
  {text}
</a>

usemix's People

Contributors

pranjalg1122 avatar

Watchers

 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.