All Projects → mamunhpath → Josh.js

mamunhpath / Josh.js

Licence: mit
A JavaScript library to animate content on page scroll.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Josh.js

Bin
A tiny (<1kb) localStorage and sessionStorage helper library.
Stars: ✭ 70 (-79.71%)
Mutual labels:  javascript-library, vanilla-javascript
Fine Uploader
Multiple file upload plugin with image previews, drag and drop, progress bars. S3 and Azure support, image scaling, form support, chunking, resume, pause, and tons of other features.
Stars: ✭ 8,158 (+2264.64%)
Mutual labels:  javascript-library, vanilla-javascript
Infinite Carousel
A timed infinite carousel that uses vanilla JavaScript & CSS animations.
Stars: ✭ 9 (-97.39%)
Mutual labels:  vanilla-javascript, css-animations
aioneframework
Aione Framework: All-in-one lightweight mobile first front-end framework to design websites, web applications, mobile applications, progressive web applications having large number of examples, documentation, tutorials, community support, components.
Stars: ✭ 13 (-96.23%)
Mutual labels:  css-animations, javascript-library
animusjs
🎆 AnimusJS is the solution for combine JS and CSS animations.
Stars: ✭ 42 (-87.83%)
Mutual labels:  css-animations, javascript-library
Micron
a [μ] microInteraction library built with CSS Animations and controlled by JavaScript Power
Stars: ✭ 2,252 (+552.75%)
Mutual labels:  javascript-library, css-animations
Darken
🌑 Dark mode made easy
Stars: ✭ 571 (+65.51%)
Mutual labels:  javascript-library, vanilla-javascript
previewer
A super light-weight JavaScript image previewer [not actively maintained]
Stars: ✭ 24 (-93.04%)
Mutual labels:  vanilla-javascript, javascript-library
web-animation-club
CSS controlled animations with transitionEnd, onTransitionEnd, animationend, onAnimationEnd events and frame throwing. Tiny javascript library with cross-browser methods to handle css animation/transition callbacks and event loop frame throwing. 📚🖥️📱
Stars: ✭ 52 (-84.93%)
Mutual labels:  css-animations, javascript-library
lexicon-mono-seq
DOM Text Based Multiple Sequence Alignment Library
Stars: ✭ 15 (-95.65%)
Mutual labels:  vanilla-javascript, javascript-library
Preload It
A tiny 1kb JavaScript library for preloading assets on the browser via XHR2. It provides the ability to load assets of different file types and composite progress events.
Stars: ✭ 300 (-13.04%)
Mutual labels:  javascript-library
Kalmanjs
Javascript based Kalman filter for 1D data
Stars: ✭ 298 (-13.62%)
Mutual labels:  javascript-library
Voca
The ultimate JavaScript string library
Stars: ✭ 3,387 (+881.74%)
Mutual labels:  javascript-library
Approvejs
A simple JavaScript validation library that doesn't interfere
Stars: ✭ 336 (-2.61%)
Mutual labels:  javascript-library
Selectr
A lightweight, vanilla javascript select box replacement. No dependencies.
Stars: ✭ 293 (-15.07%)
Mutual labels:  vanilla-javascript
Native Css
Convert pure CSS to React Style or javascript literal objects.
Stars: ✭ 322 (-6.67%)
Mutual labels:  css-animations
Length.js
📏 JavaScript library for length units conversion.
Stars: ✭ 292 (-15.36%)
Mutual labels:  javascript-library
Anychart
AnyChart is a lightweight and robust JavaScript charting solution with great API and documentation. The chart types and unique features are numerous, the library works easily with any development stack.
Stars: ✭ 288 (-16.52%)
Mutual labels:  javascript-library
Dropzone
Dropzone is an easy to use drag'n'drop library. It supports image previews and shows nice progress bars.
Stars: ✭ 16,097 (+4565.8%)
Mutual labels:  javascript-library
Epic Spinners
Easy to use css spinners collection with Vue.js integration
Stars: ✭ 3,548 (+928.41%)
Mutual labels:  css-animations

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

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 "animate__backInDown" 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!

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].