npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-curtain-reveal

v1.0.3

Published

React Container for revealing/hiding conten with a curtain animation.

Downloads

7

Readme

NPM JavaScript Style Guide

Hi! I created this react component since i couldnt find anything similar and wanted to share it with my fellow coders. The main idea is to have a Box which reveals its content onClick with a curtain animation. You can customise quite a lot of it, you can see a documentation of that down below. The react-curtain-reveal depends on the width and height of its Parent, so its easier to make responsive.

Examples

Dependencies

Since we are doing a lot of styling magic i used material-ui´s class generator, this will change in future updates since i think less dependencies are better, but keep this in mind while using it.

Get Started

First just installed the package.

npm install --save react-curtain-reveal

Then just import and use the component. Just keep in mind the height and width fit to the Parent component. If you want to directly size it whithout a Parent, look at the second example please.

<div style={{width:500,height:500}}>
    <CurtainRevealBox>
        <p>content</p>
    </CurtainRevealBox>
</div>

Here an example with custom configurations

<div style={{width:500,height:500}}>
    <CurtainRevealBox
        onReveal={() => { console.log("revealed") }}
        onHide={() => { console.log("hide") }}
        styleConfig={{
            curtain: {
            borderRadius: 0,

            },
            leftPanel: {
            background: "linear-gradient(90deg, rgba(34,193,195,1) 0%, rgba(253,187,45,1) 100%)"
            },
            rightPanel: {
            background: "linear-gradient(270deg, rgba(34,193,195,1) 0%, rgba(253,187,45,1) 100%)"
            },
            content: {
            backgroundColor: "rgba(34,193,195,1)"
            }
        }}
        animationConfig={{
            variant: "linear",
            speed: 5
        }}
        revealCheck={() => {
              return Math.random() <= 0.5;
            }}
        stayHidden={false}
        >
            <p>content</p>
    </CurtainRevealBox>
</div>

Documentation

General

| Name | Type | Default | Description | |-----------------|----------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | onReveal | function | | will be called on succesfull reveal | | onHide | function | | will be called on successfull hide | | revealCheck | function | | Will be called to check if the content should be revealed. You can do whatever you want in this function, as long as you return true(show content) or false(dont show content). By default it will allways return true. | | isRevealed | boolean | false | on true content will be shown | | stayHidden | boolean | true | If false, the user will be able to hide the content again with a click. But this comes with a downside at the moment, the content won´t be clickable or scrollable, since the clickable are stays rendered. I am working on a fix. | | animationConfig | object | | Animations settings of the curtain reveal/hide. See below for more details. | | styleConfig | object | | Style settings for the component. See below for more details. |

animationConfig

| Name | Type | Default | Description | |---------|--------|------------|------------------------------------------------------------------------------------------------------------------------------------------------| | variant | string | "ease-out" | Controlls the transition style of the curtain reveal/hide. Can be one of the following: [ 'ease' , 'linear' , 'ease-in' , 'ease-out' , 'ease-in-out' ]. | | speed | number | 1 | Controlls the duration of the reveal/hide animation. |

styleConfig

| Name | Type | Default | Description | |------------|--------|---------|----------------------------------------------------------------------------------| | curtain | object | | Style of the root curtain box. | | leftPanel | object | | Style of the left Panel. duh. | | rightPanel | object | | Style of the right Panel. | | content | object | | Style of the content box, this is where the children will be displayed. | | forbidden | object | | The styling of the curtain-box if the content reveal is denied(see checkReveal). |

Author

I hope you find this Package usefull. If you find any bugs, things you dislike or even if you want to tell me what you do like feel free to email me at: [email protected]

License

MIT © chimeralevia