Skip to content

hello-steven/ScrollMotion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scroll Motion

Small vanilla javascript library for x,y transforms while scrolling

Public URL

Figma Motion Exploration Demo:

Inspiration

Getting Started

<div class="scroll-motion" data-speed-y="-2">
  Vertical scroll slow
</div>
<div class="scroll-motion" data-speed-y="7">
  Vertical scroll fast
</div>
<div class="rellax" data-speed-x="3">
  Horizontal scroll
</div>

<script src="scroll-motion.js"></script>
<script>
  // Accepts any class name
  var scrollMotion = new ScrollMotion('.scroll-motion');
</script>
<script>
  // Also can pass in optional settings block
  let scrollMotion = new ScrollMotion('.scroll-motion', {
    speedX: -2,
    speedY: 0,
    observe: 1,
  });
  scrollMotion();
</script>

Prerequisites

Installing

To get Scroll Motion running on your local machine do the following steps.

  1. git clone https://github.com/whiteboxpub/scroll-motion.git
  2. cd scroll-motion

or

  1. npm install intersection-observer (polyfill)
  2. npm install scroll-motion

Built With

  • Vanilla JS

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Vanilla javascript scroll library for motion

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published