1.0.0-alpha.2 • Published 2 years ago

motionrack v1.0.0-alpha.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Motionrack

npm version Downloads License


Table of Contents

Description

Motionrack is a free and open source JavaScript library for React, Vue, Angular and Svelte about web page scrolling by animating elements as they come into view. When elements enter the viewport, making it easy to create engaging and interactive web experiences.

Release-notes

Version 1.0.0-alpha.2


Major Changes:

  • Two syntax tags data-motion-hold & data-motion-release
  • Can set any time duration or delay for animations

Minor Changes:

  • zoomIn renamed into expand

Patch changes:

  • Add docs for speed

Installation

To install the motionrack, you can use the following npm command:

npm install motionrack

Features

  • Compatible for React, Vue, Angular and Svelte
  • Supports TypeScript
name of animationsdefault syntaxsyntax with time durationanimation effect
motionUpdata-motion-hold="motionUp"data-motion-hold="motionUp 5s"5 seconds one time
motionUpdata-motion-release="motionUp"data-motion-release="motionUp 5s"5 seconds continue if appeared while scrolling

You can set any number for Time Duration

time syntaxvaluespeed
0.1s0.1 secondssuperfast
0.2s0.2 seconds
0.3s0.3 seconds
0.4s0.4 seconds
0.5s0.5 secondssemi-fast
0.6s0.6 seconds
0.7s0.7 seconds
0.8s0.8 seconds
0.9s0.9 secondsfast
1s1 secondsmoderate
2s2 seconds
2.5s2.5 secondsdefault
3s3 secondsslow
4s4 secondsdelay
5s5 secondssuper-delay


expand, motionUp, motionDown, motionLeft, motionRight
fadeIn, flipUp, flipDown, flipLeft, flipRight
flash, bounceUp| bounceDown, minSpinLeft, minSpinRight
flare, flicker, motionBounce, maxSpinLeft, maxSpinRight

Optional layouts

Class name to wrap:

motionrack-wrap


layoutsquantitylayers
monoPadmonoBox1
duoPadduoBox2
trioPadtrioBox3

Sample


Sample website that used Motionrack

energize-coffee-house

Example

React

Direct method:

applicable for custom CSS, Bootstrap, Tailwind and Bulma


  • Bootstrap
import { useEffect } from 'react';
import { motionRack } from 'motionrack'; 

export const ExampleComponent = () => {
  useEffect(() => {
    motionRack();
  });

  return (
    <div>
      <div className="btn btn-primary" data-motion-hold="expand 0.4s">
        expand 
      </div>
    </div>
  );
};
  • Tailwind
import { useEffect } from 'react';
import { motionRack } from 'motionrack'; 

export const ExampleComponent = () => {
  useEffect(() => {
    motionRack();
  });

  return (
    <div>
      <div className="bg-blue-500 text-white px-4 py-2" data-motion-release="expand 4s">
        expand 
      </div>
    </div>
  );
};
  • Bulma
import { useEffect } from 'react';
import { motionRack } from 'motionrack'; 

export const ExampleComponent = () => {
  useEffect(() => {
    motionRack();
  });

  return (
    <div>
      <div className="box has-background-primary has-text-white p-4" data-motion-release="expand">
        expand
      </div>
    </div>
  );
};

Layouts method (optional)

import { useEffect } from 'react';
import { motionRack } from 'motionrack'; 

export const ExampleComponent = () => {
  useEffect(() => {
    motionRack();
  });

  return (
    <div>
      <div className="motionrack-wrap">
        <div className="monoPad">
          <div className="monoBox" data-motion-hold="expand 0.9s" style={{backgroundColor: 'gray'}}>
          expand 
             </div>
        </div>
        <div className="duoPad">
          <div className="duoBox" data-motion-release="motionLeft" style={{backgroundColor: 'gray'}}>
            motionLeft
          </div>
          <div className="duoBox" data-motion-hold="motionRight" style={{backgroundColor: 'gray'}}>
            motionRight
          </div>
        </div>
        <div className="monoPad">
          <div className="monoBox" data-motion-release="motionDown" style={{backgroundColor: 'gray'}}>
            motionDown</div>
        </div>
        <div className="duoPad">
          <div className="duoBox" data-motion-release="flipUp" style={{backgroundColor: 'gray'}}>
            flipUp
          </div>
          <div className="duoBox" data-motion-release="flipDown" style={{backgroundColor: 'gray'}}>
            flipDown</div>
        </div>
        <div className="trioPad">
          
          <div className="trioBox" data-motion-release="flipLeft" style={{backgroundColor: 'gray'}}>
            flipLeft
          </div>
          <div className="trioBox" data-motion-release="fadeIn" style={{backgroundColor: 'gray'}}>
            fadeIn</div>
          <div className="trioBox" data-motion-release="flipRight" style={{backgroundColor: 'gray'}}>
            flipRight</div>
        </div>
      </div>
   
    </div>
  );
};

License

MIT


Author

Demjhon Silver

1.0.1

2 years ago

1.0.0

2 years ago

1.0.0-beta.3

2 years ago

1.0.0-beta.2

2 years ago

1.0.0-beta.1

2 years ago

1.0.0-alpha.4

2 years ago

1.0.0-alpha.3

2 years ago

1.0.0-alpha.2

2 years ago

1.0.0-alpha.1

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.2-alpha

2 years ago

0.0.1-alpha

2 years ago