A javascript library to animate elements on scroll page events

Overview

ScrollJS

by Sam Sirianni

ScrollJS is a library written in Javascript. With ScrollJS you can animate elements on scroll events. Visit the ScrollJS website.

Installation

First thing first, remember to link in the head section the CSS file (scrolljs.css) that you can directly download at this github link.

NPM and React

If you want to use ScrollJS with React, open the terminal and type:

npm i @samsiri/scrolljs --save

Usage

import React, { Component } from 'react';
import scrolljs from '@samsiri/scrolljs';

export default class Index extends Component {
    componentDidMount() {
        scrolljs();  // initialize ScrollJS
    }

    render() {
        return (
            <div>
                <h1 scrolljs="fade-up">Hello World!</h1>
            </div>
        )
    }
}

HTML

If you want to use ScrollJS directly in a HTML page, download the files scrolljs.js and scrolljs.css from my GitHub repository.

Usage

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="scrolljs.css"/>
    </head>
    <body>
        <h1 scrolljs="flip-left">Hello World!</h1>
        <script src="scrolljs.js"></script>
    </body>
</html>

ScrollJS attributes

<div scrolljs="type[|duration(ms)|timing-function]"></div>

<!-- Examples -->
<div scrolljs="flip-left|800|ease"></div>
<div scrolljs="fade-up|350"></div>
<div scrolljs="flip-left|750|linear"></div>

type

  • fade
  • fade-up
  • fade-down
  • fade-left
  • fade-right
  • fade-up-left
  • fade-down-left
  • fade-down-right
  • fade-up-right
  • flip-left
  • flip-up
  • flip-right
  • flip-up-right
  • flip-down-right
  • flip-up-left
  • flip-down-left
  • flip-down
  • scale-up
  • scale-down

duration

Duration represents the transition duration in milliseconds.

timing-function

Timing function represents the timing function (Ex. ease-in).

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

You might also like...

infiniteScrollWithTemplate - JQuery plugin for ajax-enabled infinite page scroll / auto paging with template

jQuery Infinite With Template Plugin JQuery plugin for ajax-enabled infinite page scroll with template. If you like jQuery until now, this little libr

Mar 19, 2021

Small js library to animate some writing effect through a list of strings. It also supports settings for typo errors, to make it more human likely.

Small js library to animate some writing effect through a list of strings. It also supports settings for typo errors, to make it more human likely.

Write and Delete Small js library to animate some writing effect through a list of strings. It also supports settings for typo errors, to make it more

Nov 15, 2022

The awesomebooks project is a simple list, but separated into 3 parts and given a retro feel. The main page is where we can add books, and on another page we can see the list, and remove items. There is also a "contact-us" page.

Awesome Books This is the restructured version of the famous awesome-books project! Here you can find JavaScript broken into modules, using import-exp

Nov 15, 2022

animate.css as a Tailwind plugin

tailwind-animatecss Use animate.css as a Tailwind 3 plugin. Demo – https://dumptyd.github.io/tailwind-animatecss Table of contents Installation Usage

Dec 19, 2022

Animate your Alpine components.

Animate your Alpine components 🚀 This package provides you with a simple helper to animate your ALpine.js components. Installation The recommended wa

Nov 16, 2022

Quick and easy spring animation. Works with other animation libraries (gsap, animejs, framer motion, motion one, @okikio/animate, etc...) or the Web Animation API (WAAPI).

Quick and easy spring animation. Works with other animation libraries (gsap, animejs, framer motion, motion one, @okikio/animate, etc...)  or the Web Animation API (WAAPI).

spring-easing NPM | Github | Docs | Licence Quick and easy spring animations. Works with other animation libraries (gsap, animejs, @okikio/animate, mo

Dec 14, 2022

A lightweight script to animate scrolling to anchor links.

DEPRECATION NOTICE: Smooth Scroll is, without a doubt, my most popular and widely used plugin. But in the time since I created it, a CSS-only method f

Dec 26, 2022

A jQuery plugin that works in harmony with animate.css in order to enable animations only when content comes into view.

jQuery AniView A jQuery plugin that works in harmony with animate.css in order to enable animations only when content comes into view. Now supports v4

Sep 10, 2022

A JQuery plugin to animate text as in the credits of the 2014 movie "Birdman".

birdman.js A JQuery plugin to animate text as in the credits of the 2014 movie "Birdman". See it in action at chrisma.github.io/birdman.js I'm aware t

Dec 30, 2021
Owner
Sam Sirianni
Web developer --> Javascript, HTML, CSS & Sass, Golang, Nodejs, Python, C++
Sam Sirianni
Animate on scroll library

❗ ❗ ❗ This is README for aos@next ❗ ❗ ❗ For last stable release (v2) go here ?? Demo ?? Codepen Examples Different built-in animations With anchor set

Michał Sajnóg 22.3k Jan 2, 2023
A lightweight JavaScript utility to fade elements in and out of view on page scroll.

ScrollFade ScrollFade is used to fade elements in and out of view while scrolling through a page. Tag any elements you want to fade with the class scr

Jordan Trbuhovic 14 Dec 15, 2022
Create a deep copy of a set of matched elements with the dynamic state of all form elements copied to the cloned elements.

jq-deepest-copy FUNCTION: Create a deep copy of a set of matched elements while preserving the dynamic state of any matched form elements. Example Use

Michael Coughlin 5 Oct 28, 2022
Javascript library for switching fixed elements on scroll through sections. Like Midnight.js, but without jQuery

Library for Switching Fixed Elements on Scroll Sometimes designers create complex logic and fix parts of the interface. Also they colour page sections

Vladimir Lysov 38 Sep 19, 2022
An easy way to animate SVG elements.

Walkway I loved the animations for the polygon ps4 review a few months back and decided to create a small library to re-create them (simple demo). It

Connor Atherton 4.4k Jan 2, 2023
A JavaScript library for adding ripple effects to HTML elements based on mouse events.

About project Ripplejs is an open source javascript library created for the purpose of adding ripple effects to html elements based on mouse events. L

Udezue Oluomachi Chimaobi 7 May 10, 2022
Lightweight and easy to use vanilla js library to add css animations to elements on scroll.

Scrollrisen Trigger css animations on scroll as elements enter the viewport. Zero dependencies, lightweight and easy to use and customize Installation

null 1 Oct 13, 2022
Javascript library to animate images on hover.

Ripple Hover Effect Javascript library to animate images on hover. If this project help you, don't forget to star it. Codepen demo by Essam Abed Demo

Essam Abed 13 Nov 21, 2022
Reveal CSS animation as you scroll down a page

WOW.js Reveal CSS animation as you scroll down a page. By default, you can use it to trigger animate.css animations. But you can easily change the set

Matt Delac 9.7k Jan 8, 2023
Automatically make same-page links scroll smoothly

Smooth Scroll Plugin Allows for easy implementation of smooth scrolling for same-page links. Note: Version 2.0+ of this plugin requires jQuery version

Karl Swedberg 2k Dec 25, 2022