Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bramus/sda-utilities

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bramus/sda-utilities

Collection of utility functions for use with Scroll-Driven Animations

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Scroll-Driven Animations Utilities

Collection of utility functions for use with Scroll-Driven Animations

Installation

npm i @bramus/sda-utilities

The Utilities

runOnce – Run Scroll-Driven Animation only once

Example: run the fade-in animation on the .hero element only once.

import { runOnce } from '@bramus/sda-utilities';

window.addEventListener('load', (e) => {
	const $hero = document.querySelector('#hero');
	runOnce($hero, 'fade-in');
});

trackProgress – Sync the progress of an effect to something external

Example: output the animation progress as text on the page.

import { trackProgress } from '@bramus/sda-utilities';

window.addEventListener('load', (e) => {
	trackProgress(document.querySelector('.animation-subject').getAnimations()[0], (progress) => {
		document.querySelector('.animation-subject').innerText = `${(progress * 100).toFixed(5)}%`;
	});
});

Demos

Demos are included in this repository. Run npm run dev and visit http://127.0.0.1:8000/ to see the demos.

npm run dev

License

@bramus/sda-utilities is released under the MIT public license. See the enclosed LICENSE for details.

Keywords

FAQs

Package last updated on 28 Nov 2024

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