Skip to content

Commit

Permalink
paths fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuKKu- committed Jun 7, 2017
1 parent db1c3a4 commit 20fd4e5
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 8 deletions.
61 changes: 60 additions & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,66 @@ And use the component in your HTML
<particles [style]="style" [width]="width" [height]="height" [params]="params"></particles>
```

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
<particles [style]="myStyle" [width]="width" [height]="height" [params]="myParams"></particles>
```


## License
Expand Down
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/lib/CanvasManager.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Particle.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ParticleInteraction.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Particle, IParams, ICanvasParams } from '.';
import { Particle, IParams, ICanvasParams } from './index';

export class ParticleInteraction {
constructor() { }
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ParticlesManager.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IParams, ITmpParams, Particle } from '.';
import { IParams, ITmpParams, Particle } from './index';

export type RGB = {
r: number;
Expand Down

0 comments on commit 20fd4e5

Please sign in to comment.