Coder Social home page Coder Social logo

crazko / use-dencrypt-effect Goto Github PK

View Code? Open in Web Editor NEW
57.0 57.0 9.0 1.71 MB

A custom React hook generating crypting text effect.

License: MIT License

JavaScript 6.81% TypeScript 90.27% HTML 2.91%
encryption hook react react-hooks text-effect

use-dencrypt-effect's Introduction

wakeup

use-dencrypt-effect's People

Contributors

crazko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

use-dencrypt-effect's Issues

infinite loop

Hi,
I'm new to react. I don't know how to run this hook.
Just I have used this as it. But the text effect is not running infinitely. Can you please help with this problem?
The effect is running only one.

Starts with Empty Text

As the method loads, the page is blank, so it looks as if it hangs. Is there a way to begin with some default text from the array before the animation begins?

Thanks

'useDeEncrypt' is not defined

Installed with yarn add use-dencrypt-effect, literally copied usage example and got error 'useDeEncrypt' is not defined no-undef.

import { useDencrypt } from "use-dencrypt-effect"; is grayed out.

Wrong package version install

Steps to reproduce

  • Create a new react project.
  • Run npm install --save use-dencrypt-effect

Expected result
Package.json has use-dencrypt-effect with version 1.0.1 and uses the same API as the examples.

Actual result
Package.json has use-dencrypt-effect with version 2.0.0-rc.1 and uses the different API than the examples.

Examples don't work out the box

Your example code doesn't work in my project. Various spellings of dencrypt, deEncrypt etc.

Here is one that worked for me

import React, { useEffect } from 'react';
import { useDencrypt } from 'use-dencrypt-effect';

const values = ['test', 'test2'];

function TextTest() {
  const { result, dencrypt } = useDencrypt();
  useEffect(() => {
    let i = 0;

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

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

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

  return (
    <div>
      <h1>{result}</h1>
    </div>
  );
}

export default TextTest;

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.