https://github.com/vanruesc/hygress
https://github.com/vanruesc/hygress
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vanruesc/hygress
- Owner: vanruesc
- License: zlib
- Archived: true
- Created: 2015-06-27T17:44:14.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-11T23:21:47.000Z (over 10 years ago)
- Last Synced: 2025-01-10T05:21:42.744Z (over 1 year ago)
- Language: JavaScript
- Size: 422 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hygress
[](https://travis-ci.org/vanruesc/hygress)
[](https://ci.appveyor.com/project/vanruesc/hygress)
[](http://badge.fury.io/gh/vanruesc%2Fhygress)
[](http://badge.fury.io/js/hygress)
[](https://david-dm.org/vanruesc/hygress)
A hy(potrochoid pro)gress visualisation library. The animation that this module
provides can be combined with other rendering processes and doesn't use an
isolated animation loop. The decision of where, when and how Hygress should
draw something is entirely yours.
## Installation
Download the [minified library](http://vanruesc.github.io/hygress/build/hygress.min.js) and include it in your project:
```html
```
You can also install it with [npm](https://www.npmjs.com).
```sh
$ npm install hygress
```
## Usage
```javascript
import Hygress from "hygress";
// All parameters are optional and can always
// be adjusted later by accessing them as properties.
var hygress = new Hygress({
hypotrochoid: Hygress.Hypotrochoid.PENTAGRAM,
size: [400, 300],
scale: 1.0,
clearCanvas: false,
colourRoll: false,
saturation: 90.0,
luminance: 75.0,
opacity: 0.25,
hue: 180.0
});
// Grab the canvas and put it on the page.
document.body.appendChild(hygress.canvas);
// You can also give Hygress your own canvas if you want.
var myCanvas = document.createElement("canvas");
hygress.canvas = myCanvas;
document.body.appendChild(myCanvas);
// Define the current canvas' size.
hygress.size = [window.innerWidth, window.innerHeight];
// Specifically define the hypotrochoid's size.
hygress.htSize = 100.0;
// Step the animation.
requestAnimationFrame(hygress.render);
// You need to clear the canvas if the clearCanvas flag has been set to false.
var ctx = hygress.canvas.getContext("2d");
ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
// Sick of clearing manually?
hygress.clearCanvas = true;
// Linearly transition the opacity and scale.
hygress.transitionTime = 1.25; // seconds
hygress.opacity = 0.0;
hygress.scale = 0.0;
```
## Documentation
[API](http://vanruesc.github.io/hygress/docs)
## Contributing
Maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
## License
Copyright (c) 2015 Raoul van Rüschen
Licensed under the Zlib license.