All Projects → crazko → use-dencrypt-effect

crazko / use-dencrypt-effect

Licence: MIT License
⚛ A custom React hook generating crypting text effect.

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to use-dencrypt-effect

use-route-as-state
Use React Router route and query string as component state
Stars: ✭ 37 (-5.13%)
Mutual labels:  hook, react-hooks
react-hook-videojs
Easy React integration of Video.js using hooks.
Stars: ✭ 37 (-5.13%)
Mutual labels:  hook, react-hooks
react-use-countdown
React hook for countdown state.
Stars: ✭ 19 (-51.28%)
Mutual labels:  hook, react-hooks
Fre
👻 Tiny Footprint Concurrent UI library for Fiber.
Stars: ✭ 3,195 (+8092.31%)
Mutual labels:  hook, react-hooks
react-hook-layout
Layouts in React.
Stars: ✭ 16 (-58.97%)
Mutual labels:  hook, react-hooks
web
React hooks done right, for browser and SSR.
Stars: ✭ 940 (+2310.26%)
Mutual labels:  hook, react-hooks
usehooks-ts
React hook library, ready to use, written in Typescript.
Stars: ✭ 2,873 (+7266.67%)
Mutual labels:  hook, react-hooks
ReSift
A state management library for data fetches in React
Stars: ✭ 39 (+0%)
Mutual labels:  hook, react-hooks
react-use-hotkeys
React hook for creating simple keyboard shortcuts
Stars: ✭ 74 (+89.74%)
Mutual labels:  hook, react-hooks
react-ui-hooks
🧩Simple repository of React hooks for building UI components
Stars: ✭ 20 (-48.72%)
Mutual labels:  hook, react-hooks
formalizer
React hooks based form validation made for humans.
Stars: ✭ 12 (-69.23%)
Mutual labels:  hook, react-hooks
useAudioPlayer
Custom React hook & context for controlling browser audio
Stars: ✭ 176 (+351.28%)
Mutual labels:  hook, react-hooks
window-scroll-position
React hook for Window scroll position
Stars: ✭ 81 (+107.69%)
Mutual labels:  hook, react-hooks
goverlay
DirectX hook and game overlay solution for Electron, Qt and CEF, just like discord/steam game overlay,inject any app to overlay in your game
Stars: ✭ 426 (+992.31%)
Mutual labels:  hook
Tangram.Bamboo
Tangram Bamboo CLI Wallet
Stars: ✭ 14 (-64.1%)
Mutual labels:  encryption
prophet
用于构建 react 中后台前端应用框架
Stars: ✭ 12 (-69.23%)
Mutual labels:  hook
react-hook-clipboard
A React hook for accessing clipboard
Stars: ✭ 16 (-58.97%)
Mutual labels:  react-hooks
use-simple-store
🏬 Simple state management using React Hook
Stars: ✭ 21 (-46.15%)
Mutual labels:  react-hooks
hookr
PHP action and filter hook system
Stars: ✭ 39 (+0%)
Mutual labels:  hook
LowLevelInput.Net
A thread safe and event driven LowLevelMouse and LowLevelKeyboard Hook
Stars: ✭ 32 (-17.95%)
Mutual labels:  hook

Dencrypt example

use-dencrypt-effect

NPM Open in Visual Studio Code

A custom React hook generating crypting text effect.

Live demo: https://codesandbox.io/s/use-dencrypt-effect-7td0f.

Install

npm install --save use-dencrypt-effect

Usage

import * as React from "react";

import { useDencrypt } from "use-dencrypt-effect";

const values = ["useDencrypt", "Customizable", "React Hook", "Text Effect"];

const Example = () => {
  const { result, dencrypt } = useDencrypt();

  React.useEffect(() => {
    let i = 0;

    const action = setInterval(() => {
      dencrypt(values[i]);

      i = i === values.length - 1 ? 0 : i + 1;
    }, 2000);

    return () => clearInterval(action);
  }, []);

  return <div>{result}</div>;
};

Custom Options

Type: Object.

All parameters are optional.

chars

Type: Array<string>. Default: ["-", ".", "/", "^", "*", "!", "}", "<", "~", "$", "0", "1", "2", "3", "4", "5", "a", "b", "c", "d", "e", "f"];

An array of characters used for the effect. Picked by random.

interval

Type: number. Default: 50.

Number of miliseconds it takes for every animation step (one character).

Other Examples

One character

const options = {
  chars: ["_"]
}

const Example = () => {
  const { result, dencrypt } = useDencrypt(options);

  // ...

Run effect on hover

Live Example | Source Code


This hook is created using create-react-hook.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].