# ngx-screen-saver

> Screen saver component for Angular.

Latest version **0.0.5** (published 2022-05-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install ngx-screen-saver
pnpm add ngx-screen-saver
yarn add ngx-screen-saver
bun add ngx-screen-saver
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2022-05-23 |
| First published | 2022-05-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 518.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Krzysztof "Szyszak" Szyszko |
| Maintainers | szyszak |
| Keywords | angular, screen saver, weird, silly, stupid |

## Links

- npm: https://www.npmjs.com/package/ngx-screen-saver
- Repository: https://github.com/szyszak/ngx-screen-saver
- Issues: https://github.com/szyszak/ngx-screen-saver/issues
- npm.io page: https://npm.io/package/ngx-screen-saver

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2022-05-23
- 0.0.4 — 2022-05-21
- 0.0.3 — 2022-05-19
- 0.0.2 — 2022-05-18
- 0.0.1 — 2022-05-15

## README

# ngx-screen-saver

## About:

Screen saver component for Angular.
Screen saver will appear when user is being idle for certain amount of time.

You can check them out on this demo website: https://szyszak.github.io/ngx-screen-saver-demo/

This library uses `p5.js` under the hood.

## Installation guide:

Install library using npm:

`npm install ngx-screen-saver`

Screen savers depend on additional assets, you'll have to modify your `angular.json` file to add them:

```json
"assets": [
  "src/favicon.ico",
  "src/assets",
  {
    "glob": "**/*",
    "input": "node_modules/ngx-screen-saver/assets",
    "output": "assets/ngx-screen-saver"
  }
]
```

<!-- You will also need to install p5.js peer dependency:

`npm install p5.js` -->

## Usage:

Add `NgxScreenSaverModule` to imports array in Angular module:

```ts
@NgModule({
  declarations: [AppComponent],
  imports: [BrowserModule, NgxScreenSaverModule],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}
```

Put `ngx-screen-saver` component in the template (preferably in `app.component.html`):

```html
<ngx-screen-saver></ngx-screen-saver>
```

## Configuration:

You can pass following optional inputs to the component:

**idleAfterMs**: time from last user activity after which the screen saver will appear (in miliseconds).
Default value: 10000 (10 seconds).

**variant**: screen saver variant to show. Available variants: "fireworks", "dvd", "stars".
Default value: "fireworks".

**opacity**: screen saver opacity. 0 is transparent, 1 is opaque. Defaults to 1.

**zIndex**: screen saver z-index CSS value. Defaults to 1.

Example:

```html
<ngx-screen-saver
  [opacity]="0.8"
  [zIndex]="2"
  [idleAfterMs]="2000"
  [variant]="'dvd'"
></ngx-screen-saver>
```

---
_Source: https://npm.io/package/ngx-screen-saver · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
