0.3.1 • Published 5 years ago

ng-scene v0.3.1

Weekly downloads
51
License
MIT
Repository
github
Last release
5 years ago

Installation

$ npm install ngx-scenejs

Make scene

  • app.module.ts
import { NgxSceneComponent, NgxSceneItemComponent, NgxSceneModule } from "ngx-scenejs";

@NgModule({
  declarations: [
    NgxSceneComponent,
  ],
})
  • app.component.ts
@Component(...)
export class AppComponent {
  keyframes = {
    ".circles .circle": (i: number) => ({
      0: {
        "border-width": "150px",
        "opacity": 1,
        "transform": "translate(-50%, -50%) scale(0)",
      },
      1.5: {
        "border-width": "0px",
        "opacity": 0.3,
        "transform": "scale(0.7)",
      },
      options: {
        delay: i * 0.4,
      },
    }),
  };
}
  • app.component.html
<ngx-scene
  [keyframes]="keyframes"
  easing="ease-in-out"
  fillMode="forwards"
  direction="normal"
  [iterationCount]="1"
  [playSpeed]="1"
  [time]="0"
  [css]="false"
  [autoplay]="false"
  (scenePlay)="onPlay($event)"
  (scenePaused)="onPaused($event)"
  (sceneEnded)="onEnded($event)"
  (sceneAnimate)="onAnimate($event)"
  (sceneTimeUpdate)="onTimeUpdate($event)"
  (sceneIteration)="onIteration($event)"
>
  <div className="circles">
    <div className="circle circle1"></div>
    <div className="circle circle2"></div>
    <div className="circle circle3"></div>
  </div>
</ngx-scene>

Props

nametypedefaultdescription
cssbooleanfalseCheck to play with CSS
autoplaybooleanfalseCheck to play automatically
keyframesobject{}Specify properties by time.
...optionsCheck out the options
...eventsCheck out Scene's events Check out SceneItem's events

Development

This project was generated with Angular CLI version 8.0.1.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

License

MIT License

Copyright (c) 2016 Daybrush
0.3.1

5 years ago

0.3.0

5 years ago

0.2.2

5 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago