Configurable Color Transition Library – sweep.js

Category: Animation , Color , Javascript , Recommended | October 10, 2018
Author: rileyjshaw
Views Total: 1,272
Official Page: Go to website
Last Update: October 10, 2018
License: MIT

Preview:

Configurable Color Transition Library – sweep.js

Description:

sweep.js is a vanilla JavaScript library which enables you to create smooth color transitions on any elements.

How to use it:

Insert the minified version of the sweep.js library into the html document.

<script src="bin/sweep.min.js"></script>

The basic JavaScript syntax.

sweep(target, properties, fromColor, toColor, options)
  • target: target element to animate
  • properties: CSS properties you wish to animate
  • fromColor: initial color
  • toColor: final color after the transition
  • options: an array of options

Available options.

  • callback: will be triggered once the animation finishes
  • direction: clockwise (1) or counterclockwise (-1)
  • duration: the duration of the animation.
  • space:  ‘HSL’, ‘HSLuv’, or ‘RGB’

Changelog:

10/10/2018

  • Allow API to take an array of elements

You Might Be Interested In:


Leave a Reply