# @allardyce/parallax

> Vue parallax directive

Latest version **0.1.4** (published 2019-03-30) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2019-03-30 |
| First published | 2019-03-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 25.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Craig Allardyce |
| Maintainers | callardyce |
| Keywords | parallax, directive, plugin, vue |

## Links

- npm: https://www.npmjs.com/package/@allardyce/parallax
- Repository: https://gitlab.com/allardyce/parallax
- npm.io page: https://npm.io/package/@allardyce/parallax

## Dependencies (1)

- [rollup-plugin-filesize](https://npm.io/package/rollup-plugin-filesize.md) ^6.0.1

## Recent versions

- 0.1.4 (latest) — 2019-03-30
- 0.1.3 — 2019-03-17
- 0.1.2 — 2019-03-16
- 0.1.1 — 2019-03-03
- 0.1.0 — 2019-03-03

## README

# @allardyce/parallax

A Vue Directive Parallax Solution

Live Demo: [https://allardyce.gitlab.io/parallax/](https://allardyce.gitlab.io/parallax/)

## Install

```
yarn add @allardyce/parallax
```


## Setup

```
import parallax from '@allardyce/parallax'
Vue.use(parallax)
```

## Usage

#### Default Markup with *v-parallax* directive
```
<section class="min">
    <img src="/valid/path/image.jpg" v-parallax />
</section>
```

#### Markup with *v-parallax* directive and additional options
```
<section class="min">
    <img src="/valid/path/image.jpg" v-parallax="{ direction: 'up', start: 0.2, end: 0.1 }" />
</section>
```


|Option|Default|Values|Description|
|--- |--- |--- |--- |
|**direction**|'down'|'down', 'up', 'left', 'right'|The direction the element moves when scrolling.|
|**start**|0|0 to 1|Decimal giving the percentage of the element to start at. EG: 0.2 = crop top 20% of image.|
|**end**|0|0 to 1|Decimal giving the percentage of the element to end at. EG: 0.1 = crop bottom  10% of image.|

> **Tip**: You can use start and end to change the speed of the parallax scrolling.

> **Tip**: Adding the *min* class to the parent gives a `min-height: 30rem;` styling.


## Development

Run two terminals

`yarn watch`

`cd docs && yarn serve`

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