# gliojs-2

> Detects if the mouse of a user leaves the viewport / document borders of your website — and when this happens, trigger your callback

Latest version **0.0.13** (published 2018-11-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install gliojs-2
pnpm add gliojs-2
yarn add gliojs-2
bun add gliojs-2
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.13 |
| Published | 2018-11-20 |
| First published | 2018-11-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 25.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Michael Tessier |
| Maintainers | demi_pixel |
| Keywords | gliojs, mousemove, screencorner, move, exit |

## Links

- npm: https://www.npmjs.com/package/gliojs-2
- Repository: https://github.com/MichaelTessier/gliojs
- Issues: https://github.com/MichaelTessier/gliojs/issues
- npm.io page: https://npm.io/package/gliojs-2

## Dependencies (1)

- [js-cookie](https://npm.io/package/js-cookie.md) 2.2.0

## Recent versions

- 0.0.13 (latest) — 2018-11-20
- 0.0.12 — 2018-11-20
- 0.0.11 — 2018-11-20
- 0.0.10 — 2018-11-20
- 0.0.9 — 2018-11-20
- 0.0.8 — 2018-11-20
- 0.0.7 — 2018-11-20

## README

# glio

## What is new in this version 2

* CommonJs support
* Cookie support with optional expiry date
* Set a timed delay before the script starts tracking exit intent.

<table><thead>
<tr>
<th align="center"><a href="https://camo.githubusercontent.com/4e44a98f6e0c0c6f9768b18d2c9f809a147896ce/68747470733a2f2f63646e302e69636f6e66696e6465722e636f6d2f646174612f69636f6e732f6a666b2f3531322f6368726f6d652d3531322e706e67" target="_blank"><img src="https://camo.githubusercontent.com/4e44a98f6e0c0c6f9768b18d2c9f809a147896ce/68747470733a2f2f63646e302e69636f6e66696e6465722e636f6d2f646174612f69636f6e732f6a666b2f3531322f6368726f6d652d3531322e706e67" width="50px" height="50px" alt="Chrome logo" data-canonical-src="https://cdn0.iconfinder.com/data/icons/jfk/512/chrome-512.png" style="max-width:100%;"></a></th>
<th align="center"><a href="https://camo.githubusercontent.com/2d36b448c5ae70fb9ad3b96442eb5b47ee23f43c/68747470733a2f2f63646e312e69636f6e66696e6465722e636f6d2f646174612f69636f6e732f61707069636e732f3531332f61707069636e735f46697265666f782e706e67" target="_blank"><img src="https://camo.githubusercontent.com/2d36b448c5ae70fb9ad3b96442eb5b47ee23f43c/68747470733a2f2f63646e312e69636f6e66696e6465722e636f6d2f646174612f69636f6e732f61707069636e732f3531332f61707069636e735f46697265666f782e706e67" width="50px" height="50px" alt="Firefox logo" data-canonical-src="https://cdn1.iconfinder.com/data/icons/appicns/513/appicns_Firefox.png" style="max-width:100%;"></a></th>
<th align="center"><a href="https://camo.githubusercontent.com/a2fbda846aafa15e83dd1aa03ea0b5a043a25c35/687474703a2f2f69636f6e732e69636f6e617263686976652e636f6d2f69636f6e732f636f726e6d616e7468653372642f706c65782f3531322f496e7465726e65742d69652d69636f6e2e706e67" target="_blank"><img src="https://camo.githubusercontent.com/a2fbda846aafa15e83dd1aa03ea0b5a043a25c35/687474703a2f2f69636f6e732e69636f6e617263686976652e636f6d2f69636f6e732f636f726e6d616e7468653372642f706c65782f3531322f496e7465726e65742d69652d69636f6e2e706e67" width="50px" height="50px" alt="Internet Explorer logo" data-canonical-src="http://icons.iconarchive.com/icons/cornmanthe3rd/plex/512/Internet-ie-icon.png" style="max-width:100%;"></a></th>
<th align="center"><a href="https://camo.githubusercontent.com/b041e8b2254340484643230780db469e60009673/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f352f35632f4f706572615f62726f777365725f6c6f676f5f323031335f766563746f722e7376672f35313270782d4f706572615f62726f777365725f6c6f676f5f323031335f766563746f722e7376672e706e67" target="_blank"><img src="https://camo.githubusercontent.com/b041e8b2254340484643230780db469e60009673/68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f7468756d622f352f35632f4f706572615f62726f777365725f6c6f676f5f323031335f766563746f722e7376672f35313270782d4f706572615f62726f777365725f6c6f676f5f323031335f766563746f722e7376672e706e67" width="50px" height="50px" alt="Opera logo" data-canonical-src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Opera_browser_logo_2013_vector.svg/512px-Opera_browser_logo_2013_vector.svg.png" style="max-width:100%;"></a></th>
<th align="center"><a href="https://camo.githubusercontent.com/8c4e2585a4fc7e8613c94876f0cd953e1bc9141d/687474703a2f2f69636f6e732e69636f6e617263686976652e636f6d2f69636f6e732f6f73756c6c6976616e6c756b652f6f72622d6f732d782f3531322f5361666172692d69636f6e2e706e67" target="_blank"><img src="https://camo.githubusercontent.com/8c4e2585a4fc7e8613c94876f0cd953e1bc9141d/687474703a2f2f69636f6e732e69636f6e617263686976652e636f6d2f69636f6e732f6f73756c6c6976616e6c756b652f6f72622d6f732d782f3531322f5361666172692d69636f6e2e706e67" width="50px" height="50px" alt="Safari logo" data-canonical-src="http://icons.iconarchive.com/icons/osullivanluke/orb-os-x/512/Safari-icon.png" style="max-width:100%;"></a></th>
</tr>
</thead><tbody>
<tr>
<td align="center">17+ ✔</td>
<td align="center">14+ ✔</td>
<td align="center">9+ ✔</td>
<td align="center">17+ ✔</td>
<td align="center">5+ ✔</td>
</tr>
</tbody></table>

### Reasons for use

* Increase your conversion rates!
* Give visitors reasons to stay!
* Grab your users’ attention!

#### Articles about Exit-popups

* <a href="http://conversionsciences.com/blog/7-best-practices-using-exit-intent-popovers/">7 Best Practices for Using Exit-Intent Popovers, Popups</a>
* <a href="http://blog.getrooster.com/5-scientific-reasons-exit-popups-freaking-effective/">5 Scientific Reasons Exit Popups Are So Freaking Effective</a>

#### Install

* Npm: ```npm install gliojs-2```

#### Usage

The arguments are a Arrays, where the first index is the direction and the second is a callback.

```javascript
glio( [ direction, callback ] );
```

#### 5 Directions

* top
* top-left
* top-right
* bottom-left
* bottom-right

#### Example

* top-left and top-right

```javascript
    glio.init(
      [ 'top-left', function () {
          alert('this is top-left');
        }
      ],
      [ 'top-right', function () {
          alert('this is top-right');
        }
      ]
    );
```

* all directions

```javascript
  glio.init(
    [ 'top', function () {
        alert('this is top.');
      }
    ],
    [ 'top-left', function () {
        alert('this is top-left');
      }
    ],
    [ 'top-right', function () {
        alert('this is top-right');
      }
    ],
    [ 'bottom-left', function () {
        alert('this is bottom-left');
      }
    ],
    [ 'bottom-right', function () {
        alert('this is bottom-right');
      }
    ]
  );
```

#### Configurations

* ```glio.config.key = value;``` Set the configuration before the init.
* ```screenWidthFragment```: the quantity of parts the height and width screen will be divided. Default: 12.
* ```centerTopHeight```: height of 'top' direction. When the mouse is equal or major this value, the callback is triggered. Default: 10.
* ```heightTopLeft```: height of 'top-left' direction. When the mouse is equal or major this value, the callback is triggered. Default: 30.
* ```heightTopRight```: height of 'top-right' direction. When the mouse is equal or major this value, the callback is triggered. Default: 30.
* ```cookiesExpiration```: the value in day of the expiration of cookie. Default: 30.
* ```delay```: the value in seconds of delay. Default: 0

This software is licensed under the MIT License.

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