# @mangoweb/parallax

> Watches elements vertical position in viewport.

Latest version **0.1.4** (published 2022-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mangoweb/parallax
pnpm add @mangoweb/parallax
yarn add @mangoweb/parallax
bun add @mangoweb/parallax
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2022-10-12 |
| First published | 2019-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | manGoweb |
| Maintainers | onset, mango-cli, jirkavebr, viliamkopecky, matejsimek, luchalupa |

## Links

- npm: https://www.npmjs.com/package/@mangoweb/parallax
- Repository: https://github.com/manGoweb/npm.git#master
- Homepage: https://github.com/manGoweb/npm/tree/master#readme
- Issues: https://github.com/manGoweb/npm/issues
- npm.io page: https://npm.io/package/@mangoweb/parallax

## Dependencies (1)

- [light-bounds](https://npm.io/package/light-bounds.md) 0.0.7

## Recent versions

- 0.1.4 (latest) — 2022-10-12
- 0.1.3 — 2022-10-11
- 0.1.2 — 2022-10-11
- 0.1.1 — 2022-10-11
- 0.0.11 — 2022-10-11
- 0.0.10 — 2020-12-21
- 0.1.0 — 2020-11-08
- 0.0.9 — 2020-11-04
- 0.0.8 — 2019-11-25
- 0.0.7 — 2019-11-24
- 0.0.6 — 2019-11-24
- 0.0.5 — 2019-11-24
- 0.0.4 — 2019-11-24
- 0.0.3 — 2019-11-24
- 0.0.2 — 2019-11-10
- … 1 more at https://npm.io/package/@mangoweb/parallax/versions

## README

# Parallax

The manGoweb Parallax component. Watches elements vertical position in viewport.

Demo: [codesandbox.io/s/mangowebparallax-demo-hz24v](https://codesandbox.io/s/mangowebparallax-demo-hz24v?file=/index.html)

## Installation

```bash
npm install @mangoweb/parallax @mangoweb/scripts-base
```

This is a [`@mangoweb/scripts-base`](https://www.npmjs.com/package/@mangoweb/scripts-base) component.

## Usage

In your template:

```html
<script>
	window.initComponents = (window.initComponents || []).push({
		name: 'Parallax',
		place: '#targetElement',
		props: {
			// Optional
			offsetPropertyName: 'offset', // distance between element y center and window y center
			heightPropertyName: 'height', // element height
			windowHeightPropertyName: 'windowHeight',
		},
	})
</script>
```

In your styles

```css
#targetElement {
	transform: translateY(calc(var(--offset, 0) * 20vh)); // Translates by 0 pixels when javascript is disabled
}
```

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