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

joshjs

v1.0.8

Published

A JavaScript library to animate content on page scroll.

Downloads

631

Readme

Josh.js

A JavaScript library to animate content on page scroll

  • No jQuery Dependency
  • Written on ES6(Compiled ES5 version available)
  • Very much lightweight, Only 2KB 
  • Animate using Animate.css library
  • You can use your own CSS animation library
  • Work on newly created DOM

See it in action!

 Loved it, Press the Star Button 

Installation

Using NPM

npm install joshjs

If you are facing issue using as node module then please check the "asModule" branch. I have added example code for that.

Using HTML 〈script〉 tag

<script src="js/josh.min.js">

// Or use ES5
<script src="js/josh.es5.min.js">

CDN

jsDelivr

//ES6
https://cdn.jsdelivr.net/npm/[email protected]/dist/josh.min.js

//ES5
https://cdn.jsdelivr.net/npm/[email protected]/dist/josh.es5.min.js

UNPKG

//ES6
https://unpkg.com/[email protected]/dist/josh.min.js

//ES5
https://unpkg.com/[email protected]/dist/josh.es5.min.js

Usage

HTML

<div class="josh-js" data-josh-anim-name="fadeInUp">A JavaScript library to animate content on page scroll.</div>

// You have to provide below data attribute with animation name from Animate.css library or your own library

data-josh-anim-name="fadeInUp"

How to get animation name

Go to Animate.css website. Copy the animation class name from right panel, you will get class name like "animatebackInDown" remove "animate" you get animation name like "backInDown" add this to above data attribute.

CSS

Add this css file to your HTML file.

<link rel="stylesheet" href="css/animate.css" />

JavaScript

const josh = new Josh();

If you write HTML, added CSS file and called JavaScript like above so that you are good to go!

Advanced usage

HTML

<div
    class="element josh-js"
    data-josh-anim-name="lightSpeedInRight"
    data-josh-duration="1500ms"
    data-josh-anim-delay="3.5s"
    data-josh-iteration="infinite"
>
    Written on ES6
</div>

JavaScript

const josh = new Josh({
    // DOM CSS class to Animate, default is "josh-js"
    initClass: "josh-js",

    // Animation CSS class from Animate.css library
    animClass: "animate__animated",

    // Element distance of viewport to triggering the animation. default is 0.2 means 20% of element view animation will trigger
    offset: 0.2,

    // Animation will trigger on Mobile or not. Default is true
    animateInMobile: true,

    // Animation will trigger on newly added element or not. Default is false
    onDOMChange: false,
  });

Dependencies

Browser Support

All modern browsers are supported. Because of written in ES6 and modern web API Internet Explorer will not support. Here you can check supported browser:

IntersectionObserver Not supported by IE.

MutationObserver Supported by IE 11.

If you want to support Internet Explore so that you can use Polifill for IntersectionObserver.

IntersectionObserver Polifill 1

IntersectionObserver Polifill 2

Developer

Developed by Al Mamun

Want to contribute? Great!

Fork it, clone it to your PC, fix the issue, push to your repository, Make a pull request to this repository. You are done!

License

MIT

Free Software, Hell Yeah!