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

nefesh

v1.1.20

Published

Simple and effective animation Library

Downloads

3

Readme

Nefesh


Nefesh is a simple library that returns an animated value according to the easing choosen function.

Install

npm install -D nefesh

Usage

import Nefesh from "nefesh";

const nefesh = new Nefesh({

    element: '.element',
    values: {
        x: 100,
        y: {
            from: 300,
            to: 100
        }
    },
    easing: "easeInOutExpo",
    duration: 700,
    begin: function ( element, values ) { ... },
    complete: function ( element, values ) { ... },
    progress: function ( element, values ) { ... }

});

Properties

element

default: null

'.element' indentifier. It will just cross the code, but to animate it you need to make it inside the progress callback.

values

default: { value: { from: 0, to: 1 } }

Values is an Object with the following syntax:

values :{
    value: {
        from: 0,
        to: 1
    }
}

You must send the from to the to value. It will always return the default object named value with an animation from 0 to 1.

You can also send just like this:

values: {
    value: 100
}

Nefesh will presume that it's the to value.

Or you can just send

values: 100

It will be the to value.

If you want to animate different, send multiples objects inside values:

values: {
    x: 200,
    y: {
        from: 450,
        to: 20
    }
}

ATENTION

Nefesh only calculates number values, colors are not supported.

easing

default 'easeInOutExpo'

Easing function to animate the values.

'linear', 'bounce',

'easeInCubic', 'easeOutCubic', 'easeInOutCubic',

'easeInExpo', 'easeOutExpo', 'easeInOutExpo',

'easeInElastic', 'easeOutElastic',

'easeInBack', 'easeOutBack', 'easeInOutBack',

duration

default: 700

Duration must be set in miliseconds.

begin

default: null

This function is called when the animation is about to start.

begin: function ( element, values ) { ... },

progress

default: null

This function is called in every step of the animation. Here is where you should animate your elements according to the values object.

progress: function ( element, values ) { ... }

complete

default: null

This function is called when the animation ends.

complete: function ( element, values ) { ... },