npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gold.au/animate

v2.0.0

Published

A JavaScript function to animate CSS properties of page elements.

Downloads

74

Readme

@gold.au/animate

A JavaScript function to open, close and toggle the display of page elements.

Contents


Install

yarn add @gold.au/animate
npm install @gold.au/animate

⬆ back to top


API

Animate has 3 public functions:

Run

AU.animate.Run( options )

The options settings are:

element - DOM node/s you want to animate
property - CSS property you want to animate (optional, defaults to height)
endSize - 'auto' or pixel size of the property after the animation has finished (optional)
speed - animation speed in milliseconds (optional, defaults to 250ms)
callback - callback function to run when the animation completes (optional)

Example:

AU.animate.Run(
  element: document.getElementById('elementId'),
  property: 'height',
  endSize: 'auto',
  speed: 1000,
  callback: myFunction,
)

Stop

AU.animate.Stop( options )

The options settings are:

element - DOM node you want to stop animating (this can only be a single element)

Example:

AU.animate.Stop(
  element: document.getElementById('elementId'),
)

Toggle

AU.animate.Toggle( options )

The options settings are:

element - DOM node/s you want to animate
property - CSS property you want to animate (optional, defaults to height)
openSize - pixel size of the property when the element is open (optional, defaults to auto)
closeSize - pixel size of the property when the element is closed (optional, defaults to 0)
speed - animation speed in milliseconds (optional, defaults to 250ms)
prefunction - function to be executed before any animation starts, passes {object} element, {string} state (optional) postfunction - function to be executed after any animation ends, passes {object} element, {string} state (optional) callback - function to be executed after the animation ends, passes {object} element, {string} state (optional)

Example:

AU.animate.Toggle(
  element: document.getElementById('elementId'),
  property: 'height',
  closeSize: 0,
  openSize: 'auto',
  speed: 1000,
  prefunction: function( element, state ) { myPreFunction() },
  postfunction: function( element, state ) { myPreFunction() },
  callback: function( element, state ) { myCallbackFunction() },
)

⬆ back to top


Dependency graph

/animate

⬆ back to top


Tests

The visual test: https://auds.service.gov.au/packages/animate/tests/site/

Run jest for the unit tests

⬆ back to top


Release History

  • v1.0.14 - Fix unsafe-eval CSP issue
  • v1.0.13 - Remove --save-dev flag from readme instructions
  • v1.0.12 - Removed uikit references
  • v1.0.11 - Update dependencies
  • v1.0.10 - Update dependencies
  • v1.0.9 - Update browser-sync dependency
  • v1.0.8 - Update dependencies
  • v1.0.7 - Fixing bug where openSize of 0 gets turned into auto
  • v1.0.6 - Removing web pack dev server, updating dependencies
  • v1.0.5 - Fixed build scripts for Windows
  • v1.0.4 - Change npm run watch browser-sync location
  • v1.0.3 - Update dependencies
  • v1.0.2 - Fix typo in homepage link
  • v1.0.1 - Changing homepage link
  • v1.0.0 - Moved to AU namespace, fixed export
  • v0.1.5 - Fixed pancake config
  • v0.1.4 - Pinned pancake plugins
  • v0.1.3 - Exposed GetCSSPropertyBecauseIE publicly, added prefunction, postfunction
  • v0.1.2 - Removed core as dependency
  • v0.1.1 - 💥 Initial version

⬆ back to top


License

Copyright (c) Commonwealth of Australia. Licensed under MIT.

⬆ back to top

};