From 20fd4e516da7d8b38acdc1cebcc07615b61319a7 Mon Sep 17 00:00:00 2001 From: Luc RAYMOND Date: Wed, 7 Jun 2017 10:21:54 +1000 Subject: [PATCH] paths fix --- README.MD | 61 +++++++++++++++++++++++++++++++++- src/index.ts | 2 -- src/lib/CanvasManager.ts | 2 +- src/lib/Particle.ts | 2 +- src/lib/ParticleInteraction.ts | 2 +- src/lib/ParticlesManager.ts | 2 +- src/lib/utils.ts | 2 +- 7 files changed, 65 insertions(+), 8 deletions(-) diff --git a/README.MD b/README.MD index 1b48794..81d9cb1 100644 --- a/README.MD +++ b/README.MD @@ -36,7 +36,66 @@ And use the component in your HTML ``` -Find your parameters configuration [here](http://vincentgarreau.com/particles.js/). +Parameters configuration can be found [here](http://vincentgarreau.com/particles.js/). If you don't provide parameters, default one is used. + + +##Properties + +| Property | Type | Definition | +| -------- | ------ | --------------------------------------- | +| params | object | The parameters for particle.js | +| style | object | The style of the canvas container | +| width | number | The width of the canvas element (in %) | +| height | number | The height of the canvas element (in %) | + + +##Example + +```typescript + +@Component({ + selector: 'app-root', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] +}) +export class AppComponent implements OnInit { + myStyle: object = {}; + myParams: object = {}; + width: number = 500; + height: number = 500; + + ngOnInit() { + this.myStyle = { + 'position': 'fixed', + 'width': '100%', + 'height': '100%', + 'z-index': -1, + 'top': 0, + 'left': 0, + 'right': 0, + 'bottom': 0, + }; + + this.myParams = { + particles: { + number: { + value: 200, + }, + color: { + value: '#ff0000' + }, + shape: { + type: 'triangle', + }, + } + }; + } +} +``` + +```html + +``` ## License diff --git a/src/index.ts b/src/index.ts index 41de9a1..713e504 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,8 +4,6 @@ import { CommonModule } from '@angular/common'; import { ParticlesComponent } from './particles.component'; import { ParticlesDirective } from './particles.directive'; -export * from './lib/index'; - @NgModule({ imports: [ CommonModule diff --git a/src/lib/CanvasManager.ts b/src/lib/CanvasManager.ts index 0c6dcb6..0f82beb 100644 --- a/src/lib/CanvasManager.ts +++ b/src/lib/CanvasManager.ts @@ -1,4 +1,4 @@ -import { ParticlesManager, ICanvasParams, IParams, ITmpParams, hexToRgb } from '.'; +import { ParticlesManager, ICanvasParams, IParams, ITmpParams, hexToRgb } from './index'; export class CanvasManager { public particlesManager: ParticlesManager; diff --git a/src/lib/Particle.ts b/src/lib/Particle.ts index eee6e0b..de94ef2 100644 --- a/src/lib/Particle.ts +++ b/src/lib/Particle.ts @@ -1,4 +1,4 @@ -import { IParams, ICanvasParams, ITmpParams, hexToRgb, getColor, createSvgImg }  from '.'; +import { IParams, ICanvasParams, ITmpParams, hexToRgb, getColor, createSvgImg }  from './index'; export class Particle { radius: number; diff --git a/src/lib/ParticleInteraction.ts b/src/lib/ParticleInteraction.ts index 7c09a9b..271f389 100644 --- a/src/lib/ParticleInteraction.ts +++ b/src/lib/ParticleInteraction.ts @@ -1,4 +1,4 @@ -import { Particle, IParams, ICanvasParams } from '.'; +import { Particle, IParams, ICanvasParams } from './index'; export class ParticleInteraction { constructor() { } diff --git a/src/lib/ParticlesManager.ts b/src/lib/ParticlesManager.ts index 65781aa..f8c0b5d 100644 --- a/src/lib/ParticlesManager.ts +++ b/src/lib/ParticlesManager.ts @@ -1,4 +1,4 @@ -import { Particle, ParticleInteraction, IParams, ICanvasParams, IMouseParams, ITmpParams, isInArray, clamp } from '.'; +import { Particle, ParticleInteraction, IParams, ICanvasParams, IMouseParams, ITmpParams, isInArray, clamp } from './index'; export class ParticlesManager { private _interaction: ParticleInteraction; diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 4bdf90b..f2fab58 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,4 +1,4 @@ -import { IParams, ITmpParams, Particle } from '.'; +import { IParams, ITmpParams, Particle } from './index'; export type RGB = { r: number;