New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

data-scroll-animation

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-scroll-animation

`npm install data-scroll-animation` ## Usage `data-scroll-parent` attribute >Specifies the start and end point of nested animation

  • 1.2.1
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

scroll-based HTMLElement property management

Installation

npm install data-scroll-animation

Usage

data-scroll-parent attribute

Specifies the start and end point of nested animation

data-scroll-top

Defines top offset in px

data-scroll-bottom

Defines bottom offset in px

The animation begins at start - topOffset and ends at end + bottomOffset

┌-------------------> topOffset     = frame 0
|
|
╔═════════════════╗-> start
║                 ║
║      PARENT     ║
║                 ║
╚═════════════════╝-> end
|
|
└-------------------> bottomOffset  = frame 1

data-scroll-(property)-(frame)="(value)"

Sets property of the attribute owner element to value at specified frame

property have format [property.]*property, so style.width works as well customProperty

value is linearly interpolated between frames special frames are "before" and "after"

data-scroll-(method)()

Calls method every frame with frame number as first and only argument method(frame: number): number

import * as ScrollAnimation from "data-scroll-animation";

ScrollAnimation.add(document.body); // adds all animation in the document
ScrollAnimation.add(document.querySelector("#animation")) // adds only the #animation element

ScrollAnimation.remove(document.querySelector("#element")) // removes only the #element element

FAQs

Package last updated on 08 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc