# 3d-image

> Small, dependency-free library for creating 3D image effect on your website (like seen on Facebook)

Latest version **0.1.1** (published 2019-07-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install 3d-image
pnpm add 3d-image
yarn add 3d-image
bun add 3d-image
```

## 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.1.1 |
| Published | 2019-07-21 |
| First published | 2019-07-21 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.9 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 117 |
| Maintainers | arturbien |
| Keywords | 3Dimage, 3Dphoto, 3D, image, photo, facebook |

## Links

- npm: https://www.npmjs.com/package/3d-image
- Repository: https://github.com/arturbien/3D-image
- Homepage: https://github.com/arturbien/3D-image#readme
- Issues: https://github.com/arturbien/3D-image/issues
- npm.io page: https://npm.io/package/3d-image

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2019-07-21
- 0.1.0 — 2019-07-21

## README

# 🏄 3D-image 

<p>
  <a href="https://www.npmjs.com/package/3d-image"><img src="https://flat.badgen.net/npm/dt/3d-image" alt="NPM"></a>
  <a href="https://www.npmjs.com/package/3d-image"><img src="https://flat.badgen.net/npm/v/3d-image" alt="3d-image version"></a>
  <a href="https://www.npmjs.com/package/3d-image"><img src="https://flat.badgen.net/npm/license/3d-image" alt="R3d-image license"></a>
  
</p>

<p>Small (4.35KB gzipped), dependency-free library for creating 3D image effect on your website ( just like on Facebook! ).</p>

* reacts to mouse move / mobile device movement! 🤳
* based on WebGL

## How to use 
First, you need 2 images: original image, and [depth image](https://www.youtube.com/watch?v=eeU5mUASnVI):

![coke](https://user-images.githubusercontent.com/28541613/61594285-5ea3c980-abea-11e9-97f5-59bda1da9d27.jpg)

Then, prepare image slot with `data-src` and `data-depth-src` attributes containing paths to those images:

```html
<div id="coke" data-src="path to original image" data-depth-src="path to depth image"></div>
```

Finally, add `3D-image` library and run it like so:
```html
<script src="https://unpkg.com/3d-image"></script>
<script>
    var coke = document.getElementById("coke");
    image3D.process(coke);
</script>

```
### That's it! 🥤


**Disclaimer:** this library is a work-in-progress, so the API will likely change. There will be more options added like:
* increasing and decreasing 3D effect strength
* reacting to scroll events for devices not supporting DeviceOrientation API

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